summaryrefslogtreecommitdiffstats
path: root/linux
diff options
context:
space:
mode:
authornick <nick@b3059339-0415-0410-9bf9-f77b7e298cf2>2001-10-29 18:24:29 +0000
committernick <nick@b3059339-0415-0410-9bf9-f77b7e298cf2>2001-10-29 18:24:29 +0000
commit57144b5a28cfac6408763a02df6bfa99ffbc2a97 (patch)
tree2762f9f4391509f9c73fe2ca652d7a87b87e4403 /linux
parent892759080c6ff1761e36de5dd2da10d7f23011cc (diff)
downloadmpv-57144b5a28cfac6408763a02df6bfa99ffbc2a97.tar.bz2
mpv-57144b5a28cfac6408763a02df6bfa99ffbc2a97.tar.xz
Fixed broken BIOS workaround
git-svn-id: svn://svn.mplayerhq.hu/mplayer/trunk@2537 b3059339-0415-0410-9bf9-f77b7e298cf2
Diffstat (limited to 'linux')
-rw-r--r--linux/vbelib.c32
1 files changed, 24 insertions, 8 deletions
diff --git a/linux/vbelib.c b/linux/vbelib.c
index bee899e661..c21d3c683d 100644
--- a/linux/vbelib.c
+++ b/linux/vbelib.c
@@ -17,7 +17,7 @@
static struct VesaProtModeInterface vbe_pm_info;
-static inline int VERR(void *p)
+static inline int VERR(const void *p)
{
register int retval;
__asm __volatile(
@@ -31,7 +31,7 @@ static inline int VERR(void *p)
}
#if 0
-static inline int VERW(void *p)
+static inline int VERW(const void *p)
{
register int retval;
__asm __volatile(
@@ -108,30 +108,46 @@ int vbeInit( void )
int vbeDestroy( void ) { return VBE_OK; }
-static int check_str(unsigned char *str)
+/* Fixme!!! This code is compatible only with mplayer's version of lrmi*/
+static inline int is_addr_valid(const void *p)
+{
+ return (p < (const void *)0x502) ||
+ (p >= (const void *)0x10000 && p < (const void *)0x20000) ||
+ (p >= (const void *)0xa0000 && p < (const void *)0x100000);
+}
+
+static int check_str(const unsigned char *str)
{
size_t i;
int null_found = 0;
for(i = 0;i < 256;i++)
{
- if(VERR(&str[i]))
+ if(is_addr_valid(&str[i]))
{
- if(!str[i]) { null_found = 1; break; }
+ if(VERR(&str[i]))
+ {
+ if(!str[i]) { null_found = 1; break; }
+ }
+ else break;
}
else break;
}
return null_found;
}
-static int check_wrd(unsigned short *str)
+static int check_wrd(const unsigned short *str)
{
size_t i;
int ffff_found = 0;
for(i = 0;i < 1024;i++)
{
- if(VERR(&str[i]))
+ if(is_addr_valid(&str[i]))
{
- if(str[i] == 0xffff) { ffff_found = 1; break; }
+ if(VERR(&str[i]))
+ {
+ if(str[i] == 0xffff) { ffff_found = 1; break; }
+ }
+ else break;
}
else break;
}