Changes for KGDB

This commit is contained in:
wdk 2001-02-21 09:12:14 +00:00
parent 07bb8e7a23
commit 85f0f12a55

View File

@ -1,4 +1,4 @@
/* $NetBSD: zs.c,v 1.6 2001/02/07 11:38:34 wdk Exp $ */
/* $NetBSD: zs.c,v 1.7 2001/02/21 09:12:14 wdk Exp $ */
/*-
* Copyright (c) 1996, 2000 The NetBSD Foundation, Inc.
@ -56,6 +56,9 @@
#include <sys/tty.h>
#include <sys/time.h>
#include <sys/syslog.h>
#ifdef KGDB
#include <sys/kgdb.h>
#endif
#include <machine/cpu.h>
#include <machine/mainboard.h>
@ -86,7 +89,9 @@ int zs_major = 1;
#define PCLK 10000000 /* PCLK pin input clock rate */
#ifndef ZS_DEFSPEED
#define ZS_DEFSPEED 9600
#endif
/*
* Define interrupt levels.
@ -164,9 +169,9 @@ extern struct cfdriver zsc_cd;
static int zshard __P((void *));
static void zssoft __P((void *));
static int zs_get_speed __P((struct zs_chanstate *));
static struct zschan *zs_get_chan_addr (int zs_unit, int channel);
static int zs_getc __P((void *));
static void zs_putc __P((void *, int));
struct zschan *zs_get_chan_addr (int zs_unit, int channel);
int zs_getc __P((void *));
void zs_putc __P((void *, int));
/*
* Is the zs chip present?
@ -570,9 +575,31 @@ zs_abort(cs)
#endif
}
/*
* Polled input char.
*/
/*********************************************************/
/* Polled character I/O functions for console and KGDB */
/*********************************************************/
struct zschan *
zs_get_chan_addr(zs_unit, channel)
int zs_unit, channel;
{
struct zsdevice *addr;
struct zschan *zc;
if (zs_unit >= NZS)
return NULL;
addr = (struct zsdevice *) ZS0_ADDR;
if (channel == 0) {
zc = &addr->zs_chan_a;
} else {
zc = &addr->zs_chan_b;
}
return (zc);
}
int
zs_getc(arg)
void *arg;
@ -597,7 +624,7 @@ zs_getc(arg)
/*
* Polled output char.
*/
static void
void
zs_putc(arg, c)
void *arg;
int c;
@ -618,7 +645,7 @@ zs_putc(arg, c)
splx(s);
}
/*****************************************************************/
/***************************************************************/
static void zscnprobe __P((struct consdev *));
static void zscninit __P((struct consdev *));
@ -679,23 +706,3 @@ zscnpollc(dev, on)
int on;
{
}
static struct zschan *
zs_get_chan_addr(zs_unit, channel)
int zs_unit, channel;
{
struct zsdevice *addr;
struct zschan *zc;
if (zs_unit >= NZS)
return NULL;
addr = (struct zsdevice *) ZS0_ADDR;
if (channel == 0) {
zc = &addr->zs_chan_a;
} else {
zc = &addr->zs_chan_b;
}
return (zc);
}