Lines Matching +full:segment +full:- +full:no +full:- +full:remap
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.
91 * r4: initrd_start or if no initrd then 0
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>
196 * as we jump to our code at KERNELBASE. -- Cort
197 * Actually no, pmac doesn't have it on any more. BootX enters with MMU
224 /* our cpu # was at addr 0 - go */
236 .long -1
246 * machine check inside RTAS, and we have no guarantee that certain
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
323 andis. r11, r11, SRR1_ISI_NOPT@h /* no pte found? */
359 /* Floating-point unavailable */
395 * We effectively remap it to 0x3000.
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 */
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
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
917 li r0, NUM_USER_SEGMENTS /* load up user segment register values */
927 addis r4, r4, 0x1000 /* address of next segment */
929 li r0, 16 - NUM_USER_SEGMENTS /* load up kernel segment registers */
936 addis r4, r4, 0x1000 /* address of next segment */
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,
980 * for SDR1 (hash table pointer) and the segment registers
1023 * -- Cort
1108 1: addic. r10, r10, -0x1000
1116 addi r4, r3, __after_mmu_off - _start