aboutsummaryrefslogtreecommitdiff
path: root/src/biosvar.h
diff options
context:
space:
mode:
authorKevin O'Connor <kevin@koconnor.net>2010-07-28 21:31:38 -0400
committerKevin O'Connor <kevin@koconnor.net>2010-07-28 21:31:38 -0400
commitcc9e1bf4336696340330010d59028e3b8fb9aa7d (patch)
tree108cd7725b49f689a52dfe27a9c692e408273ed4 /src/biosvar.h
parentb4525a0ec176426788f293cce92160e6573e86b6 (diff)
downloadseabios-hppa-cc9e1bf4336696340330010d59028e3b8fb9aa7d.zip
seabios-hppa-cc9e1bf4336696340330010d59028e3b8fb9aa7d.tar.gz
seabios-hppa-cc9e1bf4336696340330010d59028e3b8fb9aa7d.tar.bz2
Add FUNC16() helper macro for converting a 16bit func to a segoff_s.
Diffstat (limited to 'src/biosvar.h')
-rw-r--r--src/biosvar.h6
1 files changed, 6 insertions, 0 deletions
diff --git a/src/biosvar.h b/src/biosvar.h
index df0df0e..415f958 100644
--- a/src/biosvar.h
+++ b/src/biosvar.h
@@ -25,6 +25,12 @@ struct rmode_IVT {
#define SET_IVT(vector, segoff) \
SET_FARVAR(SEG_IVT, ((struct rmode_IVT *)0)->ivec[vector], segoff)
+#define FUNC16(func) ({ \
+ ASSERT32FLAT(); \
+ extern void func (void); \
+ SEGOFF(SEG_BIOS, (u32)func - BUILD_BIOS_ADDR); \
+ })
+
/****************************************************************
* Bios Data Area (BDA)