summaryrefslogtreecommitdiffstats
path: root/libdha
diff options
context:
space:
mode:
authornick <nick@b3059339-0415-0410-9bf9-f77b7e298cf2>2002-04-19 16:34:04 +0000
committernick <nick@b3059339-0415-0410-9bf9-f77b7e298cf2>2002-04-19 16:34:04 +0000
commit82df1b9d24824f8f65882b77143522767fc83fe6 (patch)
tree0946af8cd5196d664b6bd9eb7d2e72222e3e669c /libdha
parentd4731081be03a7799c5ebaef7a9026bb1b6a53d8 (diff)
downloadmpv-82df1b9d24824f8f65882b77143522767fc83fe6.tar.bz2
mpv-82df1b9d24824f8f65882b77143522767fc83fe6.tar.xz
sync with mplayerxp
git-svn-id: svn://svn.mplayerhq.hu/mplayer/trunk@5703 b3059339-0415-0410-9bf9-f77b7e298cf2
Diffstat (limited to 'libdha')
-rw-r--r--libdha/libdha.c17
-rw-r--r--libdha/libdha.h6
-rw-r--r--libdha/pci.c2
-rw-r--r--libdha/sysdep/pci_alpha.c4
4 files changed, 20 insertions, 9 deletions
diff --git a/libdha/libdha.c b/libdha/libdha.c
index 7b332d96c0..800b68bcf2 100644
--- a/libdha/libdha.c
+++ b/libdha/libdha.c
@@ -27,6 +27,9 @@
#include <fcntl.h>
#include <sys/stat.h>
#include <sys/types.h>
+#ifdef ARCH_ALPHA
+#include <sys/io.h>
+#endif
#include <unistd.h>
/* instead exit() use libdha_exit, and do the 'mother-application' deinit
@@ -67,8 +70,12 @@ void libdha_exit(const char *message, int level)
#include "kernelhelper/dhahelper.h"
static int mem=-1;
-void *map_phys_mem(unsigned base, unsigned size)
+void *map_phys_mem(unsigned long base, unsigned long size)
{
+#ifdef ARCH_ALPHA
+/* TODO: move it into sysdep */
+ base += bus_base();
+#endif
if ( (mem = open("/dev/dhahelper",O_RDWR)) < 0)
{
if ( (mem = open(DEV_MEM,O_RDWR)) == -1) {
@@ -95,8 +102,12 @@ void *map_phys_mem(unsigned base, unsigned size)
#else
static int mem=-1;
-void *map_phys_mem(unsigned base, unsigned size)
+void *map_phys_mem(unsigned long base, unsigned long size)
{
+#ifdef ARCH_ALPHA
+/* TODO: move it into sysdep */
+ base += bus_base();
+#endif
if ( (mem = open(DEV_MEM,O_RDWR)) == -1) {
perror("libdha: open(/dev/mem) failed") ; exit(1) ;
}
@@ -104,7 +115,7 @@ void *map_phys_mem(unsigned base, unsigned size)
}
#endif /* CONFIG_DHAHELPER */
-void unmap_phys_mem(void *ptr, unsigned size)
+void unmap_phys_mem(void *ptr, unsigned long size)
{
int res=munmap(ptr,size) ;
if (res == -1) { perror("libdha: munmap() failed") ; exit(1) ; }
diff --git a/libdha/libdha.h b/libdha/libdha.h
index a3dba42a49..54afad8b8c 100644
--- a/libdha/libdha.h
+++ b/libdha/libdha.h
@@ -55,8 +55,8 @@ extern void OUTPORT16(unsigned idx,unsigned short val);
extern void OUTPORT32(unsigned idx,unsigned val);
#define OUTPORT(idx,val) OUTPORT32(idx,val)
-extern void * map_phys_mem(unsigned base, unsigned size);
-extern void unmap_phys_mem(void *ptr, unsigned size);
+extern void * map_phys_mem(unsigned long base, unsigned long size);
+extern void unmap_phys_mem(void *ptr, unsigned long size);
/* These are the region types */
#define MTRR_TYPE_UNCACHABLE 0
@@ -70,4 +70,4 @@ extern int mtrr_set_type(unsigned base,unsigned size,int type);
}
#endif
-#endif \ No newline at end of file
+#endif
diff --git a/libdha/pci.c b/libdha/pci.c
index 87e2a1ca22..350a5be42c 100644
--- a/libdha/pci.c
+++ b/libdha/pci.c
@@ -736,4 +736,4 @@ int enable_app_io( void )
int disable_app_io( void )
{
return disable_os_io();
-} \ No newline at end of file
+}
diff --git a/libdha/sysdep/pci_alpha.c b/libdha/sysdep/pci_alpha.c
index 1ab1db2aa4..e968b3e121 100644
--- a/libdha/sysdep/pci_alpha.c
+++ b/libdha/sysdep/pci_alpha.c
@@ -11,7 +11,7 @@ static int pci_get_vendor(
unsigned char dev,
int func)
{
- int retval;
+ unsigned long retval;
pciconfig_read(bus, dev<<3, PCI_ID_REG, 4, &retval);
return retval;
}
@@ -22,7 +22,7 @@ static long pci_config_read_long(
int func,
unsigned cmd)
{
- long retval;
+ unsigned long retval;
pciconfig_read(bus, dev<<3, cmd, 4, &retval);
return retval;
}