diff options
author | H. Peter Anvin <hpa@zytor.com> | 2009-04-16 11:04:52 -0700 |
---|---|---|
committer | H. Peter Anvin <hpa@zytor.com> | 2009-04-16 11:04:52 -0700 |
commit | 2a37f9de661d6bad79c5cc8fb13dbf63a27cf863 (patch) | |
tree | 23d91b4cc15f50d6d795effd7c710b2fd0569869 | |
parent | 7f3b680fe2af99969da04c8fdd14966fdd1ce9f6 (diff) | |
parent | 9dfb9e7bec36c83a371ca9a3066a6711b5f698ba (diff) | |
download | syslinux-2a37f9de661d6bad79c5cc8fb13dbf63a27cf863.tar.gz |
Merge branch 'syslinux-3.7x'
-rw-r--r-- | NEWS | 4 | ||||
-rw-r--r-- | com32/hdt/hdt-menu-pci.c | 2 | ||||
-rw-r--r-- | com32/lib/pci/scan.c | 30 | ||||
-rw-r--r-- | com32/menu/menu.h | 6 | ||||
-rw-r--r-- | com32/menu/menumain.c | 2 | ||||
-rw-r--r-- | com32/menu/readconfig.c | 18 | ||||
-rw-r--r-- | com32/rosh/Makefile | 2 | ||||
-rw-r--r-- | doc/menu.txt | 8 | ||||
-rw-r--r-- | doc/syslinux.txt | 4 | ||||
-rw-r--r-- | gpxe/src/arch/i386/firmware/pcbios/e820mangler.S | 27 | ||||
-rw-r--r-- | gpxe/src/arch/i386/firmware/pcbios/fakee820.c | 5 | ||||
-rw-r--r-- | gpxe/src/arch/i386/interface/pxe/pxe_entry.S | 7 |
12 files changed, 70 insertions, 45 deletions
@@ -8,6 +8,10 @@ Changes in 3.75: * MEMDISK: correct the extraction of geometry information from the MBR of a hard disk image, again broken in 3.74. * extlinux(1) man page from Brian Pellin. + * Simple menu: MENU SAVE is now controllable on a menu-by-menu + or entry-by-entry basis. + * gPXELINUX: fix interrupt-disabling bug. + * HDT: fix lockup on machines with certain PCI configurations. Changes in 3.74: * New UI directive, which allows a more natural way to specify diff --git a/com32/hdt/hdt-menu-pci.c b/com32/hdt/hdt-menu-pci.c index 496d5ac1..74c07107 100644 --- a/com32/hdt/hdt-menu-pci.c +++ b/com32/hdt/hdt-menu-pci.c @@ -89,7 +89,7 @@ static void compute_pci_device(struct s_my_menu *menu, menu->items_count++; } - snprintf(buffer,sizeof buffer,"Latency : %d",pci_device->dev_info->latency); + snprintf(buffer, sizeof buffer, "Latency : %d",pci_device->dev_info->latency); snprintf(statbuffer,sizeof statbuffer,"Latency : %d",pci_device->dev_info->latency); add_item(buffer,statbuffer,OPT_INACTIVE,NULL,0); menu->items_count++; diff --git a/com32/lib/pci/scan.c b/com32/lib/pci/scan.c index 39f743b5..07794102 100644 --- a/com32/lib/pci/scan.c +++ b/com32/lib/pci/scan.c @@ -518,36 +518,24 @@ struct pci_domain *pci_scan(void) /* gathering additional configuration*/ void gather_additional_pci_config(struct pci_domain *domain) { - struct pci_bus *bus = NULL; - struct pci_slot *slot = NULL; - unsigned int nbus, ndev, nfunc, maxfunc; - pciaddr_t a; + struct pci_device *dev; + pciaddr_t pci_addr; int cfgtype; cfgtype = pci_set_config_type(PCI_CFG_AUTO); if (cfgtype == PCI_CFG_NONE) return; - for (nbus = 0; nbus < MAX_PCI_BUSES; nbus++) { - bus = NULL; - - for (ndev = 0; ndev < MAX_PCI_DEVICES; ndev++) { - maxfunc = 1; /* Assume a single-function device */ - slot = NULL; - - for (nfunc = 0; nfunc < maxfunc; nfunc++) { - a = pci_mkaddr(nbus, ndev, nfunc, 0); - struct pci_device *dev = domain->bus[nbus]->slot[ndev]->func[nfunc]; - if (! dev->dev_info) { + for_each_pci_func3(dev, domain,pci_addr) { + if (! dev->dev_info) { dev->dev_info = zalloc(sizeof *dev->dev_info); - if (!dev->dev_info) + if (!dev->dev_info) { return; + } } - dev->dev_info->irq = pci_readb(a + 0x3c); - dev->dev_info->latency = pci_readb(a + 0x0d); - } - } - } + dev->dev_info->irq = pci_readb(pci_addr + 0x3c); + dev->dev_info->latency = pci_readb(pci_addr + 0x0d); + } } diff --git a/com32/menu/menu.h b/com32/menu/menu.h index 43f65947..98b6fa9b 100644 --- a/com32/menu/menu.h +++ b/com32/menu/menu.h @@ -60,6 +60,7 @@ struct menu_entry { int entry; /* Entry number inside menu */ enum menu_action action; unsigned char hotkey; + bool save; /* Save this entry if selected */ }; static inline bool is_disabled(struct menu_entry *me) @@ -149,9 +150,11 @@ struct menu { int nentries; int nentries_space; int defentry; - int allowedit; int timeout; + bool allowedit; + bool save; /* MENU SAVE default for this menu */ + int curentry; int curtop; @@ -174,7 +177,6 @@ extern struct menu *root_menu, *start_menu, *hide_menu, *menu_list; /* These are global parameters regardless of which menu we're displaying */ extern int shiftkey; extern int hiddenmenu; -extern bool menusave; extern long long totaltimeout; void parse_configs(char **argv); diff --git a/com32/menu/menumain.c b/com32/menu/menumain.c index c3da97e4..b3131faf 100644 --- a/com32/menu/menumain.c +++ b/com32/menu/menumain.c @@ -879,7 +879,7 @@ run_menu(void) } if (done && !me->passwd) { /* Only save a new default if we don't have a password... */ - if (menusave && me->label) { + if (me->save && me->label) { syslinux_setadv(ADV_MENUSAVE, strlen(me->label), me->label); syslinux_adv_write(); } diff --git a/com32/menu/readconfig.c b/com32/menu/readconfig.c index 768591d9..376d8181 100644 --- a/com32/menu/readconfig.c +++ b/com32/menu/readconfig.c @@ -35,11 +35,11 @@ struct menu *root_menu, *start_menu, *hide_menu, *menu_list; int shiftkey = 0; /* Only display menu if shift key pressed */ int hiddenmenu = 0; long long totaltimeout = 0; -bool menusave = false; /* Keep track of global default */ static int has_ui = 0; /* DEFAULT only counts if UI is found */ static const char *globaldefault = NULL; +static bool menusave = false; /* True if there is any "menu save" */ /* Linked list of all entires, hidden or not; used by unlabel() */ static struct menu_entry *all_entries; @@ -174,6 +174,7 @@ static struct menu * new_menu(struct menu *parent, m->allowedit = parent->allowedit; m->timeout = parent->timeout; + m->save = parent->save; m->ontimeout = refstr_get(parent->ontimeout); m->onerror = refstr_get(parent->onerror); @@ -193,7 +194,7 @@ static struct menu * new_menu(struct menu *parent, for (i = 0; i < NPARAMS; i++) m->mparm[i] = mparm[i].value; - m->allowedit = 1; /* Allow edits of the command line */ + m->allowedit = true; /* Allow edits of the command line */ m->color_table = default_color_table(); } @@ -219,6 +220,7 @@ struct labeldata { unsigned int menudisabled; unsigned int menuindent; enum menu_action action; + int save; struct menu *submenu; }; @@ -305,6 +307,7 @@ record(struct menu *m, struct labeldata *ld, const char *append) me->helptext = ld->helptext; me->hotkey = 0; me->action = ld->action ? ld->action : MA_CMD; + me->save = ld->save ? (ld->save > 0) : m->save; if ( ld->menuindent ) { const char *dn; @@ -673,6 +676,15 @@ static void parse_config_file(FILE *f) shiftkey = 1; } else if ( looking_at(p, "save") ) { menusave = true; + if (ld.label) + ld.save = 1; + else + m->save = true; + } else if ( looking_at(p, "nosave") ) { + if (ld.label) + ld.save = -1; + else + m->save = false; } else if ( looking_at(p, "onerror") ) { refstr_put(m->onerror); m->onerror = refstrdup(skipspace(p+7)); @@ -938,7 +950,7 @@ static void parse_config_file(FILE *f) } else if ( looking_at(p, "ontimeout") ) { m->ontimeout = refstrdup(skipspace(p+9)); } else if ( looking_at(p, "allowoptions") ) { - m->allowedit = atoi(skipspace(p+12)); + m->allowedit = !!atoi(skipspace(p+12)); } else if ( looking_at(p, "ipappend") ) { if (ld.label) ld.ipappend = atoi(skipspace(p+8)); diff --git a/com32/rosh/Makefile b/com32/rosh/Makefile index 3895cd89..7bf5059c 100644 --- a/com32/rosh/Makefile +++ b/com32/rosh/Makefile @@ -21,7 +21,7 @@ rosh.o: rosh.h rosh.lo: rosh.h -all: rosh.lnx rosh.c32 +all: rosh.c32 tidy dist: rm -f *.o *.lo *.a *.lst *.elf .*.d *.tmp diff --git a/doc/menu.txt b/doc/menu.txt index 72bc9dca..97e172fc 100644 --- a/doc/menu.txt +++ b/doc/menu.txt @@ -276,6 +276,7 @@ DEFAULT label MENU SAVE +MENU NOSAVE Remember the last entry selected and make that the default for the next boot. A password-protected menu entry is *not* @@ -289,7 +290,12 @@ MENU SAVE file gracefully. The MENU SAVE information can be cleared with - "extlinux --reset-adv". + "extlinux --reset-adv <bootdir>". + + A MENU SAVE or MENU NOSAVE at the top of a (sub)menu affects + all entries underneath that (sub)menu except those that in + turn have MENU SAVE or MENU NOSAVE declared. This can be used + to only save certain entires when selected. INCLUDE filename [tagname] diff --git a/doc/syslinux.txt b/doc/syslinux.txt index 72f38d34..94141415 100644 --- a/doc/syslinux.txt +++ b/doc/syslinux.txt @@ -2,7 +2,7 @@ A suite of bootloaders for Linux - Copyright 1994-2008 H. Peter Anvin - All Rights Reserved + Copyright 1994-2009 H. Peter Anvin and contributors This program is provided under the terms of the GNU General Public License, version 2 or, at your option, any later version. There is no @@ -271,7 +271,7 @@ LABEL label This is mostly useful for initramfs, which can be composed of multiple separate cpio or cpio.gz archives. Note: all files except the last one are zero-padded to a - 4K page boundary. This should not affect initramfs.) + 4K page boundary. This should not affect initramfs. IMPLICIT flag_val If flag_val is 0, do not load a kernel image unless it has been diff --git a/gpxe/src/arch/i386/firmware/pcbios/e820mangler.S b/gpxe/src/arch/i386/firmware/pcbios/e820mangler.S index 4ba3fb14..decb0835 100644 --- a/gpxe/src/arch/i386/firmware/pcbios/e820mangler.S +++ b/gpxe/src/arch/i386/firmware/pcbios/e820mangler.S @@ -490,6 +490,18 @@ get_mangled_e820: .size get_mangled_e820, . - get_mangled_e820 /**************************************************************************** + * Set/clear CF on the stack as appropriate, assumes stack is as it should + * be immediately before IRET + **************************************************************************** + */ +patch_cf: + pushw %bp + movw %sp, %bp + setc 8(%bp) /* Set/reset CF; clears PF, AF, ZF, SF */ + popw %bp + ret + +/**************************************************************************** * INT 15,e820 handler **************************************************************************** */ @@ -500,7 +512,8 @@ int15_e820: popw %ds call get_mangled_e820 popw %ds - lret $2 + call patch_cf + iret .size int15_e820, . - int15_e820 /**************************************************************************** @@ -512,7 +525,7 @@ int15_e801: /* Call previous handler */ pushfw lcall *%cs:int15_vector - pushfw + call patch_cf /* Edit result */ pushw %ds pushw %cs:rm_ds @@ -524,9 +537,7 @@ int15_e801: xchgw %ax, %cx xchgw %bx, %dx popw %ds - /* Restore flags returned by previous handler and return */ - popfw - lret $2 + iret .size int15_e801, . - int15_e801 /**************************************************************************** @@ -538,16 +549,14 @@ int15_88: /* Call previous handler */ pushfw lcall *%cs:int15_vector - pushfw + call patch_cf /* Edit result */ pushw %ds pushw %cs:rm_ds popw %ds call patch_1m popw %ds - /* Restore flags returned by previous handler and return */ - popfw - lret $2 + iret .size int15_88, . - int15_88 /**************************************************************************** diff --git a/gpxe/src/arch/i386/firmware/pcbios/fakee820.c b/gpxe/src/arch/i386/firmware/pcbios/fakee820.c index e171edfd..552bf41d 100644 --- a/gpxe/src/arch/i386/firmware/pcbios/fakee820.c +++ b/gpxe/src/arch/i386/firmware/pcbios/fakee820.c @@ -63,6 +63,8 @@ void fake_e820 ( void ) { "cmpl $0x534d4150, %%edx\n\t" "jne 99f\n\t" "pushaw\n\t" + "movw %%sp, %%bp\n\t" + "andb $~0x01, 22(%%bp)\n\t" /* Clear return CF */ "leaw e820map(%%bx), %%si\n\t" "cs rep movsb\n\t" "popaw\n\t" @@ -73,8 +75,7 @@ void fake_e820 ( void ) { "xorl %%ebx,%%ebx\n\t" "\n1:\n\t" "popfw\n\t" - "clc\n\t" - "lret $2\n\t" + "iret\n\t" "\n99:\n\t" "popfw\n\t" "ljmp *%%cs:real_int15_vector\n\t" ) diff --git a/gpxe/src/arch/i386/interface/pxe/pxe_entry.S b/gpxe/src/arch/i386/interface/pxe/pxe_entry.S index 22ef4181..0e8c8e2d 100644 --- a/gpxe/src/arch/i386/interface/pxe/pxe_entry.S +++ b/gpxe/src/arch/i386/interface/pxe/pxe_entry.S @@ -199,9 +199,12 @@ pxe_int_1a: shll $4, %edx addl $pxenv, %edx movw $0x564e, %ax + pushw %bp + movw %sp, %bp + andb $~0x01, 8(%bp) /* Clear CF on return */ + popw %bp popfw - clc - lret $2 + iret 1: /* INT 1A,other - pass through */ popfw ljmp *%cs:pxe_int_1a_vector |