pkgsrc-Changes-HG archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

[pkgsrc/trunk]: pkgsrc/sysutils/lambd/files Fix build on NetBSD-current.



details:   https://anonhg.NetBSD.org/pkgsrc/rev/1ad79935df73
branches:  trunk
changeset: 536807:1ad79935df73
user:      tnn <tnn%pkgsrc.org@localhost>
date:      Sun Dec 23 00:32:49 2007 +0000

description:
Fix build on NetBSD-current.

diffstat:

 sysutils/lambd/files/lambd.c  |  10 +++++-----
 sysutils/lambd/files/lambio.c |  30 +++++++++++++++++++++++++++---
 2 files changed, 32 insertions(+), 8 deletions(-)

diffs (88 lines):

diff -r 07b907564968 -r 1ad79935df73 sysutils/lambd/files/lambd.c
--- a/sysutils/lambd/files/lambd.c      Sat Dec 22 23:41:01 2007 +0000
+++ b/sysutils/lambd/files/lambd.c      Sun Dec 23 00:32:49 2007 +0000
@@ -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 @@
        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 -r 07b907564968 -r 1ad79935df73 sysutils/lambd/files/lambio.c
--- a/sysutils/lambd/files/lambio.c     Sat Dec 22 23:41:01 2007 +0000
+++ b/sysutils/lambd/files/lambio.c     Sun Dec 23 00:32:49 2007 +0000
@@ -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 @@
 lamb_reboot()
 {
 
-       if ((inb(BASEPORT + 1) & 0x20) == 0)
+       if ((lamb_inb(BASEPORT + 1) & 0x20) == 0)
                return 1;
        else
                return 0;
@@ -80,7 +104,7 @@
        int on;
 {
 
-       outb(BASEPORT + 2, on ? 8 : 0);
+       lamb_outb(BASEPORT + 2, on ? 8 : 0);
 }
 
 /*



Home | Main Index | Thread Index | Old Index