Subversion Repositories HelenOS

Rev

Rev 3770 | Rev 4369 | Go to most recent revision | Show entire file | Ignore whitespace | Details | Blame | Last modification | View Log | RSS feed

Rev 3770 Rev 3835
Line 29... Line 29...
29
 
29
 
30
#include <arch/arch.h>
30
#include <arch/arch.h>
31
#include <arch/stack.h>
31
#include <arch/stack.h>
32
#include <arch/sun4v/regdef.h>
32
#include <arch/sun4v/regdef.h>
33
#include <arch/sun4v/hypercall.h>
33
#include <arch/sun4v/hypercall.h>
-
 
34
#include <arch/sun4v/arch.h>
-
 
35
#include <arch/sun4v/cpu.h>
34
#include <arch/mm/pagesize.h>
36
#include <arch/mm/pagesize.h>
35
#include <arch/mm/sun4v/tte.h>
37
#include <arch/mm/sun4v/tte.h>
36
#include <arch/mm/sun4v/mmu.h>
38
#include <arch/mm/sun4v/mmu.h>
37
#include <arch/mm/sun4v/tlb.h>
39
#include <arch/mm/sun4v/tlb.h>
38
 
40
 
Line 189... Line 191...
189
	 */
191
	 */
190
	sethi %hi(physmem_base), %l4
192
	sethi %hi(physmem_base), %l4
191
	stx %l6, [%l4 + %lo(physmem_base)]
193
	stx %l6, [%l4 + %lo(physmem_base)]
192
 
194
 
193
	/*
195
	/*
-
 
196
	 * Set CPUID.
-
 
197
	 */
-
 
198
	__HYPERCALL_FAST(CPU_MYID)
-
 
199
	mov SCRATCHPAD_CPUID, %g1
-
 
200
	stxa %o1, [%g1] ASI_SCRATCHPAD
-
 
201
 
-
 
202
	/*
-
 
203
	 * Set MMU fault status area for the current CPU.
-
 
204
	 */
-
 
205
	set mmu_fsas, %o0			! o0 <= addr. of fault status areas array
-
 
206
	add %o0, %l6, %o0			! kernel address to real address
-
 
207
	mulx %o1, MMU_FSA_SIZE, %g1		! g1 <= offset of current CPU's fault status area
-
 
208
	add %g1, %o0, %o0			! o0 <= FSA of the current CPU
-
 
209
	mov SCRATCHPAD_MMU_FSA, %g1
-
 
210
	stxa %o0, [%g1] ASI_SCRATCHPAD		! remember MMU fault status area to speed up miss handler
-
 
211
	__HYPERCALL_FAST(MMU_FAULT_AREA_CONF)
-
 
212
	
-
 
213
	/*
-
 
214
	 * Store a template of a TTE Data entry for kernel mappings.
-
 
215
	 * This template will be used from the kernel MMU miss handler.
-
 
216
	 */
-
 
217
	!TTE_DATA(0, %l5, %g2, %g3, %g1)
-
 
218
	setx TTE_FLAGS | PAGESIZE_8K, %g2, %g1; \
-
 
219
	add %g1, %l5, %g1; \
-
 
220
	set kernel_8k_tlb_data_template, %g4
-
 
221
	stx %g1, [%g4]
-
 
222
 
-
 
223
	/*
194
	 * So far, we have not touched the stack.
224
	 * So far, we have not touched the stack.
195
	 * It is a good idea to set the kernel stack to a known state now.
225
	 * It is a good idea to set the kernel stack to a known state now.
196
	 */
226
	 */
197
	sethi %hi(temporary_boot_stack), %sp
227
	sethi %hi(temporary_boot_stack), %sp
198
	or %sp, %lo(temporary_boot_stack), %sp
228
	or %sp, %lo(temporary_boot_stack), %sp
Line 231... Line 261...
231
 
261
 
232
.align 8
262
.align 8
233
.global physmem_base		! copy of the physical memory base address
263
.global physmem_base		! copy of the physical memory base address
234
physmem_base:
264
physmem_base:
235
	.quad 0
265
	.quad 0
-
 
266
 
-
 
267
.global kernel_8k_tlb_data_template
-
 
268
kernel_8k_tlb_data_template:
-
 
269
	.quad 0
-
 
270
 
-
 
271
/* MMU fault status areas for all CPUs */
-
 
272
.align MMU_FSA_ALIGNMENT
-
 
273
.global mmu_fsas
-
 
274
mmu_fsas:
-
 
275
	!.space (MMU_FSA_SIZE * MAX_NUM_STRANDS)
-
 
276
	.space 8192