diff --git a/ChangeLog b/ChangeLog index b657885fe..66b8371dd 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,13 @@ +2009-08-29 Robert Millan + + * term/i386/pc/serial.c: Include `'. + + [GRUB_MACHINE_PCBIOS] (serial_hw_io_addr): Macroify initialization + value (0x0400 -> GRUB_MEMORY_MACHINE_BIOS_DATA_AREA_ADDR). + + [! GRUB_MACHINE_PCBIOS] (GRUB_SERIAL_PORT_NUM): Calculate using + `ARRAY_SIZE' macro. + 2009-08-28 Vladimir Serbinenko * kern/file.c (grub_file_read): Check offset. diff --git a/term/i386/pc/serial.c b/term/i386/pc/serial.c index 195f73670..1d74dbbc8 100644 --- a/term/i386/pc/serial.c +++ b/term/i386/pc/serial.c @@ -1,6 +1,6 @@ /* * GRUB -- GRand Unified Bootloader - * Copyright (C) 2000,2001,2002,2003,2004,2005,2007,2008 Free Software Foundation, Inc. + * Copyright (C) 2000,2001,2002,2003,2004,2005,2007,2008,2009 Free Software Foundation, Inc. * * GRUB is free software: you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by @@ -17,6 +17,7 @@ */ #include +#include #include #include #include @@ -64,12 +65,11 @@ struct serial_port static struct serial_port serial_settings; #ifdef GRUB_MACHINE_PCBIOS -/* The BIOS data area. */ -static const unsigned short *serial_hw_io_addr = (const unsigned short *) 0x0400; +static const unsigned short *serial_hw_io_addr = (const unsigned short *) GRUB_MEMORY_MACHINE_BIOS_DATA_AREA_ADDR; #define GRUB_SERIAL_PORT_NUM 4 #else static const unsigned short serial_hw_io_addr[] = { 0x3f8, 0x2f8, 0x3e8, 0x2e8 }; -#define GRUB_SERIAL_PORT_NUM (sizeof(serial_hw_io_addr)/sizeof(serial_hw_io_addr[0])) +#define GRUB_SERIAL_PORT_NUM (ARRAY_SIZE(serial_hw_io_addr)) #endif /* Return the port number for the UNITth serial device. */