]> git.ipfire.org Git - thirdparty/grub.git/commitdiff
split serial
authorphcoder <phcoder@debian.bg45.phnet>
Sat, 10 Oct 2009 18:59:18 +0000 (20:59 +0200)
committerphcoder <phcoder@debian.bg45.phnet>
Sat, 10 Oct 2009 18:59:18 +0000 (20:59 +0200)
conf/i386-coreboot.rmk
conf/i386-ieee1275.rmk
conf/i386-pc.rmk
include/grub/i386/io.h
include/grub/serial.h [moved from include/grub/i386/pc/serial.h with 96% similarity]
term/serial.c [moved from term/i386/pc/serial.c with 98% similarity]

index 09ec7787c4ebdbcd412288d881070009a135062e..59a9ed607760971506f1ab8c80327dd9b41fad2f 100644 (file)
@@ -187,7 +187,7 @@ halt_mod_CFLAGS = $(COMMON_CFLAGS)
 halt_mod_LDFLAGS = $(COMMON_LDFLAGS)
 
 # For serial.mod.
-serial_mod_SOURCES = term/i386/pc/serial.c
+serial_mod_SOURCES = term/serial.c
 serial_mod_CFLAGS = $(COMMON_CFLAGS)
 serial_mod_LDFLAGS = $(COMMON_LDFLAGS)
 
index 4b640de499d59cbfaaf5f7d33efa4144386570a6..48c3ce9d94f08198ce3f4ea05b621aeb4bfa33f8 100644 (file)
@@ -156,7 +156,7 @@ halt_mod_CFLAGS = $(COMMON_CFLAGS)
 halt_mod_LDFLAGS = $(COMMON_LDFLAGS)
 
 # For serial.mod.
-serial_mod_SOURCES = term/i386/pc/serial.c
+serial_mod_SOURCES = term/serial.c
 serial_mod_CFLAGS = $(COMMON_CFLAGS)
 serial_mod_LDFLAGS = $(COMMON_LDFLAGS)
 
index bf8fbfb9d765c334acabae0b5e7404ecd7fd0852..c4a4e7754ec68313c07828e60fb0b9ee00ca5836 100644 (file)
@@ -260,7 +260,7 @@ halt_mod_CFLAGS = $(COMMON_CFLAGS)
 halt_mod_LDFLAGS = $(COMMON_LDFLAGS)
 
 # For serial.mod.
-serial_mod_SOURCES = term/i386/pc/serial.c
+serial_mod_SOURCES = term/serial.c
 serial_mod_CFLAGS = $(COMMON_CFLAGS)
 serial_mod_LDFLAGS = $(COMMON_LDFLAGS)
 
index 0e567766b958981452d8f97392cf41e7dbb9e6e5..ae12a3e3dc12976f351069858f9f27f56d19df3d 100644 (file)
@@ -21,6 +21,8 @@
 #ifndef        GRUB_IO_H
 #define        GRUB_IO_H       1
 
+typedef unsigned short int grub_port_t;
+
 static __inline unsigned char
 grub_inb (unsigned short int port)
 {
similarity index 96%
rename from include/grub/i386/pc/serial.h
rename to include/grub/serial.h
index 0632ff79daee77e4b04c1cb3e8fc5c27070ad5ce..1c35b409301bbc52e48c3f87b8a81146072fe73e 100644 (file)
@@ -17,8 +17,8 @@
  *  along with GRUB.  If not, see <http://www.gnu.org/licenses/>.
  */
 
-#ifndef GRUB_SERIAL_MACHINE_HEADER
-#define GRUB_SERIAL_MACHINE_HEADER     1
+#ifndef GRUB_SERIAL_HEADER
+#define GRUB_SERIAL_HEADER     1
 
 /* Macros.  */
 
similarity index 98%
rename from term/i386/pc/serial.c
rename to term/serial.c
index 1d74dbbc8e20377607ec70bd3b52f37086137d16..eac43bf1b291281b83b956321a8741fe5a7a955b 100644 (file)
@@ -54,7 +54,7 @@ static const struct grub_arg_option options[] =
 /* Serial port settings.  */
 struct serial_port
 {
-  unsigned short port;
+  grub_port_t port;
   unsigned short divisor;
   unsigned short word_len;
   unsigned int   parity;
@@ -68,12 +68,12 @@ static struct serial_port serial_settings;
 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 };
+static const grub_port_t serial_hw_io_addr[] = { 0x3f8, 0x2f8, 0x3e8, 0x2e8 };
 #define GRUB_SERIAL_PORT_NUM (ARRAY_SIZE(serial_hw_io_addr))
 #endif
 
 /* Return the port number for the UNITth serial device.  */
-static inline unsigned short
+static inline grub_port_t
 serial_hw_get_port (const unsigned int unit)
 {
   if (unit < GRUB_SERIAL_PORT_NUM)
@@ -503,7 +503,7 @@ grub_cmd_serial (grub_extcmd_t cmd,
     }
 
   if (state[1].set)
-    serial_settings.port = (unsigned short) grub_strtoul (state[1].arg, 0, 0);
+    serial_settings.port = (grub_port_t) grub_strtoul (state[1].arg, 0, 0);
 
   if (state[2].set)
     {