summaryrefslogtreecommitdiff
path: root/sys/arch/hppa/stand/libsa
diff options
context:
space:
mode:
authorMichael Shalayeff <mickey@cvs.openbsd.org>1998-09-29 07:28:36 +0000
committerMichael Shalayeff <mickey@cvs.openbsd.org>1998-09-29 07:28:36 +0000
commit881d5adf35bf89f15ff9b00e08d0135373bc9668 (patch)
treecb501a2ed6d7916bc5f55a5f0d8101047549e4c8 /sys/arch/hppa/stand/libsa
parentf9fc7134adb841dc40920cbac82b7cd5a5200830 (diff)
get rid of those obscuring constants
Diffstat (limited to 'sys/arch/hppa/stand/libsa')
-rw-r--r--sys/arch/hppa/stand/libsa/itecons.c51
1 files changed, 29 insertions, 22 deletions
diff --git a/sys/arch/hppa/stand/libsa/itecons.c b/sys/arch/hppa/stand/libsa/itecons.c
index 6d328b0e9c6..007d9df9a33 100644
--- a/sys/arch/hppa/stand/libsa/itecons.c
+++ b/sys/arch/hppa/stand/libsa/itecons.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: itecons.c,v 1.4 1998/07/13 03:47:35 mickey Exp $ */
+/* $OpenBSD: itecons.c,v 1.5 1998/09/29 07:28:35 mickey Exp $ */
/*
* Copyright (c) 1998 Michael Shalayeff
@@ -29,7 +29,6 @@
* (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
* THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*/
-
/*
* Copyright 1996 1995 by Open Software Foundation, Inc.
* All Rights Reserved
@@ -57,7 +56,6 @@
#include <sys/param.h>
#include <sys/disklabel.h>
#include <machine/pdc.h>
-#include <machine/iodc.h>
#include <machine/iomod.h>
#include <dev/cons.h>
@@ -65,6 +63,7 @@
iodcio_t cniodc; /* console IODC entry point */
iodcio_t kyiodc; /* keyboard IODC entry point */
+pz_device_t *cons_pzdev, *kbd_pzdev;
/*
* Console.
@@ -86,15 +85,19 @@ ite_probe(cn)
struct consdev *cn;
{
cniodc = (iodcio_t)PAGE0->mem_free;
-
- if ((*pdc) (PDC_IODC, PDC_IODC_READ, pdcbuf, CN_HPA, IODC_INIT,
- cniodc, IODC_MAXSIZE) < 0 ||
- (*cniodc)(CN_HPA, (CN_HPA==BT_HPA)? IODC_INIT_DEV: IODC_INIT_ALL,
- CN_SPA, CN_LAYER, pdcbuf, 0,0,0,0) < 0 ||
- (*pdc) (PDC_IODC, PDC_IODC_READ, pdcbuf, CN_HPA, IODC_IO,
- cniodc, IODC_MAXSIZE) < 0) {
+ cons_pzdev = &PAGE0->mem_cons;
+ kbd_pzdev = &PAGE0->mem_kbd;
+
+ if ((*pdc) (PDC_IODC, PDC_IODC_READ, pdcbuf, cons_pzdev->pz_hpa,
+ IODC_INIT, cniodc, IODC_MAXSIZE) < 0 ||
+ (*cniodc)(cons_pzdev->pz_hpa,
+ (cons_pzdev->pz_hpa==PAGE0->mem_boot.pz_hpa)?
+ IODC_INIT_DEV: IODC_INIT_ALL, cons_pzdev->pz_spa,
+ cons_pzdev->pz_layers, pdcbuf, 0,0,0,0) < 0 ||
+ (*pdc) (PDC_IODC, PDC_IODC_READ, pdcbuf, cons_pzdev->pz_hpa,
+ IODC_IO, cniodc, IODC_MAXSIZE) < 0) {
/* morse code with the LED's?!! */
- CN_IODC = KY_IODC = NULL;
+ cons_pzdev->pz_iodc_io = kbd_pzdev->pz_iodc_io = NULL;
} else {
cn->cn_pri = CN_INTERNAL;
cn->cn_dev = makedev(0, 0);
@@ -112,16 +115,19 @@ ite_init(cn)
* N.B. In this case, since the keyboard code is part of the
* boot code, it will be overwritten when we load a kernel.
*/
- if (CN_CLASS != PCL_DUPLEX || KY_CLASS == PCL_KEYBD) {
+ if (cons_pzdev->pz_class != PCL_DUPLEX ||
+ kbd_pzdev->pz_class == PCL_KEYBD) {
kyiodc = (iodcio_t)kycode;
- if ((*pdc) (PDC_IODC, PDC_IODC_READ, pdcbuf, KY_HPA,
+ if ((*pdc) (PDC_IODC, PDC_IODC_READ, pdcbuf, kbd_pzdev->pz_hpa,
IODC_INIT, kyiodc, IODC_MAXSIZE) < 0 ||
- (*kyiodc)(KY_HPA, (KY_HPA == BT_HPA || KY_HPA == CN_HPA)?
- IODC_INIT_DEV: IODC_INIT_ALL,
- KY_SPA, KY_LAYER, pdcbuf, 0,0,0,0) < 0 ||
- (*pdc) (PDC_IODC, PDC_IODC_READ, pdcbuf, KY_HPA,
+ (*kyiodc)(kbd_pzdev->pz_hpa,
+ (kbd_pzdev->pz_hpa == PAGE0->mem_boot.pz_hpa ||
+ kbd_pzdev->pz_hpa == cons_pzdev->pz_hpa)?
+ IODC_INIT_DEV: IODC_INIT_ALL, kbd_pzdev->pz_spa,
+ kbd_pzdev->pz_layers, pdcbuf, 0, 0, 0, 0) < 0 ||
+ (*pdc) (PDC_IODC, PDC_IODC_READ, pdcbuf, kbd_pzdev->pz_hpa,
IODC_IO, kyiodc, IODC_MAXSIZE))
kyiodc = NULL;
} else {
@@ -131,8 +137,8 @@ ite_init(cn)
sizeof(struct pz_device));
}
- CN_IODC = cniodc;
- KY_IODC = kyiodc;
+ cons_pzdev->pz_iodc_io = cniodc;
+ kbd_pzdev->pz_iodc_io = kyiodc;
#ifdef DEBUG
if (!kyiodc)
printf("ite_init: no kbd\n");
@@ -149,8 +155,8 @@ ite_putc(dev, c)
*cnbuf = c;
- (*cniodc)(CN_HPA, IODC_IO_CONSOUT, CN_SPA, CN_LAYER,
- pdcbuf, 0, cnbuf, 1, 0);
+ (*cniodc)(cons_pzdev->pz_hpa, IODC_IO_CONSOUT, cons_pzdev->pz_spa,
+ cons_pzdev->pz_layers, pdcbuf, 0, cnbuf, 1, 0);
}
/*
@@ -175,7 +181,8 @@ ite_getc(dev)
}
do {
- err = (*kyiodc)(KY_HPA, IODC_IO_CONSIN, KY_SPA, KY_LAYER,
+ err = (*kyiodc)(kbd_pzdev->pz_hpa, IODC_IO_CONSIN,
+ kbd_pzdev->pz_spa, kbd_pzdev->pz_layers,
pdcbuf, 0, cnbuf, 1, 0);
l = pdcbuf[0];
c = cnbuf[0];