aboutsummaryrefslogtreecommitdiff
path: root/src/biosvar.h
diff options
context:
space:
mode:
authorKevin O'Connor <kevin@koconnor.net>2009-05-17 10:31:34 -0400
committerKevin O'Connor <kevin@koconnor.net>2009-05-17 10:31:34 -0400
commit49553a4bdc31c75331fc1ba602ab440937ddab97 (patch)
treed9aa85633f42129bd55b35ccee20da7009b950a5 /src/biosvar.h
parent99e08b7fc3a6c5279a0d2d23c7d485698190ac50 (diff)
downloadseabios-hppa-49553a4bdc31c75331fc1ba602ab440937ddab97.zip
seabios-hppa-49553a4bdc31c75331fc1ba602ab440937ddab97.tar.gz
seabios-hppa-49553a4bdc31c75331fc1ba602ab440937ddab97.tar.bz2
Verify ebda segment looks sane before using during resume.
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 fceb876..c0b46cc 100644
--- a/src/biosvar.h
+++ b/src/biosvar.h
@@ -235,6 +235,12 @@ struct extended_bios_data_area_s {
u8 extra_stack[512] __aligned(8);
} PACKED;
+// The initial size and location of EBDA
+#define EBDA_SIZE_START \
+ DIV_ROUND_UP(sizeof(struct extended_bios_data_area_s), 1024)
+#define EBDA_SEGMENT_START \
+ FLATPTR_TO_SEG((640 - EBDA_SIZE_START) * 1024)
+
// Accessor functions
static inline u16 get_ebda_seg() {
return GET_BDA(ebda_seg);