Since curr_ipl is accessed using the CX() macro,
this type needs to be 8 bytes long on 64 bit.
Reported by Brent Baccala
---
i386/i386/fpu.c | 2 +-
i386/i386/spl.h | 4 ++++
2 files changed, 5 insertions(+), 1 deletion(-)
diff --git a/i386/i386/fpu.c b/i386/i386/fpu.c
index 22bb28a1..dbd16255 100644
--- a/i386/i386/fpu.c
+++ b/i386/i386/fpu.c
@@ -61,7 +61,7 @@
#define ASSERT_IPL(L) \
MACRO_BEGIN \
if (curr_ipl[cpu_number()] != L) { \
- printf("IPL is %d, expected %d\n", curr_ipl[cpu_number()], L); \
+ printf("IPL is %ld, expected %d\n", (long)curr_ipl[cpu_number()],
L); \
panic("fpu: wrong ipl"); \
} \
MACRO_END
diff --git a/i386/i386/spl.h b/i386/i386/spl.h
index 834204c4..f4417e7b 100644
--- a/i386/i386/spl.h
+++ b/i386/i386/spl.h
@@ -30,7 +30,11 @@
* machine-dependent code.
*/
+#ifdef __x86_64__
+typedef long spl_t;
+#else
typedef int spl_t;
+#endif
extern spl_t (splhi)(void);
--
2.51.0