summaryrefslogtreecommitdiffstats
path: root/c/src/lib/libcpu/sparc/access/access.S
diff options
context:
space:
mode:
authorDaniel Hellstrom <daniel@gaisler.com>2012-02-08 15:57:03 +0100
committerGedare Bloom <gedare@rtems.org>2012-03-21 12:35:47 -0400
commit80d01b3cf8e4bb2998f1e8e99ed5b5d64ac8d23e (patch)
tree547fd0c47b52041da88d89c0d099659f8e1aa693 /c/src/lib/libcpu/sparc/access/access.S
parentPR2041: sparc64: vector number not included in CPU_Interrupt_frame (diff)
downloadrtems-80d01b3cf8e4bb2998f1e8e99ed5b5d64ac8d23e.tar.bz2
SPARC: added libcpu lowlevel access and byteorder routines/definitions
The low level routines can be used in different occasions, it will be required when accessing PCI. Note the difference between byteorder.h (inlined functions) and access.S where the functions will be declared in the library archive librtemscpu.a. Function names starting with _ are in library and can be referenced by function pointers. Signed-off-by: Daniel Hellstrom <daniel@gaisler.com>
Diffstat (limited to 'c/src/lib/libcpu/sparc/access/access.S')
-rw-r--r--c/src/lib/libcpu/sparc/access/access.S81
1 files changed, 81 insertions, 0 deletions
diff --git a/c/src/lib/libcpu/sparc/access/access.S b/c/src/lib/libcpu/sparc/access/access.S
new file mode 100644
index 0000000000..bad296eff5
--- /dev/null
+++ b/c/src/lib/libcpu/sparc/access/access.S
@@ -0,0 +1,81 @@
+/*
+ * Optimized access routines for SPARC.
+ *
+ * Note the difference between byteorder.h (inlined functions) and access.S
+ * where the functions will be declared in the library archive librtemscpu.a.
+ * Function names starting with _ are in library and can be referenced by
+ * function pointers.
+ *
+ * _ldN, _stN standard machine endianess access (SPARC: big-endian)
+ * _ld_beN, _st_beN forced big-endian
+ * _ld_leN, _st_leN forced little-endian (defined in access_le.C)
+ *
+ * This file is written in assembly because the big-endian functions maps to
+ * machine dependant access methods, i.e. same function has two names.
+ *
+ * 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(_ld_be64)
+ PUBLIC(_st_be16)
+ PUBLIC(_st_be32)
+ PUBLIC(_st_be64)
+
+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
+
+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):
+ mov %o2, %o3
+ mov %o1, %o2
+ retl
+ std %o2, [%o0]