summaryrefslogtreecommitdiff
path: root/src/video_out/libdha/sysdep
diff options
context:
space:
mode:
Diffstat (limited to 'src/video_out/libdha/sysdep')
-rw-r--r--src/video_out/libdha/sysdep/AsmMacros_powerpc.h6
-rw-r--r--src/video_out/libdha/sysdep/pci_linux.c4
-rw-r--r--src/video_out/libdha/sysdep/pci_powerpc.c18
3 files changed, 12 insertions, 16 deletions
diff --git a/src/video_out/libdha/sysdep/AsmMacros_powerpc.h b/src/video_out/libdha/sysdep/AsmMacros_powerpc.h
index cf678c9b8..2169c96b4 100644
--- a/src/video_out/libdha/sysdep/AsmMacros_powerpc.h
+++ b/src/video_out/libdha/sysdep/AsmMacros_powerpc.h
@@ -56,7 +56,11 @@ static __inline__ unsigned long inl(short port)
#define intr_enable()
#else
-#include "sysdep/AsmMacros_generic.h"
+ #ifdef linux
+ /*nothing*/
+ #else
+ #include "sysdep/AsmMacros_generic.h"
+ #endif
#endif
#endif
diff --git a/src/video_out/libdha/sysdep/pci_linux.c b/src/video_out/libdha/sysdep/pci_linux.c
index 6c0d6b42a..1d2116da6 100644
--- a/src/video_out/libdha/sysdep/pci_linux.c
+++ b/src/video_out/libdha/sysdep/pci_linux.c
@@ -20,6 +20,10 @@ int dhahelper_initialized = 0;
int dhahelper_fd = 0;
#endif
+#if defined(__sparc__) || defined(__powerpc__)
+#define iopl(x) (0)
+#endif
+
static __inline__ int enable_os_io(void)
{
#ifdef CONFIG_DHAHELPER
diff --git a/src/video_out/libdha/sysdep/pci_powerpc.c b/src/video_out/libdha/sysdep/pci_powerpc.c
index b2914d551..667b4db37 100644
--- a/src/video_out/libdha/sysdep/pci_powerpc.c
+++ b/src/video_out/libdha/sysdep/pci_powerpc.c
@@ -5,7 +5,6 @@
*/
static int pci_config_type( void ) { return 1; }
-
#ifdef linux
#include <fcntl.h>
#include <sys/io.h>
@@ -139,11 +138,8 @@ static void pci_config_write_long(
val = bswap_32(val);
sprintf(path,"/proc/bus/pci/%02d/%02x.0", bus, dev);
fd = open(path,O_RDONLY|O_SYNC);
- if (fd == -1) {
- retval=0;
- }
- else pwrite(fd, &val, 4, cmd);
if (fd > 0) {
+ pwrite(fd, &val, 4, cmd);
close(fd);
}
}
@@ -160,14 +156,10 @@ static void pci_config_write_word(
val = bswap_16(val);
sprintf(path,"/proc/bus/pci/%02d/%02x.0", bus, dev);
fd = open(path,O_RDONLY|O_SYNC);
- if (fd == -1) {
- retval=0;
- }
- else pwrite(fd, &val, 2, cmd);
if (fd > 0) {
+ pwrite(fd, &val, 2, cmd);
close(fd);
}
- return retval;
}
static void pci_config_write_byte(
@@ -181,14 +173,10 @@ static void pci_config_write_byte(
int fd;
sprintf(path,"/proc/bus/pci/%02d/%02x.0", bus, dev);
fd = open(path,O_RDONLY|O_SYNC);
- if (fd == -1) {
- retval=0;
- }
- else pwrite(fd, &retval, 1, cmd);
if (fd > 0) {
+ pwrite(fd, &val, 1, cmd);
close(fd);
}
- return retval;
}
#else
static long pci_config_read_long(