~hamo/ubuntu/precise/grub2/grub2.hi_res

« back to all changes in this revision

Viewing changes to term/i386/pc/serial.c

ImportĀ upstreamĀ versionĀ 1.97~beta3

Show diffs side-by-side

added added

removed removed

Lines of Context:
1
1
/*
2
2
 *  GRUB  --  GRand Unified Bootloader
3
 
 *  Copyright (C) 2000,2001,2002,2003,2004,2005,2007,2008  Free Software Foundation, Inc.
 
3
 *  Copyright (C) 2000,2001,2002,2003,2004,2005,2007,2008,2009  Free Software Foundation, Inc.
4
4
 *
5
5
 *  GRUB is free software: you can redistribute it and/or modify
6
6
 *  it under the terms of the GNU General Public License as published by
17
17
 */
18
18
 
19
19
#include <grub/machine/machine.h>
 
20
#include <grub/machine/memory.h>
20
21
#include <grub/machine/serial.h>
21
22
#include <grub/machine/console.h>
22
23
#include <grub/term.h>
64
65
static struct serial_port serial_settings;
65
66
 
66
67
#ifdef GRUB_MACHINE_PCBIOS
67
 
/* The BIOS data area.  */
68
 
static const unsigned short *serial_hw_io_addr = (const unsigned short *) 0x0400;
 
68
static const unsigned short *serial_hw_io_addr = (const unsigned short *) GRUB_MEMORY_MACHINE_BIOS_DATA_AREA_ADDR;
69
69
#define GRUB_SERIAL_PORT_NUM 4
70
70
#else
71
71
static const unsigned short serial_hw_io_addr[] = { 0x3f8, 0x2f8, 0x3e8, 0x2e8 };
72
 
#define GRUB_SERIAL_PORT_NUM (sizeof(serial_hw_io_addr)/sizeof(serial_hw_io_addr[0]))
 
72
#define GRUB_SERIAL_PORT_NUM (ARRAY_SIZE(serial_hw_io_addr))
73
73
#endif
74
74
 
75
75
/* Return the port number for the UNITth serial device.  */