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
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 */ \
65 * -- Cort
77 * pointer (r1) points to just below the end of the half-meg region
78 * from 0x380000 - 0x400000, which is mapped in already.
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 */
138 li r24,0 /* cpu # */
142 * the necessary low-level setup and clears the BSS
143 * -- Cort <cort@fsmlabs.com>
170 * Call setup_cpu for CPU 0 and initialize 6xx Idle
173 li r24,0 /* cpu# */
174 bl call_setup_cpu /* Call setup_cpu for this CPU */
182 * the exception vectors at 0 (and therefore this copy
183 * overwrites OF's exception vectors with our own).
196 * as we jump to our code at KERNELBASE. -- Cort
214 li r3,1 /* MTX only has 1 cpu */
224 /* our cpu # was at addr 0 - go */
225 mr r24,r3 /* cpu # */
236 .long -1
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
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 */
435 ori r1, r1, 0xe06 /* clear out reserved bits */
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 */
490 ori r1,r1,0xe04 /* clear out reserved bits */
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 */
567 li r1,0xe06 /* clear out reserved bits & PP msb */
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
771 addi r5,r5,-4
772 addi r6,r6,-4
795 mr r24, r3 /* cpu # */
810 set to map the 0xf0000000 - 0xffffffff region */
818 /* Copy some CPU settings from CPU 0 */
821 lis r3,-KERNELBASE@h
823 bl call_setup_cpu /* Call setup_cpu for this CPU */
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
929 li r0, 16 - NUM_USER_SEGMENTS /* load up kernel segment registers */
947 /* Set up for using our exception vectors */
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,
981 * and change to using our exception vectors.
1023 * -- Cort
1045 /* Here's a tweak: at this point, CPU setup have
1108 1: addic. r10, r10, -0x1000
1116 addi r4, r3, __after_mmu_off - _start