changeset 10980:e687fa1d55c6

port libdha to mingw
author faust3
date Thu, 02 Oct 2003 14:48:17 +0000
parents ea4426db0db5
children c312dafb528f
files libdha/libdha.c libdha/pci.c libdha/sysdep/AsmMacros_x86.h libdha/sysdep/libdha_win32.c
diffstat 4 files changed, 11 insertions(+), 9 deletions(-) [+]
line wrap: on
line diff
--- a/libdha/libdha.c	Thu Oct 02 14:25:52 2003 +0000
+++ b/libdha/libdha.c	Thu Oct 02 14:48:17 2003 +0000
@@ -126,7 +126,6 @@
 mmap:
   return mmap(0,size,PROT_READ|PROT_WRITE,MAP_SHARED,mem_fd,base);
 }
-#endif /* Generic mmap (not win32, nor os2) */
 
 void unmap_phys_mem(void *ptr, unsigned long size)
 {
@@ -144,6 +143,8 @@
   return;
 }
 
+#endif /* Generic mmap (not win32, nor os2) */
+
 unsigned char INPORT8(unsigned idx)
 {
   return inb(idx);
--- a/libdha/pci.c	Thu Oct 02 14:25:52 2003 +0000
+++ b/libdha/pci.c	Thu Oct 02 14:48:17 2003 +0000
@@ -89,6 +89,9 @@
 #include "sysdep/pci_os2.c"
 #elif defined (_WIN32) || defined(__CYGWIN__)
 #include "sysdep/pci_win32.c"
+#ifdef __MINGW32__
+#define ENOTSUP 134		/* Not supported */
+#endif
 #endif
 
 #if 0
--- a/libdha/sysdep/AsmMacros_x86.h	Thu Oct 02 14:25:52 2003 +0000
+++ b/libdha/sysdep/AsmMacros_x86.h	Thu Oct 02 14:48:17 2003 +0000
@@ -7,9 +7,9 @@
 #ifndef __ASM_MACROS_X86_H
 #define __ASM_MACROS_X86_H
 
-#if defined (WINNT)
-#error This stuff is not ported on your system
-#else
+//#if defined (WINNT)
+//#error This stuff is not ported on your system
+//#else
 
 #include "config.h"
 
@@ -280,4 +280,4 @@
 
 #endif
 
-#endif
+//#endif
--- a/libdha/sysdep/libdha_win32.c	Thu Oct 02 14:25:52 2003 +0000
+++ b/libdha/sysdep/libdha_win32.c	Thu Oct 02 14:48:17 2003 +0000
@@ -5,7 +5,6 @@
 */
 
 #include <windows.h>
-
 /*
   This is the request structure that applications use
   to request services from the MAPDEV VxD.
@@ -34,7 +33,7 @@
     ((DeviceType)<<16) | ((Access)<<14) | ((Function)<<2) | (Method) )
 
 /* Memory Map a piece of Real Memory */
-void *map_phys_mem(unsigned base, unsigned size) {
+void *map_phys_mem(unsigned long base, unsigned long size) {
 
   HANDLE hDevice ;
   PVOID inBuf[1] ;		/* buffer for struct pointer to VxD */
@@ -66,5 +65,4 @@
   return (void*)req.mdr_LinearAddress ;
 }
 
-void unmap_phys_mem(void *ptr, unsigned size) { }
-
+void unmap_phys_mem(void *ptr, unsigned long size) { }