2c2
< * Copyright (c) 2007 The Hewlett-Packard Development Company
---
> * Copyright (c) 2007-2008 The Hewlett-Packard Development Company
71c71
< : X86System(p), commandLine(p->boot_osflags)
---
> : X86System(p), commandLine(p->boot_osflags), e820Table(p->e820_table)
147,152c147
< struct e820Entry
< {
< Addr addr;
< Addr size;
< uint32_t type;
< };
---
> e820Table->writeTo(physPort, e820MapNrPointer, e820MapPointer);
154,203d148
< // The size is computed this way to ensure no padding sneaks in.
< int e820EntrySize =
< sizeof(e820Entry().addr) +
< sizeof(e820Entry().size) +
< sizeof(e820Entry().type);
<
< // I'm not sure what these should actually be. On a real machine they
< // would be generated by the BIOS, and they need to reflect the regions
< // which are actually available/reserved. These values are copied from
< // my development machine.
< e820Entry e820Map[] = {
< {ULL(0x0), ULL(0x9d400), 1},
< {ULL(0x9d400), ULL(0xa0000) - ULL(0x9d400), 2},
< {ULL(0xe8000), ULL(0x100000) - ULL(0xe8000), 2},
< {ULL(0x100000), ULL(0xcfff9300) - ULL(0x100000), 1},
< {ULL(0xcfff9300), ULL(0xd0000000) - ULL(0xcfff9300), 2},
< {ULL(0xfec00000), ULL(0x100000000) - ULL(0xfec00000), 2}
< };
<
< uint8_t e820Nr = sizeof(e820Map) / sizeof(e820Entry);
<
< // Make sure the number of entries isn't bigger than what the kernel
< // would be capable of providing.
< assert(e820Nr <= 128);
<
< uint8_t guestE820Nr = X86ISA::htog(e820Nr);
< physPort->writeBlob(e820MapNrPointer,
< (uint8_t *)&guestE820Nr, sizeof(guestE820Nr));
<
< for (int i = 0; i < e820Nr; i++) {
< e820Entry guestE820Entry;
< guestE820Entry.addr = X86ISA::htog(e820Map[i].addr);
< guestE820Entry.size = X86ISA::htog(e820Map[i].size);
< guestE820Entry.type = X86ISA::htog(e820Map[i].type);
< physPort->writeBlob(e820MapPointer + e820EntrySize * i,
< (uint8_t *)&guestE820Entry.addr,
< sizeof(guestE820Entry.addr));
< physPort->writeBlob(
< e820MapPointer + e820EntrySize * i +
< sizeof(guestE820Entry.addr),
< (uint8_t *)&guestE820Entry.size,
< sizeof(guestE820Entry.size));
< physPort->writeBlob(
< e820MapPointer + e820EntrySize * i +
< sizeof(guestE820Entry.addr) +
< sizeof(guestE820Entry.size),
< (uint8_t *)&guestE820Entry.type,
< sizeof(guestE820Entry.type));
< }
<