Lines Matching +full:bl +full:- +full:code +full:- +full:offset
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 */
117 bl prom_init
133 bl bootx_init
142 * the necessary low-level setup and clears the BSS
143 * -- Cort <cort@fsmlabs.com>
145 bl early_init
150 bl mmu_off
152 bl clear_bats
153 bl flush_tlbs
155 bl initial_bats
156 bl load_segment_registers
157 bl reloc_offset
158 bl early_hash_table
160 bl setup_disp_bat
163 bl setup_cpm_bat
166 bl setup_usbgecko_bat
172 bl reloc_offset
174 bl call_setup_cpu /* Call setup_cpu for this CPU */
175 bl reloc_offset
176 bl init_idle_6xx
186 bl reloc_offset
196 * as we jump to our code at KERNELBASE. -- Cort
224 /* our cpu # was at addr 0 - go */
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.
274 bl machine_check_exception
303 bne- 1f
304 bl do_page_fault
306 1: bl do_break
337 bl do_page_fault
347 bl alignment_exception
355 bl program_check_exception
359 /* Floating-point unavailable */
371 bl load_up_fpu /* if from user, just load it up */
374 bl kernel_fp_unavailable_exception
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 */
684 bl hash_page
696 bl hash_page
731 bl load_up_altivec /* if from user, just load it up */
735 bl altivec_unavailable_exception
742 bl performance_monitor_exception
748 * This code is jumped to from the startup code to copy
753 li r6,0 /* Destination offset */
755 bl copy_and_flush /* copy the first 0x4000 bytes */
759 4: lis r5,_end-KERNELBASE@h
760 ori r5,r5,_end-KERNELBASE@l
761 bl copy_and_flush /* copy the rest */
767 * r3 = dest addr, r4 = source addr, r5 = copy limit, r6 = start offset
771 addi r5,r5,-4
772 addi r6,r6,-4
810 set to map the 0xf0000000 - 0xffffffff region */
819 bl __restore_cpu_setup
821 lis r3,-KERNELBASE@h
823 bl call_setup_cpu /* Call setup_cpu for this CPU */
824 lis r3,-KERNELBASE@h
825 bl init_idle_6xx
835 addi r1,r1,THREAD_SIZE-STACK_FRAME_MIN_SIZE
841 bl load_segment_registers
842 bl load_up_mmu
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 */
941 * This is where the main kernel code starts.
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,
969 bl kasan_early_init
973 bl machine_init
974 bl __save_cpu_setup
975 bl MMU_init
976 bl MMU_init_hw_patch
993 2: bl load_up_mmu
1023 * -- Cort
1086 1: bl clear_bats
1108 1: addic. r10, r10, -0x1000
1116 addi r4, r3, __after_mmu_off - _start
1154 bl reloc_offset