summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--device/cons.h11
-rw-r--r--i386/i386/xen.h1
-rw-r--r--i386/i386at/com.c4
-rw-r--r--i386/i386at/com.h6
-rw-r--r--i386/i386at/cons_conf.c6
-rw-r--r--i386/i386at/kd.c10
-rw-r--r--i386/i386at/kd.h5
-rw-r--r--xen/console.c3
-rw-r--r--xen/console.h7
9 files changed, 33 insertions, 20 deletions
diff --git a/device/cons.h b/device/cons.h
index a6b04ff..c210f8c 100644
--- a/device/cons.h
+++ b/device/cons.h
@@ -21,16 +21,18 @@
* Utah $Hdr: cons.h 1.10 94/12/14$
*/
+#ifndef _DEVICE_CONS_H
+#define _DEVICE_CONS_H
#include <sys/types.h>
struct consdev {
#ifdef MACH_KERNEL
char *cn_name; /* name of device in dev_name_list */
#endif
- int (*cn_probe)(); /* probe hardware and fill in consdev info */
- int (*cn_init)(); /* turn on as console */
- int (*cn_getc)(); /* kernel getchar interface */
- int (*cn_putc)(); /* kernel putchar interface */
+ int (*cn_probe)(struct consdev *cp); /* probe hardware and fill in consdev info */
+ int (*cn_init)(struct consdev *cp); /* turn on as console */
+ int (*cn_getc)(dev_t dev, int wait); /* kernel getchar interface */
+ int (*cn_putc)(dev_t dev, int c); /* kernel putchar interface */
dev_t cn_dev; /* major/minor of device */
short cn_pri; /* pecking order; the higher the better */
};
@@ -57,3 +59,4 @@ extern int cngetc(void);
extern int cnmaygetc(void);
extern void cnputc(char);
+#endif /* _DEVICE_CONS_H */
diff --git a/i386/i386/xen.h b/i386/i386/xen.h
index 731e5a2..69a1c41 100644
--- a/i386/i386/xen.h
+++ b/i386/i386/xen.h
@@ -25,6 +25,7 @@
#include <mach/machine/vm_types.h>
#include <mach/vm_param.h>
#include <mach/inline.h>
+#include <mach/xen.h>
#include <machine/vm_param.h>
#include <intel/pmap.h>
#include <kern/debug.h>
diff --git a/i386/i386at/com.c b/i386/i386at/com.c
index f6d5656..3030270 100644
--- a/i386/i386at/com.c
+++ b/i386/i386at/com.c
@@ -70,10 +70,6 @@ int comtimer_state[NCOM];
#define RCBAUD B9600
static int rcline = -1;
static struct bus_device *comcndev;
-int comcnprobe(struct consdev *cp);
-int comcninit(struct consdev *cp);
-int comcngetc(dev_t dev, int wait);
-int comcnputc(dev_t dev, int c);
/* XX */
extern char *kernel_cmdline;
diff --git a/i386/i386at/com.h b/i386/i386at/com.h
index e53e948..49f23ee 100644
--- a/i386/i386at/com.h
+++ b/i386/i386at/com.h
@@ -27,6 +27,7 @@
#define _COM_H_
#include <mach/std_types.h>
+#include <device/cons.h>
/*
* Set receive modem state from modem status register.
@@ -42,4 +43,9 @@ extern void commodem_intr(int unit, int stat);
extern int comgetc(int unit);
+extern int comcnprobe(struct consdev *cp);
+extern int comcninit(struct consdev *cp);
+extern int comcngetc(dev_t dev, int wait);
+extern int comcnputc(dev_t dev, int c);
+
#endif /* _COM_H_ */
diff --git a/i386/i386at/cons_conf.c b/i386/i386at/cons_conf.c
index 8a4b37c..cf42bb6 100644
--- a/i386/i386at/cons_conf.c
+++ b/i386/i386at/cons_conf.c
@@ -31,11 +31,11 @@
#include <device/cons.h>
#ifdef MACH_HYP
-extern int hypcnprobe(), hypcninit(), hypcngetc(), hypcnputc();
+#include <xen/console.h>
#else /* MACH_HYP */
-extern int kdcnprobe(), kdcninit(), kdcngetc(), kdcnputc();
+#include "kd.h"
#if NCOM > 0
-extern int comcnprobe(), comcninit(), comcngetc(), comcnputc();
+#include "com.h"
#endif
#endif /* MACH_HYP */
diff --git a/i386/i386at/kd.c b/i386/i386at/kd.c
index af5b792..bd10b5f 100644
--- a/i386/i386at/kd.c
+++ b/i386/i386at/kd.c
@@ -113,10 +113,6 @@ static void charput(), charmvup(), charmvdown(), charclear(), charsetcursor();
static void kd_noopreset();
boolean_t kdcheckmagic();
-int kdcnprobe(struct consdev *cp);
-int kdcninit(struct consdev *cp);
-int kdcngetc(dev_t dev, int wait);
-void kdcnputc(dev_t dev, int c);
int do_modifier (int, Scancode, boolean_t);
/*
@@ -2970,16 +2966,18 @@ kdcngetc(dev_t dev, int wait)
return kdcnmaygetc();
}
-void
+int
kdcnputc(dev_t dev, int c)
{
if (!kd_initialized)
- return;
+ return -1;
/* Note that tab is handled in kd_putc */
if (c == '\n')
kd_putc('\r');
kd_putc(c);
+
+ return 0;
}
/*
diff --git a/i386/i386at/kd.h b/i386/i386at/kd.h
index 98c8bfe..bc265b0 100644
--- a/i386/i386at/kd.h
+++ b/i386/i386at/kd.h
@@ -75,6 +75,7 @@ WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
#include <mach/boolean.h>
#include <sys/types.h>
#include <sys/time.h>
+#include <device/cons.h>
/*
@@ -729,7 +730,11 @@ extern void kd_handle_ack (void);
extern int kd_kbd_magic (int);
extern int kdstate2idx (int, boolean_t);
extern void kd_parserest (u_char *);
+extern int kdcnprobe(struct consdev *cp);
+extern int kdcninit(struct consdev *cp);
+extern int kdcngetc(dev_t dev, int wait);
extern int kdcnmaygetc (void);
+extern int kdcnputc(dev_t dev, int c);
extern void kd_slmwd (void *start, int count, int value);
extern void kd_slmscu (void *from, void *to, int count);
diff --git a/xen/console.c b/xen/console.c
index 9798ec0..0f8b828 100644
--- a/xen/console.c
+++ b/xen/console.c
@@ -216,9 +216,6 @@ int hypcnclose(int dev, int flag)
int hypcnprobe(struct consdev *cp)
{
- struct xencons_interface *my_console;
- my_console = (void*) mfn_to_kv(boot_info.console_mfn);
-
cp->cn_dev = makedev(0, 0);
cp->cn_pri = CN_INTERNAL;
return 0;
diff --git a/xen/console.h b/xen/console.h
index fa13dc0..172abb8 100644
--- a/xen/console.h
+++ b/xen/console.h
@@ -21,6 +21,8 @@
#include <machine/xen.h>
#include <string.h>
+#include <device/cons.h>
+
#define hyp_console_write(str, len) hyp_console_io (CONSOLEIO_write, (len), kvtolin(str))
#define hyp_console_put(str) ({ \
@@ -30,4 +32,9 @@
extern void hyp_console_init(void);
+extern int hypcnputc(dev_t dev, int c);
+extern int hypcngetc(dev_t dev, int wait);
+extern int hypcnprobe(struct consdev *cp);
+extern int hypcninit(struct consdev *cp);
+
#endif /* XEN_CONSOLE_H */