summaryrefslogtreecommitdiff
path: root/emulators/bochs/patches/patch-ad
diff options
context:
space:
mode:
Diffstat (limited to 'emulators/bochs/patches/patch-ad')
-rw-r--r--emulators/bochs/patches/patch-ad54
1 files changed, 54 insertions, 0 deletions
diff --git a/emulators/bochs/patches/patch-ad b/emulators/bochs/patches/patch-ad
new file mode 100644
index 00000000000..7229ecee440
--- /dev/null
+++ b/emulators/bochs/patches/patch-ad
@@ -0,0 +1,54 @@
+$NetBSD: patch-ad,v 1.3 2002/05/14 13:52:52 fredb Exp $
+
+--- iodev/cdrom.cc.orig Tue Mar 19 19:24:16 2002
++++ iodev/cdrom.cc
+@@ -65,7 +65,7 @@
+ #define BX_CD_FRAMESIZE 2048
+ #endif
+
+-#if (defined(__OpenBSD__) || defined(__FreeBSD__))
++#if (defined(__OpenBSD__) || defined(__FreeBSD__) || defined(__NetBSD__))
+ // OpenBSD pre version 2.7 may require extern "C" { } structure around
+ // all the includes, because the i386 sys/disklabel.h contains code which
+ // c++ considers invalid.
+@@ -357,6 +357,22 @@
+ return(true);
+ }
+
++ int
++cdrom_interface::start_cdrom()
++{
++ // Spin up the cdrom drive.
++
++ if (fd >= 0) {
++#if defined(__NetBSD__)
++ if (ioctl (fd, CDIOCSTART) < 0)
++ BX_DEBUG(( "start_cdrom: start returns error: %s", strerror (errno) ));
++ return(true);
++#else
++ BX_INFO(("start_cdrom: your OS is not supported yet."));
++ return(false); // OS not supported yet, return false always.
++#endif
++ }
++}
+
+ void
+ cdrom_interface::eject_cdrom()
+@@ -365,7 +381,7 @@
+ // some ioctl() calls to really eject the CD as well.
+
+ if (fd >= 0) {
+-#if (defined(__OpenBSD__) || defined(__FreeBSD__))
++#if (defined(__OpenBSD__) || defined(__FreeBSD__) || defined(__NetBSD__))
+ (void) ioctl (fd, CDIOCALLOW);
+ if (ioctl (fd, CDIOCEJECT) < 0)
+ BX_DEBUG(( "eject_cdrom: eject returns error." ));
+@@ -495,7 +511,7 @@
+
+ return true;
+ }
+-#elif (defined(__OpenBSD__) || defined(__FreeBSD__))
++#elif (defined(__OpenBSD__) || defined(__FreeBSD__) || defined(__NetBSD__))
+ {
+ struct ioc_toc_header h;
+ struct ioc_read_toc_entry t;