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

TOMOYO Linux Cross Reference
Linux/arch/powerpc/kernel/prom_entry_64.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  *  PowerPC version 
  4  *    Copyright (C) 1995-1996 Gary Thomas (gdt@linuxppc.org)
  5  *  Rewritten by Cort Dougan (cort@cs.nmt.edu) for PReP
  6  *    Copyright (C) 1996 Cort Dougan <cort@cs.nmt.edu>
  7  *  Adapted for Power Macintosh by Paul Mackerras.
  8  *  Low-level exception handlers and MMU support
  9  *  rewritten by Paul Mackerras.
 10  *    Copyright (C) 1996 Paul Mackerras.
 11  *  MPC8xx modifications Copyright (C) 1997 Dan Malek (dmalek@jlc.net).
 12  *
 13  *  This file contains the 64-bit prom entry code.
 14  */
 15 #include <asm/asm-offsets.h>
 16 #ifdef CONFIG_PPC_BOOK3S
 17 #include <asm/exception-64s.h>
 18 #else
 19 #include <asm/exception-64e.h>
 20 #endif
 21 #include <asm/ppc_asm.h>
 22 
 23 .section ".text","ax",@progbits
 24 
 25 _GLOBAL(enter_prom)
 26         mflr    r0
 27         std     r0,16(r1)
 28         stdu    r1,-SWITCH_FRAME_SIZE(r1) /* Save SP and create stack space */
 29 
 30         /* Because PROM is running in 32b mode, it clobbers the high order half
 31          * of all registers that it saves.  We therefore save those registers
 32          * PROM might touch to the stack.  (r0, r3-r13 are caller saved)
 33          */
 34         SAVE_GPR(2, r1)
 35         SAVE_GPR(13, r1)
 36         SAVE_NVGPRS(r1)
 37         mfcr    r10
 38         mfmsr   r11
 39         std     r10,_CCR(r1)
 40         std     r11,_MSR(r1)
 41 
 42         /* Put PROM address in SRR0 */
 43         mtsrr0  r4
 44 
 45         /* Setup our trampoline return addr in LR */
 46         bcl     20,31,$+4
 47 0:      mflr    r4
 48         addi    r4,r4,(1f - 0b)
 49         mtlr    r4
 50 
 51         /* Prepare a 32-bit mode big endian MSR
 52          */
 53 #ifdef CONFIG_PPC_BOOK3E_64
 54         rlwinm  r11,r11,0,1,31
 55         mtsrr1  r11
 56         rfi
 57 #else /* CONFIG_PPC_BOOK3E_64 */
 58         LOAD_REG_IMMEDIATE(r12, MSR_SF | MSR_LE)
 59         andc    r11,r11,r12
 60         mtsrr1  r11
 61         RFI_TO_KERNEL
 62 #endif /* CONFIG_PPC_BOOK3E_64 */
 63 
 64 1:      /* Return from OF */
 65         FIXUP_ENDIAN
 66 
 67         /* Just make sure that r1 top 32 bits didn't get
 68          * corrupt by OF
 69          */
 70         rldicl  r1,r1,0,32
 71 
 72         /* Restore the MSR (back to 64 bits) */
 73         ld      r0,_MSR(r1)
 74         MTMSRD(r0)
 75         isync
 76 
 77         /* Restore other registers */
 78         REST_GPR(2, r1)
 79         REST_GPR(13, r1)
 80         REST_NVGPRS(r1)
 81         ld      r4,_CCR(r1)
 82         mtcr    r4
 83 
 84         addi    r1,r1,SWITCH_FRAME_SIZE
 85         ld      r0,16(r1)
 86         mtlr    r0
 87         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