]> git.ipfire.org Git - thirdparty/grub.git/commitdiff
2007-11-10 Robert Millan <rmh@aybabtu.com>
authorrobertmh <robertmh@localhost>
Sat, 10 Nov 2007 20:23:14 +0000 (20:23 +0000)
committerrobertmh <robertmh@localhost>
Sat, 10 Nov 2007 20:23:14 +0000 (20:23 +0000)
* 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'.

ChangeLog
include/grub/i386/efi/machine.h [new file with mode: 0644]
include/grub/i386/linuxbios/machine.h [new file with mode: 0644]
include/grub/i386/pc/machine.h [new file with mode: 0644]
include/grub/powerpc/ieee1275/machine.h [new file with mode: 0644]
include/grub/sparc64/ieee1275/machine.h [new file with mode: 0644]
term/i386/pc/serial.c

index e7f888e87d5b320d3987b7c3adb3243083159fd5..e2900f9bd0e70563e850b2dd785d98a83d2f9b59 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,16 @@
+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'.
+
 2007-11-10  Bean  <bean123ch@gmail.com>
 
        * fs/ntfs.c (read_block): Fix a bug caused by adjacent blocks.
diff --git a/include/grub/i386/efi/machine.h b/include/grub/i386/efi/machine.h
new file mode 100644 (file)
index 0000000..1600768
--- /dev/null
@@ -0,0 +1,24 @@
+/*
+ *  GRUB  --  GRand Unified Bootloader
+ *  Copyright (C) 2007  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
+ *  the Free Software Foundation, either version 3 of the License, or
+ *  (at your option) any later version.
+ *
+ *  GRUB is distributed in the hope that it will be useful,
+ *  but WITHOUT ANY WARRANTY; without even the implied warranty of
+ *  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ *  GNU General Public License for more details.
+ *
+ *  You should have received a copy of the GNU General Public License
+ *  along with GRUB.  If not, see <http://www.gnu.org/licenses/>.
+ */
+
+#ifndef GRUB_MACHINE_MACHINE_HEADER
+#define GRUB_MACHINE_MACHINE_HEADER    1
+
+#define GRUB_MACHINE_EFI       1
+
+#endif /* ! GRUB_MACHINE_MACHINE_HEADER */
diff --git a/include/grub/i386/linuxbios/machine.h b/include/grub/i386/linuxbios/machine.h
new file mode 100644 (file)
index 0000000..3f278ed
--- /dev/null
@@ -0,0 +1,24 @@
+/*
+ *  GRUB  --  GRand Unified Bootloader
+ *  Copyright (C) 2007  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
+ *  the Free Software Foundation, either version 3 of the License, or
+ *  (at your option) any later version.
+ *
+ *  GRUB is distributed in the hope that it will be useful,
+ *  but WITHOUT ANY WARRANTY; without even the implied warranty of
+ *  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ *  GNU General Public License for more details.
+ *
+ *  You should have received a copy of the GNU General Public License
+ *  along with GRUB.  If not, see <http://www.gnu.org/licenses/>.
+ */
+
+#ifndef GRUB_MACHINE_MACHINE_HEADER
+#define GRUB_MACHINE_MACHINE_HEADER    1
+
+#define GRUB_MACHINE_LINUXBIOS 1
+
+#endif /* ! GRUB_MACHINE_MACHINE_HEADER */
diff --git a/include/grub/i386/pc/machine.h b/include/grub/i386/pc/machine.h
new file mode 100644 (file)
index 0000000..e6de728
--- /dev/null
@@ -0,0 +1,24 @@
+/*
+ *  GRUB  --  GRand Unified Bootloader
+ *  Copyright (C) 2007  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
+ *  the Free Software Foundation, either version 3 of the License, or
+ *  (at your option) any later version.
+ *
+ *  GRUB is distributed in the hope that it will be useful,
+ *  but WITHOUT ANY WARRANTY; without even the implied warranty of
+ *  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ *  GNU General Public License for more details.
+ *
+ *  You should have received a copy of the GNU General Public License
+ *  along with GRUB.  If not, see <http://www.gnu.org/licenses/>.
+ */
+
+#ifndef GRUB_MACHINE_MACHINE_HEADER
+#define GRUB_MACHINE_MACHINE_HEADER    1
+
+#define GRUB_MACHINE_PCBIOS    1
+
+#endif /* ! GRUB_MACHINE_MACHINE_HEADER */
diff --git a/include/grub/powerpc/ieee1275/machine.h b/include/grub/powerpc/ieee1275/machine.h
new file mode 100644 (file)
index 0000000..66da1d9
--- /dev/null
@@ -0,0 +1,24 @@
+/*
+ *  GRUB  --  GRand Unified Bootloader
+ *  Copyright (C) 2007  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
+ *  the Free Software Foundation, either version 3 of the License, or
+ *  (at your option) any later version.
+ *
+ *  GRUB is distributed in the hope that it will be useful,
+ *  but WITHOUT ANY WARRANTY; without even the implied warranty of
+ *  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ *  GNU General Public License for more details.
+ *
+ *  You should have received a copy of the GNU General Public License
+ *  along with GRUB.  If not, see <http://www.gnu.org/licenses/>.
+ */
+
+#ifndef GRUB_MACHINE_MACHINE_HEADER
+#define GRUB_MACHINE_MACHINE_HEADER    1
+
+#define GRUB_MACHINE_IEEE1275  1
+
+#endif /* ! GRUB_MACHINE_MACHINE_HEADER */
diff --git a/include/grub/sparc64/ieee1275/machine.h b/include/grub/sparc64/ieee1275/machine.h
new file mode 100644 (file)
index 0000000..66da1d9
--- /dev/null
@@ -0,0 +1,24 @@
+/*
+ *  GRUB  --  GRand Unified Bootloader
+ *  Copyright (C) 2007  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
+ *  the Free Software Foundation, either version 3 of the License, or
+ *  (at your option) any later version.
+ *
+ *  GRUB is distributed in the hope that it will be useful,
+ *  but WITHOUT ANY WARRANTY; without even the implied warranty of
+ *  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ *  GNU General Public License for more details.
+ *
+ *  You should have received a copy of the GNU General Public License
+ *  along with GRUB.  If not, see <http://www.gnu.org/licenses/>.
+ */
+
+#ifndef GRUB_MACHINE_MACHINE_HEADER
+#define GRUB_MACHINE_MACHINE_HEADER    1
+
+#define GRUB_MACHINE_IEEE1275  1
+
+#endif /* ! GRUB_MACHINE_MACHINE_HEADER */
index 554a7c0bf857166a7d289cfcbec8cf70c03d268b..578ea404150ac2a0ec1c2c85fef28721f4d56f44 100644 (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.  */