Lines Matching +full:reserved +full:- +full:cpu +full:- +full:vectors
1 /* SPDX-License-Identifier: GPL-2.0-or-later */
4 * Copyright (C) 1995-1996 Gary Thomas (gdt@linuxppc.org)
9 * Low-level exception handlers and MMU support
16 * This file contains the entry point for the 64-bit kernel along
17 * with some early initialization code common to all 64-bit powerpc
28 #include <asm/head-64.h>
29 #include <asm/asm-offsets.h>
42 #include <asm/ppc-opcode.h>
43 #include <asm/feature-fixups.h>
45 #include <asm/exception-64s.h>
47 #include <asm/exception-64e.h>
51 * spin code sits at 0x0000...0x00ff. On server, the vectors follow
52 * using the layout described in exceptions-64s.S
60 * 2. The primary CPU enters at __start.
61 * 3. If the RTAS supports "query-cpu-stopped-state", then secondary
62 * CPUs will enter as directed by "start-cpu" RTAS call, which is
65 * directed by the "start-cpu" RTS call, with PIR in r3.
66 * -or- For OPAL entry:
68 * 2. The primary CPU enters at 0 with device-tree in r3, OPAL base
103 /* Secondary processors spin on this value until it becomes non-zero.
104 * When non-zero, it contains the real address of the function the cpu
112 /* Secondary processors write this value with their cpu # */
121 * is used by kexec-tools to keep the kdump kernel in the
129 #define RUN_AT_LOAD_DEFAULT 0x72756e30 /* "run0" -- relocate to 0 by default */
132 /* Do not move this variable as kexec-tools knows about it. */
158 /* Grab our physical cpu number */
163 /* Tell the master cpu we're here */
199 * On server, we include the exception vectors code here as it
204 #include "exceptions-64s.S"
215 * The booting_thread_hwid holds the thread id we want to boot in cpu
216 * hotplug case. It is set by cpu hotplug code, and is invalid by default.
287 * but the low bit right by two bits so that the cpu numbering is
290 * If the old value of BUCSR is non-zero, this thread has run
309 /* turn on 64-bit mode */
324 * At entry, r3 = this processor's number (physical cpu id)
336 li r2,-1
341 /* turn on 64-bit mode */
390 addi r11,r11,(2f - 1b)
400 * physical cpu id in r24, we need to search the pacas to find
414 li r5,0 /* logical cpu id */
416 sldi r9,r5,3 /* get paca_ptrs[] index from cpu id */
417 ldx r13,r9,r8 /* r13 = paca_ptrs[cpu id] */
441 /* See if we need to call a cpu state restore handler */
521 * r5 != NULL -> OF entry, we go to prom_init, "legacy" parameter content
524 * r5 == NULL -> kexec style entry. r3 is a physical pointer to the
536 li r2,-1
539 * Are we booted from a PROM Of-type client-interface ?
543 b __boot_from_prom /* yes -> prom */
572 addis r26,r26,(_stext - 0b)@ha
573 addi r26,r26,(_stext - 0b)@l /* current runtime base addr */
580 /* Get TOC pointer, non-virtual */
586 addis r26,r26,(_stext - 0b)@ha
587 addi r26,r26,(_stext - 0b)@l /* current runtime base addr */
597 * Align the stack to 16-byte boundary
645 * real memory, which are reserved for software use.
647 * Note: This process overwrites the OF exception vectors.
691 p_end: .8byte _end - copy_to_here
696 * _end - copy_to_here to the copy limit and run again.
714 addi r5,r5,-8
715 addi r6,r6,-8
768 /* turn on 64-bit mode */
783 addi r11,r11,(2f - 1b)
790 /* Copy some CPU settings from CPU 0 */
801 sldi r5,r24,3 /* get paca_ptrs[] index from cpu id */
802 ldx r13,r5,r4 /* r13 = paca_ptrs[cpu id] */
822 * This function is called after the master CPU has released the
830 * r24 = cpu# (in Linux terms)
843 * Do early setup for this CPU, in particular initialising the MMU so we
879 * zero the stack back-chain pointer and get the TOC virtual address
891 * from cede in cpu offline.
921 * are running at the moment, using position-independent code.
924 * TOC in -mcmodel=medium mode. After we relocate to 0 but before
933 tdnei r2,-1
939 ld r2,(p_toc - 0b)(r11)
945 p_toc: .8byte .TOC. - 0b
959 * to clear it now for kexec-style entry.
967 addi r8,r8,-8
999 stdu r0,-STACK_FRAME_MIN_SIZE(r1)