Lines Matching +full:used +full:- +full:by +full:- +full:rtas
1 /* SPDX-License-Identifier: GPL-2.0-or-later */
4 * Copyright (C) 1995-1996 Gary Thomas (gdt@linuxppc.org)
6 * Rewritten by Cort Dougan (cort@cs.nmt.edu) for PReP
8 * Adapted for Power Macintosh by Paul Mackerras.
9 * Low-level exception handlers and MMU support
10 * rewritten by Paul Mackerras.
14 * This file contains the low-level support and setup for the
30 #include <asm/asm-offsets.h>
34 #include <asm/feature-fixups.h>
40 /* see the comment for clear_bats() -- Cort */ \
62 * These are here for legacy reasons, the kernel used to
64 * but we're always started by some kind of bootloader now.
65 * -- Cort
67 nop /* used by __secondary_hold on prep (mtx) and chrp smp */
68 nop /* used by __secondary_hold on prep (mtx) and chrp smp */
77 * pointer (r1) points to just below the end of the half-meg region
78 * from 0x380000 - 0x400000, which is mapped in already.
88 * to its proper place in memory by the boot loader. The expected layout
92 * r5: initrd_end - unused if r4 is 0
98 * -- Cort
115 addis r8,r8,(_stext - 0b)@ha
116 addi r8,r8,(_stext - 0b)@l /* current runtime base addr */
142 * the necessary low-level setup and clears the BSS
143 * -- Cort <cort@fsmlabs.com>
148 * the physical address we are running at, returned by early_init()
196 * as we jump to our code at KERNELBASE. -- Cort
224 /* our cpu # was at addr 0 - go */
236 .long -1
239 /* core99 pmac starts the seconary here by changing the vector, and
245 * On CHRP, this is complicated by the fact that we could get a
246 * machine check inside RTAS, and we have no guarantee that certain
249 * and all the BATs. We indicate that we are in RTAS by putting
250 * a non-zero value, the address of the exception frame to use,
252 * and uses its value if it is non-zero.
255 * -- paulus.
303 bne- 1f
359 /* Floating-point unavailable */
398 * non-altivec kernel running on a machine with altivec just
399 * by executing an altivec instruction.
410 * Note: we get an alternate set of r0 - r3 to use automatically.
414 /* Get PTE (linux-style) and check access */
426 beq- InstructionAddressInvalid /* return if no mapping */
428 lwz r2,0(r2) /* get linux-style pte */
430 bne- InstructionAddressInvalid /* return if access not permitted */
431 /* Convert linux-style PTE to low word of PPC-style PTE */
433 rlwimi r2, r3, 1, 31, 31 /* userspace ? -> PP lsb */
456 rlwimi r2,r2,1,30,30 /* change 1 -> 3 */
470 /* Get PTE (linux-style) and check access */
479 beq- 2f /* bail if no mapping */
481 lwz r2,0(r2) /* get linux-style pte */
484 bne- DataAddressInvalid /* return if access not permitted */
485 /* Convert linux-style PTE to low word of PPC-style PTE */
486 rlwinm r1,r2,32-9,30,30 /* _PAGE_WRITE -> PP msb */
487 rlwimi r2,r3,2,30,31 /* userspace ? -> PP */
488 rlwimi r1,r2,32-3,24,24 /* _PAGE_WRITE -> _PAGE_DIRTY */
505 rlwimi r2,r3,31-14,14,14
517 2: lis r2, (swapper_pg_dir - PAGE_OFFSET)@ha
518 addi r2, r2, (swapper_pg_dir - PAGE_OFFSET)@l /* kernel page table */
522 beq- DataAddressInvalid /* return if no mapping */
549 /* Get PTE (linux-style) and check access */
558 beq- 2f /* bail if no mapping */
561 lwz r2,0(r2) /* get linux-style pte */
564 bne- DataAddressInvalid /* return if access not permitted */
565 /* Convert linux-style PTE to low word of PPC-style PTE */
566 rlwimi r2,r3,1,31,31 /* userspace ? -> PP lsb */
584 rlwimi r2,r3,31-14,14,14
596 2: lis r2, (swapper_pg_dir - PAGE_OFFSET)@ha
597 addi r2, r2, (swapper_pg_dir - PAGE_OFFSET)@l /* kernel page table */
601 beq- DataAddressInvalid /* return if no mapping */
682 rlwinm r3, r3, 32 - 15, _PAGE_WRITE /* DSISR_STORE -> _PAGE_WRITE */
759 4: lis r5,_end-KERNELBASE@h
760 ori r5,r5,_end-KERNELBASE@l
765 * Copy routine used to copy the kernel to start at physical address 0
771 addi r5,r5,-4
772 addi r6,r6,-4
810 set to map the 0xf0000000 - 0xffffffff region */
821 lis r3,-KERNELBASE@h
824 lis r3,-KERNELBASE@h
835 addi r1,r1,THREAD_SIZE-STACK_FRAME_MIN_SIZE
849 lis r4, (swapper_pg_dir - PAGE_OFFSET)@h
850 ori r4, r4, (swapper_pg_dir - PAGE_OFFSET)@l
879 lis r6, early_hash - PAGE_OFFSET@h
899 /* Load the BAT registers with the values set up by MMU_init. */
929 li r0, 16 - NUM_USER_SEGMENTS /* load up kernel segment registers */
953 lis r4, (swapper_pg_dir - PAGE_OFFSET)@h
954 ori r4, r4, (swapper_pg_dir - PAGE_OFFSET)@l
963 stwu r0,THREAD_SIZE-STACK_FRAME_MIN_SIZE(r1)
965 * Do early platform-specific initialization,
1023 * -- Cort
1108 1: addic. r10, r10, -0x1000
1116 addi r4, r3, __after_mmu_off - _start
1193 * The virtual address used must match the virtual address