diff options
author | tnn <tnn> | 2007-12-23 00:32:49 +0000 |
---|---|---|
committer | tnn <tnn> | 2007-12-23 00:32:49 +0000 |
commit | 33c5d75605472616a07b6f91cefbfdb5529819a9 (patch) | |
tree | 3987453a7a742b21a5ae64c8dc51cf72539a46b9 | |
parent | 8eaf2578796f9ed60cfac1ea6a4f2035538876f2 (diff) | |
download | pkgsrc-33c5d75605472616a07b6f91cefbfdb5529819a9.tar.gz |
Fix build on NetBSD-current.
-rw-r--r-- | sysutils/lambd/files/lambd.c | 10 | ||||
-rw-r--r-- | sysutils/lambd/files/lambio.c | 30 |
2 files changed, 32 insertions, 8 deletions
diff --git a/sysutils/lambd/files/lambd.c b/sysutils/lambd/files/lambd.c index 450b3a5ea7d..3d3252de46d 100644 --- a/sysutils/lambd/files/lambd.c +++ b/sysutils/lambd/files/lambd.c @@ -1,4 +1,4 @@ -/* $NetBSD: lambd.c,v 1.5 2006/03/01 22:46:50 wiz Exp $ */ +/* $NetBSD: lambd.c,v 1.6 2007/12/23 00:32:49 tnn Exp $ */ /* * Copyright (C) 2001 WIDE Project. All rights reserved. @@ -290,16 +290,16 @@ morse() int mark, blank; unsigned long t = delay / 10; - for (p = morsestr; *p; p++) { + for (p = (unsigned char*)morsestr; *p; p++) { if (monitor()) return 1; if (isdigit(*p)) - q = digit[*p - '0']; + q = (unsigned char*)digit[*p - '0']; else if (isalpha(*p) && isupper(*p)) - q = alph[*p - 'A']; + q = (unsigned char*)alph[*p - 'A']; else if (isalpha(*p) && islower(*p)) - q = alph[*p - 'a']; + q = (unsigned char*)alph[*p - 'a']; else q = NULL; diff --git a/sysutils/lambd/files/lambio.c b/sysutils/lambd/files/lambio.c index b20c51e3b3a..ca35efb78ba 100644 --- a/sysutils/lambd/files/lambio.c +++ b/sysutils/lambd/files/lambio.c @@ -1,4 +1,4 @@ -/* $NetBSD: lambio.c,v 1.2 2004/05/23 22:55:39 kristerw Exp $ */ +/* $NetBSD: lambio.c,v 1.3 2007/12/23 00:32:49 tnn Exp $ */ /* * Copyright (C) 2001 WIDE Project. All rights reserved. @@ -43,6 +43,30 @@ #define BASEPORT (0x378) +/* We get these from libi386.so, but there are no public prototypes. */ + +int i386_get_ioperm(u_long *); +int i386_set_ioperm(u_long *); + +/* + * These used to be provided by machine/pio.h as inline functions, + * but that's not true anymore, so use a local copy. + */ + +static void +lamb_outb(unsigned port, u_int8_t data) +{ + asm volatile("outb %0,%w1" : : "a" (data), "d" (port)); +} + +static u_int8_t +lamb_inb(unsigned port) +{ + u_int8_t data; + __asm volatile("inb %w1,%0" : "=a" (data) : "id" (port)); + return data; +} + int lamb_open() { @@ -69,7 +93,7 @@ int lamb_reboot() { - if ((inb(BASEPORT + 1) & 0x20) == 0) + if ((lamb_inb(BASEPORT + 1) & 0x20) == 0) return 1; else return 0; @@ -80,7 +104,7 @@ lamb_led(on) int on; { - outb(BASEPORT + 2, on ? 8 : 0); + lamb_outb(BASEPORT + 2, on ? 8 : 0); } /* |