2007-11-10 Robert Millan <rmh@aybabtu.com>

* include/grub/i386/efi/machine.h: New file.
	* include/grub/i386/linuxbios/machine.h: Likewise.
	* include/grub/i386/pc/machine.h: Likewise.
	* include/grub/powerpc/ieee1275/machine.h: Likewise.
	* include/grub/sparc64/ieee1275/machine.h: Likewise.

	* term/i386/pc/serial.c: Include <grub/machine/machine.h>.
	(serial_hw_io_addr): New variable.
	(serial_hw_get_port): Obtain port address from `serial_hw_io_addr'
	instead of `(unsigned short *) 0x400'.
This commit is contained in:
robertmh 2007-11-10 20:23:14 +00:00
parent 270c237dbe
commit ce0f1839a5
7 changed files with 142 additions and 3 deletions

View file

@ -16,6 +16,7 @@
* along with GRUB. If not, see <http://www.gnu.org/licenses/>.
*/
#include <grub/machine/machine.h>
#include <grub/machine/serial.h>
#include <grub/machine/console.h>
#include <grub/term.h>
@ -63,13 +64,18 @@ struct serial_port
/* Serial port settings. */
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;
#else
static const unsigned short serial_hw_io_addr[] = { 0x3f8, 0x2f8 };
#endif
/* Return the port number for the UNITth serial device. */
static inline unsigned short
serial_hw_get_port (const unsigned short unit)
{
/* The BIOS data area. */
const unsigned short *addr = (const unsigned short *) 0x0400;
return addr[unit];
return serial_hw_io_addr[unit];
}
/* Fetch a key. */