ia64/xen-unstable

changeset 18938:b33b745cd5ec

Fix mini-os ia64 compilation

- Avoid nested function to avoid a trampoline.
- Do not link mini-os_app.o when it is empty.

Signed-off-by: Samuel Thibault <samuel.thibault@ens-lyon.org>
author Keir Fraser <keir.fraser@citrix.com>
date Thu Dec 18 11:27:37 2008 +0000 (2008-12-18)
parents 22e3666ee483
children c2dad16819b5
files extras/mini-os/Makefile extras/mini-os/kernel.c
line diff
     1.1 --- a/extras/mini-os/Makefile	Wed Dec 17 11:36:22 2008 +0000
     1.2 +++ b/extras/mini-os/Makefile	Thu Dec 18 11:27:37 2008 +0000
     1.3 @@ -93,8 +93,12 @@ endif
     1.4  $(OBJ_DIR)/$(TARGET)_app.o: $(APP_OBJS) app.lds
     1.5  	$(LD) -r -d $(LDFLAGS) -\( $^ -\) $(APP_LDLIBS) --undefined main -o $@
     1.6  
     1.7 -$(OBJ_DIR)/$(TARGET): links $(OBJS) $(OBJ_DIR)/$(TARGET)_app.o arch_lib
     1.8 -	$(LD) -r $(LDFLAGS) $(HEAD_OBJ) $(OBJ_DIR)/$(TARGET)_app.o $(OBJS) $(LDARCHLIB) $(LDLIBS) -o $@.o
     1.9 +ifneq ($(APP_OBJS),)
    1.10 +APP_O=$(OBJ_DIR)/$(TARGET)_app.o 
    1.11 +endif
    1.12 +
    1.13 +$(OBJ_DIR)/$(TARGET): links $(OBJS) $(APP_O) arch_lib
    1.14 +	$(LD) -r $(LDFLAGS) $(HEAD_OBJ) $(APP_O) $(OBJS) $(LDARCHLIB) $(LDLIBS) -o $@.o
    1.15  	$(OBJCOPY) -w -G $(GLOBAL_PREFIX)* -G _start $@.o $@.o
    1.16  	$(LD) $(LDFLAGS) $(LDFLAGS_FINAL) $@.o $(EXTRA_OBJS) -o $@
    1.17  	gzip -f -9 -c $@ >$@.gz
     2.1 --- a/extras/mini-os/kernel.c	Wed Dec 17 11:36:22 2008 +0000
     2.2 +++ b/extras/mini-os/kernel.c	Thu Dec 18 11:27:37 2008 +0000
     2.3 @@ -434,25 +434,25 @@ static void kbdfront_thread(void *p)
     2.4  
     2.5  static struct pcifront_dev *pci_dev;
     2.6  
     2.7 +static void print_pcidev(unsigned int domain, unsigned int bus, unsigned int slot, unsigned int fun)
     2.8 +{
     2.9 +    unsigned int vendor, device, rev, class;
    2.10 +
    2.11 +    pcifront_conf_read(pci_dev, domain, bus, slot, fun, 0x00, 2, &vendor);
    2.12 +    pcifront_conf_read(pci_dev, domain, bus, slot, fun, 0x02, 2, &device);
    2.13 +    pcifront_conf_read(pci_dev, domain, bus, slot, fun, 0x08, 1, &rev);
    2.14 +    pcifront_conf_read(pci_dev, domain, bus, slot, fun, 0x0a, 2, &class);
    2.15 +
    2.16 +    printk("%04x:%02x:%02x.%02x %04x: %04x:%04x (rev %02x)\n", domain, bus, slot, fun, class, vendor, device, rev);
    2.17 +}
    2.18 +
    2.19  static void pcifront_thread(void *p)
    2.20  {
    2.21 -    void print(unsigned int domain, unsigned int bus, unsigned int slot, unsigned int fun)
    2.22 -    {
    2.23 -        unsigned int vendor, device, rev, class;
    2.24 -
    2.25 -        pcifront_conf_read(pci_dev, domain, bus, slot, fun, 0x00, 2, &vendor);
    2.26 -        pcifront_conf_read(pci_dev, domain, bus, slot, fun, 0x02, 2, &device);
    2.27 -        pcifront_conf_read(pci_dev, domain, bus, slot, fun, 0x08, 1, &rev);
    2.28 -        pcifront_conf_read(pci_dev, domain, bus, slot, fun, 0x0a, 2, &class);
    2.29 -
    2.30 -        printk("%04x:%02x:%02x.%02x %04x: %04x:%04x (rev %02x)\n", domain, bus, slot, fun, class, vendor, device, rev);
    2.31 -    }
    2.32 -
    2.33      pci_dev = init_pcifront(NULL);
    2.34      if (!pci_dev)
    2.35          return;
    2.36      printk("PCI devices:\n");
    2.37 -    pcifront_scan(pci_dev, print);
    2.38 +    pcifront_scan(pci_dev, print_pcidev);
    2.39  }
    2.40  
    2.41  static void fs_thread(void *p)