summarylogtreecommitdiffstats
diff options
context:
space:
mode:
authorPouar2015-06-08 15:54:22 -0500
committerPouar2015-06-08 15:57:01 -0500
commit1f0f5da9869075f134df53d9d7678ed5f20e1f1d (patch)
tree48a5de712b8bf20930b55ae4f600f7db8d4b704e
downloadaur-1f0f5da9869075f134df53d9d7678ed5f20e1f1d.tar.gz
port from aur3
-rw-r--r--.SRCINFO24
-rw-r--r--PKGBUILD53
-rw-r--r--svgalib-1.9.25-glibc210.patch109
-rw-r--r--svgalib-1.9.25-linux2.6.28.patch30
-rw-r--r--svgalib-1.9.25-linux2.6.36.patch32
-rw-r--r--svgalib-1.9.25-linux2.6.patch289
6 files changed, 537 insertions, 0 deletions
diff --git a/.SRCINFO b/.SRCINFO
new file mode 100644
index 000000000000..2b9a7b6ec9e6
--- /dev/null
+++ b/.SRCINFO
@@ -0,0 +1,24 @@
+# Generated by makepkg 4.2.1
+# Mon Jun 8 20:56:35 UTC 2015
+pkgbase = svgalib
+ pkgdesc = A low-level SuperVGA graphics library
+ pkgver = 1.9.25
+ pkgrel = 4
+ url = http://www.svgalib.org/
+ arch = i686
+ arch = x86_64
+ license = GPL
+ depends = perl
+ source = http://mail.arava.co.il/~matan/svgalib/svgalib-1.9.25.tar.gz
+ source = svgalib-1.9.25-linux2.6.patch
+ source = svgalib-1.9.25-linux2.6.28.patch
+ source = svgalib-1.9.25-glibc210.patch
+ source = svgalib-1.9.25-linux2.6.36.patch
+ md5sums = 4dda7e779e550b7404cfe118f1d74222
+ md5sums = eadd4d3974a475ccc9d72f1e614c69df
+ md5sums = 5c797ca334e4c7f326dc08df7a3eb5c9
+ md5sums = 938f822ede2c9e76f2da0dd3ee38ba33
+ md5sums = 99e767dec306ff4d307eef151f352466
+
+pkgname = svgalib
+
diff --git a/PKGBUILD b/PKGBUILD
new file mode 100644
index 000000000000..cfdaa136e86e
--- /dev/null
+++ b/PKGBUILD
@@ -0,0 +1,53 @@
+# Maintainer: kfgz <kfgz at interia dot pl>
+# Contributor: Christoph Zeiler <archNOSPAM_at_moonblade.dot.org>
+# Contributor: Link Dupont <link at subpop do net>
+
+pkgname=svgalib
+pkgver=1.9.25
+pkgrel=4
+pkgdesc="A low-level SuperVGA graphics library"
+arch=('i686' 'x86_64')
+url="http://www.svgalib.org/"
+license=('GPL')
+depends=('perl')
+source=(http://mail.arava.co.il/~matan/${pkgname}/${pkgname}-${pkgver}.tar.gz
+ svgalib-1.9.25-linux2.6.patch
+ svgalib-1.9.25-linux2.6.28.patch
+ svgalib-1.9.25-glibc210.patch
+ svgalib-1.9.25-linux2.6.36.patch)
+md5sums=('4dda7e779e550b7404cfe118f1d74222'
+ 'eadd4d3974a475ccc9d72f1e614c69df'
+ '5c797ca334e4c7f326dc08df7a3eb5c9'
+ '938f822ede2c9e76f2da0dd3ee38ba33'
+ '99e767dec306ff4d307eef151f352466')
+
+build() {
+ cd ${pkgname}-${pkgver}
+
+ find -name Makefile -exec sed '/fixldsoconf/d;/ldconfig/d' -i {} \;
+ ln -sf ../gl/vgagl.h threeDKit/
+
+ cd "${srcdir}"
+
+ patch -Np1 -i "${srcdir}"/svgalib-1.9.25-linux2.6.patch
+ patch -Np1 -i "${srcdir}"/svgalib-1.9.25-linux2.6.28.patch
+ patch -Np1 -i "${srcdir}"/svgalib-1.9.25-glibc210.patch
+ patch -Np1 -i "${srcdir}"/svgalib-1.9.25-linux2.6.36.patch
+
+ cd ${pkgname}-${pkgver}
+
+ make prefix="${pkgdir}"/usr \
+ NO_HELPER=n \
+ shared static
+}
+
+package() {
+ install -dm755 "${pkgdir}"/usr/lib
+
+ cd ${pkgname}-${pkgver}
+
+ make prefix="${pkgdir}"/usr \
+ datadir="${pkgdir}"/etc/vga \
+ NO_HELPER=y \
+ install
+}
diff --git a/svgalib-1.9.25-glibc210.patch b/svgalib-1.9.25-glibc210.patch
new file mode 100644
index 000000000000..64cce9b94c00
--- /dev/null
+++ b/svgalib-1.9.25-glibc210.patch
@@ -0,0 +1,109 @@
+diff -Naur src/svgalib-1.9.25/utils/gtf/gtfcalc.c src/svgalib-1.9.25.new/utils/gtf/gtfcalc.c
+--- src/svgalib-1.9.25/utils/gtf/gtfcalc.c 2005-07-10 15:33:16.000000000 -0400
++++ src/svgalib-1.9.25/utils/gtf/gtfcalc.c 2009-07-09 15:39:08.743610103 -0400
+@@ -64,7 +64,9 @@
+
+ /*-------------------------- Implementation -------------------------------*/
+
+-static double round(double v)
++static double svg_round(double v);
++
++double svg_round(double v)
+ {
+ return floor(v + 0.5);
+ }
+@@ -84,9 +86,9 @@
+ ****************************************************************************/
+ {
+ c->margin = GC.margin;
+- c->cellGran = round(GC.cellGran);
+- c->minPorch = round(GC.minPorch);
+- c->vSyncRqd = round(GC.vSyncRqd);
++ c->cellGran = svg_round(GC.cellGran);
++ c->minPorch = svg_round(GC.minPorch);
++ c->vSyncRqd = svg_round(GC.vSyncRqd);
+ c->hSync = GC.hSync;
+ c->minVSyncBP = GC.minVSyncBP;
+ if (GC.k == 0)
+@@ -140,13 +142,13 @@
+ vFreq = hFreq = dotClock = freq;
+
+ /* Round pixels to character cell granularity */
+- hPixels = round(hPixels / c.cellGran) * c.cellGran;
++ hPixels = svg_round(hPixels / c.cellGran) * c.cellGran;
+
+ /* For interlaced mode halve the vertical parameters, and double
+ * the required field refresh rate.
+ */
+ if (wantInterlace) {
+- vLines = round(vLines / 2);
++ vLines = svg_round(vLines / 2);
+ vFieldRate = vFreq * 2;
+ dotClock = dotClock * 2;
+ interlace = 0.5;
+@@ -158,8 +160,8 @@
+
+ /* Determine the lines for margins */
+ if (wantMargins) {
+- topMarginLines = round(c.margin / 100 * vLines);
+- botMarginLines = round(c.margin / 100 * vLines);
++ topMarginLines = svg_round(c.margin / 100 * vLines);
++ botMarginLines = svg_round(c.margin / 100 * vLines);
+ }
+ else {
+ topMarginLines = 0;
+@@ -173,11 +175,11 @@
+ (vLines + (2*topMarginLines) + c.minPorch + interlace) * 1000000;
+
+ /* Find the number of lines in vSync + back porch */
+- vSyncBP = round(c.minVSyncBP / hPeriodEst);
++ vSyncBP = svg_round(c.minVSyncBP / hPeriodEst);
+ }
+ else if (type == GTF_lockHF) {
+ /* Find the number of lines in vSync + back porch */
+- vSyncBP = round((c.minVSyncBP * hFreq) / 1000);
++ vSyncBP = svg_round((c.minVSyncBP * hFreq) / 1000);
+ }
+
+ /* Find the number of lines in the V back porch alone */
+@@ -205,8 +207,8 @@
+
+ /* Find the number of pixels in the left and right margins */
+ if (wantMargins) {
+- leftMarginPixels = round(hPixels * c.margin) / (100 * c.cellGran);
+- rightMarginPixels = round(hPixels * c.margin) / (100 * c.cellGran);
++ leftMarginPixels = svg_round(hPixels * c.margin) / (100 * c.cellGran);
++ rightMarginPixels = svg_round(hPixels * c.margin) / (100 * c.cellGran);
+ }
+ else {
+ leftMarginPixels = 0;
+@@ -235,17 +237,17 @@
+ }
+
+ /* Find the number of pixels in blanking time */
+- hBlankPixels = round((hTotalActivePixels * idealDutyCycle) /
++ hBlankPixels = svg_round((hTotalActivePixels * idealDutyCycle) /
+ ((100 - idealDutyCycle) * 2 * c.cellGran)) * (2 * c.cellGran);
+
+ /* Find the total number of pixels */
+ hTotalPixels = hTotalActivePixels + hBlankPixels;
+
+ /* Find the horizontal back porch */
+- hBackPorch = round((hBlankPixels / 2) / c.cellGran) * c.cellGran;
++ hBackPorch = svg_round((hBlankPixels / 2) / c.cellGran) * c.cellGran;
+
+ /* Find the horizontal sync width */
+- hSyncWidth = round(((c.hSync/100) * hTotalPixels) / c.cellGran) * c.cellGran;
++ hSyncWidth = svg_round(((c.hSync/100) * hTotalPixels) / c.cellGran) * c.cellGran;
+
+ /* Find the horizontal sync + back porch */
+ hSyncBP = hBackPorch + hSyncWidth;
+@@ -258,7 +260,7 @@
+ hPeriod = 1000 / hFreq;
+
+ /* Find the number of lines in vSync + back porch */
+- vSyncBP = round((c.minVSyncBP * hFreq) / 1000);
++ vSyncBP = svg_round((c.minVSyncBP * hFreq) / 1000);
+
+ /* Find the number of lines in the V back porch alone */
+ vBackPorch = vSyncBP - c.vSyncRqd;
diff --git a/svgalib-1.9.25-linux2.6.28.patch b/svgalib-1.9.25-linux2.6.28.patch
new file mode 100644
index 000000000000..55430281776b
--- /dev/null
+++ b/svgalib-1.9.25-linux2.6.28.patch
@@ -0,0 +1,30 @@
+--- src/svgalib-1.9.25/kernel/svgalib_helper/kernel26compat.h 2008-12-26 15:52:24.000000000 +0100
++++ src/svgalib-1.9.25/kernel/svgalib_helper/kernel26compat.h 2008-12-26 16:48:46.000000000 +0100
+@@ -128,7 +128,7 @@
+ MKDEV(SVGALIB_HELPER_MAJOR, _minor), \
+ _name);
+ /* 2.6.27 changed device_create to device_create_drvdata */
+-#else
++#elif LINUX_VERSION_CODE < KERNEL_VERSION(2,6,28)
+ # define SLH_SYSFS_ADD_CONTROL \
+ device_create_drvdata(svgalib_helper_class, NULL, \
+ MKDEV(SVGALIB_HELPER_MAJOR, 0), \
+@@ -139,6 +139,18 @@
+ &sh_pci_devs[_minor]->dev->dev, \
+ MKDEV(SVGALIB_HELPER_MAJOR, _minor), \
+ "%s%d", _name, _minor);
++/* 2.6.28 changed device_create_drvdata back to device_create */
++#else
++# define SLH_SYSFS_ADD_CONTROL \
++ device_create(svgalib_helper_class, NULL, \
++ MKDEV(SVGALIB_HELPER_MAJOR, 0), NULL, \
++ "%s%d", "svga", 0);
++
++# define SLH_SYSFS_ADD_DEVICE(_name, _minor) \
++ device_create(svgalib_helper_class, \
++ &sh_pci_devs[_minor]->dev->dev, \
++ MKDEV(SVGALIB_HELPER_MAJOR, _minor), NULL, \
++ "%s%d", _name, _minor);
+ #endif
+
+ # define SLH_SYSFS_REMOVE_DEVICE(i) \
diff --git a/svgalib-1.9.25-linux2.6.36.patch b/svgalib-1.9.25-linux2.6.36.patch
new file mode 100644
index 000000000000..e19d378b67ce
--- /dev/null
+++ b/svgalib-1.9.25-linux2.6.36.patch
@@ -0,0 +1,32 @@
+--- src/svgalib-1.9.25/kernel/svgalib_helper/main.c
++++ src/svgalib-1.9.25/kernel/svgalib_helper/main.c
+@@ -162,10 +162,16 @@ static void task_startad(void *data) {
+ get_user(pciv.address, &user_pciv->address); \
+ get_user(pciv.val, &user_pciv->val);
+ #define PUT_PCIV \
+- put_user(pciv.val, &user_pciv->val);
++ put_user(pciv.val, &user_pciv->val);
++#if LINUX_VERSION_CODE < KERNEL_VERSION(2,6,36)
+ static int svgalib_helper_ioctl( struct inode *inode, struct file *filp,
+ unsigned int cmd, unsigned long arg) {
++#else
++static int svgalib_helper_ioctl(struct file *filp,
++ unsigned int cmd, unsigned long arg) {
++#endif
+
++ struct inode *inode=filp->f_dentry->d_inode;
+ io_t iov, *user_iov=(io_t *)arg;
+ pcic_t pciv, *user_pciv=(pcic_t *)arg;
+ int minor = my_minor(inode->i_rdev);
+@@ -595,7 +601,11 @@ struct file_operations svgalib_helper_fo
+ #if LINUX_VERSION_CODE >= KERNEL_VERSION(2,3,0)
+ .owner = THIS_MODULE,
+ #endif
++#if LINUX_VERSION_CODE < KERNEL_VERSION(2,6,36)
+ .ioctl = svgalib_helper_ioctl,
++#else
++ .unlocked_ioctl = svgalib_helper_ioctl,
++#endif
+ .mmap = svgalib_helper_mmap,
+ .open = svgalib_helper_open,
+ .release = svgalib_helper_release,
diff --git a/svgalib-1.9.25-linux2.6.patch b/svgalib-1.9.25-linux2.6.patch
new file mode 100644
index 000000000000..4f34b4c6678f
--- /dev/null
+++ b/svgalib-1.9.25-linux2.6.patch
@@ -0,0 +1,289 @@
+ - get rid of warning when linux/device.h doesnt exist
+ - touch up the Makefile to let the ebuild handle the module details
+ - fix support with io remap stuff in newer kernels
+ - dont include headers that dont exist in 2.4.x kernels
+ - use module_param() for 2.6.x and MODULE_PARM() for all others
+ - dont declare all_devices as static since it is exported
+ - dont include <linux/config.h> as the build system does it for us
+ - in lrmi, map old flag names to new names for versions >= 2.6.26
+
+--- src/svgalib-1.9.25/kernel/svgalib_helper/Makefile
++++ src/svgalib-1.9.25/kernel/svgalib_helper/Makefile
+@@ -25,7 +25,7 @@
+ endif
+
+
+-CLASS_SIMPLE := $(shell grep class_simple_create $(KDIR)/include/linux/device.h)
++CLASS_SIMPLE := $(shell grep -s class_simple_create $(KDIR)/include/linux/device.h)
+
+ ifneq ($(CLASS_SIMPLE),)
+ CLASS_CFLAGS = -DCLASS_SIMPLE=1
+--- src/svgalib-1.9.25/kernel/svgalib_helper/Makefile.alt
++++ src/svgalib-1.9.25/kernel/svgalib_helper/Makefile.alt
+@@ -37,7 +37,7 @@
+ CFLAGS += -DSVGALIB_HELPER_MAJOR=$(SVGALIB_HELPER_MAJOR)
+
+ ifeq (1,$(findstring 1,$(MODVER)))
+- CFLAGS += -DMODVERSIONS -include $(INCLUDEDIR)/linux/modversions.h
++ CFLAGS += -DMODVERSIONS -DCONFIG_MODVERSIONS=1
+ endif
+
+ TARGET = svgalib_helper
+@@ -50,7 +50,8 @@
+ endif
+ endif
+
+-all: .depend $(OBJS)
++modules: $(OBJS)
++all: .depend modules
+
+ $(TARGET).o: $(SRC:.c=.o)
+ $(LD) -r $^ -o $@
+@@ -61,8 +62,8 @@
+ install: device modules_install
+
+ modules_install: $(OBJS)
+- mkdir -p /lib/modules/$(VER)/kernel/misc
+- install -m 0644 -c $(OBJS) /lib/modules/$(VER)/kernel/misc
++ mkdir -p $(TOPDIR)/lib/modules/$(VER)/kernel/misc
++ install -m 0644 -c $(OBJS) $(TOPDIR)/lib/modules/$(VER)/kernel/misc
+
+ device:
+ rm -f /dev/svgalib_helper* /dev/svga_helper* /dev/svga /dev/svga?
+--- src/svgalib-1.9.25/kernel/svgalib_helper/kernel26compat.h
++++ src/svgalib-1.9.25/kernel/svgalib_helper/kernel26compat.h
+@@ -10,7 +10,7 @@
+ # define PCI_GET_CLASS pci_find_class
+ # define PCI_GET_DEVICE pci_find_device
+
+-# if defined (PG_chainlock)
++# if LINUX_VERSION_CODE >= KERNEL_VERSION(2,5,3)
+ # define my_io_remap_page_range(vma, start, ofs, len, prot) \
+ io_remap_page_range(vma,start,ofs,len,prot)
+ # else
+@@ -70,6 +70,7 @@
+
+ /* These are also not present in 2.6 kernels ... */
+ #if (!defined _LINUX_DEVFS_FS_KERNEL_H) || (defined KERNEL_2_6)
++#include <linux/fs.h>
+ static inline int devfs_register_chrdev (unsigned int major, const char *name,
+ struct file_operations *fops)
+ {
+@@ -77,7 +78,12 @@
+ }
+ static inline int devfs_unregister_chrdev (unsigned int major,const char *name)
+ {
+- return unregister_chrdev (major, name);
++#if LINUX_VERSION_CODE < KERNEL_VERSION(2,6,0)
++ return unregister_chrdev (major, name);
++#else
++ unregister_chrdev (major, name);
++ return 0;
++#endif
+ }
+ #endif
+
+@@ -99,7 +105,8 @@
+ class_device_create(svgalib_helper_class, \
+ MKDEV(SVGALIB_HELPER_MAJOR, _minor), \
+ &sh_pci_devs[_minor]->dev->dev, _name);
+-#else /* 2.6.15 changed class_device_create */
++/* 2.6.15 changed class_device_create */
++#elif LINUX_VERSION_CODE < KERNEL_VERSION(2,6,26)
+ # define SLH_SYSFS_ADD_CONTROL \
+ class_device_create(svgalib_helper_class, NULL, \
+ MKDEV(SVGALIB_HELPER_MAJOR, 0), \
+@@ -109,7 +116,30 @@
+ class_device_create(svgalib_helper_class, NULL, \
+ MKDEV(SVGALIB_HELPER_MAJOR, _minor), \
+ &sh_pci_devs[_minor]->dev->dev, _name);
+-#endif /* 2.6.15 */
++/* 2.6.26 changed class_device_create to device_create */
++#elif LINUX_VERSION_CODE < KERNEL_VERSION(2,6,27)
++# define SLH_SYSFS_ADD_CONTROL \
++ device_create(svgalib_helper_class, NULL, \
++ MKDEV(SVGALIB_HELPER_MAJOR, 0), \
++ "svga");
++
++# define SLH_SYSFS_ADD_DEVICE(_name, _minor) \
++ device_create(svgalib_helper_class, &sh_pci_devs[_minor]->dev->dev, \
++ MKDEV(SVGALIB_HELPER_MAJOR, _minor), \
++ _name);
++/* 2.6.27 changed device_create to device_create_drvdata */
++#else
++# define SLH_SYSFS_ADD_CONTROL \
++ device_create_drvdata(svgalib_helper_class, NULL, \
++ MKDEV(SVGALIB_HELPER_MAJOR, 0), \
++ "%s%d", "svga", 0);
++
++# define SLH_SYSFS_ADD_DEVICE(_name, _minor) \
++ device_create_drvdata(svgalib_helper_class, \
++ &sh_pci_devs[_minor]->dev->dev, \
++ MKDEV(SVGALIB_HELPER_MAJOR, _minor), \
++ "%s%d", _name, _minor);
++#endif
+
+ # define SLH_SYSFS_REMOVE_DEVICE(i) \
+ class_destroy(svgalib_helper_class);
+@@ -161,3 +191,7 @@
+ #ifndef PCI_VENDOR_ID_RENDITION
+ #define PCI_VENDOR_ID_RENDITION 0x1163
+ #endif
++
++#ifndef IRQF_SHARED
++# define IRQF_SHARED SA_SHIRQ
++#endif
+--- src/svgalib-1.9.25/kernel/svgalib_helper/main.c
++++ src/svgalib-1.9.25/kernel/svgalib_helper/main.c
+@@ -1,5 +1,3 @@
+-#include <linux/config.h>
+-
+ #if defined (CONFIG_MODVERSIONS) && !defined (MODVERSIONS)
+ # define MODVERSIONS
+ #endif
+@@ -17,15 +15,22 @@
+ #include <linux/ioport.h>
+ #include <linux/interrupt.h>
+ #include <linux/pci.h>
++#include <linux/version.h>
++#if LINUX_VERSION_CODE < KERNEL_VERSION(2,6,18)
+ #include <linux/devfs_fs_kernel.h>
++#endif
+ #include <linux/mm.h>
++#if LINUX_VERSION_CODE >= KERNEL_VERSION(2,5,0)
+ #include <linux/thread_info.h>
++#endif
+ #include <linux/smp.h>
+ #include <linux/smp_lock.h>
+
+ #include <linux/sched.h>
+ #include <linux/wait.h>
++#if LINUX_VERSION_CODE >= KERNEL_VERSION(2,5,0)
+ #include <linux/syscalls.h>
++#endif
+
+ #define __KERNEL_SYSCALLS__
+ #include <linux/unistd.h>
+@@ -50,7 +55,7 @@
+ #include "displaystart.h"
+
+ int debug=0;
+-static int all_devices=0;
++int all_devices=0;
+ int num_devices=0;
+
+ static char *sdev_id="svgalib_helper";
+@@ -98,7 +103,11 @@
+ static volatile int vsync=0;
+ static wait_queue_head_t vsync_wait;
+
+-static irqreturn_t vsync_interrupt(int irq, void *dev_id, struct pt_regs *regs)
++static irqreturn_t vsync_interrupt(int irq, void *dev_id
++#if LINUX_VERSION_CODE < KERNEL_VERSION(2,6,19)
++, struct pt_regs *regs
++#endif
++)
+ {
+ struct sh_pci_device *dev = (struct sh_pci_device *)dev_id;
+
+@@ -355,7 +364,7 @@
+ vsync=1;
+ i=0;
+ while(irqs[i]!=-1)
+- request_irq(irqs[i++], vsync_interrupt, SA_SHIRQ, "svgalib_helper", sdev_id);
++ request_irq(irqs[i++], vsync_interrupt, IRQF_SHARED, "svgalib_helper", sdev_id);
+ vga_enable_vsync((void *)sdev_id);
+ wait_event_interruptible(vsync_wait, !vsync);
+ i=0;
+@@ -443,7 +452,7 @@
+ int i=sh_pci_devs[minor]->dev->irq;
+ sh_pci_devs[minor]->opencount++;
+ if(sh_pci_devs[minor]->opencount==1 && i!=0 && i!=-1 && i!=255)
+- request_irq(i, vsync_interrupt, SA_SHIRQ, "svgalib_helper", sh_pci_devs[minor]);
++ request_irq(i, vsync_interrupt, IRQF_SHARED, "svgalib_helper", sh_pci_devs[minor]);
+ }
+
+ #ifndef KERNEL_2_6
+@@ -763,10 +772,15 @@
+
+ }
+
++#ifdef KERNEL_2_6
++module_param(debug, int, 0);
++module_param(all_devices, int, 0);
++#else
+ MODULE_PARM(debug, "i");
+-MODULE_PARM_DESC(debug, "Debug output level.");
+-
+ MODULE_PARM(all_devices, "i");
++#endif
++
++MODULE_PARM_DESC(debug, "Debug output level.");
+ MODULE_PARM_DESC(all_devices, "Give access to all PCI devices, regardless of class.");
+
+
+--- src/svgalib-1.9.25/src/lrmi.6.c
++++ src/svgalib-1.9.25/src/lrmi.6.c
+@@ -169,6 +169,13 @@
+ }
+ }
+
++#ifndef TF_MASK
++#define TF_MASK X86_EFLAGS_TF
++#define IF_MASK X86_EFLAGS_IF
++#define IOPL_MASK X86_EFLAGS_IOPL
++#define VIF_MASK X86_EFLAGS_VIF
++#define VIP_MASK X86_EFLAGS_VIP
++#endif
+
+ #define DEFAULT_VM86_FLAGS (IF_MASK | IOPL_MASK)
+ #define DEFAULT_STACK_SIZE 0x1000
+--- src/svgalib-1.9.25/src/lrmi.9.c
++++ src/svgalib-1.9.25/src/lrmi.9.c
+@@ -206,6 +206,13 @@
+
+
+ #if defined(__linux__)
++#ifndef TF_MASK
++#define TF_MASK X86_EFLAGS_TF
++#define IF_MASK X86_EFLAGS_IF
++#define IOPL_MASK X86_EFLAGS_IOPL
++#define VIF_MASK X86_EFLAGS_VIF
++#define VIP_MASK X86_EFLAGS_VIP
++#endif
+ #define DEFAULT_VM86_FLAGS (IF_MASK | IOPL_MASK)
+ #elif defined(__NetBSD__) || defined(__FreeBSD__) || defined(__OpenBSD__)
+ #define DEFAULT_VM86_FLAGS (PSL_I | PSL_IOPL)
+--- src/svgalib-1.9.25/lrmi-0.6m/lrmi.c
++++ src/svgalib-1.9.25/lrmi-0.6m/lrmi.c
+@@ -170,6 +170,14 @@
+ }
+
+
++#ifndef TF_MASK
++#define TF_MASK X86_EFLAGS_TF
++#define IF_MASK X86_EFLAGS_IF
++#define IOPL_MASK X86_EFLAGS_IOPL
++#define VIF_MASK X86_EFLAGS_VIF
++#define VIP_MASK X86_EFLAGS_VIP
++#endif
++
+ #define DEFAULT_VM86_FLAGS (IF_MASK | IOPL_MASK)
+ #define DEFAULT_STACK_SIZE 0x1000
+ #define RETURN_TO_32_INT 255
+--- src/svgalib-1.9.25/lrmi-0.9/lrmi.c
++++ src/svgalib-1.9.25/lrmi-0.9/lrmi.c
+@@ -203,6 +203,13 @@
+
+
+ #if defined(__linux__)
++#ifndef TF_MASK
++#define TF_MASK X86_EFLAGS_TF
++#define IF_MASK X86_EFLAGS_IF
++#define IOPL_MASK X86_EFLAGS_IOPL
++#define VIF_MASK X86_EFLAGS_VIF
++#define VIP_MASK X86_EFLAGS_VIP
++#endif
+ #define DEFAULT_VM86_FLAGS (IF_MASK | IOPL_MASK)
+ #elif defined(__NetBSD__) || defined(__FreeBSD__) || defined(__OpenBSD__)
+ #define DEFAULT_VM86_FLAGS (PSL_I | PSL_IOPL)