summaryrefslogtreecommitdiff
path: root/c/src/lib/libcpu/sparc/access/access.S
blob: e72cebb5b442f5200f68d5007b1b20aee5cff379 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
/*
 *  Access routines for SPARC
 *
 *  COPYRIGHT (c) 2011
 *  Aeroflex Gaisler.
 *
 *  The license and distribution terms for this file may be
 *  found in the file LICENSE in this distribution or at
 *  http://www.rtems.com/license/LICENSE.
 */

#include <rtems/asm.h>

	.align 4
	.seg "text"
	PUBLIC(_ld8)
	PUBLIC(_ld16)
	PUBLIC(_ld32)
	PUBLIC(_ld64)
	PUBLIC(_st8)
	PUBLIC(_st16)
	PUBLIC(_st32)
	PUBLIC(_st64)
	PUBLIC(_ld_be16)
	PUBLIC(_ld_be32)
	PUBLIC(_st_be16)
	PUBLIC(_st_be32)

SYM(_ld8):
	retl
	 ldub [%o0], %o0

SYM(_ld_be16):
SYM(_ld16):
	retl
	 lduh [%o0], %o0

SYM(_ld_be32):
SYM(_ld32):
	retl
	 ld [%o0], %o0

SYM(_ld_be64):
SYM(_ld64):
	retl
	 ldd [%o0], %o0

#if defined(__FIX_B2BST)

SYM(_st8):
	stub %o1, [%o0]
	retl
	 nop

SYM(_st_be16):
SYM(_st16):
	stuh %o1, [%o0]
	retl
	 nop

SYM(_st_be32):
SYM(_st32):
	st %o1, [%o0]
	retl
	 nop

SYM(_st_be64):
SYM(_st64):
	std %o1, [%o0]
	retl
	 nop

#else

SYM(_st8):
	retl
	 stub %o1, [%o0]

SYM(_st_be16):
SYM(_st16):
	retl
	 stuh %o1, [%o0]

SYM(_st_be32):
SYM(_st32):
	retl
	 st %o1, [%o0]

SYM(_st_be64):
SYM(_st64):
	retl
	 std %o1, [%o0]

#endif