ia64/xen-unstable

changeset 1245:7944940addb2

bitkeeper revision 1.825.3.6 (4064639dGSejbtZOrnsOB_IspAZ6kw)

blkdev.h, pci.c, Makefile, domain.c, setup.c, entry.S, Rules.mk:
Allow Xen to be built without device drivers using 'nodev=y make'.
author kaf24@scramble.cl.cam.ac.uk
date Fri Mar 26 17:08:45 2004 +0000 (2004-03-26)
parents 8a73ba812e21
children 0933e977b522
files xen/Rules.mk xen/arch/i386/entry.S xen/arch/i386/setup.c xen/common/domain.c xen/drivers/Makefile xen/drivers/pci/pci.c xen/include/xen/blkdev.h
line diff
     1.1 --- a/xen/Rules.mk	Fri Mar 26 16:07:48 2004 +0000
     1.2 +++ b/xen/Rules.mk	Fri Mar 26 17:08:45 2004 +0000
     1.3 @@ -1,6 +1,8 @@
     1.4  COMPILE_ARCH := $(shell uname -m | sed -e s/i.86/i386/)
     1.5  TARGET_ARCH  ?= $(COMPILE_ARCH)
     1.6  
     1.7 +nodev ?= n
     1.8 +
     1.9  TARGET  := $(BASEDIR)/xen
    1.10  HDRS    := $(wildcard $(BASEDIR)/include/xen/*.h)
    1.11  HDRS    += $(wildcard $(BASEDIR)/include/scsi/*.h)
    1.12 @@ -20,11 +22,13 @@ ALL_OBJS += $(BASEDIR)/net/network.o
    1.13  ALL_OBJS += $(BASEDIR)/drivers/char/driver.o
    1.14  ALL_OBJS += $(BASEDIR)/drivers/pci/driver.o
    1.15  ALL_OBJS += $(BASEDIR)/drivers/net/driver.o
    1.16 +ifneq ($(nodev),y)
    1.17  ALL_OBJS += $(BASEDIR)/drivers/block/driver.o
    1.18  ALL_OBJS += $(BASEDIR)/drivers/cdrom/driver.o
    1.19  ALL_OBJS += $(BASEDIR)/drivers/ide/driver.o
    1.20  ALL_OBJS += $(BASEDIR)/drivers/scsi/driver.o
    1.21  ALL_OBJS += $(BASEDIR)/drivers/message/fusion/driver.o
    1.22 +endif
    1.23  ALL_OBJS += $(BASEDIR)/arch/$(TARGET_ARCH)/arch.o
    1.24  
    1.25  HOSTCC     = gcc
    1.26 @@ -32,6 +36,11 @@ HOSTCFLAGS = -Wall -Wstrict-prototypes -
    1.27  
    1.28  include $(BASEDIR)/arch/$(TARGET_ARCH)/Rules.mk
    1.29  
    1.30 +ifeq ($(nodev),y)
    1.31 +CFLAGS += -DNO_DEVICES_IN_XEN
    1.32 +CFLAGS := $(subst -Werror,,$(CFLAGS))
    1.33 +endif
    1.34 +
    1.35  %.o: %.c $(HDRS) Makefile
    1.36  	$(CC) $(CFLAGS) -c $< -o $@
    1.37  
     2.1 --- a/xen/arch/i386/entry.S	Fri Mar 26 16:07:48 2004 +0000
     2.2 +++ b/xen/arch/i386/entry.S	Fri Mar 26 17:08:45 2004 +0000
     2.3 @@ -712,7 +712,11 @@ ENTRY(hypervisor_call_table)
     2.4          .long SYMBOL_NAME(do_sched_op)
     2.5          .long SYMBOL_NAME(do_dom0_op)
     2.6          .long SYMBOL_NAME(do_network_op)         /* 10 */
     2.7 +#ifndef NO_DEVICES_IN_XEN
     2.8          .long SYMBOL_NAME(do_block_io_op)
     2.9 +#else
    2.10 +        .long SYMBOL_NAME(do_ni_syscall)
    2.11 +#endif
    2.12          .long SYMBOL_NAME(do_set_debugreg)
    2.13          .long SYMBOL_NAME(do_get_debugreg)
    2.14          .long SYMBOL_NAME(do_update_descriptor)
     3.1 --- a/xen/arch/i386/setup.c	Fri Mar 26 16:07:48 2004 +0000
     3.2 +++ b/xen/arch/i386/setup.c	Fri Mar 26 17:08:45 2004 +0000
     3.3 @@ -420,7 +420,9 @@ void __init start_of_day(void)
     3.4      if ( !setup_network_devices() )
     3.5          panic("Must have a network device!\n");
     3.6      net_init();            /* initializes virtual network system. */
     3.7 +#ifndef NO_DEVICES_IN_XEN
     3.8      initialize_block_io(); /* setup block devices */
     3.9 +#endif
    3.10  
    3.11  #ifdef CONFIG_SMP
    3.12      wait_init_idle = cpu_online_map;
     4.1 --- a/xen/common/domain.c	Fri Mar 26 16:07:48 2004 +0000
     4.2 +++ b/xen/common/domain.c	Fri Mar 26 17:08:45 2004 +0000
     4.3 @@ -822,6 +822,7 @@ int setup_guestos(struct task_struct *p,
     4.4      write_cr3_counted(pagetable_val(current->mm.pagetable));
     4.5      __sti();
     4.6  
     4.7 +#ifndef NO_DEVICES_IN_XEN
     4.8      /* DOM0 gets access to all real block devices. */
     4.9  #define MAX_REAL_DISKS 256
    4.10      xd = kmalloc(MAX_REAL_DISKS * sizeof(xen_disk_t), GFP_KERNEL);
    4.11 @@ -843,6 +844,7 @@ int setup_guestos(struct task_struct *p,
    4.12              BUG();
    4.13      }
    4.14      kfree(xd);
    4.15 +#endif
    4.16  
    4.17      /* DOM0 gets access to everything. */
    4.18      physdev_init_dom0(p);
     5.1 --- a/xen/drivers/Makefile	Fri Mar 26 16:07:48 2004 +0000
     5.2 +++ b/xen/drivers/Makefile	Fri Mar 26 17:08:45 2004 +0000
     5.3 @@ -3,11 +3,13 @@ default:
     5.4  	$(MAKE) -C char
     5.5  	$(MAKE) -C pci
     5.6  	$(MAKE) -C net
     5.7 -	$(MAKE) -C block
     5.8 -	$(MAKE) -C cdrom
     5.9 -	$(MAKE) -C ide
    5.10 -	$(MAKE) -C scsi
    5.11 -	$(MAKE) -C message/fusion
    5.12 +	if [ "$(nodev)" != "y" ]; then \
    5.13 +	$(MAKE) -C block ; \
    5.14 +	$(MAKE) -C cdrom ; \
    5.15 +	$(MAKE) -C ide ; \
    5.16 +	$(MAKE) -C scsi ; \
    5.17 +	$(MAKE) -C message/fusion ; \
    5.18 +	fi
    5.19  
    5.20  clean:
    5.21  	$(MAKE) -C char clean
     6.1 --- a/xen/drivers/pci/pci.c	Fri Mar 26 16:07:48 2004 +0000
     6.2 +++ b/xen/drivers/pci/pci.c	Fri Mar 26 17:08:45 2004 +0000
     6.3 @@ -656,6 +656,7 @@ out:
     6.4  int
     6.5  pci_register_driver(struct pci_driver *drv)
     6.6  {
     6.7 +#ifndef NO_DEVICES_IN_XEN
     6.8  	struct pci_dev *dev;
     6.9  	int count = 0;
    6.10  
    6.11 @@ -665,6 +666,9 @@ pci_register_driver(struct pci_driver *d
    6.12  			count += pci_announce_device(drv, dev);
    6.13  	}
    6.14  	return count;
    6.15 +#else
    6.16 +	return 0;
    6.17 +#endif
    6.18  }
    6.19  
    6.20  /**
    6.21 @@ -680,6 +684,7 @@ pci_register_driver(struct pci_driver *d
    6.22  void
    6.23  pci_unregister_driver(struct pci_driver *drv)
    6.24  {
    6.25 +#ifndef NO_DEVICES_IN_XEN
    6.26  	struct pci_dev *dev;
    6.27  
    6.28  	list_del(&drv->node);
    6.29 @@ -690,6 +695,7 @@ pci_unregister_driver(struct pci_driver 
    6.30  			dev->driver = NULL;
    6.31  		}
    6.32  	}
    6.33 +#endif
    6.34  }
    6.35  
    6.36  #ifdef CONFIG_HOTPLUG
     7.1 --- a/xen/include/xen/blkdev.h	Fri Mar 26 16:07:48 2004 +0000
     7.2 +++ b/xen/include/xen/blkdev.h	Fri Mar 26 17:08:45 2004 +0000
     7.3 @@ -26,9 +26,15 @@ typedef struct {
     7.4  
     7.5  extern kdev_t xendev_to_physdev(unsigned short xendev);
     7.6  
     7.7 +#ifndef NO_DEVICES_IN_XEN
     7.8  extern void init_blkdev_info(struct task_struct *);
     7.9  extern void unlink_blkdev_info(struct task_struct *);
    7.10  extern void destroy_blkdev_info(struct task_struct *);
    7.11 +#else
    7.12 +#define init_blkdev_info(_p)    ((void)0)
    7.13 +#define unlink_blkdev_info(_p)  ((void)0)
    7.14 +#define destroy_blkdev_info(_p) ((void)0)
    7.15 +#endif
    7.16  
    7.17  extern int unregister_blkdev(unsigned int, const char *);
    7.18  extern int invalidate_device(kdev_t, int);