summaryrefslogtreecommitdiff
path: root/c/rvcontroller-libraries
diff options
context:
space:
mode:
authorcheapie <no-email-for-you@example.com>2026-05-25 14:01:06 -0500
committercheapie <no-email-for-you@example.com>2026-05-25 14:01:06 -0500
commit2ecf97e382b4aff25bb97ea730a0c36d08747998 (patch)
tree766ba234b73390a78cc3eae8ad3a2c09df7faead /c/rvcontroller-libraries
parent6ecdb461c1a823f9c2ff007457ee9963d7e1f681 (diff)
downloadrvcontroller-2ecf97e382b4aff25bb97ea730a0c36d08747998.tar
rvcontroller-2ecf97e382b4aff25bb97ea730a0c36d08747998.tar.gz
rvcontroller-2ecf97e382b4aff25bb97ea730a0c36d08747998.tar.bz2
rvcontroller-2ecf97e382b4aff25bb97ea730a0c36d08747998.tar.xz
rvcontroller-2ecf97e382b4aff25bb97ea730a0c36d08747998.zip
Add big-endian railroad crossing sample and big-endian versions of libraries
Diffstat (limited to 'c/rvcontroller-libraries')
-rw-r--r--c/rvcontroller-libraries/Makefile10
-rw-r--r--c/rvcontroller-libraries/rvcontroller-ecalls-be.obin0 -> 1292 bytes
-rw-r--r--c/rvcontroller-libraries/rvcontroller-init-be.S30
-rw-r--r--c/rvcontroller-libraries/rvcontroller-init-be.obin0 -> 928 bytes
4 files changed, 38 insertions, 2 deletions
diff --git a/c/rvcontroller-libraries/Makefile b/c/rvcontroller-libraries/Makefile
index eca2a8c..bd8752d 100644
--- a/c/rvcontroller-libraries/Makefile
+++ b/c/rvcontroller-libraries/Makefile
@@ -1,10 +1,16 @@
-all: rvcontroller-init.o rvcontroller-ecalls.o
+all: rvcontroller-init.o rvcontroller-init-be.o rvcontroller-ecalls.o rvcontroller-ecalls-be.o
rvcontroller-init.o: rvcontroller-init.S
riscv32-none-elf-as -march=rv32imcb_zicsr_zbkx -o rvcontroller-init.o rvcontroller-init.S
+rvcontroller-init-be.o: rvcontroller-init-be.S
+ riscv32be-none-elf-as -march=rv32imcb_zicsr_zbkx -o rvcontroller-init-be.o rvcontroller-init-be.S
+
rvcontroller-ecalls.o: rvcontroller-ecalls.S
riscv32-none-elf-as -march=rv32imcb_zicsr_zbkx -o rvcontroller-ecalls.o rvcontroller-ecalls.S
+rvcontroller-ecalls-be.o: rvcontroller-ecalls.S
+ riscv32be-none-elf-as -march=rv32imcb_zicsr_zbkx -o rvcontroller-ecalls-be.o rvcontroller-ecalls.S
+
clean:
- rm -f rvcontroller-init.o rvcontroller-ecalls.o
+ rm -f rvcontroller-init.o rvcontroller-init-be.o rvcontroller-ecalls.o rvcontroller-ecalls-be.o
diff --git a/c/rvcontroller-libraries/rvcontroller-ecalls-be.o b/c/rvcontroller-libraries/rvcontroller-ecalls-be.o
new file mode 100644
index 0000000..92d830e
--- /dev/null
+++ b/c/rvcontroller-libraries/rvcontroller-ecalls-be.o
Binary files differ
diff --git a/c/rvcontroller-libraries/rvcontroller-init-be.S b/c/rvcontroller-libraries/rvcontroller-init-be.S
new file mode 100644
index 0000000..86389c7
--- /dev/null
+++ b/c/rvcontroller-libraries/rvcontroller-init-be.S
@@ -0,0 +1,30 @@
+#Assembly stub for C programs targeting RVController - Big-endian Flavor
+#A product of Advanced Mesecons Devices, a Cheapie Systems company
+#This is free and unencumbered software released into the public domain.
+#See http://unlicense.org/ for more information
+
+#This file should always be linked first.
+#RVController has a default reset vector of 0,
+#therefore _start should end up as the first thing in the file.
+
+.section .text.startup
+_start:
+
+# Switch to big-endian mode (little-endian is default after reset)
+li t0,0x20 # MBE
+csrrs x0,0x310,t0 # 0x310 = mstatush
+
+# Set up stack pointer
+li sp,0x10000
+
+# Call main function
+call main
+
+# Exit program
+li a7,10
+ecall
+
+# Shouldn't ever get here, will crash if it does
+ret
+
+.globl _start
diff --git a/c/rvcontroller-libraries/rvcontroller-init-be.o b/c/rvcontroller-libraries/rvcontroller-init-be.o
new file mode 100644
index 0000000..b0b782b
--- /dev/null
+++ b/c/rvcontroller-libraries/rvcontroller-init-be.o
Binary files differ