pkgsrc-Changes-HG archive

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

[pkgsrc/trunk]: pkgsrc/sysutils/vbetool Don't expect the OS to provide inb/ou...



details:   https://anonhg.NetBSD.org/pkgsrc/rev/8ac4a3985c99
branches:  trunk
changeset: 534706:8ac4a3985c99
user:      joerg <joerg%pkgsrc.org@localhost>
date:      Mon Oct 29 18:41:24 2007 +0000

description:
Don't expect the OS to provide inb/outb, just define the assembler
functions directly. Fixes build on NetBSD current. Add DESTDIR support.

diffstat:

 sysutils/vbetool/Makefile         |   4 ++-
 sysutils/vbetool/distinfo         |   4 +-
 sysutils/vbetool/patches/patch-ab |  44 +++++++++++++++++++++++---------------
 3 files changed, 32 insertions(+), 20 deletions(-)

diffs (126 lines):

diff -r 9e2a418b9cc2 -r 8ac4a3985c99 sysutils/vbetool/Makefile
--- a/sysutils/vbetool/Makefile Mon Oct 29 18:31:11 2007 +0000
+++ b/sysutils/vbetool/Makefile Mon Oct 29 18:41:24 2007 +0000
@@ -1,4 +1,4 @@
-# $NetBSD: Makefile,v 1.4 2007/08/08 17:12:44 xtraeme Exp $
+# $NetBSD: Makefile,v 1.5 2007/10/29 18:41:24 joerg Exp $
 #
 
 DISTNAME=      vbetool_0.7-1
@@ -11,6 +11,8 @@
 HOMEPAGE=      http://www.srcf.ucam.org/~mjg59/vbetool/
 COMMENT=       Run real-mode video BIOS code to alter hardware state
 
+PKG_DESTDIR_SUPPORT=   user-destdir
+
 ONLY_FOR_PLATFORM+=    Linux-*-i386 NetBSD-*-i386 NetBSD-*-x86_64
 
 WRKSRC=                ${WRKDIR}/vbetool-0.7
diff -r 9e2a418b9cc2 -r 8ac4a3985c99 sysutils/vbetool/distinfo
--- a/sysutils/vbetool/distinfo Mon Oct 29 18:31:11 2007 +0000
+++ b/sysutils/vbetool/distinfo Mon Oct 29 18:41:24 2007 +0000
@@ -1,8 +1,8 @@
-$NetBSD: distinfo,v 1.3 2007/08/08 17:12:44 xtraeme Exp $
+$NetBSD: distinfo,v 1.4 2007/10/29 18:41:24 joerg Exp $
 
 SHA1 (vbetool_0.7-1.tar.gz) = 49c86aa6fb877f35a0b336d6aa1d6b204c2cc66f
 RMD160 (vbetool_0.7-1.tar.gz) = b5a5d3a0794f8dbb06c78373e15c26d9536d8303
 Size (vbetool_0.7-1.tar.gz) = 176277 bytes
 SHA1 (patch-aa) = d27a3dd8eb1943c3f30351996483a01638521e90
-SHA1 (patch-ab) = 1b5b041ec8dac282a0e8305b82af2c0fe325e1e8
+SHA1 (patch-ab) = 16e42e95d69b98b5ec5886a84bbc294aea942056
 SHA1 (patch-ac) = 89b24bd2fadbf40ab614186b53dc339653029919
diff -r 9e2a418b9cc2 -r 8ac4a3985c99 sysutils/vbetool/patches/patch-ab
--- a/sysutils/vbetool/patches/patch-ab Mon Oct 29 18:31:11 2007 +0000
+++ b/sysutils/vbetool/patches/patch-ab Mon Oct 29 18:41:24 2007 +0000
@@ -1,8 +1,8 @@
-$NetBSD: patch-ab,v 1.3 2007/08/08 17:12:44 xtraeme Exp $
+$NetBSD: patch-ab,v 1.4 2007/10/29 18:41:24 joerg Exp $
 
 --- vbetool.c.orig     2006-07-26 03:27:21.000000000 +0200
-+++ vbetool.c  2007-08-08 19:07:18.000000000 +0200
-@@ -8,19 +8,29 @@
++++ vbetool.c
+@@ -8,19 +8,39 @@ This program is released under the terms
  version 2
  */
  
@@ -24,16 +24,26 @@
  
 +#ifdef __NetBSD__
 +#include <machine/sysarch.h>
-+#include <machine/pio.h>
 +#endif
 +
-+/* out* arguments are swapped between NetBSD and linux */
-+#define __outb(v, p)  outb((p), (v))
++static uint8_t
++asm_inb(unsigned port)
++{
++      uint8_t data;
++      __asm volatile("inb %w1,%0" : "=a" (data) : "d" (port));
++      return data;
++}
++
++static __inline void
++asm_outb(uint8_t data, unsigned port)
++{
++      __asm volatile("outb %0,%w1" : : "a" (data), "d" (port));
++}
 +
  #include "include/lrmi.h"
  #include "vbetool.h"
  
-@@ -42,8 +52,16 @@
+@@ -42,8 +62,16 @@ int vbetool_init (void) {
                exit(1);
        }
        
@@ -50,7 +60,7 @@
        
        pacc = pci_alloc();
        pacc->numeric_ids = 1;
-@@ -256,7 +274,9 @@
+@@ -256,7 +284,9 @@ void restore_state_from(char *data)
  
        LRMI_free_real(data);
  
@@ -60,7 +70,7 @@
  
  }
  
-@@ -476,23 +496,25 @@
+@@ -476,23 +506,25 @@ int check_console()
                return 11;
        }
  
@@ -75,10 +85,10 @@
 -      outb(0x01 | inb(0x3C3),  0x3C3);
 -      outb(0x08 | inb(0x46e8), 0x46e8);
 -      outb(0x01 | inb(0x102),  0x102);
-+      __outb(0x03 | inb(0x3CC),  0x3C2);
-+      __outb(0x01 | inb(0x3C3),  0x3C3);
-+      __outb(0x08 | inb(0x46e8), 0x46e8);
-+      __outb(0x01 | inb(0x102),  0x102);
++      asm_outb(0x03 | asm_inb(0x3CC),  0x3C2);
++      asm_outb(0x01 | asm_inb(0x3C3),  0x3C3);
++      asm_outb(0x08 | asm_inb(0x46e8), 0x46e8);
++      asm_outb(0x01 | asm_inb(0x102),  0x102);
        return 0;
  }
  
@@ -87,10 +97,10 @@
 -      outb(~0x01 & inb(0x3C3),  0x3C3);
 -      outb(~0x08 & inb(0x46e8), 0x46e8);
 -      outb(~0x01 & inb(0x102),  0x102);
-+      __outb(~0x03 & inb(0x3CC),  0x3C2);
-+      __outb(~0x01 & inb(0x3C3),  0x3C3);
-+      __outb(~0x08 & inb(0x46e8), 0x46e8);
-+      __outb(~0x01 & inb(0x102),  0x102);
++      asm_outb(~0x03 & asm_inb(0x3CC),  0x3C2);
++      asm_outb(~0x01 & asm_inb(0x3C3),  0x3C3);
++      asm_outb(~0x08 & asm_inb(0x46e8), 0x46e8);
++      asm_outb(~0x01 & asm_inb(0x102),  0x102);
        return 0;
  }
  



Home | Main Index | Thread Index | Old Index