2004-05-29 Martin Mares <mj@ucw.cz>
+ * lib/pci.h: Windows don't have the standard u_int* types.
+
+ * lib/internal.h: <sys/param.h> required on Windows for endianity
+ macros.
+
+ * lib/i386-ports.c: Connected i386-io-windows.h.
+
+ * lspci.c (check_root): geteuid() is not available on Windows.
+
+ * lib/i386-io-windows.h: Added Windows port contributed by Alexander
+ Stock <stock.alexander@gmx.de>.
+
+ * lib/configure: Hopefully fixed SunOS port broken by various
+ changes to the configure script.
+
* Makefile, lib/configure: Cross-compilation support, patch by Maciej.
2004-05-28 Martin Mares <mj@ucw.cz>
/*
* The PCI Library -- Direct Configuration access via i386 Ports
*
- * Copyright (c) 1997--2003 Martin Mares <mj@ucw.cz>
+ * Copyright (c) 1997--2004 Martin Mares <mj@ucw.cz>
*
* Can be freely distributed and used under the terms of the GNU GPL.
*/
#include "i386-io-linux.h"
#elif defined(OS_GNU)
#include "i386-io-hurd.h"
-#elif defined(OS_SunOS)
+#elif defined(OS_SUNOS)
#include "i386-io-sunos.h"
+#elif defined(OS_WINDOWS)
+#include "i386-io-windows.h"
#else
#error Do not know how to access I/O ports on this OS.
#endif
/*
* The PCI Library -- Internal Include File
*
- * Copyright (c) 1997--2003 Martin Mares <mj@ucw.cz>
+ * Copyright (c) 1997--2004 Martin Mares <mj@ucw.cz>
*
* Can be freely distributed and used under the terms of the GNU GPL.
*/
#include <sys/types.h>
#endif
-#ifdef OS_SunOS
+#ifdef OS_SUNOS
#include <sys/byteorder.h>
#define BIG_ENDIAN 4321
#ifdef _LITTLE_ENDIAN
#endif
#endif
+#ifdef OS_WINDOWS
+#include <sys/param.h>
+#endif
+
#if BYTE_ORDER == BIG_ENDIAN
#define cpu_to_le16 swab16
#define cpu_to_le32 swab32
/*
* The PCI Library
*
- * Copyright (c) 1997--2003 Martin Mares <mj@ucw.cz>
+ * Copyright (c) 1997--2004 Martin Mares <mj@ucw.cz>
*
* Can be freely distributed and used under the terms of the GNU GPL.
*/
#include <sys/types.h>
+#ifdef OS_WINDOWS
+typedef unsigned char byte;
+typedef char u8;
+typedef unsigned short word;
+typedef short u16;
+typedef unsigned long u32;
+#else
typedef u_int8_t byte;
typedef u_int8_t u8;
typedef u_int16_t word;
typedef u_int16_t u16;
typedef u_int32_t u32;
+#endif
#ifdef HAVE_64BIT_ADDRESS
#include <limits.h>
static int
check_root(void)
{
+#ifdef OS_WINDOWS
+ return 1;
+#else
static int is_root = -1;
if (is_root < 0)
is_root = !geteuid();
return is_root;
+#endif
}
static int