Import of pkgsrc-2013Q2

This commit is contained in:
2013-09-26 17:14:40 +02:00
commit 785076ae39
74991 changed files with 4380255 additions and 0 deletions

3
sysutils/vbetool/DESCR Normal file
View File

@@ -0,0 +1,3 @@
vbetool uses lrmi in order to run code from the video BIOS.
Currently, it is able to alter DPMS states, save/restore video card
state and attempt to initialize the video card from scratch.

29
sysutils/vbetool/Makefile Normal file
View File

@@ -0,0 +1,29 @@
# $NetBSD: Makefile,v 1.10 2012/10/23 19:51:28 asau Exp $
#
DISTNAME= vbetool_0.7-1
PKGNAME= vbetool-0.7.1
PKGREVISION= 2
CATEGORIES= sysutils
MASTER_SITES= http://www.codon.org.uk/~mjg59/vbetool/download/
MAINTAINER= pkgsrc-users@NetBSD.org
HOMEPAGE= http://www.codon.org.uk/~mjg59/vbetool/
COMMENT= Run real-mode video BIOS code to alter hardware state
ONLY_FOR_PLATFORM+= Linux-*-i386 NetBSD-*-i386 NetBSD-*-x86_64
CONFLICTS+= vbetool-0.7-[0-9]*
WRKSRC= ${WRKDIR}/vbetool-0.7
USE_TOOLS+= gmake
GNU_CONFIGURE= yes
CONFIGURE_ARGS= --with-x86emu
.include "../../mk/bsd.prefs.mk"
# This gives us libi386 and libx86_64.
LIBS.NetBSD+= -l${MACHINE_ARCH}
.include "../../sysutils/pciutils/buildlink3.mk"
.include "../../mk/bsd.pkg.mk"

3
sysutils/vbetool/PLIST Normal file
View File

@@ -0,0 +1,3 @@
@comment $NetBSD: PLIST,v 1.1.1.1 2007/08/08 12:00:34 xtraeme Exp $
sbin/vbetool
man/man1/vbetool.1

View File

@@ -0,0 +1,8 @@
$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) = 16e42e95d69b98b5ec5886a84bbc294aea942056
SHA1 (patch-ac) = 89b24bd2fadbf40ab614186b53dc339653029919

View File

@@ -0,0 +1,16 @@
$NetBSD: patch-aa,v 1.1.1.1 2007/08/08 12:00:34 xtraeme Exp $
--- thunk.c.orig 2007-08-08 13:29:17.000000000 +0200
+++ thunk.c 2007-08-08 13:29:52.000000000 +0200
@@ -11,7 +11,11 @@
#include <unistd.h>
#include <stdlib.h>
#include <sys/mman.h>
+#ifdef __NetBSD__
+#include <machine/pio.h>
+#else
#include <sys/io.h>
+#endif
#include <string.h>
#include <sys/ipc.h>
#include <sys/shm.h>

View File

@@ -0,0 +1,106 @@
$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
@@ -8,19 +8,39 @@ This program is released under the terms
version 2
*/
-#include <pci/pci.h>
#include <assert.h>
+#include <pciutils/pci.h>
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include <unistd.h>
#include <sys/ioctl.h>
#include <sys/types.h>
+#ifdef __linux__
#include <sys/io.h>
#include <sys/kd.h>
+#endif
#include <sys/stat.h>
#include <errno.h>
+#ifdef __NetBSD__
+#include <machine/sysarch.h>
+#endif
+
+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 +62,16 @@ int vbetool_init (void) {
exit(1);
}
+#ifdef __NetBSD__
+# ifdef __i386__
+ i386_iopl(3);
+# else
+ x86_64_iopl(3);
+# endif
+#else
ioperm(0, 1024, 1);
iopl(3);
+#endif
pacc = pci_alloc();
pacc->numeric_ids = 1;
@@ -256,7 +284,9 @@ void restore_state_from(char *data)
LRMI_free_real(data);
+#ifdef __linux__
ioctl(0, KDSETMODE, KD_TEXT);
+#endif
}
@@ -476,23 +506,25 @@ int check_console()
return 11;
}
+#ifdef __linux__
ioctl(0, KDSETMODE, KD_GRAPHICS);
+#endif
return 0;
}
int enable_vga() {
- 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;
}
int disable_vga() {
- 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;
}

View File

@@ -0,0 +1,27 @@
$NetBSD: patch-ac,v 1.1.1.1 2007/08/08 12:00:34 xtraeme Exp $
--- Makefile.in.orig 2006-07-26 03:26:30.000000000 +0200
+++ Makefile.in 2007-08-08 13:51:43.000000000 +0200
@@ -57,9 +57,9 @@
@WITH_X86EMU_TRUE@am__objects_1 = thunk.$(OBJEXT) x86-common.$(OBJEXT)
am_vbetool_OBJECTS = vbetool.$(OBJEXT) $(am__objects_1)
vbetool_OBJECTS = $(am_vbetool_OBJECTS)
-@WITH_X86EMU_FALSE@vbetool_DEPENDENCIES = $(libdir)/libpci.a
+@WITH_X86EMU_FALSE@vbetool_DEPENDENCIES = -lpciutils
@WITH_X86EMU_TRUE@vbetool_DEPENDENCIES = x86emu/libx86emu.a \
-@WITH_X86EMU_TRUE@ $(libdir)/libpci.a
+@WITH_X86EMU_TRUE@ -lpciutils
DEFAULT_INCLUDES = -I. -I$(srcdir)
depcomp = $(SHELL) $(top_srcdir)/depcomp
am__depfiles_maybe = depfiles
@@ -174,8 +174,8 @@
SUBDIRS = x86emu
@WITH_X86EMU_FALSE@x86 = lrmi.c x86-common.c
@WITH_X86EMU_TRUE@x86 = thunk.c x86-common.c
-@WITH_X86EMU_FALSE@vbetool_LDADD = $(libdir)/libpci.a
-@WITH_X86EMU_TRUE@vbetool_LDADD = x86emu/libx86emu.a $(libdir)/libpci.a
+@WITH_X86EMU_FALSE@vbetool_LDADD = -lpci -lpciutils
+@WITH_X86EMU_TRUE@vbetool_LDADD = x86emu/libx86emu.a -lpci -lpciutils
@WITH_X86EMU_FALSE@x86lib = ""
man_MANS = vbetool.1
vbetool_SOURCES = vbetool.c $(x86)