31,6 → 31,8 |
#include <arch/stack.h> |
#include <arch/sun4v/regdef.h> |
#include <arch/sun4v/hypercall.h> |
#include <arch/sun4v/arch.h> |
#include <arch/sun4v/cpu.h> |
#include <arch/mm/pagesize.h> |
#include <arch/mm/sun4v/tte.h> |
#include <arch/mm/sun4v/mmu.h> |
191,6 → 193,34 |
stx %l6, [%l4 + %lo(physmem_base)] |
|
/* |
* Set CPUID. |
*/ |
__HYPERCALL_FAST(CPU_MYID) |
mov SCRATCHPAD_CPUID, %g1 |
stxa %o1, [%g1] ASI_SCRATCHPAD |
|
/* |
* Set MMU fault status area for the current CPU. |
*/ |
set mmu_fsas, %o0 ! o0 <= addr. of fault status areas array |
add %o0, %l6, %o0 ! kernel address to real address |
mulx %o1, MMU_FSA_SIZE, %g1 ! g1 <= offset of current CPU's fault status area |
add %g1, %o0, %o0 ! o0 <= FSA of the current CPU |
mov SCRATCHPAD_MMU_FSA, %g1 |
stxa %o0, [%g1] ASI_SCRATCHPAD ! remember MMU fault status area to speed up miss handler |
__HYPERCALL_FAST(MMU_FAULT_AREA_CONF) |
|
/* |
* Store a template of a TTE Data entry for kernel mappings. |
* This template will be used from the kernel MMU miss handler. |
*/ |
!TTE_DATA(0, %l5, %g2, %g3, %g1) |
setx TTE_FLAGS | PAGESIZE_8K, %g2, %g1; \ |
add %g1, %l5, %g1; \ |
set kernel_8k_tlb_data_template, %g4 |
stx %g1, [%g4] |
|
/* |
* So far, we have not touched the stack. |
* It is a good idea to set the kernel stack to a known state now. |
*/ |
233,3 → 263,14 |
.global physmem_base ! copy of the physical memory base address |
physmem_base: |
.quad 0 |
|
.global kernel_8k_tlb_data_template |
kernel_8k_tlb_data_template: |
.quad 0 |
|
/* MMU fault status areas for all CPUs */ |
.align MMU_FSA_ALIGNMENT |
.global mmu_fsas |
mmu_fsas: |
!.space (MMU_FSA_SIZE * MAX_NUM_STRANDS) |
.space 8192 |