Subversion Repositories HelenOS

Rev

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

Rev 2927 Rev 3153
Line 96... Line 96...
96
 
96
 
97
	jmp	%o7 + 8			! exit point
97
	jmp	%o7 + 8			! exit point
98
	mov	%o1, %o0
98
	mov	%o1, %o0
99
 
99
 
100
jump_to_kernel:
100
jump_to_kernel:
-
 
101
	/*
-
 
102
	 * We have copied code and now we need to guarantee cache coherence.
-
 
103
	 * 1. Make sure that the code we have moved has drained to main memory.
-
 
104
	 * 2. Invalidate I-cache.
-
 
105
	 * 3. Flush instruction pipeline.
-
 
106
	 */ 
-
 
107
	call	icache_flush
-
 
108
	membar	#StoreStore
-
 
109
	flush	%i7
-
 
110
 
101
	mov %o0, %l1
111
	mov %o0, %l1
102
	mov %o1, %o0
112
	mov %o1, %o0
103
	mov %o2, %o1
113
	mov %o2, %o1
104
	mov %o3, %o2
114
	mov %o3, %o2
105
	jmp %l1				! jump to kernel
115
	jmp %l1				! jump to kernel
106
	nop
116
	nop
107
 
117
 
-
 
118
#define ICACHE_SIZE		8192
-
 
119
#define ICACHE_LINE_SIZE	32
-
 
120
#define ICACHE_SET_BIT		(1 << 13)
-
 
121
#define ASI_ICACHE_TAG		0x67
-
 
122
 
-
 
123
# Flush I-cache
-
 
124
icache_flush:
-
 
125
	set	((ICACHE_SIZE - ICACHE_LINE_SIZE) | ICACHE_SET_BIT), %g1
-
 
126
	stxa	%g0, [%g1] ASI_ICACHE_TAG
-
 
127
0:	membar	#Sync
-
 
128
	subcc	%g1, ICACHE_LINE_SIZE, %g1
-
 
129
	bnz,pt	%xcc, 0b
-
 
130
	stxa	%g0, [%g1] ASI_ICACHE_TAG
-
 
131
	membar	#Sync
-
 
132
	retl
-
 
133
	! SF Erratum #51
-
 
134
	nop
-
 
135
 
108
.global ofw
136
.global ofw
109
ofw:
137
ofw:
110
	save %sp, -STACK_WINDOW_SAVE_AREA_SIZE, %sp
138
	save %sp, -STACK_WINDOW_SAVE_AREA_SIZE, %sp
111
	set ofw_cif, %l0
139
	set ofw_cif, %l0
112
	ldx [%l0], %l0
140
	ldx [%l0], %l0