From: Keir Fraser Date: Thu, 18 Dec 2008 11:27:37 +0000 (+0000) Subject: Fix mini-os ia64 compilation X-Git-Tag: xen-3.4.0-rc1~8 X-Git-Url: http://xenbits.xensource.com/gitweb?a=commitdiff_plain;h=675163e05aecd16ba964c2573914270ab238ea45;p=people%2Fliuw%2Fmini-os.git 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 --- diff --git a/Makefile b/Makefile index ec24cba..78e0c9d 100644 --- a/Makefile +++ b/Makefile @@ -93,8 +93,12 @@ endif $(OBJ_DIR)/$(TARGET)_app.o: $(APP_OBJS) app.lds $(LD) -r -d $(LDFLAGS) -\( $^ -\) $(APP_LDLIBS) --undefined main -o $@ -$(OBJ_DIR)/$(TARGET): links $(OBJS) $(OBJ_DIR)/$(TARGET)_app.o arch_lib - $(LD) -r $(LDFLAGS) $(HEAD_OBJ) $(OBJ_DIR)/$(TARGET)_app.o $(OBJS) $(LDARCHLIB) $(LDLIBS) -o $@.o +ifneq ($(APP_OBJS),) +APP_O=$(OBJ_DIR)/$(TARGET)_app.o +endif + +$(OBJ_DIR)/$(TARGET): links $(OBJS) $(APP_O) arch_lib + $(LD) -r $(LDFLAGS) $(HEAD_OBJ) $(APP_O) $(OBJS) $(LDARCHLIB) $(LDLIBS) -o $@.o $(OBJCOPY) -w -G $(GLOBAL_PREFIX)* -G _start $@.o $@.o $(LD) $(LDFLAGS) $(LDFLAGS_FINAL) $@.o $(EXTRA_OBJS) -o $@ gzip -f -9 -c $@ >$@.gz diff --git a/kernel.c b/kernel.c index 877168c..ba27e64 100644 --- a/kernel.c +++ b/kernel.c @@ -434,25 +434,25 @@ static void kbdfront_thread(void *p) static struct pcifront_dev *pci_dev; -static void pcifront_thread(void *p) +static void print_pcidev(unsigned int domain, unsigned int bus, unsigned int slot, unsigned int fun) { - void print(unsigned int domain, unsigned int bus, unsigned int slot, unsigned int fun) - { - unsigned int vendor, device, rev, class; + unsigned int vendor, device, rev, class; - pcifront_conf_read(pci_dev, domain, bus, slot, fun, 0x00, 2, &vendor); - pcifront_conf_read(pci_dev, domain, bus, slot, fun, 0x02, 2, &device); - pcifront_conf_read(pci_dev, domain, bus, slot, fun, 0x08, 1, &rev); - pcifront_conf_read(pci_dev, domain, bus, slot, fun, 0x0a, 2, &class); + pcifront_conf_read(pci_dev, domain, bus, slot, fun, 0x00, 2, &vendor); + pcifront_conf_read(pci_dev, domain, bus, slot, fun, 0x02, 2, &device); + pcifront_conf_read(pci_dev, domain, bus, slot, fun, 0x08, 1, &rev); + pcifront_conf_read(pci_dev, domain, bus, slot, fun, 0x0a, 2, &class); - printk("%04x:%02x:%02x.%02x %04x: %04x:%04x (rev %02x)\n", domain, bus, slot, fun, class, vendor, device, rev); - } + printk("%04x:%02x:%02x.%02x %04x: %04x:%04x (rev %02x)\n", domain, bus, slot, fun, class, vendor, device, rev); +} +static void pcifront_thread(void *p) +{ pci_dev = init_pcifront(NULL); if (!pci_dev) return; printk("PCI devices:\n"); - pcifront_scan(pci_dev, print); + pcifront_scan(pci_dev, print_pcidev); } static void fs_thread(void *p)