Fix for WINE on -CURRENT

From: Scot W. Hetzel <hetzelsw_at_westbend.net>
Date: Mon, 3 Nov 2003 23:14:03 -0600 (CST)
Below is a patch to fix WINE for the new ATA driver.

I created this patch based on the ideals from a previous user
who had patched 3 other ports to work with -CURRENT's new ATA
driver.

Could someone familar with the new ATA driver have a look at this
patch to make sure it is correct.

Thanks,

Scot W. Hetzel
Index: Makefile
===================================================================
RCS file: /home/ncvs/ports/emulators/wine/Makefile,v
retrieving revision 1.152
diff -u -r1.152 Makefile
--- Makefile	27 Oct 2003 06:16:28 -0000	1.152
+++ Makefile	4 Nov 2003 04:20:37 -0000
_at__at_ -36,8 +36,8 _at__at_
 BROKEN=		"Not supported on systems prior to FreeBSD 4.x"
 .endif
 
-.if ${OSVERSION} >= 501106
-BROKEN=		"Broken by new ATA driver"
-.endif
-
 .if defined(DEBUG)
Index: files/patch-dlls-ntdll-cdrom.c
===================================================================
RCS file: files/patch-dlls-ntdll-cdrom.c
diff -N files/patch-dlls-ntdll-cdrom.c
--- /dev/null	1 Jan 1970 00:00:00 -0000
+++ files/patch-dlls-ntdll-cdrom.c	4 Nov 2003 04:46:54 -0000
_at__at_ -0,0 +1,59 _at__at_
+--- dlls/ntdll/cdrom.c.orig	Tue Oct  7 21:59:22 2003
++++ dlls/ntdll/cdrom.c	Mon Nov  3 22:46:11 2003
+_at__at_ -65,8 +65,14 _at__at_
+ #ifdef HAVE_LINUX_UCDROM_H
+ # include <linux/ucdrom.h>
+ #endif
++#ifdef HAVE_SYS_PARAM_H
++# include <sys/param.h>
++#endif
+ #ifdef HAVE_SYS_CDIO_H
+ # include <sys/cdio.h>
++#if __FreeBSD_version > 501105
++# include <sys/cdrio.h>
++#endif
+ #endif
+ #ifdef HAVE_SYS_SCSIIO_H
+ # include <sys/scsiio.h>
+_at__at_ -1352,8 +1358,12 _at__at_
+     }
+ #elif defined(__FreeBSD__)
+     {
++#if __FreeBSD_version < 501106
+         struct ioc_read_audio   ira;
+-
++#else
++	int bsize = sectSize;
++	int begin;
++#endif
+         switch (raw->TrackMode)
+         {
+         case YellowMode2:
+_at__at_ -1365,12 +1375,27 _at__at_
+         case CDDA:
+             /* 2048 = 2 ** 11 */
+             if (raw->DiskOffset.s.HighPart & ~2047) FIXME("Unsupported value\n");
++#if __FreeBSD_version < 501106
+             ira.address.lba = ((raw->DiskOffset.s.LowPart >> 11) |
+                 raw->DiskOffset.s.HighPart << (32 - 11)) - 1;
+             ira.address_format = CD_LBA_FORMAT;
+             ira.nframes = raw->SectorCount;
+             ira.buffer = buffer;
+             io = ioctl(cdrom_cache[dev].fd, CDIOCREADAUDIO, &ira);
++#else
++	    if ((io = ioctl(cdrom_cache[dev].fd, CDRIOCSETBLOCKSIZE, &bsize)) == -1) {
++		return CDROM_GetStatusCode(io);
++	    }
++	    begin = ((raw->DiskOffset.s.LowPart >> 11) | raw->DiskOffset.s.HighPart << (32 - 11)) - 1;
++	    io = pread(cdrom_cache[dev].fd, buffer, raw->SectorCount*bsize, begin*bsize);
++	    if (io == raw->SectorCount*bsize) {
++		io = 0;
++	    } else if (io != -1) {
++		/* We retrieved < raw->SectorCount*bsize */
++		io = 0; /* change to -1, if we are required to return an error */
++		errno = ESPIPE;
++	    }
++#endif
+             break;
+         }
+     }
Received on Mon Nov 03 2003 - 20:14:09 UTC

This archive was generated by hypermail 2.4.0 : Wed May 19 2021 - 11:37:27 UTC