diff options
author | Kevin O'Connor <kevin@koconnor.net> | 2008-11-08 13:05:27 -0500 |
---|---|---|
committer | Kevin O'Connor <kevin@koconnor.net> | 2008-11-08 13:05:27 -0500 |
commit | d995b3df0189f931325f1630a6e9d17e8e5319db (patch) | |
tree | 3c81b80d22912ccdbccbc8eb7ee610e6ad2ef362 /src/system.c | |
parent | 4a14d75dbec58c5e4e6c4ac178ca13f3b948fa22 (diff) | |
download | seabios-hppa-d995b3df0189f931325f1630a6e9d17e8e5319db.zip seabios-hppa-d995b3df0189f931325f1630a6e9d17e8e5319db.tar.gz seabios-hppa-d995b3df0189f931325f1630a6e9d17e8e5319db.tar.bz2 |
Update e820 map in place instead of copying it.
Allocate the e820 map space in the 0xf0000 segment and do all updates
in place. This reduces the need to access external memory during
post.
Also, move e820 pointer and count from ebda to variables in 0xf0000.
Diffstat (limited to 'src/system.c')
-rw-r--r-- | src/system.c | 14 |
1 files changed, 10 insertions, 4 deletions
diff --git a/src/system.c b/src/system.c index 04cd6ac..f4e4263 100644 --- a/src/system.c +++ b/src/system.c @@ -266,23 +266,29 @@ handle_15e801(struct bregs *regs) set_success(regs); } +#if MODE16 +// Info on e820 map location and size. +struct e820entry *e820_list VISIBLE16; +int e820_count VISIBLE16; +#endif + static void handle_15e820(struct bregs *regs) { - int count = GET_EBDA(e820_count); + int count = GET_VAR(CS, e820_count); if (regs->edx != 0x534D4150 || regs->bx >= count) { set_code_fail(regs, RET_EUNSUPPORTED); return; } - struct e820entry *e = &((struct e820entry *)GET_EBDA(e820_loc))[regs->bx]; - memcpy_far(MAKE_FARPTR(regs->es, regs->di), e, sizeof(*e)); + struct e820entry *l = GET_VAR(CS, e820_list); + memcpy_far(MAKE_FARPTR(regs->es, regs->di), &l[regs->bx], sizeof(l[0])); if (regs->bx == count-1) regs->ebx = 0; else regs->ebx++; regs->eax = 0x534D4150; - regs->ecx = sizeof(*e); + regs->ecx = sizeof(l[0]); set_success(regs); } |