aboutsummaryrefslogtreecommitdiffstats
path: root/arch/um
diff options
context:
space:
mode:
authorPaolo 'Blaisorblade' Giarrusso <blaisorblade@yahoo.it>2005-07-14 03:33:41 -0400
committerLinus Torvalds <torvalds@g5.osdl.org>2005-07-14 12:00:25 -0400
commitecc354a90af90a80dcaccc750f5f3e5e7c83112d (patch)
tree71f60a11ff19d4e5078731a7fae39972a745c3c5 /arch/um
parent8e0a21812427313f8ee8521688e81bfcc6f207a2 (diff)
[PATCH] uml: reintroduce pcap support
The pcap support was not working because of some linking problems (expressing the construct in Kbuild was a bit difficult) and because there was no user request. Now that this has come back, here's the support. This has been tested and works on both 32 and 64-bit hosts, even when "cross-"building 32-bit binaries. Signed-off-by: Paolo 'Blaisorblade' Giarrusso <blaisorblade@yahoo.it> Cc: Jeff Dike <jdike@addtoit.com> Signed-off-by: Andrew Morton <akpm@osdl.org> Signed-off-by: Linus Torvalds <torvalds@osdl.org>
Diffstat (limited to 'arch/um')
-rw-r--r--arch/um/Kconfig_net2
-rw-r--r--arch/um/Makefile14
-rw-r--r--arch/um/drivers/Makefile17
3 files changed, 24 insertions, 9 deletions
diff --git a/arch/um/Kconfig_net b/arch/um/Kconfig_net
index 1c2f9a70d91d..fa2ab2dd78b7 100644
--- a/arch/um/Kconfig_net
+++ b/arch/um/Kconfig_net
@@ -135,7 +135,7 @@ config UML_NET_MCAST
135 135
136config UML_NET_PCAP 136config UML_NET_PCAP
137 bool "pcap transport" 137 bool "pcap transport"
138 depends on UML_NET && BROKEN 138 depends on UML_NET && EXPERIMENTAL
139 help 139 help
140 The pcap transport makes a pcap packet stream on the host look 140 The pcap transport makes a pcap packet stream on the host look
141 like an ethernet device inside UML. This is useful for making 141 like an ethernet device inside UML. This is useful for making
diff --git a/arch/um/Makefile b/arch/um/Makefile
index dfcc9eaafaa7..6a7a9f43cdef 100644
--- a/arch/um/Makefile
+++ b/arch/um/Makefile
@@ -56,17 +56,21 @@ include $(srctree)/$(ARCH_DIR)/Makefile-$(SUBARCH)
56core-y += $(SUBARCH_CORE) 56core-y += $(SUBARCH_CORE)
57libs-y += $(SUBARCH_LIBS) 57libs-y += $(SUBARCH_LIBS)
58 58
59# -Derrno=kernel_errno - This turns all kernel references to errno into 59# -Dvmap=kernel_vmap affects everything, and prevents anything from
60# kernel_errno to separate them from the libc errno. This allows -fno-common 60# referencing the libpcap.o symbol so named.
61# in CFLAGS. Otherwise, it would cause ld to complain about the two different
62# errnos.
63 61
64CFLAGS += $(CFLAGS-y) -D__arch_um__ -DSUBARCH=\"$(SUBARCH)\" \ 62CFLAGS += $(CFLAGS-y) -D__arch_um__ -DSUBARCH=\"$(SUBARCH)\" \
65 $(ARCH_INCLUDE) $(MODE_INCLUDE) 63 $(ARCH_INCLUDE) $(MODE_INCLUDE) -Dvmap=kernel_vmap
66 64
67USER_CFLAGS := $(patsubst -I%,,$(CFLAGS)) 65USER_CFLAGS := $(patsubst -I%,,$(CFLAGS))
68USER_CFLAGS := $(patsubst -D__KERNEL__,,$(USER_CFLAGS)) $(ARCH_INCLUDE) \ 66USER_CFLAGS := $(patsubst -D__KERNEL__,,$(USER_CFLAGS)) $(ARCH_INCLUDE) \
69 $(MODE_INCLUDE) $(ARCH_USER_CFLAGS) 67 $(MODE_INCLUDE) $(ARCH_USER_CFLAGS)
68
69# -Derrno=kernel_errno - This turns all kernel references to errno into
70# kernel_errno to separate them from the libc errno. This allows -fno-common
71# in CFLAGS. Otherwise, it would cause ld to complain about the two different
72# errnos.
73
70CFLAGS += -Derrno=kernel_errno -Dsigprocmask=kernel_sigprocmask 74CFLAGS += -Derrno=kernel_errno -Dsigprocmask=kernel_sigprocmask
71CFLAGS += $(call cc-option,-fno-unit-at-a-time,) 75CFLAGS += $(call cc-option,-fno-unit-at-a-time,)
72 76
diff --git a/arch/um/drivers/Makefile b/arch/um/drivers/Makefile
index b2de9916c32c..d6c31a95b887 100644
--- a/arch/um/drivers/Makefile
+++ b/arch/um/drivers/Makefile
@@ -10,7 +10,6 @@ slip-objs := slip_kern.o slip_user.o
10slirp-objs := slirp_kern.o slirp_user.o 10slirp-objs := slirp_kern.o slirp_user.o
11daemon-objs := daemon_kern.o daemon_user.o 11daemon-objs := daemon_kern.o daemon_user.o
12mcast-objs := mcast_kern.o mcast_user.o 12mcast-objs := mcast_kern.o mcast_user.o
13#pcap-objs := pcap_kern.o pcap_user.o $(PCAP)
14net-objs := net_kern.o net_user.o 13net-objs := net_kern.o net_user.o
15mconsole-objs := mconsole_kern.o mconsole_user.o 14mconsole-objs := mconsole_kern.o mconsole_user.o
16hostaudio-objs := hostaudio_kern.o 15hostaudio-objs := hostaudio_kern.o
@@ -18,6 +17,17 @@ ubd-objs := ubd_kern.o ubd_user.o
18port-objs := port_kern.o port_user.o 17port-objs := port_kern.o port_user.o
19harddog-objs := harddog_kern.o harddog_user.o 18harddog-objs := harddog_kern.o harddog_user.o
20 19
20LDFLAGS_pcap.o := -r $(shell $(CC) $(CFLAGS) -print-file-name=libpcap.a)
21
22$(obj)/pcap.o: $(obj)/pcap_kern.o $(obj)/pcap_user.o
23 $(LD) -r -dp -o $@ $^ $(LDFLAGS) $(LDFLAGS_pcap.o)
24#XXX: The call below does not work because the flags are added before the
25# object name, so nothing from the library gets linked.
26#$(call if_changed,ld)
27
28# When the above is fixed, don't forget to add this too!
29#targets := $(obj)/pcap.o
30
21obj-y := stdio_console.o fd.o chan_kern.o chan_user.o line.o 31obj-y := stdio_console.o fd.o chan_kern.o chan_user.o line.o
22obj-$(CONFIG_SSL) += ssl.o 32obj-$(CONFIG_SSL) += ssl.o
23obj-$(CONFIG_STDERR_CONSOLE) += stderr_console.o 33obj-$(CONFIG_STDERR_CONSOLE) += stderr_console.o
@@ -26,7 +36,7 @@ obj-$(CONFIG_UML_NET_SLIP) += slip.o slip_common.o
26obj-$(CONFIG_UML_NET_SLIRP) += slirp.o slip_common.o 36obj-$(CONFIG_UML_NET_SLIRP) += slirp.o slip_common.o
27obj-$(CONFIG_UML_NET_DAEMON) += daemon.o 37obj-$(CONFIG_UML_NET_DAEMON) += daemon.o
28obj-$(CONFIG_UML_NET_MCAST) += mcast.o 38obj-$(CONFIG_UML_NET_MCAST) += mcast.o
29#obj-$(CONFIG_UML_NET_PCAP) += pcap.o $(PCAP) 39obj-$(CONFIG_UML_NET_PCAP) += pcap.o
30obj-$(CONFIG_UML_NET) += net.o 40obj-$(CONFIG_UML_NET) += net.o
31obj-$(CONFIG_MCONSOLE) += mconsole.o 41obj-$(CONFIG_MCONSOLE) += mconsole.o
32obj-$(CONFIG_MMAPPER) += mmapper_kern.o 42obj-$(CONFIG_MMAPPER) += mmapper_kern.o
@@ -41,6 +51,7 @@ obj-$(CONFIG_UML_WATCHDOG) += harddog.o
41obj-$(CONFIG_BLK_DEV_COW_COMMON) += cow_user.o 51obj-$(CONFIG_BLK_DEV_COW_COMMON) += cow_user.o
42obj-$(CONFIG_UML_RANDOM) += random.o 52obj-$(CONFIG_UML_RANDOM) += random.o
43 53
44USER_OBJS := fd.o null.o pty.o tty.o xterm.o slip_common.o 54# pcap_user.o must be added explicitly.
55USER_OBJS := fd.o null.o pty.o tty.o xterm.o slip_common.o pcap_user.o
45 56
46include arch/um/scripts/Makefile.rules 57include arch/um/scripts/Makefile.rules