aboutsummaryrefslogtreecommitdiff
path: root/src/farptr.h
diff options
context:
space:
mode:
authorKevin O'Connor <kevin@koconnor.net>2009-06-15 23:03:05 -0400
committerKevin O'Connor <kevin@koconnor.net>2009-06-15 23:03:05 -0400
commit0b60a062da0c28ed4779ab707c64dde6d3af8ef1 (patch)
treef9b4672315245ab52c2f59c94718c66522087b87 /src/farptr.h
parent4d863fe762bac06f77e1884741f1ab48b27c64bc (diff)
downloadseabios-hppa-0b60a062da0c28ed4779ab707c64dde6d3af8ef1.zip
seabios-hppa-0b60a062da0c28ed4779ab707c64dde6d3af8ef1.tar.gz
seabios-hppa-0b60a062da0c28ed4779ab707c64dde6d3af8ef1.tar.bz2
Unify mode16/32 compiler checks.
Add ASSERT16/ASSERT32 macros to farptr.h. Use those macros in place of open-coded checks. Add "noreturn" attribute to functions to reduce compiler warnings. Add ASSERT32 to smp_probe() to eliminate 16bit assembler warnings.
Diffstat (limited to 'src/farptr.h')
-rw-r--r--src/farptr.h8
1 files changed, 8 insertions, 0 deletions
diff --git a/src/farptr.h b/src/farptr.h
index a26cf08..4fc727b 100644
--- a/src/farptr.h
+++ b/src/farptr.h
@@ -157,6 +157,10 @@ static inline void outsl_fl(u16 port, void *ptr_fl, u16 count) {
outsl(port, (u32*)FLATPTR_TO_OFFSET(ptr_fl), count);
}
+extern void __force_link_error__only_in_32bit() __attribute__ ((noreturn));
+#define ASSERT16() do { } while (0)
+#define ASSERT32() __force_link_error__only_in_32bit()
+
#else
// In 32-bit mode there is no need to mess with the segments.
@@ -178,6 +182,10 @@ static inline void outsl_fl(u16 port, void *ptr_fl, u16 count) {
#define outsw_fl(port, ptr_fl, count) outsw(port, ptr_fl, count)
#define outsl_fl(port, ptr_fl, count) outsl(port, ptr_fl, count)
+extern void __force_link_error__only_in_16bit() __attribute__ ((noreturn));
+#define ASSERT16() __force_link_error__only_in_16bit()
+#define ASSERT32() do { } while (0)
+
#endif
#endif // farptr.h