Subversion Repositories HelenOS

Compare Revisions

Ignore whitespace Rev 3152 → Rev 3153

/branches/dynload/boot/arch/sparc64/loader/asm.S
98,6 → 98,16
mov %o1, %o0
 
jump_to_kernel:
/*
* We have copied code and now we need to guarantee cache coherence.
* 1. Make sure that the code we have moved has drained to main memory.
* 2. Invalidate I-cache.
* 3. Flush instruction pipeline.
*/
call icache_flush
membar #StoreStore
flush %i7
 
mov %o0, %l1
mov %o1, %o0
mov %o2, %o1
105,6 → 115,24
jmp %l1 ! jump to kernel
nop
 
#define ICACHE_SIZE 8192
#define ICACHE_LINE_SIZE 32
#define ICACHE_SET_BIT (1 << 13)
#define ASI_ICACHE_TAG 0x67
 
# Flush I-cache
icache_flush:
set ((ICACHE_SIZE - ICACHE_LINE_SIZE) | ICACHE_SET_BIT), %g1
stxa %g0, [%g1] ASI_ICACHE_TAG
0: membar #Sync
subcc %g1, ICACHE_LINE_SIZE, %g1
bnz,pt %xcc, 0b
stxa %g0, [%g1] ASI_ICACHE_TAG
membar #Sync
retl
! SF Erratum #51
nop
 
.global ofw
ofw:
save %sp, -STACK_WINDOW_SAVE_AREA_SIZE, %sp