* [PATCH 2.6.9-rc1-bk8] ppc32: Fix arch/ppc/boot/common/ns16550.c
@ 2004-09-11 17:13 Tom Rini
2004-09-14 19:41 ` [RESEND][PATCH " Tom Rini
0 siblings, 1 reply; 2+ messages in thread
From: Tom Rini @ 2004-09-11 17:13 UTC (permalink / raw)
To: Linus Torvalds, Kernel Mailing List
Hello. When <linux/timex.h> started including <asm/io.h> this exposed
one of the fragilities of the code in arch/ppc/boot/, namely that it is
tied to the kernel headers for some information, yet not really the
kernel. The following starts us in the direction of being less tied to
the kernel by providing our own serial_state definition (all we care
about is the ability to grab information from SERIAL_PORT_DFNS).
Signed-off-by: Tom Rini <trini@kernel.crashing.org>
--- 1.7/arch/ppc/boot/common/ns16550.c 2003-10-08 14:29:22 -07:00
+++ edited/arch/ppc/boot/common/ns16550.c 2004-09-11 10:05:47 -07:00
@@ -5,14 +5,14 @@
#include <linux/config.h>
#include <linux/types.h>
#include <linux/serial.h>
-#include <linux/serialP.h>
#include <linux/serial_reg.h>
#include <asm/serial.h>
+#include "nonstdio.h"
+#include "serial.h"
+
#define SERIAL_BAUD 9600
-extern void outb(int port, unsigned char val);
-extern unsigned char inb(int port);
extern unsigned long ISA_io;
static struct serial_state rs_table[RS_TABLE_SIZE] = {
--- /dev/null 2004-09-11 02:23:35.739868360 -0700
+++ b/arch/ppc/boot/include/serial.h 2004-09-11 10:08:24.591280340 -0700
@@ -0,0 +1,46 @@
+/*
+ * A really private header file for the (dumb) serial driver in arch/ppc/boot
+ *
+ * Shamelessly taken from include/linux/serialP.h:
+ *
+ * Copyright (C) 1997 by Theodore Ts'o.
+ *
+ * Redistribution of this file is permitted under the terms of the GNU
+ * Public License (GPL)
+ */
+
+#ifndef _PPC_BOOT_SERIALP_H
+#define _PPC_BOOT_SERIALP_H
+
+/*
+ * This is our internal structure for each serial port's state.
+ *
+ * Many fields are paralleled by the structure used by the serial_struct
+ * structure.
+ *
+ * Given that this is how SERIAL_PORT_DFNS are done, and that we need
+ * to use a few of their fields, we need to have our own copy of it.
+ */
+struct serial_state {
+ int magic;
+ int baud_base;
+ unsigned long port;
+ int irq;
+ int flags;
+ int hub6;
+ int type;
+ int line;
+ int revision; /* Chip revision (950) */
+ int xmit_fifo_size;
+ int custom_divisor;
+ int count;
+ u8 *iomem_base;
+ u16 iomem_reg_shift;
+ unsigned short close_delay;
+ unsigned short closing_wait; /* time to wait before closing */
+ unsigned long icount;
+ int io_type;
+ void *info;
+ void *dev;
+};
+#endif /* _PPC_BOOT_SERIAL_H */
--
Tom Rini
http://gate.crashing.org/~trini/
^ permalink raw reply [flat|nested] 2+ messages in thread
* [RESEND][PATCH 2.6.9-rc1-bk8] ppc32: Fix arch/ppc/boot/common/ns16550.c
2004-09-11 17:13 [PATCH 2.6.9-rc1-bk8] ppc32: Fix arch/ppc/boot/common/ns16550.c Tom Rini
@ 2004-09-14 19:41 ` Tom Rini
0 siblings, 0 replies; 2+ messages in thread
From: Tom Rini @ 2004-09-14 19:41 UTC (permalink / raw)
To: Linus Torvalds, Kernel Mailing List
[ Originally sent Sat, Sept 11 2004 ]
Hello. When <linux/timex.h> started including <asm/io.h> this exposed
one of the fragilities of the code in arch/ppc/boot/, namely that it is
tied to the kernel headers for some information, yet not really the
kernel. The following starts us in the direction of being less tied to
the kernel by providing our own serial_state definition (all we care
about is the ability to grab information from SERIAL_PORT_DFNS).
Signed-off-by: Tom Rini <trini@kernel.crashing.org>
--- 1.7/arch/ppc/boot/common/ns16550.c 2003-10-08 14:29:22 -07:00
+++ edited/arch/ppc/boot/common/ns16550.c 2004-09-11 10:05:47 -07:00
@@ -5,14 +5,14 @@
#include <linux/config.h>
#include <linux/types.h>
#include <linux/serial.h>
-#include <linux/serialP.h>
#include <linux/serial_reg.h>
#include <asm/serial.h>
+#include "nonstdio.h"
+#include "serial.h"
+
#define SERIAL_BAUD 9600
-extern void outb(int port, unsigned char val);
-extern unsigned char inb(int port);
extern unsigned long ISA_io;
static struct serial_state rs_table[RS_TABLE_SIZE] = {
--- /dev/null 2004-09-11 02:23:35.739868360 -0700
+++ b/arch/ppc/boot/include/serial.h 2004-09-11 10:08:24.591280340 -0700
@@ -0,0 +1,46 @@
+/*
+ * A really private header file for the (dumb) serial driver in arch/ppc/boot
+ *
+ * Shamelessly taken from include/linux/serialP.h:
+ *
+ * Copyright (C) 1997 by Theodore Ts'o.
+ *
+ * Redistribution of this file is permitted under the terms of the GNU
+ * Public License (GPL)
+ */
+
+#ifndef _PPC_BOOT_SERIALP_H
+#define _PPC_BOOT_SERIALP_H
+
+/*
+ * This is our internal structure for each serial port's state.
+ *
+ * Many fields are paralleled by the structure used by the serial_struct
+ * structure.
+ *
+ * Given that this is how SERIAL_PORT_DFNS are done, and that we need
+ * to use a few of their fields, we need to have our own copy of it.
+ */
+struct serial_state {
+ int magic;
+ int baud_base;
+ unsigned long port;
+ int irq;
+ int flags;
+ int hub6;
+ int type;
+ int line;
+ int revision; /* Chip revision (950) */
+ int xmit_fifo_size;
+ int custom_divisor;
+ int count;
+ u8 *iomem_base;
+ u16 iomem_reg_shift;
+ unsigned short close_delay;
+ unsigned short closing_wait; /* time to wait before closing */
+ unsigned long icount;
+ int io_type;
+ void *info;
+ void *dev;
+};
+#endif /* _PPC_BOOT_SERIAL_H */
--
Tom Rini
http://gate.crashing.org/~trini/
^ permalink raw reply [flat|nested] 2+ messages in thread
end of thread, other threads:[~2004-09-14 19:43 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2004-09-11 17:13 [PATCH 2.6.9-rc1-bk8] ppc32: Fix arch/ppc/boot/common/ns16550.c Tom Rini
2004-09-14 19:41 ` [RESEND][PATCH " Tom Rini
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox
all inboxes | Powered by JetHome®