-#define GET_EBDA(var) \
- GET_FARVAR(SEG_EBDA, ((struct extended_bios_data_area_s *)0)->var)
-#define SET_EBDA(var, val) \
- SET_FARVAR(SEG_EBDA, ((struct extended_bios_data_area_s *)0)->var, (val))
+static inline u16 get_ebda_seg(void) {
+ return GET_BDA(ebda_seg);
+}
+static inline struct extended_bios_data_area_s *
+get_ebda_ptr(void)
+{
+ ASSERT32FLAT();
+ return MAKE_FLATPTR(get_ebda_seg(), 0);
+}
+#define GET_EBDA2(eseg, var) \
+ GET_FARVAR(eseg, ((struct extended_bios_data_area_s *)0)->var)
+#define SET_EBDA2(eseg, var, val) \
+ SET_FARVAR(eseg, ((struct extended_bios_data_area_s *)0)->var, (val))
+#define GET_EBDA(var) \
+ GET_EBDA2(get_ebda_seg(), var)
+#define SET_EBDA(var, val) \
+ SET_EBDA2(get_ebda_seg(), var, (val))
+
+#define EBDA_OFFSET_TOP_STACK \
+ offsetof(struct extended_bios_data_area_s, extra_stack[ \
+ FIELD_SIZEOF(struct extended_bios_data_area_s \
+ , extra_stack)])