From 2ec0ed9021c19f51c51cfb4d7256ed4b43592004 Mon Sep 17 00:00:00 2001 From: Robert Millan Date: Sat, 29 Aug 2009 00:24:32 +0000 Subject: [PATCH] 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. git-svn-id: svn://svn.savannah.gnu.org/grub/trunk/grub2@2545 d0de0278-0dc1-4c01-8a07-af38b3205e46 --- ChangeLog | 10 ++++++++++ term/i386/pc/serial.c | 8 ++++---- 2 files changed, 14 insertions(+), 4 deletions(-) diff --git a/ChangeLog b/ChangeLog index b657885f..66b8371d 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 195f7367..1d74dbbc 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. */ -- 2.11.4.GIT