Implement GET/SET_GLOBAL(...) instead of using GET/SET_VAR(CS, ...)
[seabios.git] / src / biosvar.h
index 646bd51180189c23dea0293e11816e1096a1e90e..f2cb47f6238e686eef41d174b54b53582381844f 100644 (file)
@@ -304,6 +304,22 @@ struct extended_bios_data_area_s {
     SET_FARVAR(SEG_EBDA, ((struct extended_bios_data_area_s *)0)->var, (val))
 
 
+/****************************************************************
+ * Global variables
+ ****************************************************************/
+
+#define GET_GLOBAL(var) \
+    GET_VAR(CS, (var))
+#if MODE16
+extern void __force_link_error__set_global_only_in_32bit();
+#define SET_GLOBAL(var, val)                            \
+    __force_link_error__set_global_only_in_32bit()
+#else
+#define SET_GLOBAL(var, val)                    \
+    do { (var) = (val); } while (0)
+#endif
+
+
 /****************************************************************
  * Bios Config Table
  ****************************************************************/