* grub-core/kern/i386/qemu/mmap.c (grub_machine_mmap_init): Use new

grub_read_cmos prototype.
This commit is contained in:
Vladimir 'phcoder' Serbinenko 2011-07-06 02:50:35 +02:00
parent 93c06ff9c6
commit cf1337aa02
2 changed files with 19 additions and 7 deletions

View file

@ -1,3 +1,8 @@
2011-07-05 Vladimir Serbinenko <phcoder@gmail.com>
* grub-core/kern/i386/qemu/mmap.c (grub_machine_mmap_init): Use new
grub_read_cmos prototype.
2011-07-05 Vladimir Serbinenko <phcoder@gmail.com>
VGA text support in qemu-mips

View file

@ -41,8 +41,11 @@ static grub_uint64_t mem_size, above_4g;
void
grub_machine_mmap_init ()
{
mem_size = ((grub_uint64_t) grub_cmos_read (QEMU_CMOS_MEMSIZE_HIGH)) << 24
| ((grub_uint64_t) grub_cmos_read (QEMU_CMOS_MEMSIZE_LOW)) << 16;
grub_uint8_t high, low, b, c, d;
grub_cmos_read (QEMU_CMOS_MEMSIZE_HIGH, &high);
grub_cmos_read (QEMU_CMOS_MEMSIZE_LOW, &low);
mem_size = ((grub_uint64_t) high) << 24
| ((grub_uint64_t) low) << 16;
if (mem_size > 0)
{
/* Don't ask... */
@ -50,15 +53,19 @@ grub_machine_mmap_init ()
}
else
{
grub_cmos_read (QEMU_CMOS_MEMSIZE2_HIGH, &high);
grub_cmos_read (QEMU_CMOS_MEMSIZE2_LOW, &low);
mem_size
= ((((grub_uint64_t) grub_cmos_read (QEMU_CMOS_MEMSIZE2_HIGH)) << 18)
| ((grub_uint64_t) (grub_cmos_read (QEMU_CMOS_MEMSIZE2_LOW)) << 10))
= ((((grub_uint64_t) high) << 18) | (((grub_uint64_t) low) << 10))
+ 1024 * 1024;
}
above_4g = (((grub_uint64_t) grub_cmos_read (0x5b)) << 16)
| (((grub_uint64_t) grub_cmos_read (0x5c)) << 24)
| (((grub_uint64_t) grub_cmos_read (0x5d)) << 32);
grub_cmos_read (0x5b, &b);
grub_cmos_read (0x5c, &c);
grub_cmos_read (0x5d, &d);
above_4g = (((grub_uint64_t) b) << 16)
| (((grub_uint64_t) c) << 24)
| (((grub_uint64_t) d) << 32);
}
grub_err_t