[flashrom] [commit] r1645 - trunk

repository service svn at flashrom.org
Tue Jan 8 23:49:14 CET 2013


Author: hailfinger
Date: Tue Jan  8 23:49:12 2013
New Revision: 1645
URL: http://flashrom.org/trac/flashrom/changeset/1645

Log:
Fix compilation for DOS and non-x86 targets.

Fixup for r1638.
Thanks to Idwer Vollering for testing.

Signed-off-by: Carl-Daniel Hailfinger <c-d.hailfinger.devel.2006 at gmx.net>
Acked-by: Carl-Daniel Hailfinger <c-d.hailfinger.devel.2006 at gmx.net>

Modified:
   trunk/hwaccess.c

Modified: trunk/hwaccess.c
==============================================================================
--- trunk/hwaccess.c	Sun Jan  6 00:52:45 2013	(r1644)
+++ trunk/hwaccess.c	Tue Jan  8 23:49:12 2013	(r1645)
@@ -65,31 +65,25 @@
 #endif
 }
 
+#if IS_X86 && !(defined(__DJGPP__) || defined(__LIBPAYLOAD__))
 static int release_io_perms(void *p)
 {
-#if IS_X86
-#if defined(__DJGPP__) || defined(__LIBPAYLOAD__)
-	/* Nothing to release */
-#elif defined (__sun)
+#if defined (__sun)
 	sysi86(SI86V86, V86SC_IOPL, 0);
 #elif IS_BSD
 	close(io_fd);
 #elif IS_LINUX
 	iopl(0);
 #endif
-#else
-/* PCI port I/O support is unimplemented on PPC/MIPS and unavailable on ARM. */
-#endif
 	return 0;
 }
+#endif
 
 /* Get I/O permissions with automatic permission release on shutdown. */
 int rget_io_perms(void)
 {
-#if IS_X86
-#if defined(__DJGPP__) || defined(__LIBPAYLOAD__)
-	/* We have full permissions by default. */
-#elif defined (__sun)
+#if IS_X86 && !(defined(__DJGPP__) || defined(__LIBPAYLOAD__))
+#if defined (__sun)
 	if (sysi86(SI86V86, V86SC_IOPL, PS_IOPL) != 0) {
 #elif IS_BSD
 	if ((io_fd = open("/dev/io", O_RDWR)) < 0) {
@@ -107,7 +101,8 @@
 		register_shutdown(release_io_perms, NULL);
 	}
 #else
-/* PCI port I/O support is unimplemented on PPC/MIPS and unavailable on ARM. */
+	/* DJGPP and libpayload environments have full PCI port I/O permissions by default. */
+	/* PCI port I/O support is unimplemented on PPC/MIPS and unavailable on ARM. */
 #endif
 	return 0;
 }




More information about the flashrom mailing list