summaryrefslogtreecommitdiffstats
path: root/qemu/roms/seabios/src/gen-defs.h
diff options
context:
space:
mode:
Diffstat (limited to 'qemu/roms/seabios/src/gen-defs.h')
-rw-r--r--qemu/roms/seabios/src/gen-defs.h19
1 files changed, 19 insertions, 0 deletions
diff --git a/qemu/roms/seabios/src/gen-defs.h b/qemu/roms/seabios/src/gen-defs.h
new file mode 100644
index 000000000..dabf64cd9
--- /dev/null
+++ b/qemu/roms/seabios/src/gen-defs.h
@@ -0,0 +1,19 @@
+// Tool for building defintions accessible from assembler code. This
+// is based on code from the Linux Kernel.
+#ifndef __GEN_DEFS_H
+#define __GEN_DEFS_H
+
+
+#define DEFINE(sym, val) \
+ asm volatile("\n->" #sym " %0 " #val : : "i" (val))
+
+#define BLANK() \
+ asm volatile("\n->" : : )
+
+#define OFFSET(sym, str, mem) \
+ DEFINE(sym, offsetof(struct str, mem))
+
+#define COMMENT(x) \
+ asm volatile("\n->#" x)
+
+#endif // gen-defs.h