~ [ source navigation ] ~ [ diff markup ] ~ [ identifier search ] ~

TOMOYO Linux Cross Reference
Linux/arch/powerpc/platforms/powernv/opal-wrappers.S

Version: ~ [ linux-6.12-rc7 ] ~ [ linux-6.11.7 ] ~ [ linux-6.10.14 ] ~ [ linux-6.9.12 ] ~ [ linux-6.8.12 ] ~ [ linux-6.7.12 ] ~ [ linux-6.6.60 ] ~ [ linux-6.5.13 ] ~ [ linux-6.4.16 ] ~ [ linux-6.3.13 ] ~ [ linux-6.2.16 ] ~ [ linux-6.1.116 ] ~ [ linux-6.0.19 ] ~ [ linux-5.19.17 ] ~ [ linux-5.18.19 ] ~ [ linux-5.17.15 ] ~ [ linux-5.16.20 ] ~ [ linux-5.15.171 ] ~ [ linux-5.14.21 ] ~ [ linux-5.13.19 ] ~ [ linux-5.12.19 ] ~ [ linux-5.11.22 ] ~ [ linux-5.10.229 ] ~ [ linux-5.9.16 ] ~ [ linux-5.8.18 ] ~ [ linux-5.7.19 ] ~ [ linux-5.6.19 ] ~ [ linux-5.5.19 ] ~ [ linux-5.4.285 ] ~ [ linux-5.3.18 ] ~ [ linux-5.2.21 ] ~ [ linux-5.1.21 ] ~ [ linux-5.0.21 ] ~ [ linux-4.20.17 ] ~ [ linux-4.19.323 ] ~ [ linux-4.18.20 ] ~ [ linux-4.17.19 ] ~ [ linux-4.16.18 ] ~ [ linux-4.15.18 ] ~ [ linux-4.14.336 ] ~ [ linux-4.13.16 ] ~ [ linux-4.12.14 ] ~ [ linux-4.11.12 ] ~ [ linux-4.10.17 ] ~ [ linux-4.9.337 ] ~ [ linux-4.4.302 ] ~ [ linux-3.10.108 ] ~ [ linux-2.6.32.71 ] ~ [ linux-2.6.0 ] ~ [ linux-2.4.37.11 ] ~ [ unix-v6-master ] ~ [ ccs-tools-1.8.12 ] ~ [ policy-sample ] ~
Architecture: ~ [ i386 ] ~ [ alpha ] ~ [ m68k ] ~ [ mips ] ~ [ ppc ] ~ [ sparc ] ~ [ sparc64 ] ~

  1 /* SPDX-License-Identifier: GPL-2.0-or-later */
  2 /*
  3  * PowerNV OPAL API wrappers
  4  *
  5  * Copyright 2011 IBM Corp.
  6  */
  7 
  8 #include <linux/jump_label.h>
  9 #include <asm/ppc_asm.h>
 10 #include <asm/hvcall.h>
 11 #include <asm/asm-offsets.h>
 12 #include <asm/opal.h>
 13 #include <asm/asm-compat.h>
 14 #include <asm/feature-fixups.h>
 15 
 16         .section ".text"
 17 
 18 /*
 19  * r3-r10               - OPAL call arguments
 20  * STK_PARAM(R11)       - OPAL opcode
 21  * STK_PARAM(R12)       - MSR to restore
 22  */
 23 _GLOBAL_TOC(__opal_call)
 24         mflr    r0
 25         std     r0,PPC_LR_STKOFF(r1)
 26         ld      r12,STK_PARAM(R12)(r1)
 27         li      r0,MSR_IR|MSR_DR|MSR_LE
 28         andc    r12,r12,r0
 29         LOAD_REG_ADDR(r11, opal_return)
 30         mtlr    r11
 31         LOAD_REG_ADDR(r11, opal)
 32         ld      r2,0(r11)
 33         ld      r11,8(r11)
 34         mtspr   SPRN_HSRR0,r11
 35         mtspr   SPRN_HSRR1,r12
 36         /* set token to r0 */
 37         ld      r0,STK_PARAM(R11)(r1)
 38         hrfid
 39 opal_return:
 40         /*
 41          * Restore MSR on OPAL return. The MSR is set to big-endian.
 42          */
 43 #ifdef __BIG_ENDIAN__
 44         ld      r11,STK_PARAM(R12)(r1)
 45         mtmsrd  r11
 46 #else
 47         /* Endian can only be switched with rfi, must byte reverse MSR load */
 48         .short 0x4039    /* li r10,STK_PARAM(R12)               */
 49         .byte (STK_PARAM(R12) >> 8) & 0xff
 50         .byte STK_PARAM(R12) & 0xff
 51 
 52         .long 0x280c6a7d /* ldbrx r11,r10,r1                    */
 53         .long 0x05009f42 /* bcl 20,31,$+4                       */
 54         .long 0xa602487d /* mflr r10                            */
 55         .long 0x14004a39 /* addi r10,r10,20                     */
 56         .long 0xa64b5a7d /* mthsrr0 r10                         */
 57         .long 0xa64b7b7d /* mthsrr1 r11                         */
 58         .long 0x2402004c /* hrfid                               */
 59 #endif
 60         LOAD_PACA_TOC()
 61         ld      r0,PPC_LR_STKOFF(r1)
 62         mtlr    r0
 63         blr

~ [ source navigation ] ~ [ diff markup ] ~ [ identifier search ] ~

kernel.org | git.kernel.org | LWN.net | Project Home | SVN repository | Mail admin

Linux® is a registered trademark of Linus Torvalds in the United States and other countries.
TOMOYO® is a registered trademark of NTT DATA CORPORATION.

sflogo.php