summaryrefslogtreecommitdiff
path: root/riscv/riscv-probe/examples/hang
diff options
context:
space:
mode:
authorCarlos Maiolino <[email protected]>2025-07-10 22:18:39 +0200
committerCarlos Maiolino <[email protected]>2025-07-10 22:18:39 +0200
commit8c6fc0c15415b32080a848bbde640e104098cf13 (patch)
tree04a21bd28f9dc82c8e216390d6208ed93b9bcd11 /riscv/riscv-probe/examples/hang
Initial drop
Add some riscv code Signed-off-by: Carlos Maiolino <[email protected]>
Diffstat (limited to 'riscv/riscv-probe/examples/hang')
-rw-r--r--riscv/riscv-probe/examples/hang/hang.c23
-rw-r--r--riscv/riscv-probe/examples/hang/rules.mk1
2 files changed, 24 insertions, 0 deletions
diff --git a/riscv/riscv-probe/examples/hang/hang.c b/riscv/riscv-probe/examples/hang/hang.c
new file mode 100644
index 0000000..066ca9e
--- /dev/null
+++ b/riscv/riscv-probe/examples/hang/hang.c
@@ -0,0 +1,23 @@
+#include <stdio.h>
+
+int main(int argc, char **argv)
+{
+ volatile int a;
+ int b, c, d, e, f, g, h, i, j, k, l, m;
+ printf("hang\n");
+ for (;;) {
+ a = b;
+ b = c;
+ c = d;
+ d = e;
+ e = f;
+ f = g;
+ g = h;
+ h = i;
+ i = j;
+ j = k;
+ k = l;
+ l = m;
+ m = a;
+ }
+}
diff --git a/riscv/riscv-probe/examples/hang/rules.mk b/riscv/riscv-probe/examples/hang/rules.mk
new file mode 100644
index 0000000..8a04005
--- /dev/null
+++ b/riscv/riscv-probe/examples/hang/rules.mk
@@ -0,0 +1 @@
+hang_objs = hang.o