summaryrefslogtreecommitdiff
path: root/bsp/env
diff options
context:
space:
mode:
authorMegan Wachs <megan@sifive.com>2017-05-05 17:32:00 -0700
committerGitHub <noreply@github.com>2017-05-05 17:32:00 -0700
commit0357ba87797afa49b5d5ddebb988458d80df91c5 (patch)
treeefffc8d3564c8d62b4703c81608976d01d76cb86 /bsp/env
parent5746b5840284339e02de22ce6e14e1a2ad1606d7 (diff)
parent7f861d2678aebbccc0a980c497febee0cdd7c025 (diff)
Merge pull request #56 from sifive/e51_fixes
E51 fixes for MCAUSE
Diffstat (limited to 'bsp/env')
-rw-r--r--bsp/env/coreplexip-arty.h2
-rw-r--r--bsp/env/coreplexip-e31-arty/platform.h10
2 files changed, 9 insertions, 3 deletions
diff --git a/bsp/env/coreplexip-arty.h b/bsp/env/coreplexip-arty.h
index 12ff9a6..161da7c 100644
--- a/bsp/env/coreplexip-arty.h
+++ b/bsp/env/coreplexip-arty.h
@@ -97,6 +97,6 @@
#define RTC_FREQ 32768
-void write_hex(int fd, uint32_t hex);
+void write_hex(int fd, long int hex);
#endif /* _SIFIVE_COREPLEXIP_ARTY_H */
diff --git a/bsp/env/coreplexip-e31-arty/platform.h b/bsp/env/coreplexip-e31-arty/platform.h
index 02a0a62..42c8887 100644
--- a/bsp/env/coreplexip-e31-arty/platform.h
+++ b/bsp/env/coreplexip-e31-arty/platform.h
@@ -4,8 +4,14 @@
#define _SIFIVE_PLATFORM_H
// Some things missing from the official encoding.h
-#define MCAUSE_INT 0x80000000
-#define MCAUSE_CAUSE 0x7FFFFFFF
+
+#if __riscv_xlen == 32
+#define MCAUSE_INT 0x80000000UL
+#define MCAUSE_CAUSE 0x7FFFFFFFUL
+#else
+#define MCAUSE_INT 0x8000000000000000UL
+#define MCAUSE_CAUSE 0x7FFFFFFFFFFFFFFFUL
+#endif
#define IRQ_M_LOCAL 16
#define MIP_MLIP(x) (1 << (IRQ_M_LOCAL + x))