summaryrefslogtreecommitdiffstats
path: root/linux
diff options
context:
space:
mode:
authornick <nick@b3059339-0415-0410-9bf9-f77b7e298cf2>2001-10-22 09:28:44 +0000
committernick <nick@b3059339-0415-0410-9bf9-f77b7e298cf2>2001-10-22 09:28:44 +0000
commit58ce93efc749c069cde27853345434d846918418 (patch)
tree3a97f0031b7fdaf1fb8a8e6968ade9102e2d9849 /linux
parent43e4f2c79241c56f92f838e401fc67a4799c7a4a (diff)
downloadmpv-58ce93efc749c069cde27853345434d846918418.tar.bz2
mpv-58ce93efc749c069cde27853345434d846918418.tar.xz
More iopl'ed ports and test for brken BIOS
git-svn-id: svn://svn.mplayerhq.hu/mplayer/trunk@2360 b3059339-0415-0410-9bf9-f77b7e298cf2
Diffstat (limited to 'linux')
-rw-r--r--linux/vbelib.c8
-rw-r--r--linux/vbelib.h1
2 files changed, 9 insertions, 0 deletions
diff --git a/linux/vbelib.c b/linux/vbelib.c
index b6379b111d..12ea0b989d 100644
--- a/linux/vbelib.c
+++ b/linux/vbelib.c
@@ -56,14 +56,22 @@ static inline int VBE_LRMI_int(int int_no, struct LRMI_regs *r)
int vbeInit( void )
{
+ unsigned short iopl_port,int_10_seg;
+ size_t i;
if(!LRMI_init()) return VBE_VM86_FAIL;
/*
Allow read/write to ALL io ports
*/
+ int_10_seg = *(unsigned short *)PhysToVirtSO(0x0000,0x0042);
+ /* Video BIOS should be at C000:0000 and above */
+ if((int_10_seg >> 12) < 0xC) return VBE_BROKEN_BIOS;
ioperm(0, 1024, 1);
iopl(3);
memset(&vbe_pm_info,0,sizeof(struct VesaProtModeInterface));
vbeGetProtModeInfo(&vbe_pm_info);
+ i = 0;
+ while((iopl_port=vbe_pm_info.iopl_ports[i++]) != 0xFFFF) ioperm(iopl_port,1,1);
+ iopl(3);
return VBE_OK;
}
diff --git a/linux/vbelib.h b/linux/vbelib.h
index c3504aa3c9..3ff95c971d 100644
--- a/linux/vbelib.h
+++ b/linux/vbelib.h
@@ -189,6 +189,7 @@ struct VesaProtModeInterface
#define VBE_VM86_FAIL -1
#define VBE_OUT_OF_DOS_MEM -2
#define VBE_OUT_OF_MEM -3
+#define VBE_BROKEN_BIOS -4
#define VBE_VESA_ERROR_MASK 0x004f
#define VBE_VESA_ERRCODE_MASK 0xff00