summaryrefslogtreecommitdiffstats
path: root/c/src/lib/libbsp/sparc/shared/cpu.c
diff options
context:
space:
mode:
authorChristian Mauderer <Christian.Mauderer@embedded-brains.de>2014-06-02 16:31:51 +0200
committerSebastian Huber <sebastian.huber@embedded-brains.de>2014-06-03 08:35:47 +0200
commit8df1f408fd8c4f67629f32470b5b7d94123bc305 (patch)
treec64a21cd0f587bae7926c2ff4d7349df026249e3 /c/src/lib/libbsp/sparc/shared/cpu.c
parentlibblock: Avoid recursive mutex (diff)
downloadrtems-8df1f408fd8c4f67629f32470b5b7d94123bc305.tar.bz2
score/sparc: Add support for paravirtualization
Guest systems in paravirtualization environments run usually in user mode. Thus it is not possible to directly access the PSR and TBR registers. Use functions instead of inline assembler to access these registers if RTEMS_PARAVIRT is defined.
Diffstat (limited to 'c/src/lib/libbsp/sparc/shared/cpu.c')
-rw-r--r--c/src/lib/libbsp/sparc/shared/cpu.c36
1 files changed, 36 insertions, 0 deletions
diff --git a/c/src/lib/libbsp/sparc/shared/cpu.c b/c/src/lib/libbsp/sparc/shared/cpu.c
new file mode 100644
index 0000000000..12d347547b
--- /dev/null
+++ b/c/src/lib/libbsp/sparc/shared/cpu.c
@@ -0,0 +1,36 @@
+/**
+ * @file
+ *
+ * @brief SPARC CPU Dependent Source
+ */
+
+/*
+ * COPYRIGHT (c) 1989-2007.
+ * On-Line Applications Research Corporation (OAR).
+ *
+ * The license and distribution terms for this file may be
+ * found in the file LICENSE in this distribution or at
+ * http://www.rtems.org/license/LICENSE.
+ */
+
+#include <rtems/score/cpu.h>
+
+/*
+ * This initializes the set of opcodes placed in each trap
+ * table entry. The routine which installs a handler is responsible
+ * for filling in the fields for the _handler address and the _vector
+ * trap type.
+ *
+ * The constants following this structure are masks for the fields which
+ * must be filled in when the handler is installed.
+ *
+ * This table is defined here to allow BSP specific versions, e.g. for guest
+ * systems under paravirtualization.
+ */
+
+const CPU_Trap_table_entry _CPU_Trap_slot_template = {
+ 0xa1480000, /* mov %psr, %l0 */
+ 0x29000000, /* sethi %hi(_handler), %l4 */
+ 0x81c52000, /* jmp %l4 + %lo(_handler) */
+ 0xa6102000 /* mov _vector, %l3 */
+};