summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorTiago Vignatti <vignatti@freedesktop.org>2009-05-13 17:55:31 -0300
committerTiago Vignatti <vignatti@freedesktop.org>2009-05-13 17:55:31 -0300
commitb77b0fc3fbacc46d55998889f09326d1233339fc (patch)
tree6aa274eaa0f5454c58c1e3db60efb2aa0bc0895f
parent67af888bcc5667eadf1e9e9bf15305f742416daf (diff)
vgaarb: make it compile.
-rw-r--r--src/Makefile.am7
-rw-r--r--src/common_vgaarb.c56
-rw-r--r--src/common_vgaarb_stub.c84
3 files changed, 92 insertions, 55 deletions
diff --git a/src/Makefile.am b/src/Makefile.am
index 14f2e48..0de6894 100644
--- a/src/Makefile.am
+++ b/src/Makefile.am
@@ -45,6 +45,12 @@ if SOLARIS
OS_SUPPORT = solx_devfs.c pci_tools.h
endif
+if LINUX
+VGA_ARBITER = common_vgaarb.c
+else
+VGA_ARBITER = common_vgaarb_stub.c
+endif
+
libpciaccess_la_SOURCES = common_bridge.c \
common_iterator.c \
common_init.c \
@@ -53,6 +59,7 @@ libpciaccess_la_SOURCES = common_bridge.c \
common_device_name.c \
common_map.c \
pciaccess_private.h \
+ $(VGA_ARBITER) \
$(OS_SUPPORT)
INCLUDES = -I$(top_srcdir)/include
diff --git a/src/common_vgaarb.c b/src/common_vgaarb.c
index 729998d..df259d5 100644
--- a/src/common_vgaarb.c
+++ b/src/common_vgaarb.c
@@ -24,8 +24,6 @@
*
*/
-/* vgaaccess.c */
-
#ifdef HAVE_CONFIG_H
#include <config.h>
#endif
@@ -39,7 +37,7 @@
#include <fcntl.h>
#include <errno.h>
-#include "vgaaccess.h"
+#include "pciaccess.h"
/* ALL messages *should* fit in this buffer */
#define BUFSIZE 128
@@ -101,7 +99,6 @@ rsrc_to_str(VgaArbRsrcType iostate)
return "none";
}
-#ifndef STUB
int
vga_arb_read(vga_arb_ptr vgaDev)
{
@@ -220,54 +217,3 @@ vga_arb_fini(vga_arb_ptr vgaDev)
if (close(vgaDev->fd) == -1)
perror("[libvgaaccess] device close failed");
}
-
-#else /* STUB */
-int
-vga_arb_read(vga_arb_ptr vgaDev)
-{
- return 1;
-}
-
-int
-vga_arb_set_target(vga_arb_ptr vgaDev, unsigned int domain, unsigned int bus,
- unsigned int dev, unsigned int fn)
-{
- return 1;
-}
-
-int
-vga_arb_lock(vga_arb_ptr vgaDev)
-{
- return 1;
-}
-
-int
-vga_arb_trylock(vga_arb_ptr vgaDev)
-{
- return 1;
-}
-
-int
-vga_arb_unlock(vga_arb_ptr vgaDev)
-{
- return 1;
-}
-
-int
-vga_arb_decodes(vga_arb_ptr vgaDev)
-{
- return 1;
-}
-
-int
-vga_arb_init(vga_arb_ptr *vgaDev)
-{
- fprintf(stderr, "[libvgaaccess] YOU'RE USING THE STUB FUNCTIONS!\n");
- return 1;
-}
-
-void
-vga_arb_fini(vga_arb_ptr vgaDev)
-{
-}
-#endif /* END OF STUB */
diff --git a/src/common_vgaarb_stub.c b/src/common_vgaarb_stub.c
new file mode 100644
index 0000000..9fa36ac
--- /dev/null
+++ b/src/common_vgaarb_stub.c
@@ -0,0 +1,84 @@
+/*
+ * Copyright (c) 2007 Paulo R. Zanoni, Tiago Vignatti
+ *
+ * Permission is hereby granted, free of charge, to any person
+ * obtaining a copy of this software and associated documentation
+ * files (the "Software"), to deal in the Software without
+ * restriction, including without limitation the rights to use,
+ * copy, modify, merge, publish, distribute, sublicense, and/or sell
+ * copies of the Software, and to permit persons to whom the
+ * Software is furnished to do so, subject to the following
+ * conditions:
+ *
+ * The above copyright notice and this permission notice shall be
+ * included in all copies or substantial portions of the Software.
+ *
+ * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
+ * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES
+ * OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
+ * NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT
+ * HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY,
+ * WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
+ * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR
+ * OTHER DEALINGS IN THE SOFTWARE.
+ *
+ */
+
+#ifdef HAVE_CONFIG_H
+#include <config.h>
+#endif
+
+#include <stdio.h>
+#include "pciaccess.h"
+
+
+int
+vga_arb_read(vga_arb_ptr vgaDev)
+{
+ return 1;
+}
+
+int
+vga_arb_set_target(vga_arb_ptr vgaDev, unsigned int domain, unsigned int bus,
+ unsigned int dev, unsigned int fn)
+{
+ return 1;
+}
+
+int
+vga_arb_lock(vga_arb_ptr vgaDev)
+{
+ return 1;
+}
+
+int
+vga_arb_trylock(vga_arb_ptr vgaDev)
+{
+ return 1;
+}
+
+int
+vga_arb_unlock(vga_arb_ptr vgaDev)
+{
+ return 1;
+}
+
+int
+vga_arb_decodes(vga_arb_ptr vgaDev)
+{
+ return 1;
+}
+
+int
+vga_arb_init(vga_arb_ptr *vgaDev)
+{
+#ifdef DEBUG
+ fprintf(stderr, "%s: YOU'RE USING THE STUB FUNCTIONS!\n", __FUNCTION__);
+#endif
+ return 1;
+}
+
+void
+vga_arb_fini(vga_arb_ptr vgaDev)
+{
+}