Subversion Repositories HelenOS

Rev

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

Rev 3168 Rev 3403
Line 39... Line 39...
39
/*
39
/*
40
 * This is the assembly language version of our _memcpy() generated by gcc.
40
 * This is the assembly language version of our _memcpy() generated by gcc.
41
 */
41
 */
42
.global memcpy
42
.global memcpy
43
memcpy:
43
memcpy:
-
 
44
	mov	%o0, %o3		! save dst
44
	add	%o1, 7, %g1
45
	add	%o1, 7, %g1
45
	and	%g1, -8, %g1
46
	and	%g1, -8, %g1
46
	cmp	%o1, %g1
47
	cmp	%o1, %g1
47
	be,pn	%xcc, 3f
48
	be,pn	%xcc, 3f
48
	add	%o0, 7, %g1
49
	add	%o0, 7, %g1
Line 57... Line 58...
57
	stb	%g1, [%g3 + %o0]
58
	stb	%g1, [%g3 + %o0]
58
	bne,pt	%xcc, 1b
59
	bne,pt	%xcc, 1b
59
	mov	%g2, %g3
60
	mov	%g2, %g3
60
2:
61
2:
61
	jmp	%o7 + 8			! exit point
62
	jmp	%o7 + 8			! exit point
62
	mov	%o1, %o0
63
	mov	%o3, %o0
63
3:
64
3:
64
	and	%g1, -8, %g1
65
	and	%g1, -8, %g1
65
	cmp	%o0, %g1
66
	cmp	%o0, %g1
66
	bne,pt	%xcc, 0b
67
	bne,pt	%xcc, 0b
67
	mov	0, %g3
68
	mov	0, %g3
Line 91... Line 92...
91
	cmp	%o2, %g2
92
	cmp	%o2, %g2
92
	bne,pt	%xcc, 6b
93
	bne,pt	%xcc, 6b
93
	mov	%g2, %g3
94
	mov	%g2, %g3
94
 
95
 
95
	jmp	%o7 + 8			! exit point
96
	jmp	%o7 + 8			! exit point
96
	mov	%o1, %o0
97
	mov	%o3, %o0
97
 
98
 
98
/*
99
/*
99
 * Almost the same as memcpy() except the loads are from userspace.
100
 * Almost the same as memcpy() except the loads are from userspace.
100
 */
101
 */
101
.global memcpy_from_uspace
102
.global memcpy_from_uspace
102
memcpy_from_uspace:
103
memcpy_from_uspace:
-
 
104
	mov	%o0, %o3		! save dst
103
	add	%o1, 7, %g1
105
	add	%o1, 7, %g1
104
	and	%g1, -8, %g1
106
	and	%g1, -8, %g1
105
	cmp	%o1, %g1
107
	cmp	%o1, %g1
106
	be,pn	%xcc, 3f
108
	be,pn	%xcc, 3f
107
	add	%o0, 7, %g1
109
	add	%o0, 7, %g1
Line 116... Line 118...
116
	stb	%g1, [%g3 + %o0]
118
	stb	%g1, [%g3 + %o0]
117
	bne,pt	%xcc, 1b
119
	bne,pt	%xcc, 1b
118
	mov	%g2, %g3
120
	mov	%g2, %g3
119
2:
121
2:
120
	jmp	%o7 + 8			! exit point
122
	jmp	%o7 + 8			! exit point
121
	mov	%o1, %o0
123
	mov	%o3, %o0
122
3:
124
3:
123
	and	%g1, -8, %g1
125
	and	%g1, -8, %g1
124
	cmp	%o0, %g1
126
	cmp	%o0, %g1
125
	bne,pt	%xcc, 0b
127
	bne,pt	%xcc, 0b
126
	mov	0, %g3
128
	mov	0, %g3
Line 150... Line 152...
150
	cmp	%o2, %g2
152
	cmp	%o2, %g2
151
	bne,pt	%xcc, 6b
153
	bne,pt	%xcc, 6b
152
	mov	%g2, %g3
154
	mov	%g2, %g3
153
 
155
 
154
	jmp	%o7 + 8			! exit point
156
	jmp	%o7 + 8			! exit point
155
	mov	%o1, %o0
157
	mov	%o3, %o0
156
 
158
 
157
/*
159
/*
158
 * Almost the same as memcpy() except the stores are to userspace.
160
 * Almost the same as memcpy() except the stores are to userspace.
159
 */
161
 */
160
.global memcpy_to_uspace
162
.global memcpy_to_uspace
161
memcpy_to_uspace:
163
memcpy_to_uspace:
-
 
164
	mov	%o0, %o3		! save dst
162
	add	%o1, 7, %g1
165
	add	%o1, 7, %g1
163
	and	%g1, -8, %g1
166
	and	%g1, -8, %g1
164
	cmp	%o1, %g1
167
	cmp	%o1, %g1
165
	be,pn	%xcc, 3f
168
	be,pn	%xcc, 3f
166
	add	%o0, 7, %g1
169
	add	%o0, 7, %g1
Line 175... Line 178...
175
	stba	%g1, [%g3 + %o0] ASI_AIUS
178
	stba	%g1, [%g3 + %o0] ASI_AIUS
176
	bne,pt	%xcc, 1b
179
	bne,pt	%xcc, 1b
177
	mov	%g2, %g3
180
	mov	%g2, %g3
178
2:
181
2:
179
	jmp	%o7 + 8			! exit point
182
	jmp	%o7 + 8			! exit point
180
	mov	%o1, %o0
183
	mov	%o3, %o0
181
3:
184
3:
182
	and	%g1, -8, %g1
185
	and	%g1, -8, %g1
183
	cmp	%o0, %g1
186
	cmp	%o0, %g1
184
	bne,pt	%xcc, 0b
187
	bne,pt	%xcc, 0b
185
	mov	0, %g3
188
	mov	0, %g3
Line 209... Line 212...
209
	cmp	%o2, %g2
212
	cmp	%o2, %g2
210
	bne,pt	%xcc, 6b
213
	bne,pt	%xcc, 6b
211
	mov	%g2, %g3
214
	mov	%g2, %g3
212
 
215
 
213
	jmp	%o7 + 8			! exit point
216
	jmp	%o7 + 8			! exit point
214
	mov	%o1, %o0
217
	mov	%o3, %o0
215
 
218
 
216
.global memcpy_from_uspace_failover_address
219
.global memcpy_from_uspace_failover_address
217
.global memcpy_to_uspace_failover_address
220
.global memcpy_to_uspace_failover_address
218
memcpy_from_uspace_failover_address:
221
memcpy_from_uspace_failover_address:
219
memcpy_to_uspace_failover_address:
222
memcpy_to_uspace_failover_address: