diff options
author | kaf24@scramble.cl.cam.ac.uk <kaf24@scramble.cl.cam.ac.uk> | 2004-04-03 16:28:51 +0000 |
---|---|---|
committer | kaf24@scramble.cl.cam.ac.uk <kaf24@scramble.cl.cam.ac.uk> | 2004-04-03 16:28:51 +0000 |
commit | 9a411a929ca7d4cdbbc5a531c0a00ffd3e7ebc84 (patch) | |
tree | 08eaa49d94371e8dde902824ed15ef75a80fe07d | |
parent | e2850253db53b8c3719ba210667626637f177cc4 (diff) | |
download | xen-9a411a929ca7d4cdbbc5a531c0a00ffd3e7ebc84.tar.gz xen-9a411a929ca7d4cdbbc5a531c0a00ffd3e7ebc84.tar.bz2 xen-9a411a929ca7d4cdbbc5a531c0a00ffd3e7ebc84.zip |
bitkeeper revision 1.839 (406ee643kSLveMGyvVob0usRgg-CGg)
vif.h, Makefile, domain.c, setup.c, entry.S, Rules.mk:
Completely remove networking support from Xen when 'nodev=y' is specified.
-rw-r--r-- | xen/Makefile | 4 | ||||
-rw-r--r-- | xen/Rules.mk | 5 | ||||
-rw-r--r-- | xen/arch/i386/entry.S | 7 | ||||
-rw-r--r-- | xen/arch/i386/setup.c | 4 | ||||
-rw-r--r-- | xen/common/Makefile | 4 | ||||
-rw-r--r-- | xen/common/domain.c | 6 | ||||
-rw-r--r-- | xen/drivers/Makefile | 2 | ||||
-rw-r--r-- | xen/include/xen/vif.h | 7 |
8 files changed, 30 insertions, 9 deletions
diff --git a/xen/Makefile b/xen/Makefile index cfe5e1242c..e75d299636 100644 --- a/xen/Makefile +++ b/xen/Makefile @@ -36,7 +36,9 @@ clean: delete-links $(TARGET): delete-unfresh-files make-links $(GENERATED_FILES) $(MAKE) -C tools $(MAKE) -C common - $(MAKE) -C net + if [ "$(nodev)" != "y" ]; then \ + $(MAKE) -C net ; \ + fi $(MAKE) -C drivers $(MAKE) -C arch/$(TARGET_ARCH) diff --git a/xen/Rules.mk b/xen/Rules.mk index 237bbbd6e1..95bd10bab1 100644 --- a/xen/Rules.mk +++ b/xen/Rules.mk @@ -18,11 +18,11 @@ OBJS += $(patsubst %.c,%.o,$(C_SRCS)) # Note that link order matters! ALL_OBJS := $(BASEDIR)/common/common.o -ALL_OBJS += $(BASEDIR)/net/network.o ALL_OBJS += $(BASEDIR)/drivers/char/driver.o ALL_OBJS += $(BASEDIR)/drivers/pci/driver.o -ALL_OBJS += $(BASEDIR)/drivers/net/driver.o ifneq ($(nodev),y) +ALL_OBJS += $(BASEDIR)/net/network.o +ALL_OBJS += $(BASEDIR)/drivers/net/driver.o ALL_OBJS += $(BASEDIR)/drivers/block/driver.o ALL_OBJS += $(BASEDIR)/drivers/cdrom/driver.o ALL_OBJS += $(BASEDIR)/drivers/ide/driver.o @@ -46,7 +46,6 @@ endif ifeq ($(nodev),y) CFLAGS += -DNO_DEVICES_IN_XEN -CFLAGS := $(subst -Werror,,$(CFLAGS)) endif %.o: %.c $(HDRS) Makefile diff --git a/xen/arch/i386/entry.S b/xen/arch/i386/entry.S index 0141991704..155ad23c4d 100644 --- a/xen/arch/i386/entry.S +++ b/xen/arch/i386/entry.S @@ -706,14 +706,19 @@ ENTRY(hypervisor_call_table) .long SYMBOL_NAME(do_set_gdt) .long SYMBOL_NAME(do_stack_switch) .long SYMBOL_NAME(do_set_callbacks) /* 5 */ +#ifndef NO_DEVICES_IN_XEN .long SYMBOL_NAME(do_net_io_op) +#else + .long SYMBOL_NAME(do_ni_syscall) +#endif .long SYMBOL_NAME(do_fpu_taskswitch) .long SYMBOL_NAME(do_sched_op) .long SYMBOL_NAME(do_dom0_op) - .long SYMBOL_NAME(do_network_op) /* 10 */ #ifndef NO_DEVICES_IN_XEN + .long SYMBOL_NAME(do_network_op) /* 10 */ .long SYMBOL_NAME(do_block_io_op) #else + .long SYMBOL_NAME(do_ni_syscall) /* 10 */ .long SYMBOL_NAME(do_ni_syscall) #endif .long SYMBOL_NAME(do_set_debugreg) diff --git a/xen/arch/i386/setup.c b/xen/arch/i386/setup.c index 862582e5d4..f9107df297 100644 --- a/xen/arch/i386/setup.c +++ b/xen/arch/i386/setup.c @@ -317,9 +317,11 @@ void __init start_of_day(void) extern void timer_bh(void); extern void init_timervecs(void); extern void ac_timer_init(void); +#ifndef NO_DEVICES_IN_XEN extern int setup_network_devices(void); extern void net_init(void); extern void initialize_block_io(void); +#endif extern void initialize_keytable(); extern void initialize_keyboard(void); extern int opt_nosmp, opt_watchdog, opt_noacpi, opt_ignorebiostables; @@ -415,10 +417,10 @@ void __init start_of_day(void) pci_init(); #endif do_initcalls(); +#ifndef NO_DEVICES_IN_XEN if ( !setup_network_devices() ) panic("Must have a network device!\n"); net_init(); /* initializes virtual network system. */ -#ifndef NO_DEVICES_IN_XEN initialize_block_io(); /* setup block devices */ #endif diff --git a/xen/common/Makefile b/xen/common/Makefile index c660a8b24b..5edce92487 100644 --- a/xen/common/Makefile +++ b/xen/common/Makefile @@ -5,6 +5,10 @@ ifeq ($(nperfc),y) OBJS := $(subst perfc.o,,$(OBJS)) endif +ifeq ($(nodev),y) +OBJS := $(subst network.o,,$(OBJS)) +endif + default: $(OBJS) $(LD) $(LDARCHFLAGS) -r -o common.o $(OBJS) diff --git a/xen/common/domain.c b/xen/common/domain.c index 7b55ee89d4..7eaa5628ad 100644 --- a/xen/common/domain.c +++ b/xen/common/domain.c @@ -695,7 +695,6 @@ int construct_dom0(struct task_struct *p, { char *dst; int i, rc; - domid_t dom = p->domain; unsigned long pfn, mfn; unsigned long nr_pages = (alloc_end - alloc_start) >> PAGE_SHIFT; unsigned long nr_pt_pages; @@ -730,11 +729,14 @@ int construct_dom0(struct task_struct *p, unsigned long mpt_alloc; extern void physdev_init_dom0(struct task_struct *); + +#ifndef NO_DEVICES_IN_XEN extern void ide_probe_devices(xen_disk_info_t *); extern void scsi_probe_devices(xen_disk_info_t *); extern void cciss_probe_devices(xen_disk_info_t *); xen_disk_info_t xdi; xen_disk_t *xd; +#endif /* Sanity! */ if ( p->domain != 0 ) @@ -989,7 +991,7 @@ int construct_dom0(struct task_struct *p, /* Add virtual network interfaces. */ while ( num_vifs-- > 0 ) - (void)create_net_vif(dom); + (void)create_net_vif(0); #ifndef NO_DEVICES_IN_XEN /* DOM0 gets access to all real block devices. */ diff --git a/xen/drivers/Makefile b/xen/drivers/Makefile index 902add28e5..5aa8a48247 100644 --- a/xen/drivers/Makefile +++ b/xen/drivers/Makefile @@ -2,8 +2,8 @@ default: $(MAKE) -C char $(MAKE) -C pci - $(MAKE) -C net if [ "$(nodev)" != "y" ]; then \ + $(MAKE) -C net ; \ $(MAKE) -C block ; \ $(MAKE) -C cdrom ; \ $(MAKE) -C ide ; \ diff --git a/xen/include/xen/vif.h b/xen/include/xen/vif.h index 71e3a3d2ea..63469ece65 100644 --- a/xen/include/xen/vif.h +++ b/xen/include/xen/vif.h @@ -95,12 +95,19 @@ do { \ } while (0) \ /* vif prototypes */ +#ifndef NO_DEVICES_IN_XEN net_vif_t *create_net_vif(domid_t dom); void destroy_net_vif(net_vif_t *vif); void unlink_net_vif(net_vif_t *vif); net_vif_t *net_get_target_vif(u8 *data, unsigned int len, net_vif_t *src_vif); net_vif_t *find_net_vif(domid_t dom, unsigned int idx); void delete_all_domain_vfr_rules(struct task_struct *p); +#else +#define create_net_vif(_d) ((void)0) +#define destroy_net_vif(_v) ((void)0) +#define unlink_net_vif(_v) ((void)0) +#define delete_all_domain_vfr_rules(_p) ((void)0) +#endif /* * Return values from net_get_target_vif: |