Subversion Repositories HelenOS

Rev

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

Rev 1978 Rev 1982
Line 65... Line 65...
65
kernel_image_start:
65
kernel_image_start:
66
	mov BSP_FLAG, %l0
66
	mov BSP_FLAG, %l0
67
	and %o0, %l0, %l7				! l7 <= bootstrap processor?
67
	and %o0, %l0, %l7				! l7 <= bootstrap processor?
68
	andn %o0, %l0, %l6				! l6 <= start of physical memory
68
	andn %o0, %l0, %l6				! l6 <= start of physical memory
69
 
69
 
70
	sethi %hi(physmem_base), %l5
-
 
71
	stx %l6, [%l5 + %lo(physmem_base)]
-
 
72
 
-
 
73
	/*
-
 
74
	 * Get bits 40:13 of physmem_base.
70
	! Get bits 40:13 of physmem_base.
75
	 */ 
-
 
76
	sethi %hi(mask_40_13), %l4
71
	srlx %l6, 13, %l5
77
	sethi %hi(physmem_base_40_13), %l3
-
 
78
	ldx [%l4 + %lo(mask_40_13)], %l4
72
	sllx %l5, 13 + (63 - 40), %l5
79
	and %l6, %l4, %l5				! l5 <= physmem_base[40:13]
73
	srlx %l5, 63 - 40, %l5				! l5 <= physmem_base[40:13]
80
	stx %l5, [%l3 + %lo(physmem_base_40_13)]
-
 
81
 
-
 
82
	/*
-
 
83
	 * Prepare kernel 8K TLB data template.
-
 
84
	 */
-
 
85
	sethi %hi(kernel_8k_tlb_data_template), %l4
-
 
86
	ldx [%l4 + %lo(kernel_8k_tlb_data_template)], %l3
-
 
87
	or %l3, %l5, %l3
-
 
88
	stx %l3, [%l4 + %lo(kernel_8k_tlb_data_template)]
-
 
89
	
74
	
90
	/*
75
	/*
91
	 * Setup basic runtime environment.
76
	 * Setup basic runtime environment.
92
	 */
77
	 */
93
 
78
 
Line 242... Line 227...
242
 
227
 
243
	brz %l7, 1f				! skip if you are not the bootstrap CPU
228
	brz %l7, 1f				! skip if you are not the bootstrap CPU
244
	nop
229
	nop
245
 
230
 
246
	/*
231
	/*
-
 
232
	 * Save physmem_base for use by the mm subsystem.
-
 
233
	 * %l6 contains starting physical address
-
 
234
	 */
-
 
235
	sethi %hi(physmem_base), %l4
-
 
236
	stx %l6, [%l4 + %lo(physmem_base)]
-
 
237
 
-
 
238
	/*
-
 
239
	 * Precompute kernel 8K TLB data template.
-
 
240
	 * %l5 contains starting physical address bits [40:13]
-
 
241
	 */
-
 
242
	sethi %hi(kernel_8k_tlb_data_template), %l4
-
 
243
	ldx [%l4 + %lo(kernel_8k_tlb_data_template)], %l3
-
 
244
	or %l3, %l5, %l3
-
 
245
	stx %l3, [%l4 + %lo(kernel_8k_tlb_data_template)]
-
 
246
 
-
 
247
	/*
247
	 * So far, we have not touched the stack.
248
	 * So far, we have not touched the stack.
248
	 * It is a good idea to set the kernel stack to a known state now.
249
	 * It is a good idea to set the kernel stack to a known state now.
249
	 */
250
	 */
250
	sethi %hi(temporary_boot_stack), %sp
251
	sethi %hi(temporary_boot_stack), %sp
251
	or %sp, %lo(temporary_boot_stack), %sp
252
	or %sp, %lo(temporary_boot_stack), %sp
Line 338... Line 339...
338
.align 8
339
.align 8
339
.global physmem_base		! copy of the physical memory base address
340
.global physmem_base		! copy of the physical memory base address
340
physmem_base:
341
physmem_base:
341
	.quad 0
342
	.quad 0
342
 
343
 
343
.global physmem_base_40_13
-
 
344
physmem_base_40_13:		! physmem_base & mask_40_13
-
 
345
	.quad 0
-
 
346
 
-
 
347
.global mask_40_13
-
 
348
mask_40_13:			! constant with bits 40:13 set
-
 
349
	.quad (((1 << 41) - 1) & ~((1 << 13) - 1))
-
 
350
 
-
 
351
/*
344
/*
352
 * This variable is used by the fast_data_MMU_miss trap handler.
345
 * This variable is used by the fast_data_MMU_miss trap handler.
353
 * It is initialized to reflect the starting address of physical
346
 * In runtime, it is further modified to reflect the starting address of
354
 * memory.
347
 * physical memory.
355
 */
348
 */
356
.global kernel_8k_tlb_data_template
349
.global kernel_8k_tlb_data_template
357
kernel_8k_tlb_data_template:
350
kernel_8k_tlb_data_template:
358
	.quad ((1 << TTE_V_SHIFT) | TTE_CV | TTE_CP | TTE_P | TTE_W)
351
	.quad ((1 << TTE_V_SHIFT) | TTE_CV | TTE_CP | TTE_P | TTE_W)
359
 
-