## Automatically generated incremental diff ## From: linux-2.5.70-bk7 ## To: linux-2.5.70-bk8 ## Robot: $Id: make-incremental-diff,v 1.11 2002/02/20 02:59:33 hpa Exp $ diff -urN linux-2.5.70-bk7/Documentation/filesystems/proc.txt linux-2.5.70-bk8/Documentation/filesystems/proc.txt --- linux-2.5.70-bk7/Documentation/filesystems/proc.txt 2003-05-26 18:00:27.000000000 -0700 +++ linux-2.5.70-bk8/Documentation/filesystems/proc.txt 2003-06-03 04:38:35.000000000 -0700 @@ -1068,6 +1068,8 @@ out to disk. This tunable expresses the interval between those wakeups, in 100'ths of a second. +Setting this to zero disables periodic writeback altogether. + dirty_expire_centisecs ---------------------- diff -urN linux-2.5.70-bk7/Documentation/kbuild/kconfig-language.txt linux-2.5.70-bk8/Documentation/kbuild/kconfig-language.txt --- linux-2.5.70-bk7/Documentation/kbuild/kconfig-language.txt 2003-05-26 18:00:37.000000000 -0700 +++ linux-2.5.70-bk8/Documentation/kbuild/kconfig-language.txt 2003-06-03 04:38:35.000000000 -0700 @@ -18,7 +18,7 @@ +- ... Every entry has its own dependencies. These dependencies are used -to determine the visible of an entry. Any child entry is only +to determine the visibility of an entry. Any child entry is only visible if its parent entry is also visible. Menu entries @@ -50,7 +50,7 @@ - type definition: "bool"/"tristate"/"string"/"hex"/"integer" Every config option must have a type. There are only two basic types: - tristate and string, the other types base on these two. The type + tristate and string, the other types are based on these two. The type definition optionally accepts an input prompt, so these two examples are equivalent: @@ -64,7 +64,7 @@ to the user. Optionally dependencies only for this prompt can be added with "if". -- default value: "default" ["if" ] +- default value: "default" ["if" ] A config option can have any number of default values. If multiple default values are visible, only the first defined one is active. Default values are not limited to the menu entry, where they are @@ -81,7 +81,7 @@ This defines a dependency for this menu entry. If multiple dependencies are defined they are connected with '&&'. Dependencies are applied to all other options within this menu entry (which also - accept "if" expression), so these two examples are equivalent: + accept an "if" expression), so these two examples are equivalent: bool "foo" if BAR default y if BAR @@ -90,9 +90,24 @@ bool "foo" default y +- reverse dependencies: "select" ["if" ] + While normal dependencies reduce the upper limit of a symbol (see + below), reverse dependencies can be used to force a lower limit of + another symbol. The value of the current menu symbol is used as the + minimal value can be set to. If is selected multiple + times, the limit is set to the largest selection. + Reverse dependencies can only be used with boolean or tristate + symbols. + +- numerical ranges: "range" ["if" ] + This allows to limit the range of possible input values for integer + and hex symbols. The user can only input a value which is larger than + or equal to the first symbol and smaller than or equal to the second + symbol. + - help text: "help" This defines a help text. The end of the help text is determined by - the level indentation, this means it ends at the first line which has + the indentation level, this means it ends at the first line which has a smaller indentation than the first line of the help text. @@ -123,14 +138,14 @@ otherwise 'y'. (4) Returns the value of the expression. Used to override precedence. (5) Returns the result of (2-/expr/). -(6) Returns the result of min(/expr/, /expr/). -(7) Returns the result of max(/expr/, /expr/). +(6) Returns the result of max(/expr/, /expr/). +(7) Returns the result of min(/expr/, /expr/). An expression can have a value of 'n', 'm' or 'y' (or 0, 1, 2 respectively for calculations). A menu entry becomes visible when it's expression evaluates to 'm' or 'y'. -There are two type of symbols: constant and nonconstant symbols. +There are two types of symbols: constant and nonconstant symbols. Nonconstant symbols are the most common ones and are defined with the 'config' statement. Nonconstant symbols consist entirely of alphanumeric characters or underscores. @@ -159,8 +174,8 @@ The other way to generate the menu structure is done by analyzing the dependencies. If a menu entry somehow depends on the previous entry, it -can be made a submenu of it. First the the previous (parent) symbol must -be part of the dependency list and then one of these two condititions +can be made a submenu of it. First, the previous (parent) symbol must +be part of the dependency list and then one of these two conditions must be true: - the child entry must become invisible, if the parent is set to 'n' - the child entry must only be visible, if the parent is visible @@ -177,7 +192,7 @@ MODVERSIONS directly depends on MODULES, this means it's only visible if MODULES is different from 'n'. The comment on the other hand is always -visible when MODULES it's visible (the (empty) dependency of MODULES is +visible when MODULES is visible (the (empty) dependency of MODULES is also part of the comment dependencies). @@ -188,12 +203,13 @@ line starts with a keyword (except help texts). The following keywords end a menu entry: - config +- menuconfig - choice/endchoice - comment - menu/endmenu - if/endif - source -The first four also start the definition of a menu entry. +The first five also start the definition of a menu entry. config: @@ -203,6 +219,14 @@ This defines a config symbol and accepts any of above attributes as options. +menuconfig: + "menuconfig" + + +This is similiar to the simple config entry above, but it also gives a +hint to front ends, that all suboptions should be displayed as a +separate list of options. + choices: "choice" diff -urN linux-2.5.70-bk7/Makefile linux-2.5.70-bk8/Makefile --- linux-2.5.70-bk7/Makefile 2003-06-03 04:38:30.000000000 -0700 +++ linux-2.5.70-bk8/Makefile 2003-06-03 04:38:35.000000000 -0700 @@ -1,7 +1,7 @@ VERSION = 2 PATCHLEVEL = 5 SUBLEVEL = 70 -EXTRAVERSION = -bk7 +EXTRAVERSION = -bk8 # *DOCUMENTATION* # To see a list of typical targets execute "make help" diff -urN linux-2.5.70-bk7/arch/i386/kernel/io_apic.c linux-2.5.70-bk8/arch/i386/kernel/io_apic.c --- linux-2.5.70-bk7/arch/i386/kernel/io_apic.c 2003-06-03 04:38:30.000000000 -0700 +++ linux-2.5.70-bk8/arch/i386/kernel/io_apic.c 2003-06-03 04:38:35.000000000 -0700 @@ -352,16 +352,8 @@ unsigned long allowed_mask; unsigned int new_cpu; - if (irqbalance_disabled == IRQBALANCE_CHECK_ARCH) - irqbalance_disabled = NO_BALANCE_IRQ; - if (irqbalance_disabled) { - static int warned; - if (warned == 0) { - printk("irqbalance disabled\n"); - warned = 1; - } + if (irqbalance_disabled) return; - } allowed_mask = cpu_online_map & irq_affinity[irq]; new_cpu = move(cpu, allowed_mask, now, 1); @@ -620,6 +612,9 @@ struct cpuinfo_x86 *c; c = &boot_cpu_data; + /* When not overwritten by the command line ask subarchitecture. */ + if (irqbalance_disabled == IRQBALANCE_CHECK_ARCH) + irqbalance_disabled = NO_BALANCE_IRQ; if (irqbalance_disabled) return 0; diff -urN linux-2.5.70-bk7/arch/i386/mach-generic/default.c linux-2.5.70-bk8/arch/i386/mach-generic/default.c --- linux-2.5.70-bk7/arch/i386/mach-generic/default.c 2003-05-26 18:00:21.000000000 -0700 +++ linux-2.5.70-bk8/arch/i386/mach-generic/default.c 2003-06-03 04:38:35.000000000 -0700 @@ -2,6 +2,7 @@ * Default generic APIC driver. This handles upto 8 CPUs. */ #define APIC_DEFINITION 1 +#include #include #include #include @@ -10,7 +11,6 @@ #include #include #include -#include #include #include diff -urN linux-2.5.70-bk7/arch/ia64/mm/init.c linux-2.5.70-bk8/arch/ia64/mm/init.c --- linux-2.5.70-bk7/arch/ia64/mm/init.c 2003-05-26 18:00:39.000000000 -0700 +++ linux-2.5.70-bk8/arch/ia64/mm/init.c 2003-06-03 04:38:35.000000000 -0700 @@ -32,7 +32,7 @@ struct mmu_gather mmu_gathers[NR_CPUS]; /* References to section boundaries: */ -extern char _stext, _etext, _edata, __init_begin, __init_end; +extern char _stext, _etext, _edata, __init_begin, __init_end, _end; extern void ia64_tlb_init (void); @@ -583,6 +583,7 @@ long reserved_pages, codesize, datasize, initsize; unsigned long num_pgt_pages; pg_data_t *pgdat; + static struct kcore_list kcore_mem, kcore_vmem, kcore_kernel; #ifdef CONFIG_PCI /* @@ -601,6 +602,10 @@ high_memory = __va(max_low_pfn * PAGE_SIZE); + kclist_add(&kcore_mem, __va(0), max_low_pfn * PAGE_SIZE); + kclist_add(&kcore_vmem, (void *)VMALLOC_START, VMALLOC_END-VMALLOC_START); + kclist_add(&kcore_kernel, &_stext, &_end - &_stext); + for_each_pgdat(pgdat) totalram_pages += free_all_bootmem_node(pgdat); diff -urN linux-2.5.70-bk7/arch/sparc64/defconfig linux-2.5.70-bk8/arch/sparc64/defconfig --- linux-2.5.70-bk7/arch/sparc64/defconfig 2003-05-26 18:00:37.000000000 -0700 +++ linux-2.5.70-bk8/arch/sparc64/defconfig 2003-06-03 04:38:35.000000000 -0700 @@ -16,6 +16,9 @@ # CONFIG_BSD_PROCESS_ACCT is not set CONFIG_SYSCTL=y CONFIG_LOG_BUF_SHIFT=15 +# CONFIG_EMBEDDED is not set +CONFIG_FUTEX=y +CONFIG_EPOLL=y # # Loadable module support @@ -795,6 +798,7 @@ # CONFIG_WINBOND_FIR is not set # CONFIG_TOSHIBA_OLD is not set # CONFIG_TOSHIBA_FIR is not set +# CONFIG_SMC_IRCC_OLD is not set # CONFIG_SMC_IRCC_FIR is not set # CONFIG_ALI_FIR is not set # CONFIG_VLSI_FIR is not set @@ -959,6 +963,8 @@ CONFIG_PROC_FS=y # CONFIG_DEVFS_FS is not set CONFIG_DEVPTS_FS=y +CONFIG_DEVPTS_FS_XATTR=y +# CONFIG_DEVPTS_FS_SECURITY is not set # CONFIG_TMPFS is not set CONFIG_RAMFS=y @@ -1111,6 +1117,7 @@ CONFIG_SND_INTEL8X0=m CONFIG_SND_SONICVIBES=m # CONFIG_SND_VIA82XX is not set +CONFIG_SND_VX222=m # # ALSA USB devices diff -urN linux-2.5.70-bk7/drivers/block/acsi.c linux-2.5.70-bk8/drivers/block/acsi.c --- linux-2.5.70-bk7/drivers/block/acsi.c 2003-05-26 18:01:00.000000000 -0700 +++ linux-2.5.70-bk8/drivers/block/acsi.c 2003-06-03 04:38:35.000000000 -0700 @@ -1728,10 +1728,8 @@ sprintf(disk->disk_name, "ad%c", 'a'+i); disk->major = ACSI_MAJOR; disk->first_minor = i << 4; - if (acsi_info[i].type != HARDDISK) { - disk->minor_shift = 0; + if (acsi_info[i].type != HARDDISK) disk->minors = 1; - } disk->fops = &acsi_fops; disk->private_data = &acsi_info[i]; set_capacity(disk, acsi_info[i].size); diff -urN linux-2.5.70-bk7/drivers/block/genhd.c linux-2.5.70-bk8/drivers/block/genhd.c --- linux-2.5.70-bk7/drivers/block/genhd.c 2003-05-26 18:00:39.000000000 -0700 +++ linux-2.5.70-bk8/drivers/block/genhd.c 2003-06-03 04:38:35.000000000 -0700 @@ -538,8 +538,6 @@ memset(disk->part, 0, size); } disk->minors = minors; - while (minors >>= 1) - disk->minor_shift++; kobj_set_kset_s(disk,block_subsys); kobject_init(&disk->kobj); rand_initialize_disk(disk); diff -urN linux-2.5.70-bk7/drivers/ide/ide-cd.c linux-2.5.70-bk8/drivers/ide/ide-cd.c --- linux-2.5.70-bk7/drivers/ide/ide-cd.c 2003-06-03 04:38:30.000000000 -0700 +++ linux-2.5.70-bk8/drivers/ide/ide-cd.c 2003-06-03 04:38:35.000000000 -0700 @@ -3376,7 +3376,6 @@ drive->driver_data = info; DRIVER(drive)->busy++; g->minors = 1; - g->minor_shift = 0; snprintf(g->devfs_name, sizeof(g->devfs_name), "%s/cd", drive->devfs_name); g->driverfs_dev = &drive->gendev; diff -urN linux-2.5.70-bk7/drivers/ide/ide-disk.c linux-2.5.70-bk8/drivers/ide/ide-disk.c --- linux-2.5.70-bk7/drivers/ide/ide-disk.c 2003-05-26 18:00:38.000000000 -0700 +++ linux-2.5.70-bk8/drivers/ide/ide-disk.c 2003-06-03 04:38:35.000000000 -0700 @@ -1814,7 +1814,6 @@ } DRIVER(drive)->busy--; g->minors = 1 << PARTN_BITS; - g->minor_shift = PARTN_BITS; strcpy(g->devfs_name, drive->devfs_name); g->driverfs_dev = &drive->gendev; g->flags = drive->removable ? GENHD_FL_REMOVABLE : 0; diff -urN linux-2.5.70-bk7/drivers/ide/ide-floppy.c linux-2.5.70-bk8/drivers/ide/ide-floppy.c --- linux-2.5.70-bk7/drivers/ide/ide-floppy.c 2003-05-26 18:00:40.000000000 -0700 +++ linux-2.5.70-bk8/drivers/ide/ide-floppy.c 2003-06-03 04:38:35.000000000 -0700 @@ -2057,7 +2057,6 @@ idefloppy_setup (drive, floppy); DRIVER(drive)->busy--; g->minors = 1 << PARTN_BITS; - g->minor_shift = PARTN_BITS; g->driverfs_dev = &drive->gendev; strcpy(g->devfs_name, drive->devfs_name); g->flags = drive->removable ? GENHD_FL_REMOVABLE : 0; diff -urN linux-2.5.70-bk7/drivers/ieee1394/eth1394.c linux-2.5.70-bk8/drivers/ieee1394/eth1394.c --- linux-2.5.70-bk7/drivers/ieee1394/eth1394.c 2003-06-03 04:38:30.000000000 -0700 +++ linux-2.5.70-bk8/drivers/ieee1394/eth1394.c 2003-06-03 04:38:35.000000000 -0700 @@ -29,12 +29,11 @@ * * TODO: * RFC 2734 related: - * - Add support for broadcast messages - * - Use EUI instead of node id in internal ARP tables * - Add Config ROM entry * - Add MCAP and multicast * * Non-RFC 2734 related: + * - Fix bug related to fragmented broadcast datagrams * - Move generic GASP reception to core 1394 code * - Convert kmalloc/kfree for link fragments to use kmem_cache_* instead * - Stability improvements @@ -73,6 +72,7 @@ #include "ieee1394.h" #include "highlevel.h" #include "iso.h" +#include "nodemgr.h" #include "eth1394.h" #define ETH1394_PRINT_G(level, fmt, args...) \ @@ -86,7 +86,7 @@ #define TRACE() printk(KERN_ERR "eth1394:%s[%d] ---- TRACE\n", __FUNCTION__, __LINE__) static char version[] __devinitdata = - "$Rev: 938 $ Ben Collins "; + "$Rev: 945 $ Ben Collins "; struct fragment_info { struct list_head list; @@ -119,22 +119,39 @@ sizeof (struct eth1394_sf_hdr) }; +static const u16 eth1394_speedto_maxpayload[] = { +/* S100, S200, S400, S800, S1600, S3200 */ + 512, 1024, 2048, 4096, 8192, 16384 +}; + MODULE_AUTHOR("Ben Collins (bcollins@debian.org)"); MODULE_DESCRIPTION("IEEE 1394 IPv4 Driver (IPv4-over-1394 as per RFC 2734)"); MODULE_LICENSE("GPL"); -/* The max_partial_datagrams parameter is the maximum number of fragmented datagrams - * per node that eth1394 will keep in memory. Providing an upper bound allows us to - * limit the amount of memory that partial datagrams consume in the event that some - * partial datagrams are never completed. This should probably change to a sysctl - * item or the like if possible. +/* The max_partial_datagrams parameter is the maximum number of fragmented + * datagrams per node that eth1394 will keep in memory. Providing an upper + * bound allows us to limit the amount of memory that partial datagrams + * consume in the event that some partial datagrams are never completed. This + * should probably change to a sysctl item or the like if possible. */ MODULE_PARM(max_partial_datagrams, "i"); MODULE_PARM_DESC(max_partial_datagrams, - "Maximum number of partially received fragmented datagrams (default = 25)."); + "Maximum number of partially received fragmented datagrams " + "(default = 25)."); static int max_partial_datagrams = 25; +static int ether1394_header(struct sk_buff *skb, struct net_device *dev, + unsigned short type, void *daddr, void *saddr, + unsigned len); +static int ether1394_rebuild_header(struct sk_buff *skb); +static int ether1394_header_parse(struct sk_buff *skb, unsigned char *haddr); +static int ether1394_header_cache(struct neighbour *neigh, struct hh_cache *hh); +static void ether1394_header_cache_update(struct hh_cache *hh, + struct net_device *dev, + unsigned char * haddr); +static int ether1394_mac_addr(struct net_device *dev, void *p); + static inline void purge_partial_datagram(struct list_head *old); static int ether1394_tx(struct sk_buff *skb, struct net_device *dev); static void ether1394_iso(struct hpsb_iso *iso); @@ -258,73 +275,34 @@ netif_wake_queue (dev); } - -/* Convert a standard ARP packet to 1394 ARP. The first 8 bytes (the - * entire arphdr) is the same format as the ip1394 header, so they - * overlap. The rest needs to be munged a bit. The remainder of the - * arphdr is formatted based on hwaddr len and ipaddr len. We know what - * they'll be, so it's easy to judge. */ -static inline void ether1394_arp_to_1394arp (struct sk_buff *skb, struct net_device *dev) -{ - struct eth1394_priv *priv = - (struct eth1394_priv *)(dev->priv); - u16 phy_id = NODEID_TO_NODE(priv->host->node_id); - - unsigned char *arp_ptr = (unsigned char *)skb->data; - struct eth1394_arp *arp1394 = (struct eth1394_arp *)skb->data; - unsigned char arp_data[2*(dev->addr_len+4)]; - - /* Copy the main data that we need */ - memcpy (arp_data, arp_ptr + sizeof(struct arphdr), sizeof (arp_data)); - - /* Extend the buffer enough for our new header */ - skb_put (skb, sizeof (struct eth1394_arp) - - (sizeof (arp_data) + sizeof (struct arphdr))); - -#define PROCESS_MEMBER(ptr,val,len) \ - memcpy (val, ptr, len); ptr += len - arp_ptr = arp_data + arp1394->hw_addr_len; - PROCESS_MEMBER (arp_ptr, &arp1394->sip, arp1394->ip_addr_len); - arp_ptr += arp1394->hw_addr_len; - PROCESS_MEMBER (arp_ptr, &arp1394->tip, arp1394->ip_addr_len); -#undef PROCESS_MEMBER - - /* Now add our own flavor of arp header fields to the orig one */ - arp1394->hw_addr_len = IP1394_HW_ADDR_LEN; - arp1394->hw_type = __constant_htons (ARPHRD_IEEE1394); - arp1394->s_uniq_id = cpu_to_le64 (priv->eui[phy_id]); - arp1394->max_rec = priv->max_rec[phy_id]; - arp1394->sspd = priv->sspd[phy_id]; - arp1394->fifo_hi = htons (priv->fifo_hi[phy_id]); - arp1394->fifo_lo = htonl (priv->fifo_lo[phy_id]); - - return; -} - static int ether1394_change_mtu(struct net_device *dev, int new_mtu) { - if ((new_mtu < 68) || (new_mtu > ETHER1394_REGION_ADDR_LEN)) + struct eth1394_priv *priv = (struct eth1394_priv *)dev->priv; + int phy_id = NODEID_TO_NODE(priv->host->node_id); + + if ((new_mtu < 68) || (new_mtu > (priv->maxpayload[phy_id] - + (sizeof(union eth1394_hdr) + + ETHER1394_GASP_OVERHEAD)))) return -EINVAL; dev->mtu = new_mtu; return 0; } -static inline void ether1394_register_limits (int nodeid, unsigned char max_rec, - unsigned char sspd, u64 eui, u16 fifo_hi, - u32 fifo_lo, struct eth1394_priv *priv) +static inline void ether1394_register_limits(int nodeid, u16 maxpayload, + unsigned char sspd, u64 eui, u64 fifo, + struct eth1394_priv *priv) { if (nodeid < 0 || nodeid >= ALL_NODES) { ETH1394_PRINT_G (KERN_ERR, "Cannot register invalid nodeid %d\n", nodeid); return; } - priv->max_rec[nodeid] = max_rec; - priv->sspd[nodeid] = sspd; - priv->fifo_hi[nodeid] = fifo_hi; - priv->fifo_lo[nodeid] = fifo_lo; - priv->eui[nodeid] = eui; + priv->maxpayload[nodeid] = maxpayload; + priv->sspd[nodeid] = sspd; + priv->fifo[nodeid] = fifo; + priv->eui[nodeid] = eui; - priv->max_rec[ALL_NODES] = min(priv->max_rec[ALL_NODES], max_rec); + priv->maxpayload[ALL_NODES] = min(priv->maxpayload[ALL_NODES], maxpayload); priv->sspd[ALL_NODES] = min(priv->sspd[ALL_NODES], sspd); return; @@ -335,34 +313,44 @@ unsigned long flags; int i; struct eth1394_priv *priv = (struct eth1394_priv *)dev->priv; - int phy_id = NODEID_TO_NODE(priv->host->node_id); struct hpsb_host *host = priv->host; + int phy_id = NODEID_TO_NODE(host->node_id); + u64 guid = *((u64*)&(host->csr.rom[3])); + u16 maxpayload = 1 << (((be32_to_cpu(host->csr.rom[2]) >> 12) & 0xf) + 1); spin_lock_irqsave (&priv->lock, flags); /* Clear the speed/payload/offset tables */ - memset (priv->max_rec, 8, sizeof (priv->max_rec)); + memset (priv->maxpayload, 0, sizeof (priv->maxpayload)); memset (priv->sspd, 0, sizeof (priv->sspd)); - memset (priv->fifo_hi, 0, sizeof (priv->fifo_hi)); - memset (priv->fifo_lo, 0, sizeof (priv->fifo_lo)); + memset (priv->fifo, 0, sizeof (priv->fifo)); + +#if 0 +/* Compile this out to make testing of fragmented broadcast datagrams + * easier. */ + priv->sspd[ALL_NODES] = SPEED_MAX; + priv->maxpayload[ALL_NODES] = eth1394_speedto_maxpayload[SPEED_MAX]; +#else + priv->sspd[ALL_NODES] = SPEED_100; + priv->maxpayload[ALL_NODES] = eth1394_speedto_maxpayload[SPEED_100]; +#endif priv->bc_state = ETHER1394_BC_CHECK; /* Register our limits now */ - ether1394_register_limits (phy_id, (be32_to_cpu(host->csr.rom[2]) >> 12) & 0xf, - host->speed_map[(phy_id << 6) + phy_id], - (u64)(((u64)be32_to_cpu(host->csr.rom[3]) << 32) | - be32_to_cpu(host->csr.rom[4])), - ETHER1394_REGION_ADDR >> 32, - ETHER1394_REGION_ADDR & 0xffffffff, priv); - - /* We'll use our max_rec as the default mtu */ - if (set_mtu) - dev->mtu = (1 << (priv->max_rec[phy_id] + 1)) - - (sizeof (union eth1394_hdr) + ETHER1394_OVERHEAD); - - /* Set our hardware address while we're at it */ - *(nodeid_t *)dev->dev_addr = htons (host->node_id); + ether1394_register_limits(phy_id, maxpayload, + host->speed_map[(phy_id << 6) + phy_id], + guid, ETHER1394_REGION_ADDR, priv); + + /* We'll use our maxpayload as the default mtu */ + if (set_mtu) { + dev->mtu = priv->maxpayload[phy_id] - (sizeof(union eth1394_hdr) + + ETHER1394_GASP_OVERHEAD); + + /* Set our hardware address while we're at it */ + *(u64*)dev->dev_addr = guid; + *(u64*)dev->broadcast = ~0x0ULL; + } spin_unlock_irqrestore (&priv->lock, flags); @@ -392,11 +380,20 @@ dev->tx_timeout = ether1394_tx_timeout; dev->change_mtu = ether1394_change_mtu; + dev->hard_header = ether1394_header; + dev->rebuild_header = ether1394_rebuild_header; + dev->hard_header_cache = ether1394_header_cache; + dev->header_cache_update= ether1394_header_cache_update; + dev->hard_header_parse = ether1394_header_parse; + dev->set_mac_address = ether1394_mac_addr; + /* Some constants */ dev->watchdog_timeo = ETHER1394_TIMEOUT; - dev->flags = IFF_BROADCAST; /* TODO: Support MCAP */ + dev->flags = IFF_BROADCAST; /* | IFF_MULTICAST someday */ dev->features = NETIF_F_NO_CSUM|NETIF_F_SG|NETIF_F_HIGHDMA|NETIF_F_FRAGLIST; - dev->addr_len = 2; + dev->addr_len = ETH1394_ALEN; + dev->hard_header_len = ETH1394_HLEN; + dev->type = ARPHRD_IEEE1394; ether1394_reset_priv (dev, 1); @@ -419,6 +416,9 @@ if (version_printed++ == 0) ETH1394_PRINT_G (KERN_INFO, "%s\n", version); + /* We should really have our own alloc_hpsbdev() function in + * net_init.c instead of calling the one for ethernet then hijacking + * it for ourselves. That way we'd be a real networking device. */ dev = alloc_etherdev(sizeof (struct eth1394_priv)); if (dev == NULL) @@ -468,7 +468,7 @@ out: if (dev != NULL) - kfree (dev); dev = NULL; + kfree(dev); if (hi) hpsb_destroy_hostinfo(ð1394_highlevel, host); @@ -489,7 +489,7 @@ unregister_netdev (hi->dev); hpsb_iso_shutdown(priv->iso); - kfree (hi->dev); hi->dev = NULL; + kfree(hi->dev); } return; @@ -513,31 +513,140 @@ netif_wake_queue (dev); } +/****************************************** + * HW Header net device functions + ******************************************/ +/* These functions have been adapted from net/ethernet/eth.c */ + + +/* Create a fake MAC header for an arbitrary protocol layer. + * saddr=NULL means use device source address + * daddr=NULL means leave destination address (eg unresolved arp). */ +static int ether1394_header(struct sk_buff *skb, struct net_device *dev, + unsigned short type, void *daddr, void *saddr, + unsigned len) +{ + struct eth1394hdr *eth = (struct eth1394hdr *)skb_push(skb, ETH1394_HLEN); + + eth->h_proto = htons(type); + + if (dev->flags & (IFF_LOOPBACK|IFF_NOARP)) + { + memset(eth->h_dest, 0, dev->addr_len); + return(dev->hard_header_len); + } + + if(daddr) + { + memcpy(eth->h_dest,daddr,dev->addr_len); + return dev->hard_header_len; + } + + return -dev->hard_header_len; + +} + + +/* Rebuild the faked MAC header. This is called after an ARP + * (or in future other address resolution) has completed on this + * sk_buff. We now let ARP fill in the other fields. + * + * This routine CANNOT use cached dst->neigh! + * Really, it is used only when dst->neigh is wrong. + */ +static int ether1394_rebuild_header(struct sk_buff *skb) +{ + struct eth1394hdr *eth = (struct eth1394hdr *)skb->data; + struct net_device *dev = skb->dev; + + switch (eth->h_proto) + { +#ifdef CONFIG_INET + case __constant_htons(ETH_P_IP): + return arp_find((unsigned char*)ð->h_dest, skb); +#endif + default: + printk(KERN_DEBUG + "%s: unable to resolve type %X addresses.\n", + dev->name, (int)eth->h_proto); + break; + } + + return 0; +} + +static int ether1394_header_parse(struct sk_buff *skb, unsigned char *haddr) +{ + struct net_device *dev = skb->dev; + memcpy(haddr, dev->dev_addr, ETH1394_ALEN); + return ETH_ALEN; +} + + +static int ether1394_header_cache(struct neighbour *neigh, struct hh_cache *hh) +{ + unsigned short type = hh->hh_type; + struct eth1394hdr *eth = (struct eth1394hdr*)(((u8*)hh->hh_data) + 6); + struct net_device *dev = neigh->dev; + + if (type == __constant_htons(ETH_P_802_3)) { + return -1; + } + + eth->h_proto = type; + memcpy(eth->h_dest, neigh->ha, dev->addr_len); + + hh->hh_len = ETH1394_HLEN; + return 0; +} + +/* Called by Address Resolution module to notify changes in address. */ +static void ether1394_header_cache_update(struct hh_cache *hh, + struct net_device *dev, + unsigned char * haddr) +{ + memcpy(((u8*)hh->hh_data) + 6, haddr, dev->addr_len); +} + +static int ether1394_mac_addr(struct net_device *dev, void *p) +{ + if (netif_running(dev)) + return -EBUSY; + + /* Not going to allow setting the MAC address, we really need to use + * the real one suppliled by the hardware */ + return -EINVAL; + } + + /****************************************** * Datagram reception code ******************************************/ /* Copied from net/ethernet/eth.c */ -static inline unsigned short ether1394_type_trans(struct sk_buff *skb, struct net_device *dev) +static inline u16 ether1394_type_trans(struct sk_buff *skb, + struct net_device *dev) { - struct ethhdr *eth; + struct eth1394hdr *eth; unsigned char *rawp; skb->mac.raw = skb->data; - skb_pull (skb, ETH_HLEN); - eth = skb->mac.ethernet; -#if 0 + skb_pull (skb, ETH1394_HLEN); + eth = (struct eth1394hdr*)skb->mac.raw; + if(*eth->h_dest & 1) { if(memcmp(eth->h_dest, dev->broadcast, dev->addr_len)==0) skb->pkt_type = PACKET_BROADCAST; +#if 0 else skb->pkt_type = PACKET_MULTICAST; +#endif } else { if(memcmp(eth->h_dest, dev->dev_addr, dev->addr_len)) skb->pkt_type = PACKET_OTHERHOST; } -#endif + if (ntohs (eth->h_proto) >= 1536) return eth->h_proto; @@ -551,56 +660,72 @@ /* Parse an encapsulated IP1394 header into an ethernet frame packet. * We also perform ARP translation here, if need be. */ -static inline unsigned short ether1394_parse_encap (struct sk_buff *skb, struct net_device *dev, - nodeid_t srcid, nodeid_t destid, u16 ether_type) +static inline u16 ether1394_parse_encap(struct sk_buff *skb, + struct net_device *dev, + nodeid_t srcid, nodeid_t destid, + u16 ether_type) { - unsigned char src_hw[ETH_ALEN], dest_hw[ETH_ALEN]; + struct eth1394_priv *priv = (struct eth1394_priv *)dev->priv; + u64 dest_hw; unsigned short ret = 0; /* Setup our hw addresses. We use these to build the * ethernet header. */ - *(u16 *)dest_hw = htons(destid); - *(u16 *)src_hw = htons(srcid); + if(destid == (LOCAL_BUS | ALL_NODES)) + dest_hw = ~0ULL; /* broadcast */ + else + dest_hw = priv->eui[NODEID_TO_NODE(destid)]; /* If this is an ARP packet, convert it. First, we want to make * use of some of the fields, since they tell us a little bit * about the sending machine. */ if (ether_type == __constant_htons (ETH_P_ARP)) { unsigned long flags; - u16 phy_id = NODEID_TO_NODE(srcid); - struct eth1394_priv *priv = - (struct eth1394_priv *)dev->priv; - struct eth1394_arp arp1394; + struct eth1394_arp *arp1394 = (struct eth1394_arp*)skb->data; struct arphdr *arp = (struct arphdr *)skb->data; unsigned char *arp_ptr = (unsigned char *)(arp + 1); + u64 fifo_addr = (u64)ntohs(arp1394->fifo_hi) << 32 | + ntohl(arp1394->fifo_lo); + u8 host_max_rec = (be32_to_cpu(priv->host->csr.rom[2]) >> + 12) & 0xf; + u8 max_rec = min(host_max_rec, (u8)(arp1394->max_rec)); + u16 maxpayload = min(eth1394_speedto_maxpayload[arp1394->sspd], + (u16)(1 << (max_rec + 1))); - memcpy (&arp1394, arp, sizeof (struct eth1394_arp)); /* Update our speed/payload/fifo_offset table */ spin_lock_irqsave (&priv->lock, flags); - ether1394_register_limits (phy_id, arp1394.max_rec, arp1394.sspd, - le64_to_cpu (arp1394.s_uniq_id), - ntohs (arp1394.fifo_hi), - ntohl (arp1394.fifo_lo), priv); + ether1394_register_limits(NODEID_TO_NODE(srcid), maxpayload, + arp1394->sspd, arp1394->s_uniq_id, + fifo_addr, priv); spin_unlock_irqrestore (&priv->lock, flags); -#define PROCESS_MEMBER(ptr,val,len) \ - memcpy (ptr, val, len); ptr += len - PROCESS_MEMBER (arp_ptr, src_hw, dev->addr_len); - PROCESS_MEMBER (arp_ptr, &arp1394.sip, 4); - PROCESS_MEMBER (arp_ptr, dest_hw, dev->addr_len); - PROCESS_MEMBER (arp_ptr, &arp1394.tip, 4); -#undef PROCESS_MEMBER - - arp->ar_hln = dev->addr_len; - arp->ar_hrd = __constant_htons (ARPHRD_ETHER); - - skb_trim (skb, sizeof (struct arphdr) + 2*(dev->addr_len+4)); + /* Now that we're done with the 1394 specific stuff, we'll + * need to alter some of the data. Believe it or not, all + * that needs to be done is sender_IP_address needs to be + * moved, the destination hardware address get stuffed + * in and the hardware address length set to 8. + * + * IMPORTANT: The code below overwrites 1394 specific data + * needed above data so keep the call to + * ether1394_register_limits() before munging the data for the + * higher level IP stack. */ + + arp->ar_hln = 8; + arp_ptr += arp->ar_hln; /* skip over sender unique id */ + *(u32*)arp_ptr = arp1394->sip; /* move sender IP addr */ + arp_ptr += arp->ar_pln; /* skip over sender IP addr */ + + if(arp->ar_op == 1) + /* just set ARP req target unique ID to 0 */ + memset(arp_ptr, 0, ETH1394_ALEN); + else + memcpy(arp_ptr, dev->dev_addr, ETH1394_ALEN); } /* Now add the ethernet header. */ if (dev->hard_header (skb, dev, __constant_ntohs (ether_type), - dest_hw, src_hw, skb->len) >= 0) + &dest_hw, NULL, skb->len) >= 0) ret = ether1394_type_trans(skb, dev); return ret; @@ -651,7 +776,7 @@ /* glue fragments together */ fi->len += fi2->len; list_del(lh->next); - kfree(fi2); fi2 = NULL; + kfree(fi2); } return 0; } else if((offset + len) == fi->offset) { @@ -664,7 +789,7 @@ /* glue fragments together */ fi2->len += fi->len; list_del(lh); - kfree(fi); fi = NULL; + kfree(fi); } return 0; } else if(offset > (fi->offset + fi->len)) { @@ -701,7 +826,7 @@ INIT_LIST_HEAD(&new->frag_info); if(new_fragment(&new->frag_info, frag_off, frag_len) < 0) { - kfree(new); new = NULL; + kfree(new); return -ENOMEM; } @@ -713,8 +838,8 @@ struct fragment_info *fi = list_entry(new->frag_info.next, struct fragment_info, list); - kfree(fi); fi = NULL; - kfree(new); new = NULL; + kfree(fi); + kfree(new); return -ENOMEM; } @@ -754,11 +879,11 @@ list_for_each_safe(lh, n, &pd->frag_info) { struct fragment_info *fi = list_entry(lh, struct fragment_info, list); list_del(lh); - kfree(fi); fi = NULL; + kfree(fi); } list_del(old); - kfree_skb(pd->skb); pd->skb = NULL; - kfree(pd); pd = NULL; + kfree_skb(pd->skb); + kfree(pd); } static inline int is_datagram_complete(struct list_head *lh, int dg_size) @@ -805,11 +930,6 @@ memcpy(skb_put(skb, len - hdr_len), buf + hdr_len, len - hdr_len); ether_type = hdr->uf.ether_type; } else { -#if 0 - return 0; - } - if(0) { -#endif /* A datagram fragment has been received, now the fun begins. */ struct list_head *pdgl, *lh; @@ -836,7 +956,6 @@ dg_size = hdr->sf.dg_size; fg_off = hdr->sf.fg_off; } - spin_lock_irqsave(&pdg->lock, flags); pdgl = &(pdg->list); @@ -1010,7 +1129,8 @@ /* This packet is not for us */ continue; } - ether1394_data_handler(dev, source_id, iso->host->node_id, buf, len); + ether1394_data_handler(dev, source_id, LOCAL_BUS | ALL_NODES, + buf, len); } hpsb_iso_recv_release_packets(iso, i); @@ -1022,6 +1142,39 @@ * Datagram transmission code ******************************************/ +/* Convert a standard ARP packet to 1394 ARP. The first 8 bytes (the entire + * arphdr) is the same format as the ip1394 header, so they overlap. The rest + * needs to be munged a bit. The remainder of the arphdr is formatted based + * on hwaddr len and ipaddr len. We know what they'll be, so it's easy to + * judge. + * + * Now that the EUI is used for the hardware address all we need to do to make + * this work for 1394 is to insert 2 quadlets that contain max_rec size, + * speed, and unicast FIFO address information between the sender_unique_id + * and the IP addresses. + */ +static inline void ether1394_arp_to_1394arp(struct sk_buff *skb, + struct net_device *dev) +{ + struct eth1394_priv *priv = (struct eth1394_priv *)(dev->priv); + u16 phy_id = NODEID_TO_NODE(priv->host->node_id); + + struct arphdr *arp = (struct arphdr *)skb->data; + unsigned char *arp_ptr = (unsigned char *)(arp + 1); + struct eth1394_arp *arp1394 = (struct eth1394_arp *)skb->data; + + /* Believe it or not, all that need to happen is sender IP get moved + * and set hw_addr_len, max_rec, sspd, fifo_hi and fifo_lo. */ + arp1394->hw_addr_len = 16; + arp1394->sip = *(u32*)(arp_ptr + ETH1394_ALEN); + arp1394->max_rec = (be32_to_cpu(priv->host->csr.rom[2]) >> 12) & 0xf; + arp1394->sspd = priv->sspd[phy_id]; + arp1394->fifo_hi = htons (priv->fifo[phy_id] >> 32); + arp1394->fifo_lo = htonl (priv->fifo[phy_id] & ~0x0); + + return; +} + /* We need to encapsulate the standard header with our own. We use the * ethernet header's proto for our own. */ static inline unsigned int ether1394_encapsulate_prep(unsigned int max_payload, @@ -1042,7 +1195,6 @@ hdr->ff.dgl = dgl; adj_max_payload = max_payload - hdr_type_len[ETH1394_HDR_LF_FF]; } - return((dg_size + (adj_max_payload - 1)) / adj_max_payload); } @@ -1132,27 +1284,33 @@ } static inline void ether1394_prep_gasp_packet(struct hpsb_packet *p, - struct hpsb_host *host, + struct eth1394_priv *priv, struct sk_buff *skb, int length) { p->header_size = 4; p->tcode = TCODE_STREAM_DATA; p->header[0] = (length << 16) | (3 << 14) - | ((host->csr.broadcast_channel & 0x3f) << 8) + | ((priv->broadcast_channel) << 8) | (TCODE_STREAM_DATA << 4); p->data_size = length; - p->data = (quadlet_t*)skb_push(skb, 2 * sizeof(quadlet_t)); - p->data[0] = cpu_to_be32((host->node_id << 16) | + p->data = ((quadlet_t*)skb->data) - 2; + p->data[0] = cpu_to_be32((priv->host->node_id << 16) | ETHER1394_GASP_SPECIFIER_ID_HI); p->data[1] = cpu_to_be32((ETHER1394_GASP_SPECIFIER_ID_LO << 24) | ETHER1394_GASP_VERSION); + + /* Setting the node id to ALL_NODES (not LOCAL_BUS | ALL_NODES) + * prevents hpsb_send_packet() from setting the speed to an arbitrary + * value based on packet->node_id if packet->node_id is not set. */ + p->node_id = ALL_NODES; + p->speed_code = priv->sspd[ALL_NODES]; } static inline void ether1394_free_packet(struct hpsb_packet *packet) { packet->data = NULL; - free_hpsb_packet(packet); packet = NULL; + free_hpsb_packet(packet); } static void ether1394_complete_cb(void *__ptask); @@ -1168,8 +1326,7 @@ if(ptask->tx_type == ETH1394_GASP) { int length = tx_len + (2 * sizeof(quadlet_t)); - ether1394_prep_gasp_packet(packet, priv->host, - ptask->skb, length); + ether1394_prep_gasp_packet(packet, priv, ptask->skb, length); } else { if(ether1394_prep_write_packet(packet, priv->host, @@ -1212,8 +1369,8 @@ spin_unlock_irqrestore(&priv->lock, flags); } - dev_kfree_skb_any(skb); skb = NULL; - kmem_cache_free(packet_task_cache, ptask); ptask = NULL; + dev_kfree_skb_any(skb); + kmem_cache_free(packet_task_cache, ptask); } @@ -1230,7 +1387,7 @@ hpsb_free_tlabel(packet); } - ether1394_free_packet(packet); packet = ptask->packet = NULL; + ether1394_free_packet(packet); ptask->outstanding_pkts--; if(ptask->outstanding_pkts > 0 && !fail) @@ -1253,7 +1410,7 @@ static int ether1394_tx (struct sk_buff *skb, struct net_device *dev) { int kmflags = in_interrupt() ? GFP_ATOMIC : GFP_KERNEL; - struct ethhdr *eth; + struct eth1394hdr *eth; struct eth1394_priv *priv = (struct eth1394_priv *)dev->priv; int proto; unsigned long flags; @@ -1265,6 +1422,7 @@ u16 dg_size; u16 dgl; struct packet_task *ptask; + struct node_entry *ne; ptask = kmem_cache_alloc(packet_task_cache, kmflags); if(ptask == NULL) { @@ -1295,34 +1453,44 @@ goto fail; } - /* Get rid of the ethernet header, but save a pointer */ - eth = (struct ethhdr *)skb->data; - skb_pull (skb, ETH_HLEN); - - /* Save the destination id, and proto for our encapsulation, then - * toss the ethernet header aside like the cheap whore it is. */ - dest_node = ntohs (*(nodeid_t *)(eth->h_dest)); + /* Get rid of the fake eth1394 header, but save a pointer */ + eth = (struct eth1394hdr*)skb->data; + skb_pull(skb, ETH1394_HLEN); + + ne = hpsb_guid_get_entry(be64_to_cpu(*(u64*)eth->h_dest)); + if(!ne) + dest_node = LOCAL_BUS | ALL_NODES; + else + dest_node = ne->nodeid; + proto = eth->h_proto; /* If this is an ARP packet, convert it */ if (proto == __constant_htons (ETH_P_ARP)) ether1394_arp_to_1394arp (skb, dev); - max_payload = 1 << (min(priv->max_rec[NODEID_TO_NODE(priv->host->node_id)], - priv->max_rec[NODEID_TO_NODE(dest_node)]) + 1); + max_payload = priv->maxpayload[NODEID_TO_NODE(dest_node)]; - if(max_payload < 512) + /* This check should be unnecessary, but we'll keep it for safety for + * a while longer. */ + if(max_payload < 512) { + ETH1394_PRINT(KERN_WARNING, dev->name, + "max_payload too small: %d (setting to 512)\n", + max_payload); max_payload = 512; + } - /* Set the transmission type for the packet. Right now only ARP - * packets are sent via GASP. IP broadcast and IP multicast are not - * yet supported properly, they too should use GASP. */ - switch(proto) { - case __constant_htons(ETH_P_ARP): + /* Set the transmission type for the packet. ARP packets and IP + * broadcast packets are sent via GASP, however, we cheat a little bit + * when detecting IP broadcast packets. This will need to change when + * we switch from using node id for the hardware address to the EUI + * which we should be using instead. IP multicast is not yet + * supported. */ + if((memcmp(eth->h_dest, dev->broadcast, ETH1394_ALEN) == 0) || + (proto == __constant_htons(ETH_P_ARP))) { tx_type = ETH1394_GASP; - max_payload -= ETHER1394_OVERHEAD; - break; - default: + max_payload -= ETHER1394_GASP_OVERHEAD; + } else { tx_type = ETH1394_WRREQ; } @@ -1345,9 +1513,17 @@ if(tx_type != ETH1394_GASP) { u64 addr; + /* This test is just temporary until ConfigROM support has + * been added to eth1394. Until then, we need an ARP packet + * after a bus reset from the current destination node so that + * we can get FIFO information. */ + if(priv->fifo[NODEID_TO_NODE(dest_node)] == 0ULL) { + ret = -EAGAIN; + goto fail; + } + spin_lock_irqsave(&priv->lock, flags); - addr = (u64)priv->fifo_hi[NODEID_TO_NODE(dest_node)] << 32 | - priv->fifo_lo[NODEID_TO_NODE(dest_node)]; + addr = priv->fifo[NODEID_TO_NODE(dest_node)]; spin_unlock_irqrestore(&priv->lock, flags); ptask->addr = addr; @@ -1370,11 +1546,11 @@ return 0; fail: if(ptask->packet) - ether1394_free_packet(ptask->packet); ptask->packet = NULL; + ether1394_free_packet(ptask->packet); if(ptask) - kmem_cache_free(packet_task_cache, ptask); ptask = NULL; + kmem_cache_free(packet_task_cache, ptask); if(skb != NULL) { - dev_kfree_skb(skb); skb = NULL; + dev_kfree_skb(skb); } spin_lock_irqsave (&priv->lock, flags); diff -urN linux-2.5.70-bk7/drivers/ieee1394/eth1394.h linux-2.5.70-bk8/drivers/ieee1394/eth1394.h --- linux-2.5.70-bk7/drivers/ieee1394/eth1394.h 2003-06-03 04:38:30.000000000 -0700 +++ linux-2.5.70-bk8/drivers/ieee1394/eth1394.h 2003-06-03 04:38:35.000000000 -0700 @@ -38,7 +38,7 @@ #define ETHER1394_GASP_SPECIFIER_ID_LO (ETHER1394_GASP_SPECIFIER_ID & 0xff) #define ETHER1394_GASP_VERSION 1 -#define ETHER1394_OVERHEAD (2 * sizeof(quadlet_t)) /* GASP header overhead */ +#define ETHER1394_GASP_OVERHEAD (2 * sizeof(quadlet_t)) /* GASP header overhead */ /* Node set == 64 */ #define NODE_SET (ALL_NODES + 1) @@ -56,10 +56,9 @@ struct eth1394_priv { struct net_device_stats stats; /* Device stats */ struct hpsb_host *host; /* The card for this dev */ - unsigned char max_rec[NODE_SET];/* Max payload per node */ + u16 maxpayload[NODE_SET]; /* Max payload per node */ unsigned char sspd[NODE_SET]; /* Max speed per node */ - u16 fifo_hi[ALL_NODES]; /* 16bit hi fifo offset per node */ - u32 fifo_lo[ALL_NODES]; /* 32bit lo fifo offset per node */ + u64 fifo[ALL_NODES]; /* FIFO offset per node */ u64 eui[ALL_NODES]; /* EUI-64 per node */ spinlock_t lock; /* Private lock */ int broadcast_channel; /* Async stream Broadcast Channel */ @@ -74,6 +73,21 @@ struct net_device *dev; }; + +/* Define a fake hardware header format for the networking core. Note that + * header size cannot exceed 16 bytes as that is the size of the header cache. + * Also, we do not need the source address in the header so we omit it and + * keep the header to under 16 bytes */ +#define ETH1394_ALEN (8) +#define ETH1394_HLEN (10) + +struct eth1394hdr { + unsigned char h_dest[ETH1394_ALEN]; /* destination eth1394 addr */ + unsigned short h_proto; /* packet type ID field */ +} __attribute__((packed)); + + + typedef enum {ETH1394_GASP, ETH1394_WRREQ} eth1394_tx_type; /* IP1394 headers */ diff -urN linux-2.5.70-bk7/drivers/ieee1394/ieee1394.h linux-2.5.70-bk8/drivers/ieee1394/ieee1394.h --- linux-2.5.70-bk7/drivers/ieee1394/ieee1394.h 2003-05-26 18:00:27.000000000 -0700 +++ linux-2.5.70-bk8/drivers/ieee1394/ieee1394.h 2003-06-03 04:38:35.000000000 -0700 @@ -57,7 +57,6 @@ /* Maps speed values above to a string representation */ extern const char *hpsb_speedto_str[]; -extern const u8 hpsb_speedto_maxrec[]; #define SELFID_PWRCL_NO_POWER 0x0 diff -urN linux-2.5.70-bk7/drivers/ieee1394/ieee1394_core.c linux-2.5.70-bk8/drivers/ieee1394/ieee1394_core.c --- linux-2.5.70-bk7/drivers/ieee1394/ieee1394_core.c 2003-06-03 04:38:30.000000000 -0700 +++ linux-2.5.70-bk8/drivers/ieee1394/ieee1394_core.c 2003-06-03 04:38:36.000000000 -0700 @@ -61,7 +61,6 @@ /* Some globals used */ const char *hpsb_speedto_str[] = { "S100", "S200", "S400", "S800", "S1600", "S3200" }; -const u8 hpsb_speedto_maxrec[] = { 0x7, 0x8, 0x9, 0x10, 0x11, 0x12 }; static void dump_packet(const char *text, quadlet_t *data, int size) { @@ -1246,7 +1245,6 @@ /** ieee1394_core.c **/ EXPORT_SYMBOL(hpsb_speedto_str); -EXPORT_SYMBOL(hpsb_speedto_maxrec); EXPORT_SYMBOL(hpsb_set_packet_complete_task); EXPORT_SYMBOL(alloc_hpsb_packet); EXPORT_SYMBOL(free_hpsb_packet); diff -urN linux-2.5.70-bk7/drivers/ieee1394/iso.c linux-2.5.70-bk8/drivers/ieee1394/iso.c --- linux-2.5.70-bk7/drivers/ieee1394/iso.c 2003-05-26 18:00:46.000000000 -0700 +++ linux-2.5.70-bk8/drivers/ieee1394/iso.c 2003-06-03 04:38:36.000000000 -0700 @@ -10,6 +10,7 @@ */ #include +#include #include "iso.h" void hpsb_iso_stop(struct hpsb_iso *iso) diff -urN linux-2.5.70-bk7/drivers/ieee1394/sbp2.c linux-2.5.70-bk8/drivers/ieee1394/sbp2.c --- linux-2.5.70-bk7/drivers/ieee1394/sbp2.c 2003-06-03 04:38:30.000000000 -0700 +++ linux-2.5.70-bk8/drivers/ieee1394/sbp2.c 2003-06-03 04:38:36.000000000 -0700 @@ -79,7 +79,7 @@ #include "sbp2.h" static char version[] __devinitdata = - "$Rev: 938 $ Ben Collins "; + "$Rev: 942 $ Ben Collins "; /* * Module load parameter definitions @@ -230,6 +230,8 @@ static Scsi_Host_Template scsi_driver_template; +const u8 sbp2_speedto_max_payload[] = { 0x7, 0x8, 0x9, 0xA, 0xB, 0xC }; + static struct hpsb_highlevel sbp2_highlevel = { .name = SBP2_DEVICE_NAME, .remove_host = sbp2_remove_host, @@ -779,7 +781,7 @@ scsi_id->ne = ud->ne; scsi_id->hi = hi; scsi_id->speed_code = SPEED_100; - scsi_id->max_payload_size = hpsb_speedto_maxrec[SPEED_100]; + scsi_id->max_payload_size = sbp2_speedto_max_payload[SPEED_100]; atomic_set(&scsi_id->sbp2_login_complete, 0); INIT_LIST_HEAD(&scsi_id->sbp2_command_orb_inuse); INIT_LIST_HEAD(&scsi_id->sbp2_command_orb_completed); @@ -1690,7 +1692,7 @@ /* Payload size is the lesser of what our speed supports and what * our host supports. */ - scsi_id->max_payload_size = min(hpsb_speedto_maxrec[scsi_id->speed_code], + scsi_id->max_payload_size = min(sbp2_speedto_max_payload[scsi_id->speed_code], (u8)(((be32_to_cpu(hi->host->csr.rom[2]) >> 12) & 0xf) - 1)); SBP2_ERR("Node[" NODE_BUS_FMT "]: Max speed [%s] - Max payload [%u]", diff -urN linux-2.5.70-bk7/drivers/mtd/maps/map_funcs.c linux-2.5.70-bk8/drivers/mtd/maps/map_funcs.c --- linux-2.5.70-bk7/drivers/mtd/maps/map_funcs.c 2003-06-03 04:38:30.000000000 -0700 +++ linux-2.5.70-bk8/drivers/mtd/maps/map_funcs.c 2003-06-03 04:38:36.000000000 -0700 @@ -13,6 +13,7 @@ #include #include +#include static u8 simple_map_read8(struct map_info *map, unsigned long ofs) { diff -urN linux-2.5.70-bk7/drivers/usb/Makefile linux-2.5.70-bk8/drivers/usb/Makefile --- linux-2.5.70-bk7/drivers/usb/Makefile 2003-06-03 04:38:31.000000000 -0700 +++ linux-2.5.70-bk8/drivers/usb/Makefile 2003-05-26 18:00:58.000000000 -0700 @@ -59,6 +59,3 @@ obj-$(CONFIG_USB_TIGL) += misc/ obj-$(CONFIG_USB_USS720) += misc/ -obj-$(CONFIG_USB_NET2280) += gadget/ -obj-$(CONFIG_USB_ZERO) += gadget/ -obj-$(CONFIG_USB_ETH) += gadget/ diff -urN linux-2.5.70-bk7/drivers/usb/core/hub.c linux-2.5.70-bk8/drivers/usb/core/hub.c --- linux-2.5.70-bk7/drivers/usb/core/hub.c 2003-06-03 04:38:31.000000000 -0700 +++ linux-2.5.70-bk8/drivers/usb/core/hub.c 2003-06-03 04:38:38.000000000 -0700 @@ -756,7 +756,7 @@ return -1; } -void usb_hub_port_disable(struct usb_device *hub, int port) +int usb_hub_port_disable(struct usb_device *hub, int port) { int ret; @@ -764,6 +764,8 @@ if (ret) dev_err(hubdev(hub), "cannot disable port %d (err = %d)\n", port + 1, ret); + + return ret; } /* USB 2.0 spec, 7.1.7.3 / fig 7-29: diff -urN linux-2.5.70-bk7/drivers/usb/core/usb.c linux-2.5.70-bk8/drivers/usb/core/usb.c --- linux-2.5.70-bk7/drivers/usb/core/usb.c 2003-06-03 04:38:31.000000000 -0700 +++ linux-2.5.70-bk8/drivers/usb/core/usb.c 2003-06-03 04:38:38.000000000 -0700 @@ -731,6 +731,70 @@ } +static struct usb_device *match_device(struct usb_device *dev, + u16 vendor_id, u16 product_id) +{ + struct usb_device *ret_dev = NULL; + int child; + + dbg("looking at vendor %d, product %d", + dev->descriptor.idVendor, + dev->descriptor.idProduct); + + /* see if this device matches */ + if ((dev->descriptor.idVendor == vendor_id) && + (dev->descriptor.idProduct == product_id)) { + dbg ("found the device!"); + ret_dev = usb_get_dev(dev); + goto exit; + } + + /* look through all of the children of this device */ + for (child = 0; child < dev->maxchild; ++child) { + if (dev->children[child]) { + ret_dev = match_device(dev->children[child], + vendor_id, product_id); + if (ret_dev) + goto exit; + } + } +exit: + return ret_dev; +} + +/** + * usb_find_device - find a specific usb device in the system + * @vendor_id: the vendor id of the device to find + * @product_id: the product id of the device to find + * + * Returns a pointer to a struct usb_device if such a specified usb + * device is present in the system currently. The usage count of the + * device will be incremented if a device is found. Make sure to call + * usb_put_dev() when the caller is finished with the device. + * + * If a device with the specified vendor and product id is not found, + * NULL is returned. + */ +struct usb_device *usb_find_device(u16 vendor_id, u16 product_id) +{ + struct list_head *buslist; + struct usb_bus *bus; + struct usb_device *dev = NULL; + + down(&usb_bus_list_lock); + for (buslist = usb_bus_list.next; + buslist != &usb_bus_list; + buslist = buslist->next) { + bus = container_of(buslist, struct usb_bus, bus_list); + dev = match_device(bus->root_hub, vendor_id, product_id); + if (dev) + goto exit; + } +exit: + up(&usb_bus_list_lock); + return dev; +} + /** * usb_get_current_frame_number - return current bus frame number * @dev: the device whose bus is being queried @@ -1510,6 +1574,7 @@ EXPORT_SYMBOL(__usb_get_extra_descriptor); +EXPORT_SYMBOL(usb_find_device); EXPORT_SYMBOL(usb_get_current_frame_number); EXPORT_SYMBOL (usb_buffer_alloc); diff -urN linux-2.5.70-bk7/drivers/usb/misc/rio500.c linux-2.5.70-bk8/drivers/usb/misc/rio500.c --- linux-2.5.70-bk7/drivers/usb/misc/rio500.c 2003-06-03 04:38:31.000000000 -0700 +++ linux-2.5.70-bk8/drivers/usb/misc/rio500.c 2003-06-03 04:38:38.000000000 -0700 @@ -23,6 +23,9 @@ * * Based upon mouse.c (Brad Keryan) and printer.c (Michael Gee). * + * Changelog: + * 30/05/2003 replaced lock/unlock kernel with up/down + * Daniele Bellucci bellucda@tiscali.it * */ #include @@ -75,17 +78,17 @@ { struct rio_usb_data *rio = &rio_instance; - lock_kernel(); + down(&(rio->lock)); if (rio->isopen || !rio->present) { - unlock_kernel(); + up(&(rio->lock)); return -EBUSY; } rio->isopen = 1; init_waitqueue_head(&rio->wait_q); - unlock_kernel(); + up(&(rio->lock)); info("Rio opened."); @@ -460,7 +463,6 @@ return -ENOMEM; } - rio->present = 1; rio->rio_dev = dev; if (!(rio->obuf = (char *) kmalloc(OBUF_SIZE, GFP_KERNEL))) { @@ -481,6 +483,8 @@ init_MUTEX(&(rio->lock)); usb_set_intfdata (intf, rio); + rio->present = 1; + return 0; } @@ -525,7 +529,7 @@ .id_table = rio_table, }; -int usb_rio_init(void) +static int __init usb_rio_init(void) { if (usb_register(&rio_driver) < 0) return -1; @@ -536,7 +540,7 @@ } -void usb_rio_cleanup(void) +static void __exit usb_rio_cleanup(void) { struct rio_usb_data *rio = &rio_instance; diff -urN linux-2.5.70-bk7/drivers/usb/serial/Kconfig linux-2.5.70-bk8/drivers/usb/serial/Kconfig --- linux-2.5.70-bk7/drivers/usb/serial/Kconfig 2003-05-26 18:00:45.000000000 -0700 +++ linux-2.5.70-bk8/drivers/usb/serial/Kconfig 2003-06-03 04:38:38.000000000 -0700 @@ -351,6 +351,7 @@ - USB TWIN - KAAN Standard Plus + - KAAN SIM - SecOVID Reader Plus - B1 Professional - KAAN Professional diff -urN linux-2.5.70-bk7/drivers/usb/serial/kobil_sct.c linux-2.5.70-bk8/drivers/usb/serial/kobil_sct.c --- linux-2.5.70-bk7/drivers/usb/serial/kobil_sct.c 2003-05-26 18:00:56.000000000 -0700 +++ linux-2.5.70-bk8/drivers/usb/serial/kobil_sct.c 2003-06-03 04:38:38.000000000 -0700 @@ -21,7 +21,8 @@ * Supported readers: USB TWIN, KAAN Standard Plus and SecOVID Reader Plus * (Adapter K), B1 Professional and KAAN Professional (Adapter B) * - * TODO: High baudrates + * (28/05/2003) tw + * Add support for KAAN SIM * * (12/09/2002) tw * Adapted to 2.5. @@ -58,7 +59,7 @@ #include "usb-serial.h" /* Version Information */ -#define DRIVER_VERSION "12/09/2002" +#define DRIVER_VERSION "28/05/2003" #define DRIVER_AUTHOR "KOBIL Systems GmbH - http://www.kobil.com" #define DRIVER_DESC "KOBIL USB Smart Card Terminal Driver (experimental)" @@ -66,6 +67,7 @@ #define KOBIL_ADAPTER_B_PRODUCT_ID 0x2011 #define KOBIL_ADAPTER_K_PRODUCT_ID 0x2012 #define KOBIL_USBTWIN_PRODUCT_ID 0x0078 +#define KOBIL_KAAN_SIM_PRODUCT_ID 0x0081 #define KOBIL_TIMEOUT 500 #define KOBIL_BUF_LENGTH 300 @@ -92,12 +94,22 @@ { USB_DEVICE(KOBIL_VENDOR_ID, KOBIL_ADAPTER_B_PRODUCT_ID) }, { USB_DEVICE(KOBIL_VENDOR_ID, KOBIL_ADAPTER_K_PRODUCT_ID) }, { USB_DEVICE(KOBIL_VENDOR_ID, KOBIL_USBTWIN_PRODUCT_ID) }, + { USB_DEVICE(KOBIL_VENDOR_ID, KOBIL_KAAN_SIM_PRODUCT_ID) }, { } /* Terminating entry */ }; MODULE_DEVICE_TABLE (usb, id_table); +static struct usb_driver kobil_driver = { + .owner = THIS_MODULE, + .name = "kobil", + .probe = usb_serial_probe, + .disconnect = usb_serial_disconnect, + .id_table = id_table, +}; + + struct usb_serial_device_type kobil_device = { .owner = THIS_MODULE, .name = "KOBIL USB smart card terminal", @@ -161,6 +173,9 @@ case KOBIL_USBTWIN_PRODUCT_ID: printk(KERN_DEBUG "KOBIL USBTWIN detected\n"); break; + case KOBIL_KAAN_SIM_PRODUCT_ID: + printk(KERN_DEBUG "KOBIL KAAN SIM detected\n"); + break; } usb_set_serial_port_data(serial->port, priv); @@ -353,7 +368,7 @@ struct usb_serial_port *port = (struct usb_serial_port *) purb->context; struct tty_struct *tty; unsigned char *data = purb->transfer_buffer; - char *dbg_data; +// char *dbg_data; dbg("%s - port %d", __FUNCTION__, port->number); @@ -366,16 +381,18 @@ if (purb->actual_length) { // BEGIN DEBUG - dbg_data = (unsigned char *) kmalloc((3 * purb->actual_length + 10) * sizeof(char), GFP_KERNEL); - if (! dbg_data) { - return; - } - memset(dbg_data, 0, (3 * purb->actual_length + 10)); - for (i = 0; i < purb->actual_length; i++) { - sprintf(dbg_data +3*i, "%02X ", data[i]); - } - dbg(" <-- %s", dbg_data ); - kfree(dbg_data); + /* + dbg_data = (unsigned char *) kmalloc((3 * purb->actual_length + 10) * sizeof(char), GFP_KERNEL); + if (! dbg_data) { + return; + } + memset(dbg_data, 0, (3 * purb->actual_length + 10)); + for (i = 0; i < purb->actual_length; i++) { + sprintf(dbg_data +3*i, "%02X ", data[i]); + } + dbg(" <-- %s", dbg_data ); + kfree(dbg_data); + */ // END DEBUG for (i = 0; i < purb->actual_length; ++i) { @@ -438,7 +455,7 @@ priv->filled = priv->filled + count; - // only send complete block. TWIN and adapter K use the same protocol. + // only send complete block. TWIN, KAAN SIM and adapter K use the same protocol. if ( ((priv->device_type != KOBIL_ADAPTER_B_PRODUCT_ID) && (priv->filled > 2) && (priv->filled >= (priv->buf[1] + 3))) || ((priv->device_type == KOBIL_ADAPTER_B_PRODUCT_ID) && (priv->filled > 3) && (priv->filled >= (priv->buf[2] + 4))) ) { @@ -503,7 +520,7 @@ int transfer_buffer_length = 8; priv = usb_get_serial_port_data(port); - if (priv->device_type == KOBIL_USBTWIN_PRODUCT_ID) { + if ((priv->device_type == KOBIL_USBTWIN_PRODUCT_ID) || (priv->device_type == KOBIL_KAAN_SIM_PRODUCT_ID)) { // This device doesn't support ioctl calls return -EINVAL; } @@ -549,7 +566,7 @@ int transfer_buffer_length = 8; priv = usb_get_serial_port_data(port); - if (priv->device_type == KOBIL_USBTWIN_PRODUCT_ID) { + if ((priv->device_type == KOBIL_USBTWIN_PRODUCT_ID) || (priv->device_type == KOBIL_KAAN_SIM_PRODUCT_ID)) { // This device doesn't support ioctl calls return -EINVAL; } @@ -616,7 +633,7 @@ char *settings; priv = usb_get_serial_port_data(port); - if (priv->device_type == KOBIL_USBTWIN_PRODUCT_ID) { + if ((priv->device_type == KOBIL_USBTWIN_PRODUCT_ID) || (priv->device_type == KOBIL_KAAN_SIM_PRODUCT_ID)) { // This device doesn't support ioctl calls return 0; } @@ -727,6 +744,7 @@ static int __init kobil_init (void) { usb_serial_register (&kobil_device); + usb_register (&kobil_driver); info(DRIVER_VERSION " " DRIVER_AUTHOR); info(DRIVER_DESC); @@ -737,6 +755,7 @@ static void __exit kobil_exit (void) { + usb_deregister (&kobil_driver); usb_serial_deregister (&kobil_device); } diff -urN linux-2.5.70-bk7/drivers/usb/storage/datafab.c linux-2.5.70-bk8/drivers/usb/storage/datafab.c --- linux-2.5.70-bk7/drivers/usb/storage/datafab.c 2003-05-26 18:01:00.000000000 -0700 +++ linux-2.5.70-bk8/drivers/usb/storage/datafab.c 2003-06-03 04:38:38.000000000 -0700 @@ -670,7 +670,7 @@ srb->result = SUCCESS; } else { info->sense_key = UNIT_ATTENTION; - srb->result = CHECK_CONDITION << 1; + srb->result = SAM_STAT_CHECK_CONDITION; } return rc; } diff -urN linux-2.5.70-bk7/drivers/usb/storage/freecom.c linux-2.5.70-bk8/drivers/usb/storage/freecom.c --- linux-2.5.70-bk7/drivers/usb/storage/freecom.c 2003-05-26 18:01:01.000000000 -0700 +++ linux-2.5.70-bk8/drivers/usb/storage/freecom.c 2003-06-03 04:38:38.000000000 -0700 @@ -399,7 +399,7 @@ } } - result = usb_control_msg(us->pusb_dev, us->recv_ctrl_pipe, + result = usb_stor_control_msg(us, us->recv_ctrl_pipe, 0x4c, 0xc0, 0x4346, 0x0, buffer, 0x20, 3*HZ); buffer[32] = '\0'; US_DEBUGP("String returned from FC init is: %s\n", buffer); @@ -411,7 +411,7 @@ */ /* send reset */ - result = usb_control_msg(us->pusb_dev, us->send_ctrl_pipe, + result = usb_stor_control_msg(us, us->send_ctrl_pipe, 0x4d, 0x40, 0x24d8, 0x0, NULL, 0x0, 3*HZ); US_DEBUGP("result from activate reset is %d\n", result); @@ -419,7 +419,7 @@ mdelay(250); /* clear reset */ - result = usb_control_msg(us->pusb_dev, us->send_ctrl_pipe, + result = usb_stor_control_msg(us, us->send_ctrl_pipe, 0x4d, 0x40, 0x24f8, 0x0, NULL, 0x0, 3*HZ); US_DEBUGP("result from clear reset is %d\n", result); diff -urN linux-2.5.70-bk7/drivers/usb/storage/initializers.c linux-2.5.70-bk8/drivers/usb/storage/initializers.c --- linux-2.5.70-bk7/drivers/usb/storage/initializers.c 2003-05-26 18:00:38.000000000 -0700 +++ linux-2.5.70-bk8/drivers/usb/storage/initializers.c 2003-06-03 04:38:38.000000000 -0700 @@ -50,7 +50,7 @@ int result; US_DEBUGP("Attempting to init eUSCSI bridge...\n"); - result = usb_control_msg(us->pusb_dev, us->send_ctrl_pipe, + result = usb_stor_control_msg(us, us->send_ctrl_pipe, 0x0C, USB_RECIP_INTERFACE | USB_TYPE_VENDOR, 0x01, 0x0, &data, 0x1, 5*HZ); US_DEBUGP("-- result is %d\n", result); diff -urN linux-2.5.70-bk7/drivers/usb/storage/initializers.h linux-2.5.70-bk8/drivers/usb/storage/initializers.h --- linux-2.5.70-bk7/drivers/usb/storage/initializers.h 2003-05-26 18:00:40.000000000 -0700 +++ linux-2.5.70-bk8/drivers/usb/storage/initializers.h 2003-06-03 04:38:38.000000000 -0700 @@ -39,6 +39,7 @@ #include #include "usb.h" +#include "transport.h" /* This places the Shuttle/SCM USB<->SCSI bridge devices in multi-target * mode */ diff -urN linux-2.5.70-bk7/drivers/usb/storage/isd200.c linux-2.5.70-bk8/drivers/usb/storage/isd200.c --- linux-2.5.70-bk7/drivers/usb/storage/isd200.c 2003-05-26 18:00:40.000000000 -0700 +++ linux-2.5.70-bk8/drivers/usb/storage/isd200.c 2003-06-03 04:38:38.000000000 -0700 @@ -558,7 +558,7 @@ case USB_STOR_TRANSPORT_GOOD: /* Indicate a good result */ - srb->result = GOOD << 1; + srb->result = SAM_STAT_GOOD; break; case USB_STOR_TRANSPORT_FAILED: @@ -598,11 +598,11 @@ } if (result == ISD200_GOOD) { isd200_build_sense(us, srb); - srb->result = CHECK_CONDITION << 1; + srb->result = SAM_STAT_CHECK_CONDITION; /* If things are really okay, then let's show that */ if ((srb->sense_buffer[2] & 0xf) == 0x0) - srb->result = GOOD << 1; + srb->result = SAM_STAT_GOOD; } else srb->result = DID_ERROR << 16; } @@ -611,7 +611,7 @@ * condition, show that in the result code */ if (transferStatus == USB_STOR_TRANSPORT_FAILED) - srb->result = CHECK_CONDITION << 1; + srb->result = SAM_STAT_CHECK_CONDITION; } #ifdef CONFIG_USB_STORAGE_DEBUG @@ -1185,7 +1185,7 @@ /* copy InquiryData */ isd200_data_copy(srb, (char *) &info->InquiryData, srb->request_bufflen); - srb->result = GOOD << 1; + srb->result = SAM_STAT_GOOD; sendToTransport = FALSE; break; @@ -1205,7 +1205,7 @@ srb->request_bufflen = 0; } else { US_DEBUGP(" Media Status not supported, just report okay\n"); - srb->result = GOOD << 1; + srb->result = SAM_STAT_GOOD; sendToTransport = FALSE; } break; @@ -1226,7 +1226,7 @@ srb->request_bufflen = 0; } else { US_DEBUGP(" Media Status not supported, just report okay\n"); - srb->result = GOOD << 1; + srb->result = SAM_STAT_GOOD; sendToTransport = FALSE; } break; @@ -1252,7 +1252,7 @@ srb->request_bufflen = sizeof(struct read_capacity_data); isd200_data_copy(srb, (char *) &readCapacityData, srb->request_bufflen); - srb->result = GOOD << 1; + srb->result = SAM_STAT_GOOD; sendToTransport = FALSE; } break; @@ -1336,7 +1336,7 @@ srb->request_bufflen = 0; } else { US_DEBUGP(" Not removeable media, just report okay\n"); - srb->result = GOOD << 1; + srb->result = SAM_STAT_GOOD; sendToTransport = FALSE; } break; @@ -1365,7 +1365,7 @@ srb->request_bufflen = 0; } else { US_DEBUGP(" Nothing to do, just report okay\n"); - srb->result = GOOD << 1; + srb->result = SAM_STAT_GOOD; sendToTransport = FALSE; } break; diff -urN linux-2.5.70-bk7/drivers/usb/storage/jumpshot.c linux-2.5.70-bk8/drivers/usb/storage/jumpshot.c --- linux-2.5.70-bk7/drivers/usb/storage/jumpshot.c 2003-05-26 18:00:21.000000000 -0700 +++ linux-2.5.70-bk8/drivers/usb/storage/jumpshot.c 2003-06-03 04:38:38.000000000 -0700 @@ -611,7 +611,7 @@ srb->result = SUCCESS; } else { info->sense_key = UNIT_ATTENTION; - srb->result = CHECK_CONDITION << 1; + srb->result = SAM_STAT_CHECK_CONDITION; } return rc; } diff -urN linux-2.5.70-bk7/drivers/usb/storage/protocol.c linux-2.5.70-bk8/drivers/usb/storage/protocol.c --- linux-2.5.70-bk7/drivers/usb/storage/protocol.c 2003-05-26 18:00:20.000000000 -0700 +++ linux-2.5.70-bk8/drivers/usb/storage/protocol.c 2003-06-03 04:38:38.000000000 -0700 @@ -137,8 +137,7 @@ /* send the command to the transport layer */ usb_stor_invoke_transport(srb, us); - if (srb->result == GOOD << 1) { - + if (srb->result == SAM_STAT_GOOD) { /* fix the INQUIRY data if necessary */ fix_inquiry_data(srb); } @@ -210,7 +209,7 @@ /* send the command to the transport layer */ usb_stor_invoke_transport(srb, us); - if (srb->result == GOOD << 1) { + if (srb->result == SAM_STAT_GOOD) { /* Fix the MODE_SENSE data if we translated the command */ if (old_cmnd == MODE_SENSE) @@ -307,7 +306,7 @@ /* send the command to the transport layer */ usb_stor_invoke_transport(srb, us); - if (srb->result == GOOD << 1) { + if (srb->result == SAM_STAT_GOOD) { /* Fix the MODE_SENSE data if we translated the command */ if (old_cmnd == MODE_SENSE) @@ -376,7 +375,7 @@ /* send the command to the transport layer */ usb_stor_invoke_transport(srb, us); - if (srb->result == GOOD << 1) { + if (srb->result == SAM_STAT_GOOD) { /* Fix the MODE_SENSE data if we translated the command */ if ((us->flags & US_FL_MODE_XLATE) && (old_cmnd == MODE_SENSE)) diff -urN linux-2.5.70-bk7/drivers/usb/storage/scsiglue.c linux-2.5.70-bk8/drivers/usb/storage/scsiglue.c --- linux-2.5.70-bk7/drivers/usb/storage/scsiglue.c 2003-06-03 04:38:31.000000000 -0700 +++ linux-2.5.70-bk8/drivers/usb/storage/scsiglue.c 2003-06-03 04:38:38.000000000 -0700 @@ -219,7 +219,7 @@ int state = atomic_read(&us->sm_state); int result; - US_DEBUGP("device_reset() called\n" ); + US_DEBUGP("%s called\n", __FUNCTION__); if (state != US_STATE_IDLE) { printk(KERN_ERR USB_STORAGE "Error in %s: " "invalid state %d\n", __FUNCTION__, state); @@ -245,39 +245,49 @@ return result; } -/* This resets the device port */ +/* This resets the device's USB port. */ /* It refuses to work if there's more than one interface in - this device, so that other users are not affected. */ + * the device, so that other users are not affected. */ /* This is always called with scsi_lock(srb->host) held */ - static int usb_storage_bus_reset( Scsi_Cmnd *srb ) { - struct us_data *us; + struct us_data *us = (struct us_data *)srb->device->host->hostdata[0]; + int state = atomic_read(&us->sm_state); int result; - /* we use the usb_reset_device() function to handle this for us */ - US_DEBUGP("bus_reset() called\n"); + US_DEBUGP("%s called\n", __FUNCTION__); + if (state != US_STATE_IDLE) { + printk(KERN_ERR USB_STORAGE "Error in %s: " + "invalid state %d\n", __FUNCTION__, state); + return FAILED; + } + + /* set the state and release the lock */ + atomic_set(&us->sm_state, US_STATE_RESETTING); scsi_unlock(srb->device->host); - us = (struct us_data *)srb->device->host->hostdata[0]; /* The USB subsystem doesn't handle synchronisation between a device's several drivers. Therefore we reset only devices - with one interface which we of course own. + with just one interface, which we of course own. */ - + //FIXME: needs locking against config changes - - if ( us->pusb_dev->actconfig->desc.bNumInterfaces == 1) { - /* attempt to reset the port */ + + if (us->pusb_dev->actconfig->desc.bNumInterfaces == 1) { + + /* lock the device and attempt to reset the port */ + down(&(us->dev_semaphore)); result = usb_reset_device(us->pusb_dev); + up(&(us->dev_semaphore)); US_DEBUGP("usb_reset_device returns %d\n", result); } else { result = -EBUSY; - US_DEBUGP("cannot reset a multiinterface device. failing to reset.\n"); + US_DEBUGP("Refusing to reset a multi-interface device\n"); } - US_DEBUGP("bus_reset() complete\n"); + /* lock access to the state and clear it */ scsi_lock(srb->device->host); + atomic_set(&us->sm_state, US_STATE_IDLE); return result < 0 ? FAILED : SUCCESS; } diff -urN linux-2.5.70-bk7/drivers/usb/storage/transport.c linux-2.5.70-bk8/drivers/usb/storage/transport.c --- linux-2.5.70-bk7/drivers/usb/storage/transport.c 2003-06-03 04:38:31.000000000 -0700 +++ linux-2.5.70-bk8/drivers/usb/storage/transport.c 2003-06-03 04:38:38.000000000 -0700 @@ -75,7 +75,7 @@ * below, which atomically tests-and-clears the URB_ACTIVE bit in us->flags * to see if the current_urb needs to be stopped. Likewise, the SG_ACTIVE * bit is tested to see if the current_sg scatter-gather request needs to be - * stopped. + * stopped. The timeout callback routine does much the same thing. * * When a disconnect occurs, the DISCONNECTING bit in us->flags is set to * prevent new URBs from being submitted, and usb_stor_stop_transport() is @@ -109,6 +109,19 @@ complete(urb_done_ptr); } + +/* This is the timeout handler which will cancel an URB when its timeout + * expires. + */ +static void timeout_handler(unsigned long us_) +{ + struct us_data *us = (struct us_data *) us_; + + if (test_and_clear_bit(US_FLIDX_URB_ACTIVE, &us->flags)) { + US_DEBUGP("Timeout -- cancelling URB\n"); + usb_unlink_urb(us->current_urb); + } +} /* This is the common part of the URB message submission code * @@ -116,9 +129,10 @@ * command _must_ pass through this function (or something like it) for the * abort mechanisms to work properly. */ -static int usb_stor_msg_common(struct us_data *us) +static int usb_stor_msg_common(struct us_data *us, int timeout) { struct completion urb_done; + struct timer_list to_timer; int status; /* don't submit URBS during abort/disconnect processing */ @@ -155,24 +169,42 @@ usb_unlink_urb(us->current_urb); } } + + /* submit the timeout timer, if a timeout was requested */ + if (timeout > 0) { + init_timer(&to_timer); + to_timer.expires = jiffies + timeout; + to_timer.function = timeout_handler; + to_timer.data = (unsigned long) us; + add_timer(&to_timer); + } /* wait for the completion of the URB */ wait_for_completion(&urb_done); clear_bit(US_FLIDX_URB_ACTIVE, &us->flags); + + /* clean up the timeout timer */ + if (timeout > 0) + del_timer_sync(&to_timer); /* return the URB status */ return us->current_urb->status; } -/* This is our function to emulate usb_control_msg() with enough control - * to make aborts/resets/timeouts work +/* + * Transfer one control message, with timeouts, and allowing early + * termination. Return codes are usual -Exxx, *not* USB_STOR_XFER_xxx. */ int usb_stor_control_msg(struct us_data *us, unsigned int pipe, - u8 request, u8 requesttype, u16 value, u16 index, - void *data, u16 size) + u8 request, u8 requesttype, u16 value, u16 index, + void *data, u16 size, int timeout) { int status; + US_DEBUGP("%s: rq=%02x rqtype=%02x value=%04x index=%02x len=%u\n", + __FUNCTION__, request, requesttype, + value, index, size); + /* fill in the devrequest structure */ us->dr->bRequestType = requesttype; us->dr->bRequest = request; @@ -184,7 +216,7 @@ usb_fill_control_urb(us->current_urb, us->pusb_dev, pipe, (unsigned char*) us->dr, data, size, usb_stor_blocking_completion, NULL); - status = usb_stor_msg_common(us); + status = usb_stor_msg_common(us, timeout); /* return the actual length of the data transferred if no error */ if (status == 0) @@ -192,9 +224,9 @@ return status; } -/* This is a version of usb_clear_halt() that doesn't read the status from - * the device -- this is because some devices crash their internal firmware - * when the status is requested after a halt. +/* This is a version of usb_clear_halt() that allows early termination and + * doesn't read the status from the device -- this is because some devices + * crash their internal firmware when the status is requested after a halt. * * A definitive list of these 'bad' devices is too difficult to maintain or * make complete enough to be useful. This problem was first observed on the @@ -214,12 +246,7 @@ result = usb_stor_control_msg(us, us->send_ctrl_pipe, USB_REQ_CLEAR_FEATURE, USB_RECIP_ENDPOINT, 0, - endp, NULL, 0); /* note: no 3*HZ timeout */ - US_DEBUGP("usb_stor_clear_halt: result=%d\n", result); - - /* this is a failure case */ - if (result < 0) - return result; + endp, NULL, 0, 3*HZ); /* reset the toggles and endpoint flags */ usb_endpoint_running(us->pusb_dev, usb_pipeendpoint(pipe), @@ -227,7 +254,8 @@ usb_settoggle(us->pusb_dev, usb_pipeendpoint(pipe), usb_pipeout(pipe), 0); - return 0; + US_DEBUGP("%s: result = %d\n", __FUNCTION__, result); + return result; } @@ -317,7 +345,7 @@ usb_fill_control_urb(us->current_urb, us->pusb_dev, pipe, (unsigned char*) us->dr, data, size, usb_stor_blocking_completion, NULL); - result = usb_stor_msg_common(us); + result = usb_stor_msg_common(us, 0); return interpret_urb_result(us, pipe, size, result, us->current_urb->actual_length); @@ -347,7 +375,7 @@ usb_fill_int_urb(us->current_urb, us->pusb_dev, pipe, buf, maxp, usb_stor_blocking_completion, NULL, us->ep_bInterval); - result = usb_stor_msg_common(us); + result = usb_stor_msg_common(us, 0); return interpret_urb_result(us, pipe, length, result, us->current_urb->actual_length); @@ -368,7 +396,7 @@ /* fill and submit the URB */ usb_fill_bulk_urb(us->current_urb, us->pusb_dev, pipe, buf, length, usb_stor_blocking_completion, NULL); - result = usb_stor_msg_common(us); + result = usb_stor_msg_common(us, 0); /* store the actual length of the data transferred */ if (act_len) @@ -490,7 +518,6 @@ } /* if there is a transport error, reset and don't auto-sense */ - /* What if we want to abort during the reset? */ if (result == USB_STOR_TRANSPORT_ERROR) { US_DEBUGP("-- transport indicates error, resetting\n"); us->transport_reset(us); @@ -559,6 +586,7 @@ unsigned char old_sc_data_direction; unsigned char old_cmd_len; unsigned char old_cmnd[MAX_COMMAND_SIZE]; + unsigned long old_serial_number; US_DEBUGP("Issuing auto-REQUEST_SENSE\n"); @@ -594,6 +622,10 @@ old_sg = srb->use_sg; srb->use_sg = 0; + /* change the serial number -- toggle the high bit*/ + old_serial_number = srb->serial_number; + srb->serial_number ^= 0x80000000; + /* issue the auto-sense command */ temp_result = us->transport(us->srb, us); @@ -601,6 +633,7 @@ srb->request_buffer = old_request_buffer; srb->request_bufflen = old_request_bufflen; srb->use_sg = old_sg; + srb->serial_number = old_serial_number; srb->sc_data_direction = old_sc_data_direction; srb->cmd_len = old_cmd_len; memcpy(srb->cmnd, old_cmnd, MAX_COMMAND_SIZE); @@ -616,10 +649,8 @@ * multi-target device, since failure of an * auto-sense is perfectly valid */ - if (!(us->flags & US_FL_SCM_MULT_TARG)) { - /* What if we try to abort during the reset? */ + if (!(us->flags & US_FL_SCM_MULT_TARG)) us->transport_reset(us); - } srb->result = DID_ERROR << 16; return; } @@ -638,19 +669,19 @@ #endif /* set the result so the higher layers expect this data */ - srb->result = CHECK_CONDITION << 1; + srb->result = SAM_STAT_CHECK_CONDITION; /* If things are really okay, then let's show that */ if ((srb->sense_buffer[2] & 0xf) == 0x0) - srb->result = GOOD << 1; + srb->result = SAM_STAT_GOOD; } else /* if (need_auto_sense) */ - srb->result = GOOD << 1; + srb->result = SAM_STAT_GOOD; /* Regardless of auto-sense, if we _know_ we have an error * condition, show that in the result code */ if (result == USB_STOR_TRANSPORT_FAILED) - srb->result = CHECK_CONDITION << 1; + srb->result = SAM_STAT_CHECK_CONDITION; /* If we think we're good, then make sure the sense data shows it. * This is necessary because the auto-sense for some devices always @@ -844,11 +875,8 @@ unsigned char data; int result; - /* Issue the command -- use usb_control_msg() because this is - * not a scsi queued-command. Also note that at this point the - * cached pipe values have not yet been stored. */ - result = usb_control_msg(us->pusb_dev, - usb_rcvctrlpipe(us->pusb_dev, 0), + /* issue the command */ + result = usb_stor_control_msg(us, us->recv_ctrl_pipe, US_BULK_GET_MAX_LUN, USB_DIR_IN | USB_TYPE_CLASS | USB_RECIP_INTERFACE, @@ -982,43 +1010,40 @@ u16 value, u16 index, void *data, u16 size) { int result; + int result2; /* A 20-second timeout may seem rather long, but a LaCie * StudioDrive USB2 device takes 16+ seconds to get going * following a powerup or USB attach event. */ - /* Use usb_control_msg() because this is not a queued-command */ - result = usb_control_msg(us->pusb_dev, us->send_ctrl_pipe, + result = usb_stor_control_msg(us, us->send_ctrl_pipe, request, requesttype, value, index, data, size, 20*HZ); - if (result < 0) - goto Done; + if (result < 0) { + US_DEBUGP("Soft reset failed: %d\n", result); + return FAILED; + } - /* long wait for reset */ + /* long wait for reset, so unlock to allow disconnects */ + up(&us->dev_semaphore); set_current_state(TASK_UNINTERRUPTIBLE); schedule_timeout(HZ*6); set_current_state(TASK_RUNNING); + down(&us->dev_semaphore); - /* Use usb_clear_halt() because this is not a queued-command */ US_DEBUGP("Soft reset: clearing bulk-in endpoint halt\n"); - result = usb_clear_halt(us->pusb_dev, us->recv_bulk_pipe); - if (result < 0) - goto Done; + result = usb_stor_clear_halt(us, us->recv_bulk_pipe); US_DEBUGP("Soft reset: clearing bulk-out endpoint halt\n"); - result = usb_clear_halt(us->pusb_dev, us->send_bulk_pipe); - - Done: + result2 = usb_stor_clear_halt(us, us->send_bulk_pipe); /* return a result code based on the result of the control message */ - if (result < 0) { - US_DEBUGP("Soft reset failed: %d\n", result); - result = FAILED; - } else { - US_DEBUGP("Soft reset done\n"); - result = SUCCESS; + if (result < 0 || result2 < 0) { + US_DEBUGP("Soft reset failed\n"); + return FAILED; } - return result; + US_DEBUGP("Soft reset done\n"); + return SUCCESS; } /* This issues a CB[I] Reset to the device in question diff -urN linux-2.5.70-bk7/drivers/usb/storage/transport.h linux-2.5.70-bk8/drivers/usb/storage/transport.h --- linux-2.5.70-bk7/drivers/usb/storage/transport.h 2003-06-03 04:38:31.000000000 -0700 +++ linux-2.5.70-bk8/drivers/usb/storage/transport.h 2003-06-03 04:38:38.000000000 -0700 @@ -160,9 +160,9 @@ extern int usb_stor_control_msg(struct us_data *us, unsigned int pipe, u8 request, u8 requesttype, u16 value, u16 index, - void *data, u16 size); + void *data, u16 size, int timeout); +extern int usb_stor_clear_halt(struct us_data *us, unsigned int pipe); -extern int usb_stor_clear_halt(struct us_data*, unsigned int pipe); extern int usb_stor_ctrl_transfer(struct us_data *us, unsigned int pipe, u8 request, u8 requesttype, u16 value, u16 index, void *data, u16 size); diff -urN linux-2.5.70-bk7/drivers/usb/storage/usb.c linux-2.5.70-bk8/drivers/usb/storage/usb.c --- linux-2.5.70-bk7/drivers/usb/storage/usb.c 2003-06-03 04:38:31.000000000 -0700 +++ linux-2.5.70-bk8/drivers/usb/storage/usb.c 2003-06-03 04:38:38.000000000 -0700 @@ -374,7 +374,7 @@ memcpy(us->srb->sense_buffer, usb_stor_sense_invalidCDB, sizeof(usb_stor_sense_invalidCDB)); - us->srb->result = CHECK_CONDITION << 1; + us->srb->result = SAM_STAT_CHECK_CONDITION; } /* Handle those devices which need us to fake @@ -387,7 +387,7 @@ US_DEBUGP("Faking INQUIRY command\n"); fill_inquiry_response(us, data_ptr, 36); - us->srb->result = GOOD << 1; + us->srb->result = SAM_STAT_GOOD; } /* we've got a command, let's do it! */ @@ -412,9 +412,11 @@ US_DEBUGP("scsi command aborted\n"); } - /* in case an abort request was received after the command - * completed, we must use a separate test to see whether - * we need to signal that the abort has finished */ + /* If an abort request was received we need to signal that + * the abort has finished. The proper test for this is + * sm_state == US_STATE_ABORTING, not srb->result == DID_ABORT, + * because an abort request might be received after all the + * USB processing was complete. */ if (atomic_read(&us->sm_state) == US_STATE_ABORTING) complete(&(us->notify)); @@ -715,7 +717,6 @@ us->transport_name = "Bulk"; us->transport = usb_stor_Bulk_transport; us->transport_reset = usb_stor_Bulk_reset; - us->max_lun = usb_stor_Bulk_max_lun(us); break; #ifdef CONFIG_USB_STORAGE_HP8200e @@ -842,6 +843,10 @@ if (usb_stor_allocate_urbs(us)) goto BadDevice; + /* For bulk-only devices, determine the max LUN value */ + if (us->protocol == US_PR_BULK) + us->max_lun = usb_stor_Bulk_max_lun(us); + /* * Since this is a new device, we need to generate a scsi * host definition, and register with the higher SCSI layers diff -urN linux-2.5.70-bk7/drivers/usb/storage/usb.h linux-2.5.70-bk8/drivers/usb/storage/usb.h --- linux-2.5.70-bk7/drivers/usb/storage/usb.h 2003-06-03 04:38:31.000000000 -0700 +++ linux-2.5.70-bk8/drivers/usb/storage/usb.h 2003-06-03 04:38:38.000000000 -0700 @@ -82,7 +82,7 @@ #define US_FLIDX_SG_ACTIVE 19 /* 0x00080000 current_sg is in use */ #define US_FLIDX_ABORTING 20 /* 0x00100000 abort is in progress */ #define US_FLIDX_DISCONNECTING 21 /* 0x00200000 disconnect in progress */ -#define DONT_SUBMIT ((1UL << US_FLIDX_ABORTING) || \ +#define DONT_SUBMIT ((1UL << US_FLIDX_ABORTING) | \ (1UL << US_FLIDX_DISCONNECTING)) diff -urN linux-2.5.70-bk7/fs/eventpoll.c linux-2.5.70-bk8/fs/eventpoll.c --- linux-2.5.70-bk7/fs/eventpoll.c 2003-05-26 18:00:38.000000000 -0700 +++ linux-2.5.70-bk8/fs/eventpoll.c 2003-06-03 04:38:38.000000000 -0700 @@ -150,6 +150,14 @@ /* Protect the this structure access */ rwlock_t lock; + /* + * This semaphore is used to ensure that files are not removed + * while epoll is using them. This is read-held during the event + * collection loop and it is write-held during the file cleanup + * path, the epoll file exit code and the ctl operations. + */ + struct rw_semaphore sem; + /* Wait queue used by sys_epoll_wait() */ wait_queue_head_t wq; @@ -279,16 +287,6 @@ /* Safe wake up implementation */ static struct poll_safewake psw; -/* - * This semaphore is used to ensure that files are not removed - * while epoll is using them. Namely the f_op->poll(), since - * it has to be called from outside the lock, must be protected. - * This is read-held during the event transfer loop to userspace - * and it is write-held during the file cleanup path and the epoll - * file exit code. - */ -static struct rw_semaphore epsem; - /* Slab cache used to allocate "struct epitem" */ static kmem_cache_t *epi_cache; @@ -357,15 +355,14 @@ list_for_each(lnk, lsthead) { tncur = list_entry(lnk, struct wake_task_node, llink); - if (tncur->task == this_task) { - if (tncur->wq == wq || ++wake_nests > EP_MAX_POLLWAKE_NESTS) { - /* - * Ops ... loop detected or maximum nest level reached. - * We abort this wake by breaking the cycle itself. - */ - spin_unlock_irqrestore(&psw->lock, flags); - return; - } + if (tncur->wq == wq || + (tncur->task == this_task && ++wake_nests > EP_MAX_POLLWAKE_NESTS)) { + /* + * Ops ... loop detected or maximum nest level reached. + * We abort this wake by breaking the cycle itself. + */ + spin_unlock_irqrestore(&psw->lock, flags); + return; } } @@ -437,14 +434,15 @@ * The only hit might come from ep_free() but by holding the semaphore * will correctly serialize the operation. */ - down_write(&epsem); + while (!list_empty(lsthead)) { epi = list_entry(lsthead->next, struct epitem, fllink); EP_LIST_DEL(&epi->fllink); + down_write(&epi->ep->sem); ep_remove(epi->ep, epi); + up_write(&epi->ep->sem); } - up_write(&epsem); } @@ -568,9 +566,18 @@ error = -EEXIST; break; case EPOLL_CTL_DEL: - if (epi) + if (epi) { + /* + * We need to protect the remove operation because another + * thread might be doing an epoll_wait() and using the + * target file. + */ + down_write(&ep->sem); + error = ep_remove(ep, epi); - else + + up_write(&ep->sem); + } else error = -ENOENT; break; case EPOLL_CTL_MOD: @@ -703,10 +710,6 @@ file->f_vfsmnt = mntget(eventpoll_mnt); file->f_dentry = dget(dentry); - /* - * Initialize the file as read/write because it could be used - * with write() to add/remove/change interest sets. - */ file->f_pos = 0; file->f_flags = O_RDONLY; file->f_op = &eventpoll_fops; @@ -815,6 +818,7 @@ unsigned int i, hsize; rwlock_init(&ep->lock); + init_rwsem(&ep->sem); init_waitqueue_head(&ep->wq); init_waitqueue_head(&ep->poll_wait); INIT_LIST_HEAD(&ep->rdllist); @@ -841,11 +845,15 @@ struct list_head *lsthead, *lnk; struct epitem *epi; + /* We need to release all tasks waiting for these file */ + if (waitqueue_active(&ep->poll_wait)) + ep_poll_safewake(&psw, &ep->poll_wait); + /* * We need to lock this because we could be hit by * eventpoll_release() while we're freeing the "struct eventpoll". */ - down_write(&epsem); + down_write(&ep->sem); /* * Walks through the whole hash by unregistering poll callbacks. @@ -863,7 +871,7 @@ /* * Walks through the whole hash by freeing each "struct epitem". At this * point we are sure no poll callbacks will be lingering around, and also by - * write-holding "epsem" we can be sure that no file cleanup code will hit + * write-holding "sem" we can be sure that no file cleanup code will hit * us during this operation. So we can avoid the lock on "ep->lock". */ for (i = 0, hsize = 1 << ep->hashbits; i < hsize; i++) { @@ -876,7 +884,7 @@ } } - up_write(&epsem); + up_write(&ep->sem); /* Free hash pages */ ep_free_pages(ep->hpages, EP_HASH_PAGES(ep->hashbits)); @@ -1338,20 +1346,6 @@ /* If this file is already in the ready list we exit soon */ if (!EP_IS_LINKED(&epi->txlink)) { /* - * We need to increase the usage count of the "struct epitem" because - * another thread might call EPOLL_CTL_DEL on this target and make the - * object to vanish underneath our nose. - */ - ep_use_epitem(epi); - - /* - * We need to increase the usage count of the "struct file" because - * another thread might call close() on this target and make the file - * to vanish before we will be able to call f_op->poll(). - */ - get_file(epi->file); - - /* * This is initialized in this way so that the default * behaviour of the reinjecting code will be to push back * the item inside the ready list. @@ -1389,19 +1383,21 @@ struct epitem *epi; struct epoll_event event[EP_MAX_BUF_EVENTS]; + /* + * We can loop without lock because this is a task private list. + * The test done during the collection loop will guarantee us that + * another task will not try to collect this file. Also, items + * cannot vanish during the loop because we are holding "sem". + */ list_for_each(lnk, txlist) { epi = list_entry(lnk, struct epitem, txlink); - /* Get the ready file event set */ - revents = epi->file->f_op->poll(epi->file, NULL); - /* - * Release the file usage before checking the event mask. - * In case this call will lead to the file removal, its - * ->event.events member has been already set to zero and - * this will make the event to be dropped. + * Get the ready file event set. We can safely use the file + * because we are holding the "sem" in read and this will + * guarantee that both the file and the item will not vanish. */ - fput(epi->file); + revents = epi->file->f_op->poll(epi->file, NULL); /* * Set the return event set for the current file descriptor. @@ -1416,17 +1412,8 @@ eventbuf++; if (eventbuf == EP_MAX_BUF_EVENTS) { if (__copy_to_user(&events[eventcnt], event, - eventbuf * sizeof(struct epoll_event))) { - /* - * We need to complete the loop to decrement the file - * usage before returning from this function. - */ - for (lnk = lnk->next; lnk != txlist; lnk = lnk->next) { - epi = list_entry(lnk, struct epitem, txlink); - fput(epi->file); - } + eventbuf * sizeof(struct epoll_event))) return -EFAULT; - } eventcnt += eventbuf; eventbuf = 0; } @@ -1447,7 +1434,8 @@ /* * Walk through the transfer list we collected with ep_collect_ready_items() * and, if 1) the item is still "alive" 2) its event set is not empty 3) it's - * not already linked, links it to the ready list. + * not already linked, links it to the ready list. Same as above, we are holding + * "sem" so items cannot vanish underneath our nose. */ static void ep_reinject_items(struct eventpoll *ep, struct list_head *txlist) { @@ -1475,8 +1463,6 @@ list_add_tail(&epi->rdllink, &ep->rdllist); ricnt++; } - - ep_release_epitem(epi); } if (ricnt) { @@ -1510,17 +1496,12 @@ /* * We need to lock this because we could be hit by - * eventpoll_release() while we're transfering - * events to userspace. Read-holding "epsem" will lock - * out eventpoll_release() during the whole - * transfer loop and this will garantie us that the - * file will not vanish underneath our nose when - * we will call f_op->poll() from ep_send_events(). + * eventpoll_release() and epoll_ctl(EPOLL_CTL_DEL). */ - down_read(&epsem); + down_read(&ep->sem); /* Collect/extract ready items */ - if (ep_collect_ready_items(ep, &txlist, maxevents)) { + if (ep_collect_ready_items(ep, &txlist, maxevents) > 0) { /* Build result set in userspace */ eventcnt = ep_send_events(ep, &txlist, events); @@ -1528,7 +1509,7 @@ ep_reinject_items(ep, &txlist); } - up_read(&epsem); + up_read(&ep->sem); return eventcnt; } @@ -1652,9 +1633,6 @@ { int error; - /* Initialize the semaphore used to syncronize the file cleanup code */ - init_rwsem(&epsem); - /* Initialize the structure used to perform safe poll wait head wake ups */ ep_poll_safewake_init(&psw); diff -urN linux-2.5.70-bk7/fs/ext3/inode.c linux-2.5.70-bk8/fs/ext3/inode.c --- linux-2.5.70-bk7/fs/ext3/inode.c 2003-05-26 18:00:42.000000000 -0700 +++ linux-2.5.70-bk8/fs/ext3/inode.c 2003-06-03 04:38:38.000000000 -0700 @@ -1262,6 +1262,13 @@ return 0; } +static int journal_dirty_data_fn(handle_t *handle, struct buffer_head *bh) +{ + if (buffer_mapped(bh)) + return ext3_journal_dirty_data(handle, bh); + return 0; +} + /* * Note that we always start a transaction even if we're not journalling * data. This is to preserve ordering: any hole instantiation within @@ -1381,7 +1388,7 @@ if (ret == 0) { err = walk_page_buffers(handle, page_bufs, 0, PAGE_CACHE_SIZE, NULL, - ext3_journal_dirty_data); + journal_dirty_data_fn); if (!ret) ret = err; } diff -urN linux-2.5.70-bk7/fs/proc/kcore.c linux-2.5.70-bk8/fs/proc/kcore.c --- linux-2.5.70-bk7/fs/proc/kcore.c 2003-05-26 18:00:40.000000000 -0700 +++ linux-2.5.70-bk8/fs/proc/kcore.c 2003-06-03 04:38:38.000000000 -0700 @@ -99,7 +99,12 @@ } #else /* CONFIG_KCORE_AOUT */ -#define KCORE_BASE PAGE_OFFSET +#ifndef kc_vaddr_to_offset +#define kc_vaddr_to_offset(v) ((v) - PAGE_OFFSET) +#endif +#ifndef kc_offset_to_vaddr +#define kc_offset_to_vaddr(o) ((o) + PAGE_OFFSET) +#endif #define roundup(x, y) ((((x)+((y)-1))/(y))*(y)) @@ -112,29 +117,60 @@ void *data; }; +static struct kcore_list *kclist; +static rwlock_t kclist_lock = RW_LOCK_UNLOCKED; + +void +kclist_add(struct kcore_list *new, void *addr, size_t size) +{ + new->addr = (unsigned long)addr; + new->size = size; + + write_lock(&kclist_lock); + new->next = kclist; + kclist = new; + write_unlock(&kclist_lock); +} + +struct kcore_list * +kclist_del(void *addr) +{ + struct kcore_list *m, **p = &kclist; + + write_lock(&kclist_lock); + for (m = *p; m; p = &m->next) { + if (m->addr == (unsigned long)addr) { + *p = m->next; + write_unlock(&kclist_lock); + return m; + } + } + write_unlock(&kclist_lock); + return 0; +} + extern char saved_command_line[]; -static size_t get_kcore_size(int *num_vma, size_t *elf_buflen) +static size_t get_kcore_size(int *nphdr, size_t *elf_buflen) { size_t try, size; - struct vm_struct *m; + struct kcore_list *m; - *num_vma = 0; - size = ((size_t)high_memory - KCORE_BASE + PAGE_SIZE); - if (!vmlist) { - *elf_buflen = PAGE_SIZE; - return (size); - } + *nphdr = 1; /* PT_NOTE */ + size = 0; - for (m=vmlist; m; m=m->next) { - try = (size_t)m->addr + m->size; - if (try > KCORE_BASE + size) - size = try - KCORE_BASE; - *num_vma = *num_vma + 1; + for (m=kclist; m; m=m->next) { + try = kc_vaddr_to_offset((size_t)m->addr + m->size); + if (try > size) + size = try; + *nphdr = *nphdr + 1; } *elf_buflen = sizeof(struct elfhdr) + - (*num_vma + 2)*sizeof(struct elf_phdr) + - 3 * sizeof(struct memelfnote); + (*nphdr + 2)*sizeof(struct elf_phdr) + + 3 * sizeof(struct memelfnote) + + sizeof(struct elf_prstatus) + + sizeof(struct elf_prpsinfo) + + sizeof(struct task_struct); *elf_buflen = PAGE_ALIGN(*elf_buflen); return size + *elf_buflen; } @@ -184,9 +220,9 @@ /* * store an ELF coredump header in the supplied buffer - * num_vma is the number of elements in vmlist + * nphdr is the number of elf_phdr to insert */ -static void elf_kcore_store_hdr(char *bufp, int num_vma, int dataoff) +static void elf_kcore_store_hdr(char *bufp, int nphdr, int dataoff) { struct elf_prstatus prstatus; /* NT_PRSTATUS */ struct elf_prpsinfo prpsinfo; /* NT_PRPSINFO */ @@ -194,7 +230,7 @@ struct elfhdr *elf; struct memelfnote notes[3]; off_t offset = 0; - struct vm_struct *m; + struct kcore_list *m; /* setup ELF header */ elf = (struct elfhdr *) bufp; @@ -214,7 +250,7 @@ elf->e_flags = 0; elf->e_ehsize = sizeof(struct elfhdr); elf->e_phentsize= sizeof(struct elf_phdr); - elf->e_phnum = 2 + num_vma; + elf->e_phnum = nphdr; elf->e_shentsize= 0; elf->e_shnum = 0; elf->e_shstrndx = 0; @@ -232,33 +268,17 @@ nhdr->p_flags = 0; nhdr->p_align = 0; - /* setup ELF PT_LOAD program header for the - * virtual range 0xc0000000 -> high_memory */ - phdr = (struct elf_phdr *) bufp; - bufp += sizeof(struct elf_phdr); - offset += sizeof(struct elf_phdr); - phdr->p_type = PT_LOAD; - phdr->p_flags = PF_R|PF_W|PF_X; - phdr->p_offset = PAGE_OFFSET - KCORE_BASE + dataoff; - phdr->p_vaddr = PAGE_OFFSET; - phdr->p_paddr = __pa(PAGE_OFFSET); - phdr->p_filesz = phdr->p_memsz = ((unsigned long)high_memory - PAGE_OFFSET); - phdr->p_align = PAGE_SIZE; - - /* setup ELF PT_LOAD program header for every vmalloc'd area */ - for (m=vmlist; m; m=m->next) { - if (m->flags & VM_IOREMAP) /* don't dump ioremap'd stuff! (TA) */ - continue; - + /* setup ELF PT_LOAD program header for every area */ + for (m=kclist; m; m=m->next) { phdr = (struct elf_phdr *) bufp; bufp += sizeof(struct elf_phdr); offset += sizeof(struct elf_phdr); phdr->p_type = PT_LOAD; phdr->p_flags = PF_R|PF_W|PF_X; - phdr->p_offset = (size_t)m->addr - KCORE_BASE + dataoff; + phdr->p_offset = kc_vaddr_to_offset(m->addr) + dataoff; phdr->p_vaddr = (size_t)m->addr; - phdr->p_paddr = __pa(m->addr); + phdr->p_paddr = 0; phdr->p_filesz = phdr->p_memsz = m->size; phdr->p_align = PAGE_SIZE; } @@ -294,7 +314,7 @@ strcpy(prpsinfo.pr_fname, "vmlinux"); strncpy(prpsinfo.pr_psargs, saved_command_line, ELF_PRARGSZ); - nhdr->p_filesz = notesize(¬es[1]); + nhdr->p_filesz += notesize(¬es[1]); bufp = storenote(¬es[1], bufp); /* set up the task structure */ @@ -303,7 +323,7 @@ notes[2].datasz = sizeof(struct task_struct); notes[2].data = current; - nhdr->p_filesz = notesize(¬es[2]); + nhdr->p_filesz += notesize(¬es[2]); bufp = storenote(¬es[2], bufp); } /* end elf_kcore_store_hdr() */ @@ -317,13 +337,14 @@ ssize_t acc = 0; size_t size, tsz; size_t elf_buflen; - int num_vma; + int nphdr; unsigned long start; - read_lock(&vmlist_lock); - proc_root_kcore->size = size = get_kcore_size(&num_vma, &elf_buflen); + read_lock(&kclist_lock); + tsz = get_kcore_size(&nphdr, &elf_buflen); + proc_root_kcore->size = size = tsz + elf_buflen; if (buflen == 0 || *fpos >= size) { - read_unlock(&vmlist_lock); + read_unlock(&kclist_lock); return 0; } @@ -340,12 +361,12 @@ tsz = buflen; elf_buf = kmalloc(elf_buflen, GFP_ATOMIC); if (!elf_buf) { - read_unlock(&vmlist_lock); + read_unlock(&kclist_lock); return -ENOMEM; } memset(elf_buf, 0, elf_buflen); - elf_kcore_store_hdr(elf_buf, num_vma, elf_buflen); - read_unlock(&vmlist_lock); + elf_kcore_store_hdr(elf_buf, nphdr, elf_buflen); + read_unlock(&kclist_lock); if (copy_to_user(buffer, elf_buf + *fpos, tsz)) { kfree(elf_buf); return -EFAULT; @@ -360,41 +381,30 @@ if (buflen == 0) return acc; } else - read_unlock(&vmlist_lock); - - /* where page 0 not mapped, write zeros into buffer */ -#if defined (__i386__) || defined (__mc68000__) || defined(__x86_64__) - if (*fpos < PAGE_SIZE + elf_buflen) { - /* work out how much to clear */ - tsz = PAGE_SIZE + elf_buflen - *fpos; - if (buflen < tsz) - tsz = buflen; - - /* write zeros to buffer */ - if (clear_user(buffer, tsz)) - return -EFAULT; - buflen -= tsz; - *fpos += tsz; - buffer += tsz; - acc += tsz; + read_unlock(&kclist_lock); - /* leave now if filled buffer already */ - if (buflen == 0) - return tsz; - } -#endif - /* - * Fill the remainder of the buffer from kernel VM space. - * We said in the ELF header that the data which starts - * at 'elf_buflen' is virtual address KCORE_BASE. --rmk + * Check to see if our file offset matches with any of + * the addresses in the elf_phdr on our list. */ - start = KCORE_BASE + (*fpos - elf_buflen); + start = kc_offset_to_vaddr(*fpos - elf_buflen); if ((tsz = (PAGE_SIZE - (start & ~PAGE_MASK))) > buflen) tsz = buflen; while (buflen) { - if ((start >= VMALLOC_START) && (start < VMALLOC_END)) { + struct kcore_list *m; + + read_lock(&kclist_lock); + for (m=kclist; m; m=m->next) { + if (start >= m->addr && start < (m->addr+m->size)) + break; + } + read_unlock(&kclist_lock); + + if (m == NULL) { + if (clear_user(buffer, tsz)) + return -EFAULT; + } else if ((start >= VMALLOC_START) && (start < VMALLOC_END)) { char * elf_buf; struct vm_struct *m; unsigned long curstart = start; @@ -439,8 +449,7 @@ return -EFAULT; } kfree(elf_buf); - } else if ((start > PAGE_OFFSET) && (start < - (unsigned long)high_memory)) { + } else { if (kern_addr_valid(start)) { if (copy_to_user(buffer, (char *)start, tsz)) return -EFAULT; @@ -448,9 +457,6 @@ if (clear_user(buffer, tsz)) return -EFAULT; } - } else { - if (clear_user(buffer, tsz)) - return -EFAULT; } buflen -= tsz; *fpos += tsz; diff -urN linux-2.5.70-bk7/include/asm-i386/mach-generic/mach_apic.h linux-2.5.70-bk8/include/asm-i386/mach-generic/mach_apic.h --- linux-2.5.70-bk7/include/asm-i386/mach-generic/mach_apic.h 2003-05-26 18:00:37.000000000 -0700 +++ linux-2.5.70-bk8/include/asm-i386/mach-generic/mach_apic.h 2003-06-03 04:38:38.000000000 -0700 @@ -24,8 +24,6 @@ #define check_apicid_present (genapic->check_apicid_present) #define check_phys_apicid_present (genapic->check_phys_apicid_present) #define check_apicid_used (genapic->check_apicid_used) -#define GET_APIC_ID (genapic->get_apic_id) -#define APIC_ID_MASK (genapic->apic_id_mask) #define cpu_mask_to_apicid (genapic->cpu_mask_to_apicid) #endif /* __ASM_MACH_APIC_H */ diff -urN linux-2.5.70-bk7/include/asm-i386/mach-generic/mach_apicdef.h linux-2.5.70-bk8/include/asm-i386/mach-generic/mach_apicdef.h --- linux-2.5.70-bk7/include/asm-i386/mach-generic/mach_apicdef.h 1969-12-31 16:00:00.000000000 -0800 +++ linux-2.5.70-bk8/include/asm-i386/mach-generic/mach_apicdef.h 2003-06-03 04:38:38.000000000 -0700 @@ -0,0 +1,11 @@ +#ifndef _GENAPIC_MACH_APICDEF_H +#define _GENAPIC_MACH_APICDEF_H 1 + +#ifndef APIC_DEFINITION +#include + +#define GET_APIC_ID (genapic->get_apic_id) +#define APIC_ID_MASK (genapic->apic_id_mask) +#endif + +#endif diff -urN linux-2.5.70-bk7/include/asm-i386/stat.h linux-2.5.70-bk8/include/asm-i386/stat.h --- linux-2.5.70-bk7/include/asm-i386/stat.h 2003-05-26 18:00:22.000000000 -0700 +++ linux-2.5.70-bk8/include/asm-i386/stat.h 2003-06-03 04:38:38.000000000 -0700 @@ -73,4 +73,6 @@ unsigned long long st_ino; }; +#define STAT_HAVE_NSEC 1 + #endif diff -urN linux-2.5.70-bk7/include/asm-ia64/pgtable.h linux-2.5.70-bk8/include/asm-ia64/pgtable.h --- linux-2.5.70-bk7/include/asm-ia64/pgtable.h 2003-05-26 18:00:27.000000000 -0700 +++ linux-2.5.70-bk8/include/asm-ia64/pgtable.h 2003-06-03 04:38:38.000000000 -0700 @@ -209,6 +209,10 @@ #define VMALLOC_VMADDR(x) ((unsigned long)(x)) #define VMALLOC_END (0xa000000000000000 + (1UL << (4*PAGE_SHIFT - 9))) +/* fs/proc/kcore.c */ +#define kc_vaddr_to_offset(v) ((v) - 0xA000000000000000) +#define kc_offset_to_vaddr(o) ((o) + 0xA000000000000000) + /* * Conversion functions: convert page frame number (pfn) and a protection value to a page * table entry (pte). diff -urN linux-2.5.70-bk7/include/linux/genhd.h linux-2.5.70-bk8/include/linux/genhd.h --- linux-2.5.70-bk7/include/linux/genhd.h 2003-05-26 18:00:24.000000000 -0700 +++ linux-2.5.70-bk8/include/linux/genhd.h 2003-06-03 04:38:38.000000000 -0700 @@ -83,8 +83,6 @@ int major; /* major number of driver */ int first_minor; int minors; - int minor_shift; /* number of times minor is shifted to - get real minor */ char disk_name[16]; /* name of major driver */ struct hd_struct **part; /* [indexed by minor] */ struct block_device_operations *fops; diff -urN linux-2.5.70-bk7/include/linux/init_task.h linux-2.5.70-bk8/include/linux/init_task.h --- linux-2.5.70-bk7/include/linux/init_task.h 2003-05-26 18:00:23.000000000 -0700 +++ linux-2.5.70-bk8/include/linux/init_task.h 2003-06-03 04:38:38.000000000 -0700 @@ -45,7 +45,9 @@ #define INIT_SIGNALS(sig) { \ .count = ATOMIC_INIT(1), \ - .shared_pending = { NULL, &sig.shared_pending.head, {{0}}}, \ + .shared_pending = { \ + .list = LIST_HEAD_INIT(sig.shared_pending.list), \ + .signal = {{0}}}, \ } #define INIT_SIGHAND(sighand) { \ @@ -97,9 +99,11 @@ .files = &init_files, \ .signal = &init_signals, \ .sighand = &init_sighand, \ - .pending = { NULL, &tsk.pending.head, {{0}}}, \ + .pending = { \ + .list = LIST_HEAD_INIT(tsk.pending.list), \ + .signal = {{0}}}, \ .blocked = {{0}}, \ - .posix_timers = LIST_HEAD_INIT(tsk.posix_timers), \ + .posix_timers = LIST_HEAD_INIT(tsk.posix_timers), \ .alloc_lock = SPIN_LOCK_UNLOCKED, \ .proc_lock = SPIN_LOCK_UNLOCKED, \ .switch_lock = SPIN_LOCK_UNLOCKED, \ diff -urN linux-2.5.70-bk7/include/linux/proc_fs.h linux-2.5.70-bk8/include/linux/proc_fs.h --- linux-2.5.70-bk7/include/linux/proc_fs.h 2003-06-03 04:38:31.000000000 -0700 +++ linux-2.5.70-bk8/include/linux/proc_fs.h 2003-06-03 04:38:38.000000000 -0700 @@ -74,6 +74,12 @@ kdev_t rdev; }; +struct kcore_list { + struct kcore_list *next; + unsigned long addr; + size_t size; +}; + #ifdef CONFIG_PROC_FS extern struct proc_dir_entry proc_root; @@ -179,6 +185,12 @@ remove_proc_entry(name,proc_net); } +/* + * fs/proc/kcore.c + */ +extern void kclist_add(struct kcore_list *, void *, size_t); +extern struct kcore_list *kclist_del(void *); + #else #define proc_root_driver NULL @@ -223,6 +235,8 @@ return NULL; } +static inline void kclist_add(struct kcore_list *new, void *addr, size_t size) {}; +static inline struct kcore_list * kclist_del(void *addr) {return NULL}; #endif /* CONFIG_PROC_FS */ struct proc_inode { diff -urN linux-2.5.70-bk7/include/linux/sched.h linux-2.5.70-bk8/include/linux/sched.h --- linux-2.5.70-bk7/include/linux/sched.h 2003-05-26 18:00:23.000000000 -0700 +++ linux-2.5.70-bk8/include/linux/sched.h 2003-06-03 04:38:38.000000000 -0700 @@ -317,6 +317,7 @@ unsigned long it_incr; /* interval specified in jiffies */ struct task_struct *it_process; /* process to send signal to */ struct timer_list it_timer; + struct sigqueue *sigq; /* signal queue entry. */ }; @@ -571,6 +572,10 @@ extern int kill_pg(pid_t, int, int); extern int kill_sl(pid_t, int, int); extern int kill_proc(pid_t, int, int); +extern struct sigqueue *sigqueue_alloc(void); +extern void sigqueue_free(struct sigqueue *); +extern int send_sigqueue(int, struct sigqueue *, struct task_struct *); +extern int send_group_sigqueue(int, struct sigqueue *, struct task_struct *); extern int do_sigaction(int, const struct k_sigaction *, struct k_sigaction *); extern int do_sigaltstack(const stack_t __user *, stack_t __user *, unsigned long); diff -urN linux-2.5.70-bk7/include/linux/signal.h linux-2.5.70-bk8/include/linux/signal.h --- linux-2.5.70-bk7/include/linux/signal.h 2003-05-26 18:00:25.000000000 -0700 +++ linux-2.5.70-bk8/include/linux/signal.h 2003-06-03 04:38:38.000000000 -0700 @@ -3,6 +3,7 @@ #include #include +#include #ifdef __KERNEL__ /* @@ -10,12 +11,17 @@ */ struct sigqueue { - struct sigqueue *next; + struct list_head list; + spinlock_t *lock; + int flags; siginfo_t info; }; +/* flags values. */ +#define SIGQUEUE_PREALLOC 1 + struct sigpending { - struct sigqueue *head, **tail; + struct list_head list; sigset_t signal; }; @@ -197,8 +203,7 @@ static inline void init_sigpending(struct sigpending *sig) { sigemptyset(&sig->signal); - sig->head = NULL; - sig->tail = &sig->head; + INIT_LIST_HEAD(&sig->list); } extern long do_sigpending(void __user *, unsigned long); diff -urN linux-2.5.70-bk7/include/linux/timex.h linux-2.5.70-bk8/include/linux/timex.h --- linux-2.5.70-bk7/include/linux/timex.h 2003-05-26 18:00:21.000000000 -0700 +++ linux-2.5.70-bk8/include/linux/timex.h 2003-06-03 04:38:38.000000000 -0700 @@ -51,6 +51,9 @@ #ifndef _LINUX_TIMEX_H #define _LINUX_TIMEX_H +#include +#include + #include /* @@ -310,6 +313,105 @@ extern long pps_errcnt; /* calibration errors */ extern long pps_stbcnt; /* stability limit exceeded */ +#ifdef CONFIG_TIME_INTERPOLATION + +struct time_interpolator { + /* cache-hot stuff first: */ + unsigned long (*get_offset) (void); + void (*update) (long); + void (*reset) (void); + + /* cache-cold stuff follows here: */ + struct time_interpolator *next; + unsigned long frequency; /* frequency in counts/second */ + long drift; /* drift in parts-per-million (or -1) */ +}; + +extern volatile unsigned long last_nsec_offset; +#ifndef __HAVE_ARCH_CMPXCHG +extern spin_lock_t last_nsec_offset_lock; +#endif +extern struct time_interpolator *time_interpolator; + +extern void register_time_interpolator(struct time_interpolator *); +extern void unregister_time_interpolator(struct time_interpolator *); + +/* Called with xtime WRITE-lock acquired. */ +static inline void +time_interpolator_update(long delta_nsec) +{ + struct time_interpolator *ti = time_interpolator; + + if (last_nsec_offset > 0) { +#ifdef __HAVE_ARCH_CMPXCHG + unsigned long new, old; + + do { + old = last_nsec_offset; + if (old > delta_nsec) + new = old - delta_nsec; + else + new = 0; + } while (cmpxchg(&last_nsec_offset, old, new) != old); +#else + /* + * This really hurts, because it serializes gettimeofday(), but without an + * atomic single-word compare-and-exchange, there isn't all that much else + * we can do. + */ + spin_lock(&last_nsec_offset_lock); + { + last_nsec_offset -= min(last_nsec_offset, delta_nsec); + } + spin_unlock(&last_nsec_offset_lock); +#endif + } + + if (ti) + (*ti->update)(delta_nsec); +} + +/* Called with xtime WRITE-lock acquired. */ +static inline void +time_interpolator_reset(void) +{ + struct time_interpolator *ti = time_interpolator; + + last_nsec_offset = 0; + if (ti) + (*ti->reset)(); +} + +/* Called with xtime READ-lock acquired. */ +static inline unsigned long +time_interpolator_get_offset(void) +{ + struct time_interpolator *ti = time_interpolator; + if (ti) + return (*ti->get_offset)(); + return last_nsec_offset; +} + +#else /* !CONFIG_TIME_INTERPOLATION */ + +static inline void +time_interpolator_update(long delta_nsec) +{ +} + +static inline void +time_interpolator_reset(void) +{ +} + +static inline unsigned long +time_interpolator_get_offset(void) +{ + return 0; +} + +#endif /* !CONFIG_TIME_INTERPOLATION */ + #endif /* KERNEL */ #endif /* LINUX_TIMEX_H */ diff -urN linux-2.5.70-bk7/include/linux/usb.h linux-2.5.70-bk8/include/linux/usb.h --- linux-2.5.70-bk7/include/linux/usb.h 2003-05-26 18:00:39.000000000 -0700 +++ linux-2.5.70-bk8/include/linux/usb.h 2003-06-03 04:38:39.000000000 -0700 @@ -278,6 +278,8 @@ /* mostly for devices emulating SCSI over USB */ extern int usb_reset_device(struct usb_device *dev); +extern struct usb_device *usb_find_device(u16 vendor_id, u16 product_id); + /* for drivers using iso endpoints */ extern int usb_get_current_frame_number (struct usb_device *usb_dev); diff -urN linux-2.5.70-bk7/include/linux/writeback.h linux-2.5.70-bk8/include/linux/writeback.h --- linux-2.5.70-bk7/include/linux/writeback.h 2003-05-26 18:00:23.000000000 -0700 +++ linux-2.5.70-bk8/include/linux/writeback.h 2003-06-03 04:38:39.000000000 -0700 @@ -78,6 +78,10 @@ extern int dirty_writeback_centisecs; extern int dirty_expire_centisecs; +struct ctl_table; +struct file; +int dirty_writeback_centisecs_handler(struct ctl_table *, int, struct file *, + void *, size_t *); void page_writeback_init(void); void balance_dirty_pages(struct address_space *mapping); diff -urN linux-2.5.70-bk7/ipc/sem.c linux-2.5.70-bk8/ipc/sem.c --- linux-2.5.70-bk7/ipc/sem.c 2003-05-26 18:00:38.000000000 -0700 +++ linux-2.5.70-bk8/ipc/sem.c 2003-06-03 04:38:39.000000000 -0700 @@ -268,39 +268,39 @@ for (sop = sops; sop < sops + nsops; sop++) { curr = sma->sem_base + sop->sem_num; sem_op = sop->sem_op; - - if (!sem_op && curr->semval) + result = curr->semval; + + if (!sem_op && result) goto would_block; - curr->sempid = (curr->sempid << 16) | pid; - curr->semval += sem_op; - if (sop->sem_flg & SEM_UNDO) - { + result += sem_op; + if (result < 0) + goto would_block; + if (result > SEMVMX) + goto out_of_range; + if (sop->sem_flg & SEM_UNDO) { int undo = un->semadj[sop->sem_num] - sem_op; /* * Exceeding the undo range is an error. */ if (undo < (-SEMAEM - 1) || undo > SEMAEM) - { - /* Don't undo the undo */ - sop->sem_flg &= ~SEM_UNDO; goto out_of_range; - } - un->semadj[sop->sem_num] = undo; } - if (curr->semval < 0) - goto would_block; - if (curr->semval > SEMVMX) - goto out_of_range; + curr->semval = result; } - if (do_undo) - { - sop--; + if (do_undo) { result = 0; goto undo; } - + sop--; + while (sop >= sops) { + sma->sem_base[sop->sem_num].sempid = pid; + if (sop->sem_flg & SEM_UNDO) + un->semadj[sop->sem_num] -= sop->sem_op; + sop--; + } + sma->sem_otime = get_seconds(); return 0; @@ -315,13 +315,9 @@ result = 1; undo: + sop--; while (sop >= sops) { - curr = sma->sem_base + sop->sem_num; - curr->semval -= sop->sem_op; - curr->sempid >>= 16; - - if (sop->sem_flg & SEM_UNDO) - un->semadj[sop->sem_num] += sop->sem_op; + sma->sem_base[sop->sem_num].semval -= sop->sem_op; sop--; } @@ -659,7 +655,7 @@ err = curr->semval; goto out_unlock; case GETPID: - err = curr->sempid & 0xffff; + err = curr->sempid; goto out_unlock; case GETNCNT: err = count_semncnt(sma,semnum); diff -urN linux-2.5.70-bk7/kernel/posix-timers.c linux-2.5.70-bk8/kernel/posix-timers.c --- linux-2.5.70-bk7/kernel/posix-timers.c 2003-05-26 18:00:40.000000000 -0700 +++ linux-2.5.70-bk8/kernel/posix-timers.c 2003-06-03 04:38:39.000000000 -0700 @@ -288,46 +288,32 @@ static void timer_notify_task(struct k_itimer *timr) { - struct siginfo info; int ret; - memset(&info, 0, sizeof (info)); + memset(&timr->sigq->info, 0, sizeof(siginfo_t)); /* Send signal to the process that owns this timer. */ - info.si_signo = timr->it_sigev_signo; - info.si_errno = 0; - info.si_code = SI_TIMER; - info.si_tid = timr->it_id; - info.si_value = timr->it_sigev_value; + timr->sigq->info.si_signo = timr->it_sigev_signo; + timr->sigq->info.si_errno = 0; + timr->sigq->info.si_code = SI_TIMER; + timr->sigq->info.si_tid = timr->it_id; + timr->sigq->info.si_value = timr->it_sigev_value; if (timr->it_incr) - info.si_sys_private = ++timr->it_requeue_pending; + timr->sigq->info.si_sys_private = ++timr->it_requeue_pending; if (timr->it_sigev_notify & SIGEV_THREAD_ID & MIPS_SIGEV) - ret = send_sig_info(info.si_signo, &info, timr->it_process); + ret = send_sigqueue(timr->it_sigev_signo, timr->sigq, + timr->it_process); else - ret = send_group_sig_info(info.si_signo, &info, - timr->it_process); - switch (ret) { - - default: - /* - * Signal was not sent. May or may not need to - * restart the timer. - */ - printk(KERN_WARNING "sending signal failed: %d\n", ret); - case 1: + ret = send_group_sigqueue(timr->it_sigev_signo, timr->sigq, + timr->it_process); + if (ret) { /* - * signal was not sent because of sig_ignor or, - * possibly no queue memory OR will be sent but, + * signal was not sent because of sig_ignor * we will not get a call back to restart it AND * it should be restarted. */ schedule_next_timer(timr); - case 0: - /* - * all's well new signal queued - */ - break; } } @@ -379,7 +365,11 @@ struct k_itimer *tmr; tmr = kmem_cache_alloc(posix_timers_cache, GFP_KERNEL); memset(tmr, 0, sizeof (struct k_itimer)); - + tmr->it_id = (timer_t)-1; + if (unlikely(!(tmr->sigq = sigqueue_alloc()))) { + kmem_cache_free(posix_timers_cache, tmr); + tmr = 0; + } return tmr; } @@ -390,6 +380,7 @@ idr_remove(&posix_timers_id, tmr->it_id); spin_unlock_irq(&idr_lock); } + sigqueue_free(tmr->sigq); kmem_cache_free(posix_timers_cache, tmr); } diff -urN linux-2.5.70-bk7/kernel/signal.c linux-2.5.70-bk8/kernel/signal.c --- linux-2.5.70-bk7/kernel/signal.c 2003-05-26 18:00:38.000000000 -0700 +++ linux-2.5.70-bk8/kernel/signal.c 2003-06-03 04:38:39.000000000 -0700 @@ -4,6 +4,10 @@ * Copyright (C) 1991, 1992 Linus Torvalds * * 1997-11-02 Modified for POSIX.1b signals by Richard Henderson + * + * 2003-06-02 Jim Houston - Concurrent Computer Corp. + * Changes to use preallocated sigqueue structures + * to allow signals to be sent reliably. */ #define __KERNEL_SYSCALLS__ @@ -258,20 +262,38 @@ return sig; } +struct sigqueue *__sigqueue_alloc(void) +{ + struct sigqueue *q = 0; + + if (atomic_read(&nr_queued_signals) < max_queued_signals) + q = kmem_cache_alloc(sigqueue_cachep, GFP_ATOMIC); + if (q) { + atomic_inc(&nr_queued_signals); + INIT_LIST_HEAD(&q->list); + q->flags = 0; + q->lock = 0; + } + return(q); +} + +static inline void __sigqueue_free(struct sigqueue *q) +{ + if (q->flags & SIGQUEUE_PREALLOC) + return; + kmem_cache_free(sigqueue_cachep, q); + atomic_dec(&nr_queued_signals); +} + static void flush_sigqueue(struct sigpending *queue) { - struct sigqueue *q, *n; + struct sigqueue *q; sigemptyset(&queue->signal); - q = queue->head; - queue->head = NULL; - queue->tail = &queue->head; - - while (q) { - n = q->next; - kmem_cache_free(sigqueue_cachep, q); - atomic_dec(&nr_queued_signals); - q = n; + while (!list_empty(&queue->list)) { + q = list_entry(queue->list.next, struct sigqueue , list); + list_del_init(&q->list); + __sigqueue_free(q); } } @@ -411,15 +433,32 @@ static inline int collect_signal(int sig, struct sigpending *list, siginfo_t *info) { - if (sigismember(&list->signal, sig)) { - /* Collect the siginfo appropriate to this signal. */ - struct sigqueue *q, **pp; - pp = &list->head; - while ((q = *pp) != NULL) { - if (q->info.si_signo == sig) - goto found_it; - pp = &q->next; + struct sigqueue *q, *first = 0; + int still_pending = 0; + + if (unlikely(!sigismember(&list->signal, sig))) + return 0; + + /* + * Collect the siginfo appropriate to this signal. Check if + * there is another siginfo for the same signal. + */ + list_for_each_entry(q, &list->list, list) { + if (q->info.si_signo == sig) { + if (first) { + still_pending = 1; + break; + } + first = q; } + } + if (first) { + list_del_init(&first->list); + copy_siginfo(info, &first->info); + __sigqueue_free(first); + if (!still_pending) + sigdelset(&list->signal, sig); + } else { /* Ok, it wasn't in the queue. This must be a fast-pathed signal or we must have been @@ -431,31 +470,8 @@ info->si_code = 0; info->si_pid = 0; info->si_uid = 0; - return 1; - -found_it: - if ((*pp = q->next) == NULL) - list->tail = pp; - - /* Copy the sigqueue information and free the queue entry */ - copy_siginfo(info, &q->info); - kmem_cache_free(sigqueue_cachep,q); - atomic_dec(&nr_queued_signals); - - /* Non-RT signals can exist multiple times.. */ - if (sig >= SIGRTMIN) { - while ((q = *pp) != NULL) { - if (q->info.si_signo == sig) - goto found_another; - pp = &q->next; - } - } - - sigdelset(&list->signal, sig); -found_another: - return 1; } - return 0; + return 1; } static int __dequeue_signal(struct sigpending *pending, sigset_t *mask, @@ -544,25 +560,18 @@ */ static int rm_from_queue(unsigned long mask, struct sigpending *s) { - struct sigqueue *q, **pp; + struct sigqueue *q, *n; if (!sigtestsetmask(&s->signal, mask)) return 0; sigdelsetmask(&s->signal, mask); - - pp = &s->head; - - while ((q = *pp) != NULL) { + list_for_each_entry_safe(q, n, &s->list, list) { if (q->info.si_signo < SIGRTMIN && - (mask & sigmask (q->info.si_signo))) { - if ((*pp = q->next) == NULL) - s->tail = pp; - kmem_cache_free(sigqueue_cachep,q); - atomic_dec(&nr_queued_signals); - continue; + (mask & sigmask(q->info.si_signo))) { + list_del_init(&q->list); + __sigqueue_free(q); } - pp = &q->next; } return 1; } @@ -695,9 +704,8 @@ if (q) { atomic_inc(&nr_queued_signals); - q->next = NULL; - *signals->tail = q; - signals->tail = &q->next; + q->flags = 0; + list_add_tail(&q->list, &signals->list); switch ((unsigned long) info) { case 0: q->info.si_signo = sig; @@ -827,49 +835,11 @@ && !((p)->flags & PF_EXITING) \ && (task_curr(p) || !signal_pending(p))) -static inline int -__group_send_sig_info(int sig, struct siginfo *info, struct task_struct *p) + +static inline void +__group_complete_signal(int sig, struct task_struct *p, unsigned int mask) { struct task_struct *t; - unsigned int mask; - int ret = 0; - -#ifdef CONFIG_SMP - if (!spin_is_locked(&p->sighand->siglock)) - BUG(); -#endif - handle_stop_signal(sig, p); - - if (((unsigned long)info > 2) && (info->si_code == SI_TIMER)) - /* - * Set up a return to indicate that we dropped the signal. - */ - ret = info->si_sys_private; - - /* Short-circuit ignored signals. */ - if (sig_ignored(p, sig)) - return ret; - - if (LEGACY_QUEUE(&p->signal->shared_pending, sig)) - /* This is a non-RT signal and we already have one queued. */ - return ret; - - /* - * Don't bother zombies and stopped tasks (but - * SIGKILL will punch through stopped state) - */ - mask = TASK_DEAD | TASK_ZOMBIE; - if (sig != SIGKILL) - mask |= TASK_STOPPED; - - /* - * Put this signal on the shared-pending queue, or fail with EAGAIN. - * We always use the shared queue for process-wide signals, - * to avoid several races. - */ - ret = send_signal(sig, info, &p->signal->shared_pending); - if (unlikely(ret)) - return ret; /* * Now find a thread we can wake up to take the signal off the queue. @@ -884,7 +854,7 @@ * There is just one thread and it does not need to be woken. * It will dequeue unblocked signals before it runs again. */ - return 0; + return; else { /* * Otherwise try to find a suitable thread. @@ -903,7 +873,7 @@ * Any eligible threads will see * the signal in the queue soon. */ - return 0; + return; } p->signal->curr_target = t; } @@ -934,7 +904,7 @@ signal_wake_up(t, 1); t = next_thread(t); } while (t != p); - return 0; + return; } /* @@ -958,7 +928,7 @@ t = next_thread(t); } while (t != p); wake_up_process(p->signal->group_exit_task); - return 0; + return; } /* @@ -966,6 +936,53 @@ * Tell the chosen thread to wake up and dequeue it. */ signal_wake_up(t, sig == SIGKILL); + return; +} + +static inline int +__group_send_sig_info(int sig, struct siginfo *info, struct task_struct *p) +{ + unsigned int mask; + int ret = 0; + +#ifdef CONFIG_SMP + if (!spin_is_locked(&p->sighand->siglock)) + BUG(); +#endif + handle_stop_signal(sig, p); + + if (((unsigned long)info > 2) && (info->si_code == SI_TIMER)) + /* + * Set up a return to indicate that we dropped the signal. + */ + ret = info->si_sys_private; + + /* Short-circuit ignored signals. */ + if (sig_ignored(p, sig)) + return ret; + + if (LEGACY_QUEUE(&p->signal->shared_pending, sig)) + /* This is a non-RT signal and we already have one queued. */ + return ret; + + /* + * Don't bother zombies and stopped tasks (but + * SIGKILL will punch through stopped state) + */ + mask = TASK_DEAD | TASK_ZOMBIE; + if (sig != SIGKILL) + mask |= TASK_STOPPED; + + /* + * Put this signal on the shared-pending queue, or fail with EAGAIN. + * We always use the shared queue for process-wide signals, + * to avoid several races. + */ + ret = send_signal(sig, info, &p->signal->shared_pending); + if (unlikely(ret)) + return ret; + + __group_complete_signal(sig, p, mask); return 0; } @@ -1195,6 +1212,142 @@ } /* + * These functions support sending signals using preallocated sigqueue + * structures. This is needed "because realtime applications cannot + * afford to lose notifications of asynchronous events, like timer + * expirations or I/O completions". In the case of Posix Timers + * we allocate the sigqueue structure from the timer_create. If this + * allocation fails we are able to report the failure to the application + * with an EAGAIN error. + */ + +struct sigqueue *sigqueue_alloc(void) +{ + struct sigqueue *q; + + if ((q = __sigqueue_alloc())) + q->flags |= SIGQUEUE_PREALLOC; + return(q); +} + +void sigqueue_free(struct sigqueue *q) +{ + unsigned long flags; + BUG_ON(!(q->flags & SIGQUEUE_PREALLOC)); + /* + * If the signal is still pending remove it from the + * pending queue. + */ + if (unlikely(!list_empty(&q->list))) { + read_lock(&tasklist_lock); + spin_lock_irqsave(q->lock, flags); + if (!list_empty(&q->list)) + list_del_init(&q->list); + spin_unlock_irqrestore(q->lock, flags); + read_unlock(&tasklist_lock); + } + q->flags &= ~SIGQUEUE_PREALLOC; + __sigqueue_free(q); +} + +int +send_sigqueue(int sig, struct sigqueue *q, struct task_struct *p) +{ + unsigned long flags; + int ret = 0; + + /* + * We need the tasklist lock even for the specific + * thread case (when we don't need to follow the group + * lists) in order to avoid races with "p->sighand" + * going away or changing from under us. + */ + BUG_ON(!(q->flags & SIGQUEUE_PREALLOC)); + read_lock(&tasklist_lock); + spin_lock_irqsave(&p->sighand->siglock, flags); + + if (unlikely(!list_empty(&q->list))) { + /* + * If an SI_TIMER entry is already queue just increment + * the overrun count. + */ + if (q->info.si_code != SI_TIMER) + BUG(); + q->info.si_overrun++; + goto out; + } + /* Short-circuit ignored signals. */ + if (sig_ignored(p, sig)) { + ret = 1; + goto out; + } + + q->lock = &p->sighand->siglock; + list_add_tail(&q->list, &p->pending.list); + sigaddset(&p->pending.signal, sig); + if (!sigismember(&p->blocked, sig)) + signal_wake_up(p, sig == SIGKILL); + +out: + spin_unlock_irqrestore(&p->sighand->siglock, flags); + read_unlock(&tasklist_lock); + return(ret); +} + +int +send_group_sigqueue(int sig, struct sigqueue *q, struct task_struct *p) +{ + unsigned long flags; + unsigned int mask; + int ret = 0; + + BUG_ON(!(q->flags & SIGQUEUE_PREALLOC)); + read_lock(&tasklist_lock); + spin_lock_irqsave(&p->sighand->siglock, flags); + handle_stop_signal(sig, p); + + /* Short-circuit ignored signals. */ + if (sig_ignored(p, sig)) { + ret = 1; + goto out; + } + + if (unlikely(!list_empty(&q->list))) { + /* + * If an SI_TIMER entry is already queue just increment + * the overrun count. Other uses should not try to + * send the signal multiple times. + */ + if (q->info.si_code != SI_TIMER) + BUG(); + q->info.si_overrun++; + goto out; + } + /* + * Don't bother zombies and stopped tasks (but + * SIGKILL will punch through stopped state) + */ + mask = TASK_DEAD | TASK_ZOMBIE; + if (sig != SIGKILL) + mask |= TASK_STOPPED; + + /* + * Put this signal on the shared-pending queue. + * We always use the shared queue for process-wide signals, + * to avoid several races. + */ + q->lock = &p->sighand->siglock; + list_add_tail(&q->list, &p->signal->shared_pending.list); + sigaddset(&p->signal->shared_pending.signal, sig); + + __group_complete_signal(sig, p, mask); +out: + spin_unlock_irqrestore(&p->sighand->siglock, flags); + read_unlock(&tasklist_lock); + return(ret); +} + +/* * Joy. Or not. Pthread wants us to wake up every thread * in our parent group. */ @@ -1646,6 +1799,10 @@ EXPORT_SYMBOL(send_sig); EXPORT_SYMBOL(send_sig_info); EXPORT_SYMBOL(send_group_sig_info); +EXPORT_SYMBOL(sigqueue_alloc); +EXPORT_SYMBOL(sigqueue_free); +EXPORT_SYMBOL(send_sigqueue); +EXPORT_SYMBOL(send_group_sigqueue); EXPORT_SYMBOL(sigprocmask); EXPORT_SYMBOL(block_all_signals); EXPORT_SYMBOL(unblock_all_signals); diff -urN linux-2.5.70-bk7/kernel/sysctl.c linux-2.5.70-bk8/kernel/sysctl.c --- linux-2.5.70-bk7/kernel/sysctl.c 2003-05-26 18:00:23.000000000 -0700 +++ linux-2.5.70-bk8/kernel/sysctl.c 2003-06-03 04:38:39.000000000 -0700 @@ -271,7 +271,6 @@ /* Constants for minimum and maximum testing in vm_table. We use these as one-element integer vectors. */ static int zero = 0; -static int one = 1; static int one_hundred = 100; @@ -292,20 +291,7 @@ &sysctl_intvec, NULL, &zero, &one_hundred }, {VM_DIRTY_WB_CS, "dirty_writeback_centisecs", &dirty_writeback_centisecs, sizeof(dirty_writeback_centisecs), 0644, - NULL, &proc_dointvec_minmax, &sysctl_intvec, NULL, - /* Here, we define the range of possible values for - dirty_writeback_centisecs. - - The default value is 5 seconds (500 centisec). We will use 1 - centisec, the smallest possible value that could make any sort of - sense. If we allowed the user to set the interval to 0 seconds - (which would presumably mean to chew up all of the CPU looking for - dirty pages and writing them out, without taking a break), the - interval would effectively become 1 second (100 centisecs), due to - some nicely documented throttling code in wb_kupdate(). - - There is no maximum legal value for dirty_writeback. */ - &one , NULL}, + NULL, dirty_writeback_centisecs_handler }, {VM_DIRTY_EXPIRE_CS, "dirty_expire_centisecs", &dirty_expire_centisecs, sizeof(dirty_expire_centisecs), 0644, NULL, &proc_dointvec}, diff -urN linux-2.5.70-bk7/kernel/time.c linux-2.5.70-bk8/kernel/time.c --- linux-2.5.70-bk7/kernel/time.c 2003-05-26 18:00:26.000000000 -0700 +++ linux-2.5.70-bk8/kernel/time.c 2003-06-03 04:38:39.000000000 -0700 @@ -35,8 +35,6 @@ */ struct timezone sys_tz; -extern unsigned long last_time_offset; - #if !defined(__alpha__) && !defined(__ia64__) /* @@ -77,9 +75,10 @@ if (get_user(value, tptr)) return -EFAULT; write_seqlock_irq(&xtime_lock); + + time_interpolator_reset(); xtime.tv_sec = value; xtime.tv_nsec = 0; - last_time_offset = 0; time_adjust = 0; /* stop active adjtime() */ time_status |= STA_UNSYNC; time_maxerror = NTP_PHASE_LIMIT; @@ -125,7 +124,7 @@ { write_seqlock_irq(&xtime_lock); xtime.tv_sec += sys_tz.tz_minuteswest * 60; - last_time_offset = 0; + time_interpolator_update(sys_tz.tz_minuteswest * 60 * NSEC_PER_SEC); write_sequnlock_irq(&xtime_lock); } @@ -381,7 +380,6 @@ txc->calcnt = pps_calcnt; txc->errcnt = pps_errcnt; txc->stbcnt = pps_stbcnt; - last_time_offset = 0; write_sequnlock_irq(&xtime_lock); do_gettimeofday(&txc->time); return(result); diff -urN linux-2.5.70-bk7/kernel/timer.c linux-2.5.70-bk8/kernel/timer.c --- linux-2.5.70-bk7/kernel/timer.c 2003-05-26 18:00:47.000000000 -0700 +++ linux-2.5.70-bk8/kernel/timer.c 2003-06-03 04:38:39.000000000 -0700 @@ -517,6 +517,7 @@ if (xtime.tv_sec % 86400 == 0) { xtime.tv_sec--; wall_to_monotonic.tv_sec++; + time_interpolator_update(-NSEC_PER_SEC); time_state = TIME_OOP; clock_was_set(); printk(KERN_NOTICE "Clock: inserting leap second 23:59:60 UTC\n"); @@ -527,6 +528,7 @@ if ((xtime.tv_sec + 1) % 86400 == 0) { xtime.tv_sec++; wall_to_monotonic.tv_sec--; + time_interpolator_update(NSEC_PER_SEC); time_state = TIME_WAIT; clock_was_set(); printk(KERN_NOTICE "Clock: deleting leap second 23:59:59 UTC\n"); @@ -605,7 +607,7 @@ /* in the NTP reference this is called "hardclock()" */ static void update_wall_time_one_tick(void) { - long time_adjust_step; + long time_adjust_step, delta_nsec; if ( (time_adjust_step = time_adjust) != 0 ) { /* We are doing an adjtime thing. @@ -621,11 +623,11 @@ time_adjust_step = tickadj; else if (time_adjust < -tickadj) time_adjust_step = -tickadj; - + /* Reduce by this step the amount of time left */ time_adjust -= time_adjust_step; } - xtime.tv_nsec += tick_nsec + time_adjust_step * 1000; + delta_nsec = tick_nsec + time_adjust_step * 1000; /* * Advance the phase, once it gets to one microsecond, then * advance the tick more. @@ -634,13 +636,15 @@ if (time_phase <= -FINEUSEC) { long ltemp = -time_phase >> (SHIFT_SCALE - 10); time_phase += ltemp << (SHIFT_SCALE - 10); - xtime.tv_nsec -= ltemp; + delta_nsec -= ltemp; } else if (time_phase >= FINEUSEC) { long ltemp = time_phase >> (SHIFT_SCALE - 10); time_phase -= ltemp << (SHIFT_SCALE - 10); - xtime.tv_nsec += ltemp; + delta_nsec += ltemp; } + xtime.tv_nsec += delta_nsec; + time_interpolator_update(delta_nsec); } /* @@ -660,6 +664,7 @@ if (xtime.tv_nsec >= 1000000000) { xtime.tv_nsec -= 1000000000; xtime.tv_sec++; + time_interpolator_update(NSEC_PER_SEC); second_overflow(); } } @@ -777,7 +782,6 @@ #ifndef ARCH_HAVE_XTIME_LOCK seqlock_t xtime_lock __cacheline_aligned_in_smp = SEQLOCK_UNLOCKED; #endif -unsigned long last_time_offset; /* * This function runs timers and the timer-tq in bottom half context. @@ -811,7 +815,6 @@ wall_jiffies += ticks; update_wall_time(ticks); } - last_time_offset = 0; calc_load(ticks); } @@ -1221,3 +1224,80 @@ register_cpu_notifier(&timers_nb); open_softirq(TIMER_SOFTIRQ, run_timer_softirq, NULL); } + +#ifdef CONFIG_TIME_INTERPOLATION + +volatile unsigned long last_nsec_offset; + +struct time_interpolator *time_interpolator; + +#ifndef __HAVE_ARCH_CMPXCHG +spinlock_t last_nsec_offset_lock = SPIN_LOCK_UNLOCKED; +#endif + +static struct { + spinlock_t lock; /* lock protecting list */ + struct time_interpolator *list; /* list of registered interpolators */ +} ti_global = { + .lock = SPIN_LOCK_UNLOCKED +}; + +static inline int +is_better_time_interpolator(struct time_interpolator *new) +{ + if (!time_interpolator) + return 1; + return new->frequency > 2*time_interpolator->frequency + || (unsigned long) new->drift < (unsigned long) time_interpolator->drift; +} + +void +register_time_interpolator(struct time_interpolator *ti) +{ + spin_lock(&ti_global.lock); + { + write_seqlock_irq(&xtime_lock); + { + if (is_better_time_interpolator(ti)) + time_interpolator = ti; + } + write_sequnlock_irq(&xtime_lock); + + ti->next = ti_global.list; + ti_global.list = ti; + } + spin_unlock(&ti_global.lock); +} + +void +unregister_time_interpolator(struct time_interpolator *ti) +{ + struct time_interpolator *curr, **prev; + + spin_lock(&ti_global.lock); + { + prev = &ti_global.list; + for (curr = *prev; curr; curr = curr->next) { + if (curr == ti) { + *prev = curr->next; + break; + } + prev = &curr->next; + } + write_seqlock_irq(&xtime_lock); + { + if (ti == time_interpolator) { + /* we lost the best time-interpolator: */ + time_interpolator = NULL; + /* find the next-best interpolator */ + for (curr = ti_global.list; curr; curr = curr->next) + if (is_better_time_interpolator(curr)) + time_interpolator = curr; + } + } + write_sequnlock_irq(&xtime_lock); + } + spin_unlock(&ti_global.lock); +} + +#endif /* CONFIG_TIME_INTERPOLATION */ diff -urN linux-2.5.70-bk7/mm/mmap.c linux-2.5.70-bk8/mm/mmap.c --- linux-2.5.70-bk7/mm/mmap.c 2003-05-26 18:00:41.000000000 -0700 +++ linux-2.5.70-bk8/mm/mmap.c 2003-06-03 04:38:39.000000000 -0700 @@ -677,6 +677,7 @@ vma->vm_pgoff = pgoff; vma->vm_file = NULL; vma->vm_private_data = NULL; + vma->vm_next = NULL; INIT_LIST_HEAD(&vma->shared); if (file) { diff -urN linux-2.5.70-bk7/mm/page-writeback.c linux-2.5.70-bk8/mm/page-writeback.c --- linux-2.5.70-bk7/mm/page-writeback.c 2003-06-03 04:38:31.000000000 -0700 +++ linux-2.5.70-bk8/mm/page-writeback.c 2003-06-03 04:38:39.000000000 -0700 @@ -26,6 +26,7 @@ #include #include #include +#include /* * The maximum number of pages to writeout in a single bdflush/kupdate @@ -329,7 +330,24 @@ } if (time_before(next_jif, jiffies + HZ)) next_jif = jiffies + HZ; - mod_timer(&wb_timer, next_jif); + if (dirty_writeback_centisecs) + mod_timer(&wb_timer, next_jif); +} + +/* + * sysctl handler for /proc/sys/vm/dirty_writeback_centisecs + */ +int dirty_writeback_centisecs_handler(ctl_table *table, int write, + struct file *file, void *buffer, size_t *length) +{ + proc_dointvec(table, write, file, buffer, length); + if (dirty_writeback_centisecs) { + mod_timer(&wb_timer, + jiffies + (dirty_writeback_centisecs * HZ) / 100); + } else { + del_timer(&wb_timer); + } + return 0; } static void wb_timer_fn(unsigned long unused) diff -urN linux-2.5.70-bk7/mm/slab.c linux-2.5.70-bk8/mm/slab.c --- linux-2.5.70-bk7/mm/slab.c 2003-05-26 18:00:46.000000000 -0700 +++ linux-2.5.70-bk8/mm/slab.c 2003-06-03 04:38:39.000000000 -0700 @@ -210,6 +210,7 @@ unsigned long free_objects; int free_touched; unsigned long next_reap; + struct array_cache *shared; }; #define LIST3_INIT(parent) \ @@ -1209,6 +1210,7 @@ } static void free_block (kmem_cache_t* cachep, void** objpp, int len); +static void drain_array_locked(kmem_cache_t* cachep, struct array_cache *ac); static void do_drain(void *arg) { @@ -1217,13 +1219,20 @@ check_irq_off(); ac = ac_data(cachep); + spin_lock(&cachep->spinlock); free_block(cachep, &ac_entry(ac)[0], ac->avail); + spin_unlock(&cachep->spinlock); ac->avail = 0; } static void drain_cpu_caches(kmem_cache_t *cachep) { smp_call_function_all_cpus(do_drain, cachep); + check_irq_on(); + spin_lock_irq(&cachep->spinlock); + if (cachep->lists.shared) + drain_array_locked(cachep, cachep->lists.shared); + spin_unlock_irq(&cachep->spinlock); } @@ -1321,6 +1330,8 @@ for (i = 0; i < NR_CPUS; i++) kfree(cachep->array[i]); /* NUMA: free the list3 structures */ + kfree(cachep->lists.shared); + cachep->lists.shared = NULL; } kmem_cache_free(&cache_cache, cachep); @@ -1663,6 +1674,19 @@ BUG_ON(ac->avail > 0); spin_lock(&cachep->spinlock); + if (l3->shared) { + struct array_cache *shared_array = l3->shared; + if (shared_array->avail) { + if (batchcount > shared_array->avail) + batchcount = shared_array->avail; + shared_array->avail -= batchcount; + ac->avail = batchcount; + memcpy(ac_entry(ac), &ac_entry(shared_array)[shared_array->avail], + sizeof(void*)*batchcount); + shared_array->touched = 1; + goto alloc_done; + } + } while (batchcount > 0) { struct list_head *entry; struct slab *slabp; @@ -1686,6 +1710,7 @@ must_grow: l3->free_objects -= ac->avail; +alloc_done: spin_unlock(&cachep->spinlock); if (unlikely(!ac->avail)) { @@ -1784,13 +1809,11 @@ * the l3 structure */ -static inline void -__free_block(kmem_cache_t *cachep, void **objpp, int nr_objects) +static void free_block(kmem_cache_t *cachep, void **objpp, int nr_objects) { int i; - check_irq_off(); - spin_lock(&cachep->spinlock); + check_spinlock_acquired(cachep); /* NUMA: move add into loop */ cachep->lists.free_objects += nr_objects; @@ -1828,12 +1851,6 @@ &list3_data_ptr(cachep, objp)->slabs_partial); } } - spin_unlock(&cachep->spinlock); -} - -static void free_block(kmem_cache_t* cachep, void** objpp, int len) -{ - __free_block(cachep, objpp, len); } static void cache_flusharray (kmem_cache_t* cachep, struct array_cache *ac) @@ -1845,14 +1862,28 @@ BUG_ON(!batchcount || batchcount > ac->avail); #endif check_irq_off(); - __free_block(cachep, &ac_entry(ac)[0], batchcount); + spin_lock(&cachep->spinlock); + if (cachep->lists.shared) { + struct array_cache *shared_array = cachep->lists.shared; + int max = shared_array->limit-shared_array->avail; + if (max) { + if (batchcount > max) + batchcount = max; + memcpy(&ac_entry(shared_array)[shared_array->avail], + &ac_entry(ac)[0], + sizeof(void*)*batchcount); + shared_array->avail += batchcount; + goto free_done; + } + } + free_block(cachep, &ac_entry(ac)[0], batchcount); +free_done: #if STATS { int i = 0; struct list_head *p; - spin_lock(&cachep->spinlock); p = list3_data(cachep)->slabs_free.next; while (p != &(list3_data(cachep)->slabs_free)) { struct slab *slabp; @@ -1864,9 +1895,9 @@ p = p->next; } STATS_SET_FREEABLE(cachep, i); - spin_unlock(&cachep->spinlock); } #endif + spin_unlock(&cachep->spinlock); ac->avail -= batchcount; memmove(&ac_entry(ac)[0], &ac_entry(ac)[batchcount], sizeof(void*)*ac->avail); @@ -2107,9 +2138,10 @@ } -static int do_tune_cpucache (kmem_cache_t* cachep, int limit, int batchcount) +static int do_tune_cpucache (kmem_cache_t* cachep, int limit, int batchcount, int shared) { struct ccupdate_struct new; + struct array_cache *new_shared; int i; memset(&new.new,0,sizeof(new.new)); @@ -2143,11 +2175,29 @@ struct array_cache *ccold = new.new[i]; if (!ccold) continue; - local_irq_disable(); + spin_lock_irq(&cachep->spinlock); free_block(cachep, ac_entry(ccold), ccold->avail); - local_irq_enable(); + spin_unlock_irq(&cachep->spinlock); kfree(ccold); } + new_shared = kmalloc(sizeof(void*)*batchcount*shared+ + sizeof(struct array_cache), GFP_KERNEL); + if (new_shared) { + struct array_cache *old; + new_shared->avail = 0; + new_shared->limit = batchcount*shared; + new_shared->batchcount = 0xbaadf00d; + new_shared->touched = 0; + + spin_lock_irq(&cachep->spinlock); + old = cachep->lists.shared; + cachep->lists.shared = new_shared; + if (old) + free_block(cachep, ac_entry(old), old->avail); + spin_unlock_irq(&cachep->spinlock); + kfree(old); + } + return 0; } @@ -2155,7 +2205,7 @@ static void enable_cpucache (kmem_cache_t *cachep) { int err; - int limit; + int limit, shared; /* The head array serves three purposes: * - create a LIFO ordering, i.e. return objects that are cache-warm @@ -2170,11 +2220,25 @@ else if (cachep->objsize > PAGE_SIZE) limit = 8; else if (cachep->objsize > 1024) - limit = 54; + limit = 24; else if (cachep->objsize > 256) - limit = 120; + limit = 54; else - limit = 248; + limit = 120; + + /* Cpu bound tasks (e.g. network routing) can exhibit cpu bound + * allocation behaviour: Most allocs on one cpu, most free operations + * on another cpu. For these cases, an efficient object passing between + * cpus is necessary. This is provided by a shared array. The array + * replaces Bonwick's magazine layer. + * On uniprocessor, it's functionally equivalent (but less efficient) + * to a larger limit. Thus disabled by default. + */ + shared = 0; +#ifdef CONFIG_SMP + if (cachep->objsize <= PAGE_SIZE) + shared = 8; +#endif #if DEBUG /* With debugging enabled, large batchcount lead to excessively @@ -2184,12 +2248,53 @@ if (limit > 32) limit = 32; #endif - err = do_tune_cpucache(cachep, limit, (limit+1)/2); + err = do_tune_cpucache(cachep, limit, (limit+1)/2, shared); if (err) printk(KERN_ERR "enable_cpucache failed for %s, error %d.\n", cachep->name, -err); } +static void drain_array(kmem_cache_t *cachep, struct array_cache *ac) +{ + int tofree; + + check_irq_off(); + if (ac->touched) { + ac->touched = 0; + } else if (ac->avail) { + tofree = (ac->limit+4)/5; + if (tofree > ac->avail) { + tofree = (ac->avail+1)/2; + } + spin_lock(&cachep->spinlock); + free_block(cachep, ac_entry(ac), tofree); + spin_unlock(&cachep->spinlock); + ac->avail -= tofree; + memmove(&ac_entry(ac)[0], &ac_entry(ac)[tofree], + sizeof(void*)*ac->avail); + } +} + +static void drain_array_locked(kmem_cache_t *cachep, struct array_cache *ac) +{ + int tofree; + + check_spinlock_acquired(cachep); + if (ac->touched) { + ac->touched = 0; + } else if (ac->avail) { + tofree = (ac->limit+4)/5; + if (tofree > ac->avail) { + tofree = (ac->avail+1)/2; + } + free_block(cachep, ac_entry(ac), tofree); + ac->avail -= tofree; + memmove(&ac_entry(ac)[0], &ac_entry(ac)[tofree], + sizeof(void*)*ac->avail); + } +} + + /** * cache_reap - Reclaim memory from caches. * @@ -2216,7 +2321,6 @@ kmem_cache_t *searchp; struct list_head* p; int tofree; - struct array_cache *ac; struct slab *slabp; searchp = list_entry(walk, kmem_cache_t, next); @@ -2226,19 +2330,8 @@ check_irq_on(); local_irq_disable(); - ac = ac_data(searchp); - if (ac->touched) { - ac->touched = 0; - } else if (ac->avail) { - tofree = (ac->limit+4)/5; - if (tofree > ac->avail) { - tofree = (ac->avail+1)/2; - } - free_block(searchp, ac_entry(ac), tofree); - ac->avail -= tofree; - memmove(&ac_entry(ac)[0], &ac_entry(ac)[tofree], - sizeof(void*)*ac->avail); - } + drain_array(searchp, ac_data(searchp)); + if(time_after(searchp->lists.next_reap, jiffies)) goto next_irqon; @@ -2247,6 +2340,10 @@ goto next_unlock; } searchp->lists.next_reap = jiffies + REAPTIMEOUT_LIST3; + + if (searchp->lists.shared) + drain_array_locked(searchp, searchp->lists.shared); + if (searchp->lists.free_touched) { searchp->lists.free_touched = 0; goto next_unlock; @@ -2311,11 +2408,19 @@ * Output format version, so at least we can change it * without _too_ many complaints. */ - seq_puts(m, "slabinfo - version: 1.2" #if STATS - " (statistics)" + seq_puts(m, "slabinfo - version: 2.0 (statistics)\n"); +#else + seq_puts(m, "slabinfo - version: 2.0\n"); +#endif + seq_puts(m, "# name "); + seq_puts(m, " : tunables "); + seq_puts(m, " : slabdata "); +#if STATS + seq_puts(m, " : globalstat "); + seq_puts(m, " : cpustat "); #endif - "\n"); + seq_putc(m, '\n'); } p = cache_chain.next; while (n--) { @@ -2399,13 +2504,16 @@ if (error) printk(KERN_ERR "slab: cache %s error: %s\n", name, error); - seq_printf(m, "%-17s %6lu %6lu %6u %4lu %4lu %4u", + seq_printf(m, "%-17s %6lu %6lu %6u %4u %4d", name, active_objs, num_objs, cachep->objsize, - active_slabs, num_slabs, (1<gfporder)); - - seq_printf(m, " : %4u %4u", cachep->limit, cachep->batchcount); + cachep->num, (1<gfporder)); + seq_printf(m, " : tunables %4u %4u %4u", + cachep->limit, cachep->batchcount, + cachep->lists.shared->limit/cachep->batchcount); + seq_printf(m, " : slabdata %6lu %6lu %6u", + active_slabs, num_slabs, cachep->lists.shared->avail); #if STATS - { // list3 stats + { /* list3 stats */ unsigned long high = cachep->high_mark; unsigned long allocs = cachep->num_allocations; unsigned long grown = cachep->grown; @@ -2414,22 +2522,23 @@ unsigned long max_freeable = cachep->max_freeable; unsigned long free_limit = cachep->free_limit; - seq_printf(m, " : %6lu %7lu %5lu %4lu %4lu %4lu %4lu", - high, allocs, grown, reaped, errors, + seq_printf(m, " : globalstat %7lu %6lu %5lu %4lu %4lu %4lu %4lu", + allocs, high, grown, reaped, errors, max_freeable, free_limit); } - { // cpucache stats + /* cpu stats */ + { unsigned long allochit = atomic_read(&cachep->allochit); unsigned long allocmiss = atomic_read(&cachep->allocmiss); unsigned long freehit = atomic_read(&cachep->freehit); unsigned long freemiss = atomic_read(&cachep->freemiss); - seq_printf(m, " : %6lu %6lu %6lu %6lu", - allochit, allocmiss, freehit, freemiss); + seq_printf(m, " : cpustat %6lu %6lu %6lu %6lu", + allochit, allocmiss, freehit, freemiss); } #endif - spin_unlock_irq(&cachep->spinlock); seq_putc(m, '\n'); + spin_unlock_irq(&cachep->spinlock); return 0; } @@ -2456,7 +2565,7 @@ #define MAX_SLABINFO_WRITE 128 /** - * slabinfo_write - SMP tuning for the slab allocator + * slabinfo_write - Tuning for the slab allocator * @file: unused * @buffer: user buffer * @count: data len @@ -2466,7 +2575,7 @@ size_t count, loff_t *ppos) { char kbuf[MAX_SLABINFO_WRITE+1], *tmp; - int limit, batchcount, res; + int limit, batchcount, shared, res; struct list_head *p; if (count > MAX_SLABINFO_WRITE) @@ -2480,10 +2589,8 @@ return -EINVAL; *tmp = '\0'; tmp++; - limit = simple_strtol(tmp, &tmp, 10); - while (*tmp == ' ') - tmp++; - batchcount = simple_strtol(tmp, &tmp, 10); + if (sscanf(tmp, " %d %d %d", &limit, &batchcount, &shared) != 3) + return -EINVAL; /* Find the cache in the chain of caches. */ down(&cache_chain_sem); @@ -2494,10 +2601,11 @@ if (!strcmp(cachep->name, kbuf)) { if (limit < 1 || batchcount < 1 || - batchcount > limit) { + batchcount > limit || + shared < 0) { res = -EINVAL; } else { - res = do_tune_cpucache(cachep, limit, batchcount); + res = do_tune_cpucache(cachep, limit, batchcount, shared); } break; } diff -urN linux-2.5.70-bk7/scripts/kconfig/conf.c linux-2.5.70-bk8/scripts/kconfig/conf.c --- linux-2.5.70-bk7/scripts/kconfig/conf.c 2003-05-26 18:00:57.000000000 -0700 +++ linux-2.5.70-bk8/scripts/kconfig/conf.c 2003-06-03 04:38:40.000000000 -0700 @@ -35,44 +35,6 @@ static char nohelp_text[] = "Sorry, no help available for this option yet.\n"; -#if 0 -static void printc(int ch) -{ - static int sep = 0; - - if (!sep) { - putchar('['); - sep = 1; - } else if (ch) - putchar('/'); - if (!ch) { - putchar(']'); - putchar(' '); - sep = 0; - } else - putchar(ch); -} -#endif - -static void printo(const char *o) -{ - static int sep = 0; - - if (!sep) { - putchar('('); - sep = 1; - } else if (o) { - putchar(','); - putchar(' '); - } - if (!o) { - putchar(')'); - putchar(' '); - sep = 0; - } else - printf("%s", o); -} - static void strip(char *str) { char *p = str; @@ -90,6 +52,16 @@ *p-- = 0; } +static void check_stdin(void) +{ + if (!valid_stdin && input_mode == ask_silent) { + printf("aborted!\n\n"); + printf("Console input/output is redirected. "); + printf("Run 'make oldconfig' to update configuration.\n\n"); + exit(1); + } +} + static void conf_askvalue(struct symbol *sym, const char *def) { enum symbol_type type = sym_get_type(sym); @@ -108,13 +80,14 @@ printf("%s\n", def); return; } - if (!valid_stdin && input_mode == ask_silent) { - printf("aborted!\n\n"); - printf("Console input/output is redirected. "); - printf("Run 'make oldconfig' to update configuration.\n\n"); - exit(1); - } + check_stdin(); case ask_all: + if (!sym_is_changable(sym)) { + printf("%s\n", def); + line[0] = '\n'; + line[1] = 0; + return; + } fflush(stdout); fgets(line, 128, stdin); return; @@ -294,9 +267,8 @@ static int conf_choice(struct menu *menu) { struct symbol *sym, *def_sym; - struct menu *cmenu, *def_menu; - const char *help; - int type, len; + struct menu *child; + int type; bool is_new; sym = menu->sym; @@ -314,74 +286,107 @@ break; } } else { - sym->def = sym->curr; - if (S_TRI(sym->curr) == mod) { + sym->user = sym->curr; + if (sym->curr.tri == mod) { printf("%*s%s\n", indent - 1, "", menu_get_prompt(menu)); return 0; } } while (1) { - printf("%*s%s ", indent - 1, "", menu_get_prompt(menu)); + int cnt, def; + + printf("%*s%s\n", indent - 1, "", menu_get_prompt(menu)); def_sym = sym_get_choice_value(sym); - def_menu = NULL; - for (cmenu = menu->list; cmenu; cmenu = cmenu->next) { - if (!menu_is_visible(cmenu)) + cnt = def = 0; + line[0] = '0'; + line[1] = 0; + for (child = menu->list; child; child = child->next) { + if (!menu_is_visible(child)) + continue; + if (!child->sym) { + printf("%*c %s\n", indent, '*', menu_get_prompt(child)); continue; - printo(menu_get_prompt(cmenu)); - if (cmenu->sym == def_sym) - def_menu = cmenu; - } - printo(NULL); - if (def_menu) - printf("[%s] ", menu_get_prompt(def_menu)); - else { + } + cnt++; + if (child->sym == def_sym) { + def = cnt; + printf("%*c", indent, '>'); + } else + printf("%*c", indent, ' '); + printf(" %d. %s", cnt, menu_get_prompt(child)); + if (child->sym->name) + printf(" (%s)", child->sym->name); + if (!sym_has_value(child->sym)) + printf(" (NEW)"); printf("\n"); - return 1; } + printf("%*schoice", indent - 1, ""); + if (cnt == 1) { + printf("[1]: 1\n"); + goto conf_childs; + } + printf("[1-%d", cnt); + if (sym->help) + printf("?"); + printf("]: "); switch (input_mode) { case ask_new: case ask_silent: + if (!is_new) { + cnt = def; + printf("%d\n", cnt); + break; + } + check_stdin(); case ask_all: - if (is_new) - sym->flags |= SYMBOL_NEW; - conf_askvalue(sym, menu_get_prompt(def_menu)); + fflush(stdout); + fgets(line, 128, stdin); strip(line); + if (line[0] == '?') { + printf("\n%s\n", menu->sym->help ? + menu->sym->help : nohelp_text); + continue; + } + if (!line[0]) + cnt = def; + else if (isdigit(line[0])) + cnt = atoi(line); + else + continue; + break; + case set_random: + def = (random() % cnt) + 1; + case set_default: + case set_yes: + case set_mod: + case set_no: + cnt = def; + printf("%d\n", cnt); break; - default: - line[0] = 0; - printf("\n"); } - if (line[0] == '?' && !line[1]) { - help = nohelp_text; - if (menu->sym->help) - help = menu->sym->help; - printf("\n%s\n", help); - continue; + + conf_childs: + for (child = menu->list; child; child = child->next) { + if (!child->sym || !menu_is_visible(child)) + continue; + if (!--cnt) + break; } - if (line[0]) { - len = strlen(line); - line[len] = 0; - - def_menu = NULL; - for (cmenu = menu->list; cmenu; cmenu = cmenu->next) { - if (!cmenu->sym || !menu_is_visible(cmenu)) - continue; - if (!strncasecmp(line, menu_get_prompt(cmenu), len)) { - def_menu = cmenu; - break; - } - } + if (!child) + continue; + if (line[strlen(line) - 1] == '?') { + printf("\n%s\n", child->sym->help ? + child->sym->help : nohelp_text); + continue; } - if (def_menu) { - sym_set_choice_value(sym, def_menu->sym); - if (def_menu->list) { - indent += 2; - conf(def_menu->list); - indent -= 2; - } - return 1; + sym_set_choice_value(sym, child->sym); + if (child->list) { + indent += 2; + conf(child->list); + indent -= 2; } + return 1; } } @@ -422,7 +427,7 @@ if (sym_is_choice(sym)) { conf_choice(menu); - if (S_TRI(sym->curr) != mod) + if (sym->curr.tri != mod) return; goto conf_childs; } diff -urN linux-2.5.70-bk7/scripts/kconfig/confdata.c linux-2.5.70-bk8/scripts/kconfig/confdata.c --- linux-2.5.70-bk7/scripts/kconfig/confdata.c 2003-05-26 18:01:00.000000000 -0700 +++ linux-2.5.70-bk8/scripts/kconfig/confdata.c 2003-06-03 04:38:40.000000000 -0700 @@ -105,11 +105,11 @@ case S_INT: case S_HEX: case S_STRING: - if (S_VAL(sym->def)) - free(S_VAL(sym->def)); + if (sym->user.val) + free(sym->user.val); default: - S_VAL(sym->def) = NULL; - S_TRI(sym->def) = no; + sym->user.val = NULL; + sym->user.tri = no; } } @@ -129,7 +129,7 @@ switch (sym->type) { case S_BOOLEAN: case S_TRISTATE: - sym->def = symbol_no.curr; + sym->user = symbol_no.curr; sym->flags &= ~SYMBOL_NEW; break; default: @@ -154,18 +154,18 @@ switch (sym->type) { case S_TRISTATE: if (p[0] == 'm') { - S_TRI(sym->def) = mod; + sym->user.tri = mod; sym->flags &= ~SYMBOL_NEW; break; } case S_BOOLEAN: if (p[0] == 'y') { - S_TRI(sym->def) = yes; + sym->user.tri = yes; sym->flags &= ~SYMBOL_NEW; break; } if (p[0] == 'n') { - S_TRI(sym->def) = no; + sym->user.tri = no; sym->flags &= ~SYMBOL_NEW; break; } @@ -187,7 +187,7 @@ case S_INT: case S_HEX: if (sym_string_valid(sym, p)) { - S_VAL(sym->def) = strdup(p); + sym->user.val = strdup(p); sym->flags &= ~SYMBOL_NEW; } else { fprintf(stderr, "%s:%d: symbol value '%s' invalid for %s\n", name, lineno, p, sym->name); @@ -198,21 +198,21 @@ ; } if (sym_is_choice_value(sym)) { - prop = sym_get_choice_prop(sym); - switch (S_TRI(sym->def)) { + struct symbol *cs = prop_get_symbol(sym_get_choice_prop(sym)); + switch (sym->user.tri) { case mod: - if (S_TRI(prop->def->def) == yes) + if (cs->user.tri == yes) /* warn? */; break; case yes: - if (S_TRI(prop->def->def) != no) + if (cs->user.tri != no) /* warn? */; - S_VAL(prop->def->def) = sym; + cs->user.val = sym; break; case no: break; } - S_TRI(prop->def->def) = S_TRI(sym->def); + cs->user.tri = sym->user.tri; } break; case '\n': @@ -224,11 +224,25 @@ fclose(in); for_all_symbols(i, sym) { + sym_calc_value(sym); + if (sym_has_value(sym)) { + if (sym->visible == no) + sym->flags |= SYMBOL_NEW; + switch (sym->type) { + case S_STRING: + case S_INT: + case S_HEX: + if (!sym_string_within_range(sym, sym->user.val)) + sym->flags |= SYMBOL_NEW; + default: + break; + } + } if (!sym_is_choice(sym)) continue; prop = sym_get_choice_prop(sym); sym->flags &= ~SYMBOL_NEW; - for (e = prop->dep; e; e = e->left.expr) + for (e = prop->expr; e; e = e->left.expr) sym->flags |= e->right.sym->flags & SYMBOL_NEW; } @@ -242,23 +256,45 @@ FILE *out, *out_h; struct symbol *sym; struct menu *menu; - char oldname[128]; + const char *basename; + char dirname[128], tmpname[128], newname[128]; int type, l; const char *str; - out = fopen(".tmpconfig", "w"); + dirname[0] = 0; + if (name && name[0]) { + char *slash = strrchr(name, '/'); + if (slash) { + int size = slash - name + 1; + memcpy(dirname, name, size); + dirname[size] = 0; + if (slash[1]) + basename = slash + 1; + else + basename = conf_def_filename; + } else + basename = name; + } else + basename = conf_def_filename; + + sprintf(newname, "%s.tmpconfig.%d", dirname, getpid()); + out = fopen(newname, "w"); if (!out) return 1; - out_h = fopen(".tmpconfig.h", "w"); - if (!out_h) - return 1; + out_h = NULL; + if (!name) { + out_h = fopen(".tmpconfig.h", "w"); + if (!out_h) + return 1; + } fprintf(out, "#\n" "# Automatically generated make config: don't edit\n" "#\n"); - fprintf(out_h, "/*\n" - " * Automatically generated C config: don't edit\n" - " */\n" - "#define AUTOCONF_INCLUDED\n"); + if (out_h) + fprintf(out_h, "/*\n" + " * Automatically generated C config: don't edit\n" + " */\n" + "#define AUTOCONF_INCLUDED\n"); if (!sym_change_count) sym_clear_all_valid(); @@ -274,10 +310,11 @@ "#\n" "# %s\n" "#\n", str); - fprintf(out_h, "\n" - "/*\n" - " * %s\n" - " */\n", str); + if (out_h) + fprintf(out_h, "\n" + "/*\n" + " * %s\n" + " */\n", str); } else if (!(sym->flags & SYMBOL_CHOICE)) { sym_calc_value(sym); if (!(sym->flags & SYMBOL_WRITE)) @@ -286,7 +323,7 @@ type = sym->type; if (type == S_TRISTATE) { sym_calc_value(modules_sym); - if (S_TRI(modules_sym->curr) == no) + if (modules_sym->curr.tri == no) type = S_BOOLEAN; } switch (type) { @@ -295,15 +332,18 @@ switch (sym_get_tristate_value(sym)) { case no: fprintf(out, "# CONFIG_%s is not set\n", sym->name); - fprintf(out_h, "#undef CONFIG_%s\n", sym->name); + if (out_h) + fprintf(out_h, "#undef CONFIG_%s\n", sym->name); break; case mod: fprintf(out, "CONFIG_%s=m\n", sym->name); - fprintf(out_h, "#define CONFIG_%s_MODULE 1\n", sym->name); + if (out_h) + fprintf(out_h, "#define CONFIG_%s_MODULE 1\n", sym->name); break; case yes: fprintf(out, "CONFIG_%s=y\n", sym->name); - fprintf(out_h, "#define CONFIG_%s 1\n", sym->name); + if (out_h) + fprintf(out_h, "#define CONFIG_%s 1\n", sym->name); break; } break; @@ -311,34 +351,40 @@ // fix me str = sym_get_string_value(sym); fprintf(out, "CONFIG_%s=\"", sym->name); - fprintf(out_h, "#define CONFIG_%s \"", sym->name); + if (out_h) + fprintf(out_h, "#define CONFIG_%s \"", sym->name); do { l = strcspn(str, "\"\\"); if (l) { fwrite(str, l, 1, out); - fwrite(str, l, 1, out_h); + if (out_h) + fwrite(str, l, 1, out_h); } str += l; while (*str == '\\' || *str == '"') { fprintf(out, "\\%c", *str); - fprintf(out_h, "\\%c", *str); + if (out_h) + fprintf(out_h, "\\%c", *str); str++; } } while (*str); fputs("\"\n", out); - fputs("\"\n", out_h); + if (out_h) + fputs("\"\n", out_h); break; case S_HEX: str = sym_get_string_value(sym); if (str[0] != '0' || (str[1] != 'x' && str[1] != 'X')) { fprintf(out, "CONFIG_%s=%s\n", sym->name, str); - fprintf(out_h, "#define CONFIG_%s 0x%s\n", sym->name, str); + if (out_h) + fprintf(out_h, "#define CONFIG_%s 0x%s\n", sym->name, str); break; } case S_INT: str = sym_get_string_value(sym); fprintf(out, "CONFIG_%s=%s\n", sym->name, str); - fprintf(out_h, "#define CONFIG_%s %s\n", sym->name, str); + if (out_h) + fprintf(out_h, "#define CONFIG_%s %s\n", sym->name, str); break; } } @@ -358,18 +404,18 @@ } } fclose(out); - fclose(out_h); - - if (!name) { + if (out_h) { + fclose(out_h); rename(".tmpconfig.h", "include/linux/autoconf.h"); - name = conf_def_filename; - file_write_dep(NULL); - } else - unlink(".tmpconfig.h"); - - sprintf(oldname, "%s.old", name); - rename(name, oldname); - if (rename(".tmpconfig", name)) + } + if (!name || basename != conf_def_filename) { + if (!name) + name = conf_def_filename; + sprintf(tmpname, "%s.old", name); + rename(name, tmpname); + } + sprintf(tmpname, "%s%s", dirname, basename); + if (rename(newname, tmpname)) return 1; sym_change_count = 0; diff -urN linux-2.5.70-bk7/scripts/kconfig/expr.c linux-2.5.70-bk8/scripts/kconfig/expr.c --- linux-2.5.70-bk7/scripts/kconfig/expr.c 2003-05-26 18:00:38.000000000 -0700 +++ linux-2.5.70-bk8/scripts/kconfig/expr.c 2003-06-03 04:38:40.000000000 -0700 @@ -55,6 +55,13 @@ return e2 ? expr_alloc_two(E_AND, e1, e2) : e1; } +struct expr *expr_alloc_or(struct expr *e1, struct expr *e2) +{ + if (!e1) + return e2; + return e2 ? expr_alloc_two(E_OR, e1, e2) : e1; +} + struct expr *expr_copy(struct expr *org) { struct expr *e; @@ -158,9 +165,22 @@ void expr_eliminate_eq(struct expr **ep1, struct expr **ep2) { - if (!e1 || !e2 || e1->type != e2->type) + if (!e1 || !e2) return; - __expr_eliminate_eq(e1->type, ep1, ep2); + switch (e1->type) { + case E_OR: + case E_AND: + __expr_eliminate_eq(e1->type, ep1, ep2); + default: + ; + } + if (e1->type != e2->type) switch (e2->type) { + case E_OR: + case E_AND: + __expr_eliminate_eq(e2->type, ep1, ep2); + default: + ; + } e1 = expr_eliminate_yn(e1); e2 = expr_eliminate_yn(e2); } @@ -195,6 +215,7 @@ trans_count = old_count; return res; case E_CHOICE: + case E_RANGE: case E_NONE: /* panic */; } @@ -897,6 +918,7 @@ case E_SYMBOL: return expr_alloc_comp(type, e->left.sym, sym); case E_CHOICE: + case E_RANGE: case E_NONE: /* panic */; } @@ -914,7 +936,7 @@ switch (e->type) { case E_SYMBOL: sym_calc_value(e->left.sym); - return S_TRI(e->left.sym->curr); + return e->left.sym->curr.tri; case E_AND: val1 = expr_calc_value(e->left.expr); val2 = expr_calc_value(e->right.expr); @@ -1017,11 +1039,18 @@ expr_print(e->right.expr, fn, data, E_AND); break; case E_CHOICE: + fn(data, e->right.sym->name); if (e->left.expr) { - expr_print(e->left.expr, fn, data, E_CHOICE); fn(data, " ^ "); + expr_print(e->left.expr, fn, data, E_CHOICE); } + break; + case E_RANGE: + fn(data, "["); + fn(data, e->left.sym->name); + fn(data, " "); fn(data, e->right.sym->name); + fn(data, "]"); break; default: { diff -urN linux-2.5.70-bk7/scripts/kconfig/expr.h linux-2.5.70-bk8/scripts/kconfig/expr.h --- linux-2.5.70-bk7/scripts/kconfig/expr.h 2003-05-26 18:00:41.000000000 -0700 +++ linux-2.5.70-bk8/scripts/kconfig/expr.h 2003-06-03 04:38:40.000000000 -0700 @@ -18,10 +18,6 @@ struct file { struct file *next; struct file *parent; -#ifdef CML1 - struct statement *stmt; - struct statement *last_stmt; -#endif char *name; int lineno; int flags; @@ -36,7 +32,7 @@ } tristate; enum expr_type { - E_NONE, E_OR, E_AND, E_NOT, E_EQUAL, E_UNEQUAL, E_CHOICE, E_SYMBOL + E_NONE, E_OR, E_AND, E_NOT, E_EQUAL, E_UNEQUAL, E_CHOICE, E_SYMBOL, E_RANGE }; union expr_data { @@ -45,18 +41,10 @@ }; struct expr { -#ifdef CML1 - int token; -#else enum expr_type type; -#endif union expr_data left, right; }; -#define E_TRI(ev) ((ev).tri) -#define E_EXPR(ev) ((ev).expr) -#define E_CALC(ev) (E_TRI(ev) = expr_calc_value(E_EXPR(ev))) - #define E_OR(dep1, dep2) (((dep1)>(dep2))?(dep1):(dep2)) #define E_AND(dep1, dep2) (((dep1)<(dep2))?(dep1):(dep2)) #define E_NOT(dep) (2-(dep)) @@ -66,12 +54,8 @@ tristate tri; }; -#define S_VAL(sv) ((sv).value) -#define S_TRI(sv) ((sv).tri) -#define S_EQ(sv1, sv2) (S_VAL(sv1) == S_VAL(sv2) || !strcmp(S_VAL(sv1), S_VAL(sv2))) - struct symbol_value { - void *value; + void *val; tristate tri; }; @@ -83,31 +67,17 @@ struct symbol *next; char *name; char *help; -#ifdef CML1 - int type; -#else enum symbol_type type; -#endif - struct symbol_value curr, def; + struct symbol_value curr, user; tristate visible; int flags; struct property *prop; struct expr *dep, *dep2; - struct menu *menu; + struct expr_value rev_dep; }; #define for_all_symbols(i, sym) for (i = 0; i < 257; i++) for (sym = symbol_hash[i]; sym; sym = sym->next) if (sym->type != S_OTHER) -#ifdef CML1 -#define SYMBOL_UNKNOWN S_UNKNOWN -#define SYMBOL_BOOLEAN S_BOOLEAN -#define SYMBOL_TRISTATE S_TRISTATE -#define SYMBOL_INT S_INT -#define SYMBOL_HEX S_HEX -#define SYMBOL_STRING S_STRING -#define SYMBOL_OTHER S_OTHER -#endif - #define SYMBOL_YES 0x0001 #define SYMBOL_MOD 0x0002 #define SYMBOL_NO 0x0004 @@ -122,34 +92,28 @@ #define SYMBOL_CHANGED 0x0400 #define SYMBOL_NEW 0x0800 #define SYMBOL_AUTO 0x1000 +#define SYMBOL_CHECKED 0x2000 +#define SYMBOL_CHECK_DONE 0x4000 +#define SYMBOL_WARNED 0x8000 #define SYMBOL_MAXLENGTH 256 #define SYMBOL_HASHSIZE 257 #define SYMBOL_HASHMASK 0xff enum prop_type { - P_UNKNOWN, P_PROMPT, P_COMMENT, P_MENU, P_ROOTMENU, P_DEFAULT, P_CHOICE + P_UNKNOWN, P_PROMPT, P_COMMENT, P_MENU, P_DEFAULT, P_CHOICE, P_SELECT, P_RANGE }; struct property { struct property *next; struct symbol *sym; -#ifdef CML1 - int token; -#else enum prop_type type; -#endif const char *text; - struct symbol *def; struct expr_value visible; - struct expr *dep; - struct expr *dep2; + struct expr *expr; struct menu *menu; struct file *file; int lineno; -#ifdef CML1 - struct property *next_pos; -#endif }; #define for_all_properties(sym, st, tok) \ @@ -176,6 +140,7 @@ }; #define MENU_CHANGED 0x0001 +#define MENU_ROOT 0x0002 #ifndef SWIG @@ -186,18 +151,12 @@ extern struct symbol symbol_yes, symbol_no, symbol_mod; extern struct symbol *modules_sym; extern int cdebug; -extern int print_type; struct expr *expr_alloc_symbol(struct symbol *sym); -#ifdef CML1 -struct expr *expr_alloc_one(int token, struct expr *ce); -struct expr *expr_alloc_two(int token, struct expr *e1, struct expr *e2); -struct expr *expr_alloc_comp(int token, struct symbol *s1, struct symbol *s2); -#else struct expr *expr_alloc_one(enum expr_type type, struct expr *ce); struct expr *expr_alloc_two(enum expr_type type, struct expr *e1, struct expr *e2); struct expr *expr_alloc_comp(enum expr_type type, struct symbol *s1, struct symbol *s2); -#endif struct expr *expr_alloc_and(struct expr *e1, struct expr *e2); +struct expr *expr_alloc_or(struct expr *e1, struct expr *e2); struct expr *expr_copy(struct expr *org); void expr_free(struct expr *e); int expr_eq(struct expr *e1, struct expr *e2); @@ -217,17 +176,6 @@ void expr_fprint(struct expr *e, FILE *out); void print_expr(int mask, struct expr *e, int prevtoken); -#ifdef CML1 -static inline int expr_is_yes(struct expr *e) -{ - return !e || (e->token == WORD && e->left.sym == &symbol_yes); -} - -static inline int expr_is_no(struct expr *e) -{ - return e && (e->token == WORD && e->left.sym == &symbol_no); -} -#else static inline int expr_is_yes(struct expr *e) { return !e || (e->type == E_SYMBOL && e->left.sym == &symbol_yes); @@ -238,7 +186,6 @@ return e && (e->type == E_SYMBOL && e->left.sym == &symbol_no); } #endif -#endif #ifdef __cplusplus } diff -urN linux-2.5.70-bk7/scripts/kconfig/gconf.c linux-2.5.70-bk8/scripts/kconfig/gconf.c --- linux-2.5.70-bk7/scripts/kconfig/gconf.c 2003-05-26 18:00:58.000000000 -0700 +++ linux-2.5.70-bk8/scripts/kconfig/gconf.c 2003-06-03 04:38:40.000000000 -0700 @@ -164,8 +164,6 @@ strcpy(buf, "comment"); if (val == P_MENU) strcpy(buf, "menu"); - if (val == P_ROOTMENU) - strcpy(buf, "rootmenu"); if (val == P_DEFAULT) strcpy(buf, "default"); if (val == P_CHOICE) @@ -798,7 +796,7 @@ current = current->parent; ptype = current->prompt ? current->prompt->type : P_UNKNOWN; - if ((ptype != P_ROOTMENU) && (ptype != P_MENU)) + if (ptype != P_MENU) current = current->parent; display_tree_part(); @@ -836,6 +834,8 @@ gtk_widget_show(tree1_w); gtk_window_get_default_size(GTK_WINDOW(main_wnd), &w, &h); gtk_paned_set_position(GTK_PANED(hpaned), w / 2); + if (tree2) + gtk_tree_store_clear(tree2); display_list(); } @@ -922,8 +922,10 @@ config_changed = TRUE; if (view_mode == FULL_VIEW) update_tree(&rootmenu, NULL); - else if (view_mode == SPLIT_VIEW) + else if (view_mode == SPLIT_VIEW) { update_tree(current, NULL); + display_list(); + } else if (view_mode == SINGLE_VIEW) display_tree_part(); //fixme: keep exp/coll break; @@ -949,8 +951,10 @@ sym_set_tristate_value(menu->sym, newval); if (view_mode == FULL_VIEW) update_tree(&rootmenu, NULL); - else if (view_mode == SPLIT_VIEW) + else if (view_mode == SPLIT_VIEW) { update_tree(current, NULL); + display_list(); + } else if (view_mode == SINGLE_VIEW) display_tree_part(); //fixme: keep exp/coll } @@ -1035,8 +1039,7 @@ enum prop_type ptype; ptype = menu->prompt ? menu->prompt->type : P_UNKNOWN; - if (((ptype == P_MENU) || (ptype == P_ROOTMENU)) && - (view_mode == SINGLE_VIEW) && (col == COL_OPTION)) { + if (ptype == P_MENU && view_mode != FULL_VIEW && col == COL_OPTION) { // goes down into menu current = menu; display_tree_part(); @@ -1192,7 +1195,6 @@ ptype = menu->prompt ? menu->prompt->type : P_UNKNOWN; switch (ptype) { case P_MENU: - case P_ROOTMENU: row[COL_PIXBUF] = (gchar *) xpm_menu; if (view_mode != FULL_VIEW) row[COL_PIXVIS] = GINT_TO_POINTER(TRUE); @@ -1477,11 +1479,11 @@ if (sym) sym->flags &= ~SYMBOL_CHANGED; - if ((view_mode == SPLIT_VIEW) && (ptype != P_ROOTMENU) && + if ((view_mode == SPLIT_VIEW) && !(child->flags & MENU_ROOT) && (tree == tree1)) continue; - if ((view_mode == SPLIT_VIEW) && (ptype == P_ROOTMENU) && + if ((view_mode == SPLIT_VIEW) && (child->flags & MENU_ROOT) && (tree == tree2)) continue; @@ -1503,7 +1505,7 @@ && (tree == tree2)) continue; - if (((menu != &rootmenu) && (ptype != P_ROOTMENU)) || + if (((menu != &rootmenu) && !(menu->flags & MENU_ROOT)) || (view_mode == FULL_VIEW) || (view_mode == SPLIT_VIEW)) { indent++; @@ -1525,8 +1527,6 @@ /* Display the list in the left frame (split view) */ static void display_list(void) { - if (tree2) - gtk_tree_store_clear(tree2); if (tree1) gtk_tree_store_clear(tree1); @@ -1542,7 +1542,7 @@ if (!menu->prompt || menu->prompt->type != P_MENU) return; - menu->prompt->type = P_ROOTMENU; + menu->flags |= MENU_ROOT; for (child = menu->list; child; child = child->next) fixup_rootmenu(child); } diff -urN linux-2.5.70-bk7/scripts/kconfig/lex.zconf.c_shipped linux-2.5.70-bk8/scripts/kconfig/lex.zconf.c_shipped --- linux-2.5.70-bk7/scripts/kconfig/lex.zconf.c_shipped 2003-05-26 18:00:57.000000000 -0700 +++ linux-2.5.70-bk8/scripts/kconfig/lex.zconf.c_shipped 2003-06-03 04:38:40.000000000 -0700 @@ -1,50 +1,84 @@ -#define yy_create_buffer zconf_create_buffer -#define yy_delete_buffer zconf_delete_buffer -#define yy_scan_buffer zconf_scan_buffer -#define yy_scan_string zconf_scan_string -#define yy_scan_bytes zconf_scan_bytes -#define yy_flex_debug zconf_flex_debug -#define yy_init_buffer zconf_init_buffer -#define yy_flush_buffer zconf_flush_buffer -#define yy_load_buffer_state zconf_load_buffer_state -#define yy_switch_to_buffer zconf_switch_to_buffer -#define yyin zconfin -#define yyleng zconfleng -#define yylex zconflex -#define yyout zconfout -#define yyrestart zconfrestart -#define yytext zconftext -/* A lexical scanner generated by flex */ +#line 3 "lex.zconf.c" -/* Scanner skeleton version: - * $Header: /home/daffy/u0/vern/flex/RCS/flex.skl,v 2.91 96/09/10 16:58:48 vern Exp $ - */ +#define YY_INT_ALIGNED short int + +/* A lexical scanner generated by flex */ #define FLEX_SCANNER #define YY_FLEX_MAJOR_VERSION 2 #define YY_FLEX_MINOR_VERSION 5 +#define YY_FLEX_SUBMINOR_VERSION 31 +#if YY_FLEX_SUBMINOR_VERSION > 0 +#define FLEX_BETA +#endif + +/* First, we deal with platform-specific or compiler-specific issues. */ +/* begin standard C headers. */ #include +#include #include +#include -/* cfront 1.2 defines "c_plusplus" instead of "__cplusplus" */ -#ifdef c_plusplus -#ifndef __cplusplus -#define __cplusplus -#endif -#endif +/* end standard C headers. */ +/* flex integer type definitions */ -#ifdef __cplusplus +#ifndef FLEXINT_H +#define FLEXINT_H -#include -#ifndef _WIN32 -#include +/* C99 systems have . Non-C99 systems may or may not. */ + +#if defined __STDC_VERSION__ && __STDC_VERSION__ >= 199901L +#include +typedef int8_t flex_int8_t; +typedef uint8_t flex_uint8_t; +typedef int16_t flex_int16_t; +typedef uint16_t flex_uint16_t; +typedef int32_t flex_int32_t; +typedef uint32_t flex_uint32_t; +#else +typedef signed char flex_int8_t; +typedef short int flex_int16_t; +typedef int flex_int32_t; +typedef unsigned char flex_uint8_t; +typedef unsigned short int flex_uint16_t; +typedef unsigned int flex_uint32_t; +#endif /* ! C99 */ + +/* Limits of integral types. */ +#ifndef INT8_MIN +#define INT8_MIN (-128) +#endif +#ifndef INT16_MIN +#define INT16_MIN (-32767-1) +#endif +#ifndef INT32_MIN +#define INT32_MIN (-2147483647-1) +#endif +#ifndef INT8_MAX +#define INT8_MAX (127) +#endif +#ifndef INT16_MAX +#define INT16_MAX (32767) +#endif +#ifndef INT32_MAX +#define INT32_MAX (2147483647) +#endif +#ifndef UINT8_MAX +#define UINT8_MAX (255U) +#endif +#ifndef UINT16_MAX +#define UINT16_MAX (65535U) +#endif +#ifndef UINT32_MAX +#define UINT32_MAX (4294967295U) #endif -/* Use prototypes in function declarations. */ -#define YY_USE_PROTOS +#endif /* ! FLEXINT_H */ + +#ifdef __cplusplus /* The "const" storage-class-modifier is valid. */ #define YY_USE_CONST @@ -53,34 +87,17 @@ #if __STDC__ -#define YY_USE_PROTOS #define YY_USE_CONST #endif /* __STDC__ */ #endif /* ! __cplusplus */ -#ifdef __TURBOC__ - #pragma warn -rch - #pragma warn -use -#include -#include -#define YY_USE_CONST -#define YY_USE_PROTOS -#endif - #ifdef YY_USE_CONST #define yyconst const #else #define yyconst #endif - -#ifdef YY_USE_PROTOS -#define YY_PROTO(proto) proto -#else -#define YY_PROTO(proto) () -#endif - /* Returned upon end-of-file. */ #define YY_NULL 0 @@ -95,71 +112,71 @@ * but we do it the disgusting crufty way forced on us by the ()-less * definition of BEGIN. */ -#define BEGIN yy_start = 1 + 2 * +#define BEGIN (yy_start) = 1 + 2 * /* Translate the current start state into a value that can be later handed * to BEGIN to return to the state. The YYSTATE alias is for lex * compatibility. */ -#define YY_START ((yy_start - 1) / 2) +#define YY_START (((yy_start) - 1) / 2) #define YYSTATE YY_START /* Action number for EOF rule of a given start state. */ #define YY_STATE_EOF(state) (YY_END_OF_BUFFER + state + 1) /* Special action meaning "start processing a new file". */ -#define YY_NEW_FILE yyrestart( yyin ) +#define YY_NEW_FILE zconfrestart(zconfin ) #define YY_END_OF_BUFFER_CHAR 0 /* Size of default input buffer. */ +#ifndef YY_BUF_SIZE #define YY_BUF_SIZE 16384 +#endif +#ifndef YY_TYPEDEF_YY_BUFFER_STATE +#define YY_TYPEDEF_YY_BUFFER_STATE typedef struct yy_buffer_state *YY_BUFFER_STATE; +#endif -extern int yyleng; -extern FILE *yyin, *yyout; +extern int zconfleng; + +extern FILE *zconfin, *zconfout; #define EOB_ACT_CONTINUE_SCAN 0 #define EOB_ACT_END_OF_FILE 1 #define EOB_ACT_LAST_MATCH 2 -/* The funky do-while in the following #define is used to turn the definition - * int a single C statement (which needs a semi-colon terminator). This - * avoids problems with code like: - * - * if ( condition_holds ) - * yyless( 5 ); - * else - * do_something_else(); - * - * Prior to using the do-while the compiler would get upset at the - * "else" because it interpreted the "if" statement as being all - * done when it reached the ';' after the yyless() call. - */ - -/* Return all but the first 'n' matched characters back to the input stream. */ - + #define YY_LESS_LINENO(n) + +/* Return all but the first "n" matched characters back to the input stream. */ #define yyless(n) \ do \ { \ - /* Undo effects of setting up yytext. */ \ - *yy_cp = yy_hold_char; \ + /* Undo effects of setting up zconftext. */ \ + int yyless_macro_arg = (n); \ + YY_LESS_LINENO(yyless_macro_arg);\ + *yy_cp = (yy_hold_char); \ YY_RESTORE_YY_MORE_OFFSET \ - yy_c_buf_p = yy_cp = yy_bp + n - YY_MORE_ADJ; \ - YY_DO_BEFORE_ACTION; /* set up yytext again */ \ + (yy_c_buf_p) = yy_cp = yy_bp + yyless_macro_arg - YY_MORE_ADJ; \ + YY_DO_BEFORE_ACTION; /* set up zconftext again */ \ } \ while ( 0 ) -#define unput(c) yyunput( c, yytext_ptr ) +#define unput(c) yyunput( c, (yytext_ptr) ) /* The following is because we cannot portably get our hands on size_t * (without autoconf's help, which isn't available because we want * flex-generated scanners to compile on their own). */ -typedef unsigned int yy_size_t; +#ifndef YY_TYPEDEF_YY_SIZE_T +#define YY_TYPEDEF_YY_SIZE_T +typedef unsigned int yy_size_t; +#endif +#ifndef YY_STRUCT_YY_BUFFER_STATE +#define YY_STRUCT_YY_BUFFER_STATE struct yy_buffer_state { FILE *yy_input_file; @@ -196,12 +213,16 @@ */ int yy_at_bol; + int yy_bs_lineno; /**< The line count. */ + int yy_bs_column; /**< The column count. */ + /* Whether to try to fill the input buffer when we reach the * end of it. */ int yy_fill_buffer; int yy_buffer_status; + #define YY_BUFFER_NEW 0 #define YY_BUFFER_NORMAL 1 /* When an EOF's been seen but there's still some text to process @@ -211,97 +232,126 @@ * possible backing-up. * * When we actually see the EOF, we change the status to "new" - * (via yyrestart()), so that the user can continue scanning by - * just pointing yyin at a new input file. + * (via zconfrestart()), so that the user can continue scanning by + * just pointing zconfin at a new input file. */ #define YY_BUFFER_EOF_PENDING 2 + }; +#endif /* !YY_STRUCT_YY_BUFFER_STATE */ -static YY_BUFFER_STATE yy_current_buffer = 0; +/* Stack of input buffers. */ +static size_t yy_buffer_stack_top = 0; /**< index of top of stack. */ +static size_t yy_buffer_stack_max = 0; /**< capacity of stack. */ +static YY_BUFFER_STATE * yy_buffer_stack = 0; /**< Stack as an array. */ /* We provide macros for accessing buffer states in case in the * future we want to put the buffer states in a more general * "scanner state". + * + * Returns the top of the stack, or NULL. */ -#define YY_CURRENT_BUFFER yy_current_buffer +#define YY_CURRENT_BUFFER ( (yy_buffer_stack) \ + ? (yy_buffer_stack)[(yy_buffer_stack_top)] \ + : NULL) +/* Same as previous macro, but useful when we know that the buffer stack is not + * NULL or when we need an lvalue. For internal use only. + */ +#define YY_CURRENT_BUFFER_LVALUE (yy_buffer_stack)[(yy_buffer_stack_top)] -/* yy_hold_char holds the character lost when yytext is formed. */ +/* yy_hold_char holds the character lost when zconftext is formed. */ static char yy_hold_char; - static int yy_n_chars; /* number of characters read into yy_ch_buf */ - - -int yyleng; +int zconfleng; /* Points to current character in buffer. */ static char *yy_c_buf_p = (char *) 0; static int yy_init = 1; /* whether we need to initialize */ static int yy_start = 0; /* start state number */ -/* Flag which is used to allow yywrap()'s to do buffer switches - * instead of setting up a fresh yyin. A bit of a hack ... +/* Flag which is used to allow zconfwrap()'s to do buffer switches + * instead of setting up a fresh zconfin. A bit of a hack ... */ static int yy_did_buffer_switch_on_eof; -void yyrestart YY_PROTO(( FILE *input_file )); +void zconfrestart (FILE *input_file ); +void zconf_switch_to_buffer (YY_BUFFER_STATE new_buffer ); +YY_BUFFER_STATE zconf_create_buffer (FILE *file,int size ); +void zconf_delete_buffer (YY_BUFFER_STATE b ); +void zconf_flush_buffer (YY_BUFFER_STATE b ); +void zconfpush_buffer_state (YY_BUFFER_STATE new_buffer ); +void zconfpop_buffer_state (void ); + +static void zconfensure_buffer_stack (void ); +static void zconf_load_buffer_state (void ); +static void zconf_init_buffer (YY_BUFFER_STATE b,FILE *file ); + +#define YY_FLUSH_BUFFER zconf_flush_buffer(YY_CURRENT_BUFFER ) + +YY_BUFFER_STATE zconf_scan_buffer (char *base,yy_size_t size ); +YY_BUFFER_STATE zconf_scan_string (yyconst char *yy_str ); +YY_BUFFER_STATE zconf_scan_bytes (yyconst char *bytes,int len ); + +void *zconfalloc (yy_size_t ); +void *zconfrealloc (void *,yy_size_t ); +void zconffree (void * ); -void yy_switch_to_buffer YY_PROTO(( YY_BUFFER_STATE new_buffer )); -void yy_load_buffer_state YY_PROTO(( void )); -YY_BUFFER_STATE yy_create_buffer YY_PROTO(( FILE *file, int size )); -void yy_delete_buffer YY_PROTO(( YY_BUFFER_STATE b )); -void yy_init_buffer YY_PROTO(( YY_BUFFER_STATE b, FILE *file )); -void yy_flush_buffer YY_PROTO(( YY_BUFFER_STATE b )); -#define YY_FLUSH_BUFFER yy_flush_buffer( yy_current_buffer ) - -YY_BUFFER_STATE yy_scan_buffer YY_PROTO(( char *base, yy_size_t size )); -YY_BUFFER_STATE yy_scan_string YY_PROTO(( yyconst char *yy_str )); -YY_BUFFER_STATE yy_scan_bytes YY_PROTO(( yyconst char *bytes, int len )); - -static void *yy_flex_alloc YY_PROTO(( yy_size_t )); -static void *yy_flex_realloc YY_PROTO(( void *, yy_size_t )); -static void yy_flex_free YY_PROTO(( void * )); - -#define yy_new_buffer yy_create_buffer +#define yy_new_buffer zconf_create_buffer #define yy_set_interactive(is_interactive) \ { \ - if ( ! yy_current_buffer ) \ - yy_current_buffer = yy_create_buffer( yyin, YY_BUF_SIZE ); \ - yy_current_buffer->yy_is_interactive = is_interactive; \ + if ( ! YY_CURRENT_BUFFER ){ \ + zconfensure_buffer_stack (); \ + YY_CURRENT_BUFFER_LVALUE = \ + zconf_create_buffer(zconfin,YY_BUF_SIZE ); \ + } \ + YY_CURRENT_BUFFER_LVALUE->yy_is_interactive = is_interactive; \ } #define yy_set_bol(at_bol) \ { \ - if ( ! yy_current_buffer ) \ - yy_current_buffer = yy_create_buffer( yyin, YY_BUF_SIZE ); \ - yy_current_buffer->yy_at_bol = at_bol; \ + if ( ! YY_CURRENT_BUFFER ){\ + zconfensure_buffer_stack (); \ + YY_CURRENT_BUFFER_LVALUE = \ + zconf_create_buffer(zconfin,YY_BUF_SIZE ); \ + } \ + YY_CURRENT_BUFFER_LVALUE->yy_at_bol = at_bol; \ } -#define YY_AT_BOL() (yy_current_buffer->yy_at_bol) +#define YY_AT_BOL() (YY_CURRENT_BUFFER_LVALUE->yy_at_bol) +/* Begin user sect3 */ -#define yywrap() 1 +#define zconfwrap(n) 1 #define YY_SKIP_YYWRAP + typedef unsigned char YY_CHAR; -FILE *yyin = (FILE *) 0, *yyout = (FILE *) 0; + +FILE *zconfin = (FILE *) 0, *zconfout = (FILE *) 0; + typedef int yy_state_type; -extern char *yytext; -#define yytext_ptr yytext -static yyconst short yy_nxt[][37] = + +extern int zconflineno; + +int zconflineno = 1; + +extern char *zconftext; +#define yytext_ptr zconftext +static yyconst flex_int16_t yy_nxt[][38] = { { 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0 + 0, 0, 0, 0, 0, 0, 0, 0 }, { 11, 12, 13, 14, 12, 12, 15, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, - 12, 12, 12, 12, 12, 12, 12 + 12, 12, 12, 12, 12, 12, 12, 12 }, { @@ -309,21 +359,21 @@ 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, - 12, 12, 12, 12, 12, 12, 12 + 12, 12, 12, 12, 12, 12, 12, 12 }, { 11, 16, 16, 17, 16, 16, 16, 16, 16, 16, - 16, 16, 16, 18, 16, 16, 18, 19, 20, 21, - 22, 18, 18, 23, 24, 18, 25, 18, 26, 27, - 18, 28, 29, 30, 18, 18, 16 + 16, 16, 16, 18, 16, 16, 18, 18, 19, 20, + 21, 22, 18, 18, 23, 24, 18, 25, 18, 26, + 27, 18, 28, 29, 30, 18, 18, 16 }, { 11, 16, 16, 17, 16, 16, 16, 16, 16, 16, - 16, 16, 16, 18, 16, 16, 18, 19, 20, 21, - 22, 18, 18, 23, 24, 18, 25, 18, 26, 27, - 18, 28, 29, 30, 18, 18, 16 + 16, 16, 16, 18, 16, 16, 18, 18, 19, 20, + 21, 22, 18, 18, 23, 24, 18, 25, 18, 26, + 27, 18, 28, 29, 30, 18, 18, 16 }, @@ -331,14 +381,14 @@ 11, 31, 32, 33, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, - 31, 31, 31, 31, 31, 31, 31 + 31, 31, 31, 31, 31, 31, 31, 31 }, { 11, 31, 32, 33, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, - 31, 31, 31, 31, 31, 31, 31 + 31, 31, 31, 31, 31, 31, 31, 31 }, { @@ -346,36 +396,36 @@ 34, 34, 34, 34, 34, 37, 34, 34, 34, 34, 34, 34, 34, 34, 34, 34, 34, 34, 34, 34, - 34, 34, 34, 34, 34, 34, 34 + 34, 34, 34, 34, 34, 34, 34, 34 }, { 11, 34, 34, 35, 34, 36, 34, 34, 36, 34, 34, 34, 34, 34, 34, 37, 34, 34, 34, 34, 34, 34, 34, 34, 34, 34, 34, 34, 34, 34, - 34, 34, 34, 34, 34, 34, 34 + 34, 34, 34, 34, 34, 34, 34, 34 }, { 11, 38, 38, 39, 40, 41, 42, 43, 41, 44, 45, 46, 47, 47, 48, 49, 47, 47, 47, 47, - 47, 47, 47, 47, 50, 47, 47, 47, 51, 47, - 47, 47, 47, 47, 47, 47, 52 + 47, 47, 47, 47, 47, 50, 47, 47, 47, 51, + 47, 47, 47, 47, 47, 47, 47, 52 }, { 11, 38, 38, 39, 40, 41, 42, 43, 41, 44, 45, 46, 47, 47, 48, 49, 47, 47, 47, 47, - 47, 47, 47, 47, 50, 47, 47, 47, 51, 47, - 47, 47, 47, 47, 47, 47, 52 + 47, 47, 47, 47, 47, 50, 47, 47, 47, 51, + 47, 47, 47, 47, 47, 47, 47, 52 }, { -11, -11, -11, -11, -11, -11, -11, -11, -11, -11, -11, -11, -11, -11, -11, -11, -11, -11, -11, -11, -11, -11, -11, -11, -11, -11, -11, -11, -11, -11, - -11, -11, -11, -11, -11, -11, -11 + -11, -11, -11, -11, -11, -11, -11, -11 }, { @@ -383,21 +433,21 @@ -12, -12, -12, -12, -12, -12, -12, -12, -12, -12, -12, -12, -12, -12, -12, -12, -12, -12, -12, -12, - -12, -12, -12, -12, -12, -12, -12 + -12, -12, -12, -12, -12, -12, -12, -12 }, { 11, -13, 53, 54, -13, -13, 55, -13, -13, -13, -13, -13, -13, -13, -13, -13, -13, -13, -13, -13, -13, -13, -13, -13, -13, -13, -13, -13, -13, -13, - -13, -13, -13, -13, -13, -13, -13 + -13, -13, -13, -13, -13, -13, -13, -13 }, { 11, -14, -14, -14, -14, -14, -14, -14, -14, -14, -14, -14, -14, -14, -14, -14, -14, -14, -14, -14, -14, -14, -14, -14, -14, -14, -14, -14, -14, -14, - -14, -14, -14, -14, -14, -14, -14 + -14, -14, -14, -14, -14, -14, -14, -14 }, @@ -405,14 +455,14 @@ 11, 56, 56, 57, 56, 56, 56, 56, 56, 56, 56, 56, 56, 56, 56, 56, 56, 56, 56, 56, 56, 56, 56, 56, 56, 56, 56, 56, 56, 56, - 56, 56, 56, 56, 56, 56, 56 + 56, 56, 56, 56, 56, 56, 56, 56 }, { 11, -16, -16, -16, -16, -16, -16, -16, -16, -16, -16, -16, -16, -16, -16, -16, -16, -16, -16, -16, -16, -16, -16, -16, -16, -16, -16, -16, -16, -16, - -16, -16, -16, -16, -16, -16, -16 + -16, -16, -16, -16, -16, -16, -16, -16 }, { @@ -420,73 +470,73 @@ -17, -17, -17, -17, -17, -17, -17, -17, -17, -17, -17, -17, -17, -17, -17, -17, -17, -17, -17, -17, - -17, -17, -17, -17, -17, -17, -17 + -17, -17, -17, -17, -17, -17, -17, -17 }, { 11, -18, -18, -18, -18, -18, -18, -18, -18, -18, -18, -18, -18, 58, -18, -18, 58, 58, 58, 58, 58, 58, 58, 58, 58, 58, 58, 58, 58, 58, - 58, 58, 58, 58, 58, 58, -18 + 58, 58, 58, 58, 58, 58, 58, -18 }, { 11, -19, -19, -19, -19, -19, -19, -19, -19, -19, -19, -19, -19, 58, -19, -19, 58, 58, 58, 58, - 58, 58, 58, 58, 58, 58, 58, 58, 59, 58, - 58, 58, 58, 58, 58, 58, -19 + 58, 58, 58, 58, 58, 58, 58, 58, 58, 59, + 58, 58, 58, 58, 58, 58, 58, -19 }, { 11, -20, -20, -20, -20, -20, -20, -20, -20, -20, -20, -20, -20, 58, -20, -20, 58, 58, 58, 58, - 58, 58, 58, 60, 58, 58, 58, 58, 61, 58, - 58, 58, 58, 58, 58, 58, -20 + 58, 58, 58, 58, 60, 58, 58, 58, 58, 61, + 58, 58, 58, 58, 58, 58, 58, -20 }, { 11, -21, -21, -21, -21, -21, -21, -21, -21, -21, -21, -21, -21, 58, -21, -21, 58, 58, 58, 58, - 62, 58, 58, 58, 58, 58, 58, 58, 58, 58, - 58, 58, 58, 58, 58, 58, -21 + 58, 62, 58, 58, 58, 58, 58, 58, 58, 58, + 58, 58, 58, 58, 58, 58, 58, -21 }, { 11, -22, -22, -22, -22, -22, -22, -22, -22, -22, -22, -22, -22, 58, -22, -22, 58, 58, 58, 58, - 58, 58, 58, 58, 58, 58, 58, 63, 58, 58, - 58, 58, 58, 58, 58, 58, -22 + 58, 58, 58, 58, 58, 58, 58, 58, 63, 58, + 58, 58, 58, 58, 58, 58, 58, -22 }, { 11, -23, -23, -23, -23, -23, -23, -23, -23, -23, -23, -23, -23, 58, -23, -23, 58, 58, 58, 58, - 64, 58, 58, 58, 58, 58, 58, 58, 58, 58, - 58, 58, 58, 58, 58, 58, -23 + 58, 64, 58, 58, 58, 58, 58, 58, 58, 58, + 58, 58, 58, 58, 58, 58, 58, -23 }, { 11, -24, -24, -24, -24, -24, -24, -24, -24, -24, -24, -24, -24, 58, -24, -24, 58, 58, 58, 58, - 58, 65, 58, 58, 58, 58, 58, 66, 58, 58, - 58, 58, 58, 58, 58, 58, -24 + 58, 58, 65, 58, 58, 58, 58, 58, 66, 58, + 58, 58, 58, 58, 58, 58, 58, -24 }, { 11, -25, -25, -25, -25, -25, -25, -25, -25, -25, - -25, -25, -25, 58, -25, -25, 67, 58, 58, 58, - 68, 58, 58, 58, 58, 58, 58, 58, 58, 58, - 58, 58, 58, 58, 58, 58, -25 + -25, -25, -25, 58, -25, -25, 58, 67, 58, 58, + 58, 68, 58, 58, 58, 58, 58, 58, 58, 58, + 58, 58, 58, 58, 58, 58, 58, -25 }, { 11, -26, -26, -26, -26, -26, -26, -26, -26, -26, -26, -26, -26, 58, -26, -26, 58, 58, 58, 58, - 58, 58, 58, 58, 58, 58, 58, 58, 58, 69, - 58, 58, 58, 58, 58, 58, -26 + 58, 58, 58, 58, 58, 58, 58, 58, 58, 58, + 69, 58, 58, 58, 58, 58, 58, -26 }, { @@ -494,21 +544,21 @@ -27, -27, -27, 58, -27, -27, 58, 58, 58, 58, 58, 58, 58, 58, 58, 58, 58, 58, 58, 58, - 58, 70, 58, 58, 58, 58, -27 + 58, 58, 70, 58, 58, 58, 58, -27 }, { 11, -28, -28, -28, -28, -28, -28, -28, -28, -28, - -28, -28, -28, 58, -28, -28, 58, 58, 58, 58, - 71, 58, 58, 58, 58, 58, 58, 58, 58, 58, - 58, 58, 58, 58, 58, 58, -28 + -28, -28, -28, 58, -28, -28, 58, 71, 58, 58, + 58, 72, 58, 58, 58, 58, 58, 58, 58, 58, + 58, 58, 58, 58, 58, 58, 58, -28 }, { 11, -29, -29, -29, -29, -29, -29, -29, -29, -29, -29, -29, -29, 58, -29, -29, 58, 58, 58, 58, - 58, 58, 58, 58, 58, 58, 58, 58, 72, 58, - 58, 58, 58, 73, 58, 58, -29 + 58, 73, 58, 58, 58, 58, 58, 58, 58, 74, + 58, 58, 58, 58, 75, 58, 58, -29 }, @@ -516,36 +566,36 @@ 11, -30, -30, -30, -30, -30, -30, -30, -30, -30, -30, -30, -30, 58, -30, -30, 58, 58, 58, 58, 58, 58, 58, 58, 58, 58, 58, 58, 58, 58, - 58, 74, 58, 58, 58, 58, -30 + 58, 58, 76, 58, 58, 58, 58, -30 }, { - 11, 75, 75, -31, 75, 75, 75, 75, 75, 75, - 75, 75, 75, 75, 75, 75, 75, 75, 75, 75, - 75, 75, 75, 75, 75, 75, 75, 75, 75, 75, - 75, 75, 75, 75, 75, 75, 75 + 11, 77, 77, -31, 77, 77, 77, 77, 77, 77, + 77, 77, 77, 77, 77, 77, 77, 77, 77, 77, + 77, 77, 77, 77, 77, 77, 77, 77, 77, 77, + 77, 77, 77, 77, 77, 77, 77, 77 }, { - 11, -32, 76, 77, -32, -32, -32, -32, -32, -32, + 11, -32, 78, 79, -32, -32, -32, -32, -32, -32, -32, -32, -32, -32, -32, -32, -32, -32, -32, -32, -32, -32, -32, -32, -32, -32, -32, -32, -32, -32, - -32, -32, -32, -32, -32, -32, -32 + -32, -32, -32, -32, -32, -32, -32, -32 }, { - 11, 78, -33, -33, 78, 78, 78, 78, 78, 78, - 78, 78, 78, 78, 78, 78, 78, 78, 78, 78, - 78, 78, 78, 78, 78, 78, 78, 78, 78, 78, - 78, 78, 78, 78, 78, 78, 78 + 11, 80, -33, -33, 80, 80, 80, 80, 80, 80, + 80, 80, 80, 80, 80, 80, 80, 80, 80, 80, + 80, 80, 80, 80, 80, 80, 80, 80, 80, 80, + 80, 80, 80, 80, 80, 80, 80, 80 }, { - 11, 79, 79, 80, 79, -34, 79, 79, -34, 79, - 79, 79, 79, 79, 79, -34, 79, 79, 79, 79, - 79, 79, 79, 79, 79, 79, 79, 79, 79, 79, - 79, 79, 79, 79, 79, 79, 79 + 11, 81, 81, 82, 81, -34, 81, 81, -34, 81, + 81, 81, 81, 81, 81, -34, 81, 81, 81, 81, + 81, 81, 81, 81, 81, 81, 81, 81, 81, 81, + 81, 81, 81, 81, 81, 81, 81, 81 }, @@ -553,73 +603,73 @@ 11, -35, -35, -35, -35, -35, -35, -35, -35, -35, -35, -35, -35, -35, -35, -35, -35, -35, -35, -35, -35, -35, -35, -35, -35, -35, -35, -35, -35, -35, - -35, -35, -35, -35, -35, -35, -35 + -35, -35, -35, -35, -35, -35, -35, -35 }, { 11, -36, -36, -36, -36, -36, -36, -36, -36, -36, -36, -36, -36, -36, -36, -36, -36, -36, -36, -36, -36, -36, -36, -36, -36, -36, -36, -36, -36, -36, - -36, -36, -36, -36, -36, -36, -36 + -36, -36, -36, -36, -36, -36, -36, -36 }, { - 11, 81, 81, 82, 81, 81, 81, 81, 81, 81, - 81, 81, 81, 81, 81, 81, 81, 81, 81, 81, + 11, 83, 83, 84, 83, 83, 83, 83, 83, 83, + 83, 83, 83, 83, 83, 83, 83, 83, 83, 83, - 81, 81, 81, 81, 81, 81, 81, 81, 81, 81, - 81, 81, 81, 81, 81, 81, 81 + 83, 83, 83, 83, 83, 83, 83, 83, 83, 83, + 83, 83, 83, 83, 83, 83, 83, 83 }, { 11, -38, -38, -38, -38, -38, -38, -38, -38, -38, -38, -38, -38, -38, -38, -38, -38, -38, -38, -38, -38, -38, -38, -38, -38, -38, -38, -38, -38, -38, - -38, -38, -38, -38, -38, -38, -38 + -38, -38, -38, -38, -38, -38, -38, -38 }, { 11, -39, -39, -39, -39, -39, -39, -39, -39, -39, -39, -39, -39, -39, -39, -39, -39, -39, -39, -39, -39, -39, -39, -39, -39, -39, -39, -39, -39, -39, - -39, -39, -39, -39, -39, -39, -39 + -39, -39, -39, -39, -39, -39, -39, -39 }, { 11, -40, -40, -40, -40, -40, -40, -40, -40, -40, - -40, -40, -40, -40, 83, -40, -40, -40, -40, -40, + -40, -40, -40, -40, 85, -40, -40, -40, -40, -40, -40, -40, -40, -40, -40, -40, -40, -40, -40, -40, - -40, -40, -40, -40, -40, -40, -40 + -40, -40, -40, -40, -40, -40, -40, -40 }, { 11, -41, -41, -41, -41, -41, -41, -41, -41, -41, -41, -41, -41, -41, -41, -41, -41, -41, -41, -41, -41, -41, -41, -41, -41, -41, -41, -41, -41, -41, - -41, -41, -41, -41, -41, -41, -41 + -41, -41, -41, -41, -41, -41, -41, -41 }, { - 11, 84, 84, -42, 84, 84, 84, 84, 84, 84, - 84, 84, 84, 84, 84, 84, 84, 84, 84, 84, + 11, 86, 86, -42, 86, 86, 86, 86, 86, 86, + 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, - 84, 84, 84, 84, 84, 84, 84, 84, 84, 84, - 84, 84, 84, 84, 84, 84, 84 + 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, + 86, 86, 86, 86, 86, 86, 86, 86 }, { - 11, -43, -43, -43, -43, -43, -43, 85, -43, -43, + 11, -43, -43, -43, -43, -43, -43, 87, -43, -43, -43, -43, -43, -43, -43, -43, -43, -43, -43, -43, -43, -43, -43, -43, -43, -43, -43, -43, -43, -43, - -43, -43, -43, -43, -43, -43, -43 + -43, -43, -43, -43, -43, -43, -43, -43 }, { 11, -44, -44, -44, -44, -44, -44, -44, -44, -44, -44, -44, -44, -44, -44, -44, -44, -44, -44, -44, -44, -44, -44, -44, -44, -44, -44, -44, -44, -44, - -44, -44, -44, -44, -44, -44, -44 + -44, -44, -44, -44, -44, -44, -44, -44 }, @@ -627,51 +677,51 @@ 11, -45, -45, -45, -45, -45, -45, -45, -45, -45, -45, -45, -45, -45, -45, -45, -45, -45, -45, -45, -45, -45, -45, -45, -45, -45, -45, -45, -45, -45, - -45, -45, -45, -45, -45, -45, -45 + -45, -45, -45, -45, -45, -45, -45, -45 }, { 11, -46, -46, -46, -46, -46, -46, -46, -46, -46, - -46, 86, 87, 87, -46, -46, 87, 87, 87, 87, - 87, 87, 87, 87, 87, 87, 87, 87, 87, 87, - 87, 87, 87, 87, 87, 87, -46 + -46, 88, 89, 89, -46, -46, 89, 89, 89, 89, + 89, 89, 89, 89, 89, 89, 89, 89, 89, 89, + 89, 89, 89, 89, 89, 89, 89, -46 }, { 11, -47, -47, -47, -47, -47, -47, -47, -47, -47, - -47, 87, 87, 87, -47, -47, 87, 87, 87, 87, + -47, 89, 89, 89, -47, -47, 89, 89, 89, 89, - 87, 87, 87, 87, 87, 87, 87, 87, 87, 87, - 87, 87, 87, 87, 87, 87, -47 + 89, 89, 89, 89, 89, 89, 89, 89, 89, 89, + 89, 89, 89, 89, 89, 89, 89, -47 }, { 11, -48, -48, -48, -48, -48, -48, -48, -48, -48, -48, -48, -48, -48, -48, -48, -48, -48, -48, -48, -48, -48, -48, -48, -48, -48, -48, -48, -48, -48, - -48, -48, -48, -48, -48, -48, -48 + -48, -48, -48, -48, -48, -48, -48, -48 }, { - 11, -49, -49, 88, -49, -49, -49, -49, -49, -49, + 11, -49, -49, 90, -49, -49, -49, -49, -49, -49, -49, -49, -49, -49, -49, -49, -49, -49, -49, -49, -49, -49, -49, -49, -49, -49, -49, -49, -49, -49, - -49, -49, -49, -49, -49, -49, -49 + -49, -49, -49, -49, -49, -49, -49, -49 }, { 11, -50, -50, -50, -50, -50, -50, -50, -50, -50, - -50, 87, 87, 87, -50, -50, 87, 87, 87, 87, - 87, 89, 87, 87, 87, 87, 87, 87, 87, 87, - 87, 87, 87, 87, 87, 87, -50 + -50, 89, 89, 89, -50, -50, 89, 89, 89, 89, + 89, 89, 91, 89, 89, 89, 89, 89, 89, 89, + 89, 89, 89, 89, 89, 89, 89, -50 }, { 11, -51, -51, -51, -51, -51, -51, -51, -51, -51, - -51, 87, 87, 87, -51, -51, 87, 87, 87, 87, - 87, 87, 87, 87, 87, 87, 87, 90, 87, 87, - 87, 87, 87, 87, 87, 87, -51 + -51, 89, 89, 89, -51, -51, 89, 89, 89, 89, + 89, 89, 89, 89, 89, 89, 89, 89, 92, 89, + 89, 89, 89, 89, 89, 89, 89, -51 }, { @@ -679,21 +729,21 @@ -52, -52, -52, -52, -52, -52, -52, -52, -52, -52, -52, -52, -52, -52, -52, -52, -52, -52, -52, -52, - -52, -52, -52, -52, -52, -52, 91 + -52, -52, -52, -52, -52, -52, -52, 93 }, { 11, -53, 53, 54, -53, -53, 55, -53, -53, -53, -53, -53, -53, -53, -53, -53, -53, -53, -53, -53, -53, -53, -53, -53, -53, -53, -53, -53, -53, -53, - -53, -53, -53, -53, -53, -53, -53 + -53, -53, -53, -53, -53, -53, -53, -53 }, { 11, -54, -54, -54, -54, -54, -54, -54, -54, -54, -54, -54, -54, -54, -54, -54, -54, -54, -54, -54, -54, -54, -54, -54, -54, -54, -54, -54, -54, -54, - -54, -54, -54, -54, -54, -54, -54 + -54, -54, -54, -54, -54, -54, -54, -54 }, @@ -701,14 +751,14 @@ 11, 56, 56, 57, 56, 56, 56, 56, 56, 56, 56, 56, 56, 56, 56, 56, 56, 56, 56, 56, 56, 56, 56, 56, 56, 56, 56, 56, 56, 56, - 56, 56, 56, 56, 56, 56, 56 + 56, 56, 56, 56, 56, 56, 56, 56 }, { 11, 56, 56, 57, 56, 56, 56, 56, 56, 56, 56, 56, 56, 56, 56, 56, 56, 56, 56, 56, 56, 56, 56, 56, 56, 56, 56, 56, 56, 56, - 56, 56, 56, 56, 56, 56, 56 + 56, 56, 56, 56, 56, 56, 56, 56 }, { @@ -716,58 +766,58 @@ -57, -57, -57, -57, -57, -57, -57, -57, -57, -57, -57, -57, -57, -57, -57, -57, -57, -57, -57, -57, - -57, -57, -57, -57, -57, -57, -57 + -57, -57, -57, -57, -57, -57, -57, -57 }, { 11, -58, -58, -58, -58, -58, -58, -58, -58, -58, -58, -58, -58, 58, -58, -58, 58, 58, 58, 58, 58, 58, 58, 58, 58, 58, 58, 58, 58, 58, - 58, 58, 58, 58, 58, 58, -58 + 58, 58, 58, 58, 58, 58, 58, -58 }, { 11, -59, -59, -59, -59, -59, -59, -59, -59, -59, -59, -59, -59, 58, -59, -59, 58, 58, 58, 58, - 58, 58, 58, 58, 58, 58, 58, 58, 92, 58, - 58, 58, 58, 58, 58, 58, -59 + 58, 58, 58, 58, 58, 58, 58, 58, 58, 94, + 58, 58, 58, 58, 58, 58, 58, -59 }, { 11, -60, -60, -60, -60, -60, -60, -60, -60, -60, -60, -60, -60, 58, -60, -60, 58, 58, 58, 58, - 58, 58, 58, 58, 58, 58, 58, 58, 93, 58, - 58, 58, 58, 58, 58, 58, -60 + 58, 58, 58, 58, 58, 58, 58, 58, 58, 95, + 58, 58, 58, 58, 58, 58, 58, -60 }, { 11, -61, -61, -61, -61, -61, -61, -61, -61, -61, -61, -61, -61, 58, -61, -61, 58, 58, 58, 58, - 58, 58, 58, 58, 58, 58, 94, 95, 58, 58, - 58, 58, 58, 58, 58, 58, -61 + 58, 58, 58, 58, 58, 58, 58, 96, 97, 58, + 58, 58, 58, 58, 58, 58, 58, -61 }, { 11, -62, -62, -62, -62, -62, -62, -62, -62, -62, -62, -62, -62, 58, -62, -62, 58, 58, 58, 58, - 58, 96, 58, 58, 58, 58, 58, 58, 58, 97, - 58, 58, 58, 58, 58, 58, -62 + 58, 58, 98, 58, 58, 58, 58, 58, 58, 58, + 99, 58, 58, 58, 58, 58, 58, -62 }, { 11, -63, -63, -63, -63, -63, -63, -63, -63, -63, - -63, -63, -63, 58, -63, -63, 58, 58, 58, 98, - 58, 58, 58, 58, 58, 58, 58, 58, 58, 58, - 58, 58, 58, 58, 58, 58, -63 + -63, -63, -63, 58, -63, -63, 58, 100, 58, 58, + 101, 58, 58, 58, 58, 58, 58, 58, 58, 58, + 58, 58, 58, 58, 58, 58, 58, -63 }, { 11, -64, -64, -64, -64, -64, -64, -64, -64, -64, -64, -64, -64, 58, -64, -64, 58, 58, 58, 58, - 58, 58, 58, 58, 58, 99, 58, 58, 58, 58, - 58, 58, 58, 58, 58, 100, -64 + 58, 58, 58, 58, 58, 58, 102, 58, 58, 58, + 58, 58, 58, 58, 58, 58, 103, -64 }, @@ -775,51 +825,51 @@ 11, -65, -65, -65, -65, -65, -65, -65, -65, -65, -65, -65, -65, 58, -65, -65, 58, 58, 58, 58, 58, 58, 58, 58, 58, 58, 58, 58, 58, 58, - 58, 58, 58, 58, 58, 58, -65 + 58, 58, 58, 58, 58, 58, 58, -65 }, { 11, -66, -66, -66, -66, -66, -66, -66, -66, -66, -66, -66, -66, 58, -66, -66, 58, 58, 58, 58, 58, 58, 58, 58, 58, 58, 58, 58, 58, 58, - 58, 58, 58, 101, 58, 58, -66 + 58, 58, 58, 58, 104, 58, 58, -66 }, { 11, -67, -67, -67, -67, -67, -67, -67, -67, -67, -67, -67, -67, 58, -67, -67, 58, 58, 58, 58, - 58, 58, 58, 58, 102, 58, 58, 58, 58, 58, - 58, 58, 58, 58, 58, 58, -67 + 58, 58, 58, 58, 58, 105, 58, 58, 58, 58, + 58, 58, 58, 58, 58, 58, 58, -67 }, { 11, -68, -68, -68, -68, -68, -68, -68, -68, -68, -68, -68, -68, 58, -68, -68, 58, 58, 58, 58, - 58, 58, 58, 58, 58, 58, 58, 103, 58, 58, - 58, 58, 58, 58, 58, 58, -68 + 58, 58, 58, 58, 58, 58, 58, 58, 106, 58, + 58, 58, 58, 58, 58, 58, 58, -68 }, { 11, -69, -69, -69, -69, -69, -69, -69, -69, -69, -69, -69, -69, 58, -69, -69, 58, 58, 58, 58, 58, 58, 58, 58, 58, 58, 58, 58, 58, 58, - 58, 58, 58, 104, 58, 58, -69 + 58, 58, 58, 58, 107, 58, 58, -69 }, { 11, -70, -70, -70, -70, -70, -70, -70, -70, -70, -70, -70, -70, 58, -70, -70, 58, 58, 58, 58, - 58, 58, 58, 58, 58, 58, 58, 58, 105, 58, - 58, 58, 58, 58, 58, 58, -70 + 58, 58, 58, 58, 58, 58, 58, 58, 58, 108, + 58, 58, 58, 58, 58, 58, 58, -70 }, { 11, -71, -71, -71, -71, -71, -71, -71, -71, -71, -71, -71, -71, 58, -71, -71, 58, 58, 58, 58, - 58, 58, 58, 58, 58, 58, 58, 58, 58, 58, - 106, 58, 58, 58, 58, 58, -71 + 58, 58, 58, 58, 58, 58, 58, 58, 109, 58, + 58, 58, 58, 58, 58, 58, 58, -71 }, { @@ -827,58 +877,58 @@ -72, -72, -72, 58, -72, -72, 58, 58, 58, 58, 58, 58, 58, 58, 58, 58, 58, 58, 58, 58, - 58, 58, 58, 58, 107, 58, -72 + 58, 110, 58, 58, 58, 58, 58, -72 }, { 11, -73, -73, -73, -73, -73, -73, -73, -73, -73, -73, -73, -73, 58, -73, -73, 58, 58, 58, 58, - 58, 58, 58, 58, 58, 58, 58, 58, 58, 58, - 58, 108, 58, 58, 58, 58, -73 + 58, 58, 58, 58, 58, 58, 111, 58, 58, 58, + 58, 58, 58, 58, 58, 58, 58, -73 }, { 11, -74, -74, -74, -74, -74, -74, -74, -74, -74, -74, -74, -74, 58, -74, -74, 58, 58, 58, 58, - 58, 58, 58, 58, 109, 58, 58, 58, 58, 58, - 58, 58, 58, 58, 58, 58, -74 + 58, 58, 58, 58, 58, 58, 58, 58, 58, 58, + 58, 58, 58, 58, 58, 112, 58, -74 }, { - 11, 75, 75, -75, 75, 75, 75, 75, 75, 75, - 75, 75, 75, 75, 75, 75, 75, 75, 75, 75, - 75, 75, 75, 75, 75, 75, 75, 75, 75, 75, - 75, 75, 75, 75, 75, 75, 75 + 11, -75, -75, -75, -75, -75, -75, -75, -75, -75, + -75, -75, -75, 58, -75, -75, 58, 58, 58, 58, + 58, 58, 58, 58, 58, 58, 58, 58, 58, 58, + 58, 58, 113, 58, 58, 58, 58, -75 }, { - 11, -76, 76, 77, -76, -76, -76, -76, -76, -76, - -76, -76, -76, -76, -76, -76, -76, -76, -76, -76, - -76, -76, -76, -76, -76, -76, -76, -76, -76, -76, - -76, -76, -76, -76, -76, -76, -76 + 11, -76, -76, -76, -76, -76, -76, -76, -76, -76, + -76, -76, -76, 58, -76, -76, 58, 58, 58, 58, + 58, 58, 58, 58, 58, 114, 58, 58, 58, 58, + 58, 58, 58, 58, 58, 58, 58, -76 }, { - 11, 78, -77, -77, 78, 78, 78, 78, 78, 78, - 78, 78, 78, 78, 78, 78, 78, 78, 78, 78, + 11, 77, 77, -77, 77, 77, 77, 77, 77, 77, + 77, 77, 77, 77, 77, 77, 77, 77, 77, 77, - 78, 78, 78, 78, 78, 78, 78, 78, 78, 78, - 78, 78, 78, 78, 78, 78, 78 + 77, 77, 77, 77, 77, 77, 77, 77, 77, 77, + 77, 77, 77, 77, 77, 77, 77, 77 }, { - 11, -78, -78, -78, -78, -78, -78, -78, -78, -78, + 11, -78, 78, 79, -78, -78, -78, -78, -78, -78, -78, -78, -78, -78, -78, -78, -78, -78, -78, -78, -78, -78, -78, -78, -78, -78, -78, -78, -78, -78, - -78, -78, -78, -78, -78, -78, -78 + -78, -78, -78, -78, -78, -78, -78, -78 }, { - 11, 79, 79, 80, 79, -79, 79, 79, -79, 79, - 79, 79, 79, 79, 79, -79, 79, 79, 79, 79, - 79, 79, 79, 79, 79, 79, 79, 79, 79, 79, - 79, 79, 79, 79, 79, 79, 79 + 11, 80, -79, -79, 80, 80, 80, 80, 80, 80, + 80, 80, 80, 80, 80, 80, 80, 80, 80, 80, + 80, 80, 80, 80, 80, 80, 80, 80, 80, 80, + 80, 80, 80, 80, 80, 80, 80, 80 }, @@ -886,14 +936,14 @@ 11, -80, -80, -80, -80, -80, -80, -80, -80, -80, -80, -80, -80, -80, -80, -80, -80, -80, -80, -80, -80, -80, -80, -80, -80, -80, -80, -80, -80, -80, - -80, -80, -80, -80, -80, -80, -80 + -80, -80, -80, -80, -80, -80, -80, -80 }, { - 11, -81, -81, 82, -81, -81, -81, -81, -81, -81, - -81, -81, -81, -81, -81, -81, -81, -81, -81, -81, - -81, -81, -81, -81, -81, -81, -81, -81, -81, -81, - -81, -81, -81, -81, -81, -81, -81 + 11, 81, 81, 82, 81, -81, 81, 81, -81, 81, + 81, 81, 81, 81, 81, -81, 81, 81, 81, 81, + 81, 81, 81, 81, 81, 81, 81, 81, 81, 81, + 81, 81, 81, 81, 81, 81, 81, 81 }, { @@ -901,21 +951,21 @@ -82, -82, -82, -82, -82, -82, -82, -82, -82, -82, -82, -82, -82, -82, -82, -82, -82, -82, -82, -82, - -82, -82, -82, -82, -82, -82, -82 + -82, -82, -82, -82, -82, -82, -82, -82 }, { - 11, -83, -83, -83, -83, -83, -83, -83, -83, -83, + 11, -83, -83, 84, -83, -83, -83, -83, -83, -83, -83, -83, -83, -83, -83, -83, -83, -83, -83, -83, -83, -83, -83, -83, -83, -83, -83, -83, -83, -83, - -83, -83, -83, -83, -83, -83, -83 + -83, -83, -83, -83, -83, -83, -83, -83 }, { - 11, 84, 84, -84, 84, 84, 84, 84, 84, 84, - 84, 84, 84, 84, 84, 84, 84, 84, 84, 84, - 84, 84, 84, 84, 84, 84, 84, 84, 84, 84, - 84, 84, 84, 84, 84, 84, 84 + 11, -84, -84, -84, -84, -84, -84, -84, -84, -84, + -84, -84, -84, -84, -84, -84, -84, -84, -84, -84, + -84, -84, -84, -84, -84, -84, -84, -84, -84, -84, + -84, -84, -84, -84, -84, -84, -84, -84 }, @@ -923,569 +973,569 @@ 11, -85, -85, -85, -85, -85, -85, -85, -85, -85, -85, -85, -85, -85, -85, -85, -85, -85, -85, -85, -85, -85, -85, -85, -85, -85, -85, -85, -85, -85, - -85, -85, -85, -85, -85, -85, -85 + -85, -85, -85, -85, -85, -85, -85, -85 }, { - 11, -86, -86, -86, -86, -86, -86, -86, -86, -86, - -86, 110, 87, 87, -86, -86, 87, 87, 87, 87, - 87, 87, 87, 87, 87, 87, 87, 87, 87, 87, - 87, 87, 87, 87, 87, 87, -86 + 11, 86, 86, -86, 86, 86, 86, 86, 86, 86, + 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, + 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, + 86, 86, 86, 86, 86, 86, 86, 86 }, { 11, -87, -87, -87, -87, -87, -87, -87, -87, -87, - -87, 87, 87, 87, -87, -87, 87, 87, 87, 87, + -87, -87, -87, -87, -87, -87, -87, -87, -87, -87, - 87, 87, 87, 87, 87, 87, 87, 87, 87, 87, - 87, 87, 87, 87, 87, 87, -87 + -87, -87, -87, -87, -87, -87, -87, -87, -87, -87, + -87, -87, -87, -87, -87, -87, -87, -87 }, { 11, -88, -88, -88, -88, -88, -88, -88, -88, -88, - -88, -88, -88, -88, -88, -88, -88, -88, -88, -88, - -88, -88, -88, -88, -88, -88, -88, -88, -88, -88, - -88, -88, -88, -88, -88, -88, -88 + -88, 115, 89, 89, -88, -88, 89, 89, 89, 89, + 89, 89, 89, 89, 89, 89, 89, 89, 89, 89, + 89, 89, 89, 89, 89, 89, 89, -88 }, { 11, -89, -89, -89, -89, -89, -89, -89, -89, -89, - -89, 87, 87, 87, -89, -89, 87, 87, 87, 87, - 87, 87, 87, 87, 87, 87, 87, 87, 87, 87, - 87, 87, 87, 87, 87, 87, -89 + -89, 89, 89, 89, -89, -89, 89, 89, 89, 89, + 89, 89, 89, 89, 89, 89, 89, 89, 89, 89, + 89, 89, 89, 89, 89, 89, 89, -89 }, { 11, -90, -90, -90, -90, -90, -90, -90, -90, -90, - -90, 87, 87, 87, -90, -90, 87, 87, 87, 87, - 87, 87, 87, 87, 87, 87, 87, 87, 87, 87, - 87, 87, 87, 87, 87, 87, -90 + -90, -90, -90, -90, -90, -90, -90, -90, -90, -90, + -90, -90, -90, -90, -90, -90, -90, -90, -90, -90, + -90, -90, -90, -90, -90, -90, -90, -90 }, { 11, -91, -91, -91, -91, -91, -91, -91, -91, -91, - -91, -91, -91, -91, -91, -91, -91, -91, -91, -91, - -91, -91, -91, -91, -91, -91, -91, -91, -91, -91, - -91, -91, -91, -91, -91, -91, -91 + -91, 89, 89, 89, -91, -91, 89, 89, 89, 89, + 89, 89, 89, 89, 89, 89, 89, 89, 89, 89, + 89, 89, 89, 89, 89, 89, 89, -91 }, { 11, -92, -92, -92, -92, -92, -92, -92, -92, -92, - -92, -92, -92, 58, -92, -92, 58, 58, 58, 58, + -92, 89, 89, 89, -92, -92, 89, 89, 89, 89, - 58, 58, 58, 58, 58, 111, 58, 58, 58, 58, - 58, 58, 58, 58, 58, 58, -92 + 89, 89, 89, 89, 89, 89, 89, 89, 89, 89, + 89, 89, 89, 89, 89, 89, 89, -92 }, { 11, -93, -93, -93, -93, -93, -93, -93, -93, -93, - -93, -93, -93, 58, -93, -93, 58, 58, 58, 58, - 58, 58, 58, 58, 112, 58, 58, 58, 58, 58, - 58, 58, 58, 58, 58, 58, -93 + -93, -93, -93, -93, -93, -93, -93, -93, -93, -93, + -93, -93, -93, -93, -93, -93, -93, -93, -93, -93, + -93, -93, -93, -93, -93, -93, -93, -93 }, { 11, -94, -94, -94, -94, -94, -94, -94, -94, -94, -94, -94, -94, 58, -94, -94, 58, 58, 58, 58, - 58, 58, 58, 58, 58, 58, 113, 58, 58, 58, - 58, 58, 58, 58, 58, 58, -94 + 58, 58, 58, 58, 58, 58, 116, 58, 58, 58, + 58, 58, 58, 58, 58, 58, 58, -94 }, { 11, -95, -95, -95, -95, -95, -95, -95, -95, -95, -95, -95, -95, 58, -95, -95, 58, 58, 58, 58, - 58, 114, 58, 58, 58, 58, 58, 58, 58, 58, - 58, 58, 58, 58, 58, 58, -95 + 58, 58, 58, 58, 58, 117, 58, 58, 58, 58, + 58, 58, 58, 58, 58, 58, 58, -95 }, { 11, -96, -96, -96, -96, -96, -96, -96, -96, -96, - -96, -96, -96, 58, -96, -96, 115, 58, 58, 58, - 58, 58, 58, 58, 58, 58, 58, 58, 58, 58, - 58, 58, 58, 58, 58, 58, -96 + -96, -96, -96, 58, -96, -96, 58, 58, 58, 58, + 58, 58, 58, 58, 58, 58, 58, 118, 58, 58, + 58, 58, 58, 58, 58, 58, 58, -96 }, { 11, -97, -97, -97, -97, -97, -97, -97, -97, -97, -97, -97, -97, 58, -97, -97, 58, 58, 58, 58, - 116, 58, 58, 58, 58, 58, 58, 58, 58, 58, - 58, 58, 58, 58, 58, 58, -97 + 58, 58, 119, 58, 58, 58, 58, 58, 58, 58, + 58, 58, 58, 58, 58, 58, 58, -97 }, { 11, -98, -98, -98, -98, -98, -98, -98, -98, -98, - -98, -98, -98, 58, -98, -98, 58, 58, 117, 58, - 58, 58, 58, 58, 118, 58, 119, 58, 58, 58, - 58, 58, 58, 58, 58, 58, -98 + -98, -98, -98, 58, -98, -98, 120, 121, 58, 58, + 58, 58, 58, 58, 58, 58, 58, 58, 58, 58, + 58, 58, 58, 58, 58, 58, 58, -98 }, { 11, -99, -99, -99, -99, -99, -99, -99, -99, -99, -99, -99, -99, 58, -99, -99, 58, 58, 58, 58, - 58, 58, 58, 58, 58, 58, 58, 58, 58, 120, - 58, 58, 58, 58, 58, 58, -99 + 58, 122, 58, 58, 58, 58, 58, 58, 58, 58, + 58, 58, 58, 58, 58, 58, 58, -99 }, { 11, -100, -100, -100, -100, -100, -100, -100, -100, -100, - -100, -100, -100, 58, -100, -100, 58, 58, 58, 58, + -100, -100, -100, 58, -100, -100, 58, 58, 123, 58, 58, 58, 58, 58, 58, 58, 58, 58, 58, 58, - 58, 58, 58, 58, 58, 58, -100 + 58, 58, 58, 58, 58, 58, 58, -100 }, { 11, -101, -101, -101, -101, -101, -101, -101, -101, -101, - -101, -101, -101, 58, -101, -101, 58, 58, 58, 58, - 58, 58, 58, 58, 58, 58, 58, 58, 58, 58, - 58, 58, 58, 58, 58, 58, -101 + -101, -101, -101, 58, -101, -101, 58, 58, 58, 124, + 58, 58, 58, 58, 58, 125, 58, 126, 58, 58, + 58, 58, 58, 58, 58, 58, 58, -101 }, { 11, -102, -102, -102, -102, -102, -102, -102, -102, -102, -102, -102, -102, 58, -102, -102, 58, 58, 58, 58, - 58, 58, 58, 58, 58, 58, 58, 121, 58, 58, - 58, 58, 58, 58, 58, 58, -102 + 58, 58, 58, 58, 58, 58, 58, 58, 58, 58, + 127, 58, 58, 58, 58, 58, 58, -102 }, { 11, -103, -103, -103, -103, -103, -103, -103, -103, -103, -103, -103, -103, 58, -103, -103, 58, 58, 58, 58, 58, 58, 58, 58, 58, 58, 58, 58, 58, 58, - 58, 58, 58, 58, 122, 58, -103 + 58, 58, 58, 58, 58, 58, 58, -103 }, { 11, -104, -104, -104, -104, -104, -104, -104, -104, -104, -104, -104, -104, 58, -104, -104, 58, 58, 58, 58, - 58, 58, 58, 58, 123, 58, 58, 58, 58, 58, - 58, 58, 58, 58, 58, 58, -104 + 58, 58, 58, 58, 58, 58, 58, 58, 58, 58, + 58, 58, 58, 58, 58, 58, 58, -104 }, { 11, -105, -105, -105, -105, -105, -105, -105, -105, -105, -105, -105, -105, 58, -105, -105, 58, 58, 58, 58, - 58, 58, 58, 58, 58, 58, 124, 58, 58, 58, - 58, 58, 58, 58, 58, 58, -105 + 58, 58, 58, 58, 58, 58, 58, 58, 128, 58, + 58, 58, 58, 58, 58, 58, 58, -105 }, { 11, -106, -106, -106, -106, -106, -106, -106, -106, -106, -106, -106, -106, 58, -106, -106, 58, 58, 58, 58, 58, 58, 58, 58, 58, 58, 58, 58, 58, 58, - 58, 58, 58, 58, 125, 58, -106 + 58, 58, 58, 58, 58, 129, 58, -106 }, { 11, -107, -107, -107, -107, -107, -107, -107, -107, -107, -107, -107, -107, 58, -107, -107, 58, 58, 58, 58, - 58, 58, 58, 58, 58, 58, 58, 58, 58, 58, - 58, 126, 58, 58, 58, 58, -107 + 58, 58, 58, 58, 58, 130, 58, 58, 58, 58, + 58, 58, 58, 58, 58, 58, 58, -107 }, { 11, -108, -108, -108, -108, -108, -108, -108, -108, -108, -108, -108, -108, 58, -108, -108, 58, 58, 58, 58, - 58, 58, 58, 58, 127, 58, 58, 58, 58, 58, - 58, 58, 58, 58, 58, 58, -108 + 58, 58, 58, 58, 58, 58, 58, 131, 58, 58, + 58, 58, 58, 58, 58, 58, 58, -108 }, { 11, -109, -109, -109, -109, -109, -109, -109, -109, -109, -109, -109, -109, 58, -109, -109, 58, 58, 58, 58, - 58, 58, 58, 58, 58, 58, 58, 58, 58, 58, - 58, 58, 128, 58, 58, 58, -109 + 58, 58, 58, 132, 58, 58, 58, 58, 58, 58, + 58, 58, 58, 58, 58, 58, 58, -109 }, { 11, -110, -110, -110, -110, -110, -110, -110, -110, -110, - -110, 87, 87, 87, -110, -110, 87, 87, 87, 87, - 87, 87, 87, 87, 87, 87, 87, 87, 87, 87, - 87, 87, 87, 87, 87, 87, -110 + -110, -110, -110, 58, -110, -110, 58, 58, 58, 58, + 58, 58, 58, 58, 58, 58, 58, 58, 58, 58, + 58, 58, 58, 58, 58, 133, 58, -110 }, { 11, -111, -111, -111, -111, -111, -111, -111, -111, -111, -111, -111, -111, 58, -111, -111, 58, 58, 58, 58, - 129, 58, 58, 58, 58, 58, 58, 58, 58, 58, - 58, 58, 58, 58, 58, 58, -111 + 58, 134, 58, 58, 58, 58, 58, 58, 58, 58, + 58, 58, 58, 58, 58, 58, 58, -111 }, { 11, -112, -112, -112, -112, -112, -112, -112, -112, -112, - -112, -112, -112, 58, -112, -112, 58, 58, 130, 58, + -112, -112, -112, 58, -112, -112, 58, 58, 58, 58, 58, 58, 58, 58, 58, 58, 58, 58, 58, 58, - 58, 58, 58, 58, 58, 58, -112 + 58, 58, 135, 58, 58, 58, 58, -112 }, { 11, -113, -113, -113, -113, -113, -113, -113, -113, -113, -113, -113, -113, 58, -113, -113, 58, 58, 58, 58, - 131, 58, 58, 58, 58, 58, 58, 58, 58, 58, - 58, 58, 58, 58, 58, 58, -113 + 58, 58, 58, 58, 58, 136, 58, 58, 58, 58, + 58, 58, 58, 58, 58, 58, 58, -113 }, { 11, -114, -114, -114, -114, -114, -114, -114, -114, -114, -114, -114, -114, 58, -114, -114, 58, 58, 58, 58, - 58, 58, 58, 58, 132, 58, 58, 58, 58, 58, - 58, 58, 58, 58, 58, 58, -114 + 58, 58, 58, 58, 58, 58, 58, 58, 58, 58, + 58, 58, 58, 137, 58, 58, 58, -114 }, { 11, -115, -115, -115, -115, -115, -115, -115, -115, -115, - -115, -115, -115, 58, -115, -115, 58, 58, 58, 58, - 58, 58, 58, 58, 58, 58, 58, 58, 58, 58, - 58, 58, 58, 58, 133, 58, -115 + -115, 89, 89, 89, -115, -115, 89, 89, 89, 89, + 89, 89, 89, 89, 89, 89, 89, 89, 89, 89, + 89, 89, 89, 89, 89, 89, 89, -115 }, { 11, -116, -116, -116, -116, -116, -116, -116, -116, -116, -116, -116, -116, 58, -116, -116, 58, 58, 58, 58, - 58, 58, 58, 58, 58, 58, 58, 134, 58, 58, - 58, 58, 58, 58, 58, 58, -116 + 58, 138, 58, 58, 58, 58, 58, 58, 58, 58, + 58, 58, 58, 58, 58, 58, 58, -116 }, { 11, -117, -117, -117, -117, -117, -117, -117, -117, -117, - -117, -117, -117, 58, -117, -117, 58, 58, 58, 58, + -117, -117, -117, 58, -117, -117, 58, 58, 58, 139, - 58, 58, 58, 135, 58, 58, 58, 58, 58, 58, - 58, 58, 58, 58, 58, 58, -117 + 58, 58, 58, 58, 58, 58, 58, 58, 58, 58, + 58, 58, 58, 58, 58, 58, 58, -117 }, { 11, -118, -118, -118, -118, -118, -118, -118, -118, -118, -118, -118, -118, 58, -118, -118, 58, 58, 58, 58, - 58, 136, 58, 58, 58, 58, 58, 58, 58, 58, - 58, 58, 58, 58, 58, 58, -118 + 58, 140, 58, 58, 58, 58, 58, 58, 58, 58, + 58, 58, 58, 58, 58, 58, 58, -118 }, { 11, -119, -119, -119, -119, -119, -119, -119, -119, -119, -119, -119, -119, 58, -119, -119, 58, 58, 58, 58, - 137, 58, 58, 58, 58, 58, 58, 58, 58, 58, - 58, 58, 58, 58, 58, 58, -119 + 58, 58, 58, 58, 58, 141, 58, 58, 58, 58, + 58, 58, 58, 58, 58, 58, 58, -119 }, { 11, -120, -120, -120, -120, -120, -120, -120, -120, -120, - -120, -120, -120, 58, -120, -120, 58, 58, 58, 58, + -120, -120, -120, 58, -120, -120, 58, 58, 142, 58, 58, 58, 58, 58, 58, 58, 58, 58, 58, 58, - 58, 58, 58, 58, 58, 58, -120 + 58, 58, 58, 58, 143, 58, 58, -120 }, { 11, -121, -121, -121, -121, -121, -121, -121, -121, -121, -121, -121, -121, 58, -121, -121, 58, 58, 58, 58, - 58, 58, 58, 58, 58, 58, 138, 58, 58, 58, - 58, 58, 58, 58, 58, 58, -121 + 58, 58, 58, 58, 58, 58, 58, 58, 58, 58, + 58, 58, 58, 58, 58, 144, 58, -121 }, { 11, -122, -122, -122, -122, -122, -122, -122, -122, -122, - -122, -122, -122, 58, -122, -122, 58, 58, 139, 58, + -122, -122, -122, 58, -122, -122, 58, 58, 58, 58, - 58, 58, 58, 58, 58, 58, 58, 58, 58, 58, - 58, 58, 58, 58, 58, 58, -122 + 58, 58, 58, 58, 58, 58, 58, 58, 145, 58, + 58, 58, 58, 58, 58, 58, 58, -122 }, { 11, -123, -123, -123, -123, -123, -123, -123, -123, -123, -123, -123, -123, 58, -123, -123, 58, 58, 58, 58, - 58, 58, 58, 58, 58, 58, 58, 58, 140, 58, - 58, 58, 58, 58, 58, 58, -123 + 58, 58, 58, 58, 58, 58, 146, 58, 58, 58, + 58, 58, 58, 58, 58, 58, 58, -123 }, { 11, -124, -124, -124, -124, -124, -124, -124, -124, -124, -124, -124, -124, 58, -124, -124, 58, 58, 58, 58, - 58, 58, 58, 58, 58, 58, 58, 58, 58, 141, - 58, 58, 58, 58, 58, 58, -124 + 58, 58, 58, 58, 147, 58, 58, 58, 58, 58, + 58, 58, 58, 58, 58, 58, 58, -124 }, { 11, -125, -125, -125, -125, -125, -125, -125, -125, -125, -125, -125, -125, 58, -125, -125, 58, 58, 58, 58, - 58, 58, 58, 58, 142, 58, 58, 58, 58, 58, - 58, 58, 58, 58, 58, 58, -125 + 58, 58, 148, 58, 58, 58, 58, 58, 58, 58, + 58, 58, 58, 58, 58, 58, 58, -125 }, { 11, -126, -126, -126, -126, -126, -126, -126, -126, -126, - -126, -126, -126, 58, -126, -126, 58, 58, 143, 58, - 58, 58, 58, 58, 58, 58, 58, 58, 58, 58, - 58, 58, 58, 58, 58, 58, -126 + -126, -126, -126, 58, -126, -126, 58, 58, 58, 58, + 58, 149, 58, 58, 58, 58, 58, 58, 58, 58, + 58, 58, 58, 58, 58, 58, 58, -126 }, { 11, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 58, -127, -127, 58, 58, 58, 58, - 58, 58, 58, 58, 58, 58, 58, 144, 58, 58, - 58, 58, 58, 58, 58, 58, -127 + 58, 58, 58, 58, 58, 58, 58, 58, 58, 58, + 58, 58, 58, 58, 58, 58, 58, -127 }, { 11, -128, -128, -128, -128, -128, -128, -128, -128, -128, -128, -128, -128, 58, -128, -128, 58, 58, 58, 58, - 58, 58, 58, 58, 58, 58, 58, 58, 58, 58, - 58, 58, 58, 145, 58, 58, -128 + 58, 58, 58, 58, 58, 58, 58, 150, 58, 58, + 58, 58, 58, 58, 58, 58, 58, -128 }, { 11, -129, -129, -129, -129, -129, -129, -129, -129, -129, - -129, -129, -129, 58, -129, -129, 146, 58, 58, 58, + -129, -129, -129, 58, -129, -129, 58, 58, 58, 151, 58, 58, 58, 58, 58, 58, 58, 58, 58, 58, - 58, 58, 58, 58, 58, 58, -129 + 58, 58, 58, 58, 58, 58, 58, -129 }, { 11, -130, -130, -130, -130, -130, -130, -130, -130, -130, -130, -130, -130, 58, -130, -130, 58, 58, 58, 58, - 147, 58, 58, 58, 58, 58, 58, 58, 58, 58, - 58, 58, 58, 58, 58, 58, -130 + 58, 58, 58, 58, 58, 58, 58, 58, 58, 152, + 58, 58, 58, 58, 58, 58, 58, -130 }, { 11, -131, -131, -131, -131, -131, -131, -131, -131, -131, -131, -131, -131, 58, -131, -131, 58, 58, 58, 58, - 58, 58, 58, 58, 58, 58, 58, 148, 58, 58, - 58, 58, 58, 58, 58, 58, -131 + 58, 58, 58, 58, 58, 58, 58, 58, 58, 58, + 153, 58, 58, 58, 58, 58, 58, -131 }, { 11, -132, -132, -132, -132, -132, -132, -132, -132, -132, -132, -132, -132, 58, -132, -132, 58, 58, 58, 58, - 58, 58, 149, 58, 58, 58, 58, 58, 58, 58, - 58, 58, 58, 58, 58, 58, -132 + 58, 154, 58, 58, 58, 58, 58, 58, 58, 58, + 58, 58, 58, 58, 58, 58, 58, -132 }, { 11, -133, -133, -133, -133, -133, -133, -133, -133, -133, -133, -133, -133, 58, -133, -133, 58, 58, 58, 58, - 58, 58, 58, 58, 58, 150, 58, 58, 58, 58, - 58, 58, 58, 58, 58, 58, -133 + 58, 58, 58, 58, 58, 155, 58, 58, 58, 58, + 58, 58, 58, 58, 58, 58, 58, -133 }, { 11, -134, -134, -134, -134, -134, -134, -134, -134, -134, - -134, -134, -134, 58, -134, -134, 58, 58, 58, 151, + -134, -134, -134, 58, -134, -134, 58, 58, 58, 156, 58, 58, 58, 58, 58, 58, 58, 58, 58, 58, - 58, 58, 58, 58, 58, 58, -134 + 58, 58, 58, 58, 58, 58, 58, -134 }, { 11, -135, -135, -135, -135, -135, -135, -135, -135, -135, - -135, -135, -135, 58, -135, -135, 58, 58, 58, 58, - 58, 58, 58, 58, 58, 58, 58, 58, 152, 58, - 58, 58, 58, 58, 58, 58, -135 + -135, -135, -135, 58, -135, -135, 58, 58, 58, 157, + 58, 58, 58, 58, 58, 58, 58, 58, 58, 58, + 58, 58, 58, 58, 58, 58, 58, -135 }, { 11, -136, -136, -136, -136, -136, -136, -136, -136, -136, -136, -136, -136, 58, -136, -136, 58, 58, 58, 58, - 58, 58, 58, 58, 58, 58, 58, 58, 58, 58, - 58, 58, 58, 58, 58, 58, -136 + 58, 58, 58, 58, 58, 58, 58, 58, 158, 58, + 58, 58, 58, 58, 58, 58, 58, -136 }, { 11, -137, -137, -137, -137, -137, -137, -137, -137, -137, -137, -137, -137, 58, -137, -137, 58, 58, 58, 58, - 58, 58, 58, 58, 58, 58, 58, 153, 58, 58, - 58, 58, 58, 58, 58, 58, -137 + 58, 58, 58, 58, 58, 58, 58, 58, 58, 58, + 58, 58, 58, 58, 159, 58, 58, -137 }, { 11, -138, -138, -138, -138, -138, -138, -138, -138, -138, - -138, -138, -138, 58, -138, -138, 58, 58, 58, 58, - 154, 58, 58, 58, 58, 58, 58, 58, 58, 58, - 58, 58, 58, 58, 58, 58, -138 + -138, -138, -138, 58, -138, -138, 58, 160, 58, 58, + 58, 58, 58, 58, 58, 58, 58, 58, 58, 58, + 58, 58, 58, 58, 58, 58, 58, -138 }, { 11, -139, -139, -139, -139, -139, -139, -139, -139, -139, -139, -139, -139, 58, -139, -139, 58, 58, 58, 58, - 58, 58, 58, 58, 58, 58, 58, 58, 155, 58, - 58, 58, 58, 58, 58, 58, -139 + 58, 161, 58, 58, 58, 58, 58, 58, 58, 58, + 58, 58, 58, 58, 58, 58, 58, -139 }, { 11, -140, -140, -140, -140, -140, -140, -140, -140, -140, -140, -140, -140, 58, -140, -140, 58, 58, 58, 58, - 58, 58, 58, 58, 58, 58, 58, 156, 58, 58, - 58, 58, 58, 58, 58, 58, -140 + 58, 58, 58, 58, 58, 58, 58, 58, 162, 58, + 58, 58, 58, 58, 58, 58, 58, -140 }, { 11, -141, -141, -141, -141, -141, -141, -141, -141, -141, -141, -141, -141, 58, -141, -141, 58, 58, 58, 58, - 58, 58, 58, 58, 58, 58, 58, 58, 58, 58, - 58, 58, 58, 157, 58, 58, -141 + 58, 58, 58, 163, 58, 58, 58, 58, 58, 58, + 58, 58, 58, 58, 58, 58, 58, -141 }, { 11, -142, -142, -142, -142, -142, -142, -142, -142, -142, -142, -142, -142, 58, -142, -142, 58, 58, 58, 58, - 58, 58, 58, 58, 58, 58, 58, 58, 58, 58, - 58, 158, 58, 58, 58, 58, -142 + 58, 58, 58, 58, 58, 58, 58, 58, 58, 164, + 58, 58, 58, 58, 58, 58, 58, -142 }, { 11, -143, -143, -143, -143, -143, -143, -143, -143, -143, -143, -143, -143, 58, -143, -143, 58, 58, 58, 58, - 159, 58, 58, 58, 58, 58, 58, 58, 58, 58, - 58, 58, 58, 58, 58, 58, -143 + 58, 58, 58, 58, 58, 58, 58, 58, 58, 58, + 58, 58, 165, 58, 58, 58, 58, -143 }, { 11, -144, -144, -144, -144, -144, -144, -144, -144, -144, -144, -144, -144, 58, -144, -144, 58, 58, 58, 58, - 58, 58, 160, 58, 58, 58, 58, 58, 58, 58, - 58, 58, 58, 58, 58, 58, -144 + 58, 58, 58, 58, 58, 58, 166, 58, 58, 58, + 58, 58, 58, 58, 58, 58, 58, -144 }, { 11, -145, -145, -145, -145, -145, -145, -145, -145, -145, - -145, -145, -145, 58, -145, -145, 161, 58, 58, 58, - 58, 58, 58, 58, 58, 58, 58, 58, 58, 58, - 58, 58, 58, 58, 58, 58, -145 + -145, -145, -145, 58, -145, -145, 58, 58, 58, 58, + 167, 58, 58, 58, 58, 58, 58, 58, 58, 58, + 58, 58, 58, 58, 58, 58, 58, -145 }, { 11, -146, -146, -146, -146, -146, -146, -146, -146, -146, -146, -146, -146, 58, -146, -146, 58, 58, 58, 58, - 58, 58, 58, 58, 58, 58, 58, 162, 58, 58, - 58, 58, 58, 58, 58, 58, -146 + 58, 168, 58, 58, 58, 58, 58, 58, 58, 58, + 58, 58, 58, 58, 58, 58, 58, -146 }, { 11, -147, -147, -147, -147, -147, -147, -147, -147, -147, -147, -147, -147, 58, -147, -147, 58, 58, 58, 58, - 58, 58, 58, 58, 58, 58, 58, 58, 58, 58, - 58, 58, 58, 58, 58, 58, -147 + 58, 58, 58, 58, 58, 58, 58, 58, 58, 169, + 58, 58, 58, 58, 58, 58, 58, -147 }, { 11, -148, -148, -148, -148, -148, -148, -148, -148, -148, -148, -148, -148, 58, -148, -148, 58, 58, 58, 58, 58, 58, 58, 58, 58, 58, 58, 58, 58, 58, - 58, 58, 58, 163, 58, 58, -148 + 58, 58, 58, 58, 58, 58, 58, -148 }, { 11, -149, -149, -149, -149, -149, -149, -149, -149, -149, -149, -149, -149, 58, -149, -149, 58, 58, 58, 58, - 58, 58, 58, 58, 58, 58, 58, 58, 58, 58, - 58, 58, 58, 58, 58, 58, -149 + 58, 58, 58, 58, 58, 58, 58, 58, 170, 58, + 58, 58, 58, 58, 58, 58, 58, -149 }, { 11, -150, -150, -150, -150, -150, -150, -150, -150, -150, -150, -150, -150, 58, -150, -150, 58, 58, 58, 58, - 58, 58, 58, 58, 58, 58, 58, 58, 58, 58, - 58, 58, 58, 164, 58, 58, -150 + 58, 171, 58, 58, 58, 58, 58, 58, 58, 58, + 58, 58, 58, 58, 58, 58, 58, -150 }, { 11, -151, -151, -151, -151, -151, -151, -151, -151, -151, -151, -151, -151, 58, -151, -151, 58, 58, 58, 58, - 58, 58, 58, 58, 58, 58, 58, 58, 58, 58, - 58, 58, 165, 58, 58, 58, -151 + 58, 58, 58, 58, 58, 58, 58, 58, 58, 172, + 58, 58, 58, 58, 58, 58, 58, -151 }, { 11, -152, -152, -152, -152, -152, -152, -152, -152, -152, -152, -152, -152, 58, -152, -152, 58, 58, 58, 58, - 58, 58, 58, 58, 166, 58, 58, 58, 58, 58, - 58, 58, 58, 58, 58, 58, -152 + 58, 58, 58, 58, 58, 58, 58, 58, 173, 58, + 58, 58, 58, 58, 58, 58, 58, -152 }, { 11, -153, -153, -153, -153, -153, -153, -153, -153, -153, -153, -153, -153, 58, -153, -153, 58, 58, 58, 58, 58, 58, 58, 58, 58, 58, 58, 58, 58, 58, - 58, 58, 58, 58, 167, 58, -153 + 58, 58, 58, 58, 174, 58, 58, -153 }, { 11, -154, -154, -154, -154, -154, -154, -154, -154, -154, -154, -154, -154, 58, -154, -154, 58, 58, 58, 58, - 58, 58, 58, 58, 58, 58, 58, 168, 58, 58, - 58, 58, 58, 58, 58, 58, -154 + 58, 58, 58, 58, 58, 58, 58, 58, 58, 58, + 58, 58, 58, 58, 58, 58, 58, -154 }, { 11, -155, -155, -155, -155, -155, -155, -155, -155, -155, -155, -155, -155, 58, -155, -155, 58, 58, 58, 58, - 58, 58, 58, 58, 58, 58, 58, 169, 58, 58, - 58, 58, 58, 58, 58, 58, -155 + 58, 58, 58, 58, 58, 58, 58, 58, 58, 58, + 58, 58, 175, 58, 58, 58, 58, -155 }, { 11, -156, -156, -156, -156, -156, -156, -156, -156, -156, - -156, -156, -156, 58, -156, -156, 170, 58, 58, 58, + -156, -156, -156, 58, -156, -156, 58, 58, 58, 58, 58, 58, 58, 58, 58, 58, 58, 58, 58, 58, - 58, 58, 58, 58, 58, 58, -156 + 58, 58, 58, 58, 176, 58, 58, -156 }, { 11, -157, -157, -157, -157, -157, -157, -157, -157, -157, -157, -157, -157, 58, -157, -157, 58, 58, 58, 58, - 58, 58, 58, 58, 58, 58, 58, 58, 58, 58, - 58, 58, 58, 58, 58, 58, -157 + 58, 177, 58, 58, 58, 58, 58, 58, 58, 58, + 58, 58, 58, 58, 58, 58, 58, -157 }, { 11, -158, -158, -158, -158, -158, -158, -158, -158, -158, -158, -158, -158, 58, -158, -158, 58, 58, 58, 58, - 171, 58, 58, 58, 58, 58, 58, 58, 58, 58, - 58, 58, 58, 58, 58, 58, -158 + 58, 58, 58, 178, 58, 58, 58, 58, 58, 58, + 58, 58, 58, 58, 58, 58, 58, -158 }, { 11, -159, -159, -159, -159, -159, -159, -159, -159, -159, - -159, -159, -159, 58, -159, -159, 58, 58, 58, 58, + -159, -159, -159, 58, -159, -159, 58, 179, 58, 58, 58, 58, 58, 58, 58, 58, 58, 58, 58, 58, - 58, 58, 58, 58, 58, 58, -159 + 58, 58, 58, 58, 58, 58, 58, -159 }, { 11, -160, -160, -160, -160, -160, -160, -160, -160, -160, -160, -160, -160, 58, -160, -160, 58, 58, 58, 58, - 58, 58, 58, 58, 58, 58, 58, 58, 58, 58, - 58, 58, 58, 58, 58, 58, -160 + 58, 58, 58, 58, 58, 58, 58, 58, 180, 58, + 58, 58, 58, 58, 58, 58, 58, -160 }, { 11, -161, -161, -161, -161, -161, -161, -161, -161, -161, -161, -161, -161, 58, -161, -161, 58, 58, 58, 58, 58, 58, 58, 58, 58, 58, 58, 58, 58, 58, - 58, 58, 58, 172, 58, 58, -161 + 58, 58, 58, 58, 58, 58, 58, -161 }, { @@ -1493,36 +1543,36 @@ -162, -162, -162, 58, -162, -162, 58, 58, 58, 58, 58, 58, 58, 58, 58, 58, 58, 58, 58, 58, - 58, 58, 58, 58, 58, 58, -162 + 58, 58, 58, 58, 181, 58, 58, -162 }, { 11, -163, -163, -163, -163, -163, -163, -163, -163, -163, -163, -163, -163, 58, -163, -163, 58, 58, 58, 58, 58, 58, 58, 58, 58, 58, 58, 58, 58, 58, - 58, 58, 58, 58, 58, 58, -163 + 58, 58, 58, 58, 58, 58, 58, -163 }, { 11, -164, -164, -164, -164, -164, -164, -164, -164, -164, -164, -164, -164, 58, -164, -164, 58, 58, 58, 58, - 58, 58, 58, 58, 58, 58, 58, 58, 58, 58, - 58, 58, 58, 58, 58, 58, -164 + 58, 58, 58, 58, 58, 58, 58, 58, 58, 182, + 58, 58, 58, 58, 58, 58, 58, -164 }, { 11, -165, -165, -165, -165, -165, -165, -165, -165, -165, -165, -165, -165, 58, -165, -165, 58, 58, 58, 58, - 58, 58, 58, 58, 58, 58, 58, 58, 58, 58, - 58, 58, 58, 58, 58, 58, -165 + 58, 58, 58, 58, 58, 183, 58, 58, 58, 58, + 58, 58, 58, 58, 58, 58, 58, -165 }, { 11, -166, -166, -166, -166, -166, -166, -166, -166, -166, - -166, -166, -166, 58, -166, -166, 58, 58, 173, 58, + -166, -166, -166, 58, -166, -166, 58, 58, 58, 58, 58, 58, 58, 58, 58, 58, 58, 58, 58, 58, - 58, 58, 58, 58, 58, 58, -166 + 58, 58, 58, 58, 184, 58, 58, -166 }, { @@ -1530,73 +1580,73 @@ -167, -167, -167, 58, -167, -167, 58, 58, 58, 58, 58, 58, 58, 58, 58, 58, 58, 58, 58, 58, - 58, 58, 58, 58, 58, 58, -167 + 58, 58, 58, 185, 58, 58, 58, -167 }, { 11, -168, -168, -168, -168, -168, -168, -168, -168, -168, -168, -168, -168, 58, -168, -168, 58, 58, 58, 58, 58, 58, 58, 58, 58, 58, 58, 58, 58, 58, - 58, 58, 58, 58, 174, 58, -168 + 58, 58, 58, 58, 58, 58, 58, -168 }, { 11, -169, -169, -169, -169, -169, -169, -169, -169, -169, -169, -169, -169, 58, -169, -169, 58, 58, 58, 58, - 58, 175, 58, 58, 58, 58, 58, 58, 58, 58, - 58, 58, 58, 58, 58, 58, -169 + 58, 58, 58, 58, 58, 186, 58, 58, 58, 58, + 58, 58, 58, 58, 58, 58, 58, -169 }, { 11, -170, -170, -170, -170, -170, -170, -170, -170, -170, -170, -170, -170, 58, -170, -170, 58, 58, 58, 58, - 58, 58, 58, 58, 58, 176, 58, 58, 58, 58, - 58, 58, 58, 58, 58, 58, -170 + 58, 58, 58, 58, 58, 58, 58, 58, 58, 58, + 58, 58, 58, 58, 58, 187, 58, -170 }, { 11, -171, -171, -171, -171, -171, -171, -171, -171, -171, -171, -171, -171, 58, -171, -171, 58, 58, 58, 58, - 58, 58, 58, 58, 58, 58, 58, 58, 58, 58, - 58, 58, 177, 58, 58, 58, -171 + 58, 58, 58, 58, 58, 58, 58, 58, 188, 58, + 58, 58, 58, 58, 58, 58, 58, -171 }, { 11, -172, -172, -172, -172, -172, -172, -172, -172, -172, -172, -172, -172, 58, -172, -172, 58, 58, 58, 58, - 178, 58, 58, 58, 58, 58, 58, 58, 58, 58, - 58, 58, 58, 58, 58, 58, -172 + 58, 58, 58, 58, 58, 58, 58, 58, 189, 58, + 58, 58, 58, 58, 58, 58, 58, -172 }, { 11, -173, -173, -173, -173, -173, -173, -173, -173, -173, - -173, -173, -173, 58, -173, -173, 58, 58, 58, 58, - 179, 58, 58, 58, 58, 58, 58, 58, 58, 58, - 58, 58, 58, 58, 58, 58, -173 + -173, -173, -173, 58, -173, -173, 58, 190, 58, 58, + 58, 58, 58, 58, 58, 58, 58, 58, 58, 58, + 58, 58, 58, 58, 58, 58, 58, -173 }, { 11, -174, -174, -174, -174, -174, -174, -174, -174, -174, -174, -174, -174, 58, -174, -174, 58, 58, 58, 58, 58, 58, 58, 58, 58, 58, 58, 58, 58, 58, - 58, 58, 58, 58, 58, 58, -174 + 58, 58, 58, 58, 58, 58, 58, -174 }, { 11, -175, -175, -175, -175, -175, -175, -175, -175, -175, -175, -175, -175, 58, -175, -175, 58, 58, 58, 58, - 58, 58, 58, 58, 180, 58, 58, 58, 58, 58, - 58, 58, 58, 58, 58, 58, -175 + 58, 191, 58, 58, 58, 58, 58, 58, 58, 58, + 58, 58, 58, 58, 58, 58, 58, -175 }, { 11, -176, -176, -176, -176, -176, -176, -176, -176, -176, -176, -176, -176, 58, -176, -176, 58, 58, 58, 58, 58, 58, 58, 58, 58, 58, 58, 58, 58, 58, - 58, 58, 58, 58, 58, 58, -176 + 58, 58, 58, 58, 58, 58, 58, -176 }, { @@ -1604,83 +1654,307 @@ -177, -177, -177, 58, -177, -177, 58, 58, 58, 58, 58, 58, 58, 58, 58, 58, 58, 58, 58, 58, - 58, 58, 58, 58, 58, 58, -177 + 58, 58, 58, 58, 58, 58, 58, -177 }, { 11, -178, -178, -178, -178, -178, -178, -178, -178, -178, -178, -178, -178, 58, -178, -178, 58, 58, 58, 58, 58, 58, 58, 58, 58, 58, 58, 58, 58, 58, - 58, 58, 58, 58, 58, 58, -178 + 58, 58, 58, 58, 58, 58, 58, -178 }, { 11, -179, -179, -179, -179, -179, -179, -179, -179, -179, -179, -179, -179, 58, -179, -179, 58, 58, 58, 58, 58, 58, 58, 58, 58, 58, 58, 58, 58, 58, - 58, 58, 58, 58, 58, 58, -179 + 58, 58, 58, 58, 192, 58, 58, -179 }, { 11, -180, -180, -180, -180, -180, -180, -180, -180, -180, -180, -180, -180, 58, -180, -180, 58, 58, 58, 58, - 58, 58, 181, 58, 58, 58, 58, 58, 58, 58, - 58, 58, 58, 58, 58, 58, -180 + 58, 58, 58, 58, 58, 58, 58, 58, 58, 58, + 58, 58, 58, 58, 58, 58, 58, -180 }, { 11, -181, -181, -181, -181, -181, -181, -181, -181, -181, -181, -181, -181, 58, -181, -181, 58, 58, 58, 58, 58, 58, 58, 58, 58, 58, 58, 58, 58, 58, - 58, 58, 58, 58, 58, 58, -181 + 58, 58, 58, 58, 58, 58, 58, -181 }, - } ; + { + 11, -182, -182, -182, -182, -182, -182, -182, -182, -182, + -182, -182, -182, 58, -182, -182, 58, 58, 58, 58, + + 58, 58, 58, 58, 58, 58, 193, 58, 58, 58, + 58, 58, 58, 58, 58, 58, 58, -182 + }, + + { + 11, -183, -183, -183, -183, -183, -183, -183, -183, -183, + -183, -183, -183, 58, -183, -183, 58, 58, 58, 58, + 58, 58, 58, 58, 58, 58, 58, 58, 58, 58, + 58, 58, 58, 194, 58, 58, 58, -183 + }, + + { + 11, -184, -184, -184, -184, -184, -184, -184, -184, -184, + -184, -184, -184, 58, -184, -184, 58, 58, 58, 58, + 58, 58, 58, 58, 58, 58, 58, 58, 58, 58, + 58, 58, 58, 58, 58, 58, 58, -184 + + }, + + { + 11, -185, -185, -185, -185, -185, -185, -185, -185, -185, + -185, -185, -185, 58, -185, -185, 58, 58, 58, 58, + 58, 58, 58, 58, 58, 58, 58, 58, 58, 58, + 58, 58, 58, 58, 58, 58, 58, -185 + }, + + { + 11, -186, -186, -186, -186, -186, -186, -186, -186, -186, + -186, -186, -186, 58, -186, -186, 58, 58, 58, 195, + 58, 58, 58, 58, 58, 58, 58, 58, 58, 58, + 58, 58, 58, 58, 58, 58, 58, -186 + }, + + { + 11, -187, -187, -187, -187, -187, -187, -187, -187, -187, + -187, -187, -187, 58, -187, -187, 58, 58, 58, 58, + + 58, 58, 58, 58, 58, 58, 58, 58, 58, 58, + 58, 58, 58, 58, 58, 58, 58, -187 + }, + + { + 11, -188, -188, -188, -188, -188, -188, -188, -188, -188, + -188, -188, -188, 58, -188, -188, 58, 58, 58, 58, + 58, 58, 58, 58, 58, 58, 58, 58, 58, 58, + 58, 58, 58, 58, 58, 196, 58, -188 + }, + + { + 11, -189, -189, -189, -189, -189, -189, -189, -189, -189, + -189, -189, -189, 58, -189, -189, 58, 58, 58, 58, + 58, 58, 197, 58, 58, 58, 58, 58, 58, 58, + 58, 58, 58, 58, 58, 58, 58, -189 + + }, + + { + 11, -190, -190, -190, -190, -190, -190, -190, -190, -190, + -190, -190, -190, 58, -190, -190, 58, 58, 58, 58, + 58, 58, 58, 58, 58, 58, 198, 58, 58, 58, + 58, 58, 58, 58, 58, 58, 58, -190 + }, + + { + 11, -191, -191, -191, -191, -191, -191, -191, -191, -191, + -191, -191, -191, 58, -191, -191, 58, 58, 58, 58, + 58, 58, 58, 58, 58, 58, 58, 58, 58, 58, + 58, 58, 58, 199, 58, 58, 58, -191 + }, + + { + 11, -192, -192, -192, -192, -192, -192, -192, -192, -192, + -192, -192, -192, 58, -192, -192, 58, 58, 58, 58, + + 58, 200, 58, 58, 58, 58, 58, 58, 58, 58, + 58, 58, 58, 58, 58, 58, 58, -192 + }, + + { + 11, -193, -193, -193, -193, -193, -193, -193, -193, -193, + -193, -193, -193, 58, -193, -193, 58, 58, 58, 58, + 58, 201, 58, 58, 58, 58, 58, 58, 58, 58, + 58, 58, 58, 58, 58, 58, 58, -193 + }, + + { + 11, -194, -194, -194, -194, -194, -194, -194, -194, -194, + -194, -194, -194, 58, -194, -194, 58, 58, 58, 58, + 58, 58, 58, 58, 58, 58, 58, 58, 58, 58, + 58, 58, 58, 58, 202, 58, 58, -194 + + }, + + { + 11, -195, -195, -195, -195, -195, -195, -195, -195, -195, + -195, -195, -195, 58, -195, -195, 58, 58, 58, 58, + 58, 203, 58, 58, 58, 58, 58, 58, 58, 58, + 58, 58, 58, 58, 58, 58, 58, -195 + }, + + { + 11, -196, -196, -196, -196, -196, -196, -196, -196, -196, + -196, -196, -196, 58, -196, -196, 58, 58, 58, 58, + 58, 58, 58, 58, 58, 58, 58, 58, 58, 58, + 58, 58, 58, 58, 58, 58, 58, -196 + }, + + { + 11, -197, -197, -197, -197, -197, -197, -197, -197, -197, + -197, -197, -197, 58, -197, -197, 58, 58, 58, 58, + + 58, 58, 58, 58, 58, 204, 58, 58, 58, 58, + 58, 58, 58, 58, 58, 58, 58, -197 + }, + + { + 11, -198, -198, -198, -198, -198, -198, -198, -198, -198, + -198, -198, -198, 58, -198, -198, 58, 58, 58, 58, + 58, 58, 58, 58, 58, 58, 58, 58, 58, 58, + 58, 58, 58, 58, 58, 58, 58, -198 + }, + + { + 11, -199, -199, -199, -199, -199, -199, -199, -199, -199, + -199, -199, -199, 58, -199, -199, 58, 58, 58, 58, + 58, 58, 58, 58, 58, 58, 58, 58, 58, 58, + 58, 58, 58, 58, 58, 58, 58, -199 + + }, + + { + 11, -200, -200, -200, -200, -200, -200, -200, -200, -200, + -200, -200, -200, 58, -200, -200, 58, 58, 58, 58, + 58, 58, 58, 58, 58, 58, 58, 58, 58, 58, + 58, 58, 58, 58, 58, 58, 58, -200 + }, + + { + 11, -201, -201, -201, -201, -201, -201, -201, -201, -201, + -201, -201, -201, 58, -201, -201, 58, 205, 58, 58, + 58, 58, 58, 58, 58, 58, 58, 58, 58, 58, + 58, 58, 58, 58, 58, 58, 58, -201 + }, + + { + 11, -202, -202, -202, -202, -202, -202, -202, -202, -202, + -202, -202, -202, 58, -202, -202, 58, 206, 58, 58, + + 58, 58, 58, 58, 58, 58, 58, 58, 58, 58, + 58, 58, 58, 58, 58, 58, 58, -202 + }, + + { + 11, -203, -203, -203, -203, -203, -203, -203, -203, -203, + -203, -203, -203, 58, -203, -203, 58, 58, 58, 58, + 58, 58, 58, 58, 58, 58, 58, 58, 58, 58, + 58, 58, 58, 58, 58, 58, 58, -203 + }, + + { + 11, -204, -204, -204, -204, -204, -204, -204, -204, -204, + -204, -204, -204, 58, -204, -204, 58, 58, 58, 58, + 58, 58, 58, 207, 58, 58, 58, 58, 58, 58, + 58, 58, 58, 58, 58, 58, 58, -204 + + }, + + { + 11, -205, -205, -205, -205, -205, -205, -205, -205, -205, + -205, -205, -205, 58, -205, -205, 58, 58, 58, 58, + 58, 58, 58, 58, 58, 58, 58, 58, 208, 58, + 58, 58, 58, 58, 58, 58, 58, -205 + }, + + { + 11, -206, -206, -206, -206, -206, -206, -206, -206, -206, + -206, -206, -206, 58, -206, -206, 58, 58, 58, 58, + 58, 58, 58, 58, 58, 58, 58, 58, 58, 58, + 58, 58, 58, 58, 209, 58, 58, -206 + }, + + { + 11, -207, -207, -207, -207, -207, -207, -207, -207, -207, + -207, -207, -207, 58, -207, -207, 58, 58, 58, 58, + + 58, 58, 58, 58, 58, 58, 58, 58, 58, 58, + 58, 58, 58, 58, 58, 58, 58, -207 + }, + + { + 11, -208, -208, -208, -208, -208, -208, -208, -208, -208, + -208, -208, -208, 58, -208, -208, 58, 58, 58, 58, + 58, 58, 58, 58, 58, 58, 58, 58, 58, 58, + 58, 58, 58, 58, 58, 58, 58, -208 + }, + + { + 11, -209, -209, -209, -209, -209, -209, -209, -209, -209, + -209, -209, -209, 58, -209, -209, 58, 58, 58, 58, + 58, 210, 58, 58, 58, 58, 58, 58, 58, 58, + 58, 58, 58, 58, 58, 58, 58, -209 + + }, + + { + 11, -210, -210, -210, -210, -210, -210, -210, -210, -210, + -210, -210, -210, 58, -210, -210, 58, 58, 58, 58, + 58, 58, 58, 58, 58, 58, 58, 58, 58, 58, + 58, 58, 58, 58, 58, 58, 58, -210 + }, + } ; -static yy_state_type yy_get_previous_state YY_PROTO(( void )); -static yy_state_type yy_try_NUL_trans YY_PROTO(( yy_state_type current_state )); -static int yy_get_next_buffer YY_PROTO(( void )); -static void yy_fatal_error YY_PROTO(( yyconst char msg[] )); +static yy_state_type yy_get_previous_state (void ); +static yy_state_type yy_try_NUL_trans (yy_state_type current_state ); +static int yy_get_next_buffer (void ); +static void yy_fatal_error (yyconst char msg[] ); /* Done after the current pattern has been matched and before the - * corresponding action - sets up yytext. + * corresponding action - sets up zconftext. */ #define YY_DO_BEFORE_ACTION \ - yytext_ptr = yy_bp; \ - yyleng = (int) (yy_cp - yy_bp); \ - yy_hold_char = *yy_cp; \ + (yytext_ptr) = yy_bp; \ + zconfleng = (size_t) (yy_cp - yy_bp); \ + (yy_hold_char) = *yy_cp; \ *yy_cp = '\0'; \ - yy_c_buf_p = yy_cp; + (yy_c_buf_p) = yy_cp; -#define YY_NUM_RULES 58 -#define YY_END_OF_BUFFER 59 -static yyconst short int yy_accept[182] = +#define YY_NUM_RULES 64 +#define YY_END_OF_BUFFER 65 +/* This struct is not used in this scanner, + but its presence is necessary. */ +struct yy_trans_info + { + flex_int32_t yy_verify; + flex_int32_t yy_nxt; + }; +static yyconst flex_int16_t yy_accept[211] = { 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 59, 5, 4, 3, 2, 30, 31, 29, 29, 29, - 29, 29, 29, 29, 29, 29, 29, 29, 29, 29, - 57, 54, 56, 49, 53, 52, 51, 47, 42, 36, - 41, 45, 47, 34, 35, 44, 44, 37, 47, 44, - 44, 47, 4, 3, 2, 2, 1, 29, 29, 29, - 29, 29, 29, 29, 16, 29, 29, 29, 29, 29, - 29, 29, 29, 29, 57, 54, 56, 55, 49, 48, - 51, 50, 38, 45, 32, 44, 44, 46, 39, 40, - 33, 29, 29, 29, 29, 29, 29, 29, 29, 27, - - 26, 29, 29, 29, 29, 29, 29, 29, 29, 43, - 24, 29, 29, 29, 29, 29, 29, 29, 29, 15, - 29, 7, 29, 29, 29, 29, 29, 29, 29, 29, - 29, 29, 29, 29, 29, 17, 29, 29, 29, 29, - 29, 29, 29, 29, 29, 29, 10, 29, 13, 29, - 29, 29, 29, 29, 29, 29, 22, 29, 9, 28, - 29, 25, 12, 21, 18, 29, 8, 29, 29, 29, - 29, 29, 29, 6, 29, 20, 19, 23, 11, 29, - 14 + 65, 5, 4, 3, 2, 36, 37, 35, 35, 35, + 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, + 63, 60, 62, 55, 59, 58, 57, 53, 48, 42, + 47, 51, 53, 40, 41, 50, 50, 43, 53, 50, + 50, 53, 4, 3, 2, 2, 1, 35, 35, 35, + 35, 35, 35, 35, 16, 35, 35, 35, 35, 35, + 35, 35, 35, 35, 35, 35, 63, 60, 62, 61, + 55, 54, 57, 56, 44, 51, 38, 50, 50, 52, + 45, 46, 39, 35, 35, 35, 35, 35, 35, 35, + + 35, 35, 30, 29, 35, 35, 35, 35, 35, 35, + 35, 35, 35, 35, 49, 25, 35, 35, 35, 35, + 35, 35, 35, 35, 35, 35, 15, 35, 7, 35, + 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, + 35, 35, 35, 35, 35, 35, 35, 17, 35, 35, + 35, 35, 35, 34, 35, 35, 35, 35, 35, 35, + 10, 35, 13, 35, 35, 35, 35, 33, 35, 35, + 35, 35, 35, 22, 35, 32, 9, 31, 35, 26, + 12, 35, 35, 21, 18, 35, 8, 35, 35, 35, + 35, 35, 27, 35, 35, 6, 35, 20, 19, 23, + + 35, 35, 11, 35, 35, 35, 14, 28, 35, 24 } ; -static yyconst int yy_ec[256] = +static yyconst flex_int32_t yy_ec[256] = { 0, 1, 1, 1, 1, 1, 1, 1, 1, 2, 3, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, @@ -1691,11 +1965,11 @@ 14, 1, 1, 1, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, - 1, 15, 1, 1, 13, 1, 16, 17, 18, 19, + 1, 15, 1, 1, 16, 1, 17, 18, 19, 20, - 20, 21, 22, 23, 24, 13, 13, 25, 26, 27, - 28, 29, 30, 31, 32, 33, 34, 13, 13, 35, - 13, 13, 1, 36, 1, 1, 1, 1, 1, 1, + 21, 22, 23, 24, 25, 13, 13, 26, 27, 28, + 29, 30, 31, 32, 33, 34, 35, 13, 13, 36, + 13, 13, 1, 37, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, @@ -1712,6 +1986,9 @@ 1, 1, 1, 1, 1 } ; +extern int zconf_flex_debug; +int zconf_flex_debug = 0; + /* The intent behind this definition is that it'll catch * any uses of REJECT which flex missed. */ @@ -1719,13 +1996,7 @@ #define yymore() yymore_used_but_not_detected #define YY_MORE_ADJ 0 #define YY_RESTORE_YY_MORE_OFFSET -char *yytext; -#define INITIAL 0 -#define YY_NEVER_INTERACTIVE 1 -#define COMMAND 1 -#define HELP 2 -#define STRING 3 -#define PARAM 4 +char *zconftext; /* * Copyright (C) 2002 Roman Zippel @@ -1789,85 +2060,65 @@ text[size] = 0; } +#define INITIAL 0 +#define COMMAND 1 +#define HELP 2 +#define STRING 3 +#define PARAM 4 + +/* Special case for "unistd.h", since it is non-ANSI. We include it way + * down here because we want the user's section 1 to have been scanned first. + * The user has a chance to override it with an option. + */ +#include + +#ifndef YY_EXTRA_TYPE +#define YY_EXTRA_TYPE void * +#endif + /* Macros after this point can all be overridden by user definitions in * section 1. */ #ifndef YY_SKIP_YYWRAP #ifdef __cplusplus -extern "C" int yywrap YY_PROTO(( void )); +extern "C" int zconfwrap (void ); #else -extern int yywrap YY_PROTO(( void )); -#endif +extern int zconfwrap (void ); #endif - -#ifndef YY_NO_UNPUT -static void yyunput YY_PROTO(( int c, char *buf_ptr )); #endif + static void yyunput (int c,char *buf_ptr ); + #ifndef yytext_ptr -static void yy_flex_strncpy YY_PROTO(( char *, yyconst char *, int )); +static void yy_flex_strncpy (char *,yyconst char *,int ); #endif #ifdef YY_NEED_STRLEN -static int yy_flex_strlen YY_PROTO(( yyconst char * )); +static int yy_flex_strlen (yyconst char * ); #endif #ifndef YY_NO_INPUT + #ifdef __cplusplus -static int yyinput YY_PROTO(( void )); +static int yyinput (void ); #else -static int input YY_PROTO(( void )); -#endif +static int input (void ); #endif -#if YY_STACK_USED -static int yy_start_stack_ptr = 0; -static int yy_start_stack_depth = 0; -static int *yy_start_stack = 0; -#ifndef YY_NO_PUSH_STATE -static void yy_push_state YY_PROTO(( int new_state )); -#endif -#ifndef YY_NO_POP_STATE -static void yy_pop_state YY_PROTO(( void )); #endif -#ifndef YY_NO_TOP_STATE -static int yy_top_state YY_PROTO(( void )); -#endif - -#else -#define YY_NO_PUSH_STATE 1 -#define YY_NO_POP_STATE 1 -#define YY_NO_TOP_STATE 1 -#endif - -#ifdef YY_MALLOC_DECL -YY_MALLOC_DECL -#else -#if __STDC__ -#ifndef __cplusplus -#include -#endif -#else -/* Just try to get by without declaring the routines. This will fail - * miserably on non-ANSI systems for which sizeof(size_t) != sizeof(int) - * or sizeof(void*) != sizeof(int). - */ -#endif -#endif - -/* Amount of stuff to slurp up with each read. */ -#ifndef YY_READ_BUF_SIZE -#define YY_READ_BUF_SIZE 8192 + +/* Amount of stuff to slurp up with each read. */ +#ifndef YY_READ_BUF_SIZE +#define YY_READ_BUF_SIZE 8192 #endif /* Copy whatever the last rule matched to the standard output. */ - #ifndef ECHO /* This used to be an fputs(), but since the string might contain NUL's, * we now use fwrite(). */ -#define ECHO (void) fwrite( yytext, yyleng, 1, yyout ) +#define ECHO (void) fwrite( zconftext, zconfleng, 1, zconfout ) #endif /* Gets input and stuffs it into "buf". number of characters read, or YY_NULL, @@ -1876,7 +2127,7 @@ #ifndef YY_INPUT #define YY_INPUT(buf,result,max_size) \ errno=0; \ - while ( (result = read( fileno(yyin), (char *) buf, max_size )) < 0 ) \ + while ( (result = read( fileno(zconfin), (char *) buf, max_size )) < 0 ) \ { \ if( errno != EINTR) \ { \ @@ -1884,8 +2135,10 @@ break; \ } \ errno=0; \ - clearerr(yyin); \ - } + clearerr(zconfin); \ + }\ +\ + #endif /* No semi-colon after return; correct usage is to write "yyterminate();" - @@ -1906,14 +2159,20 @@ #define YY_FATAL_ERROR(msg) yy_fatal_error( msg ) #endif +/* end tables serialization structures and prototypes */ + /* Default declaration of generated scanner - a define so the user can * easily add parameters. */ #ifndef YY_DECL -#define YY_DECL int yylex YY_PROTO(( void )) -#endif +#define YY_DECL_IS_OURS 1 -/* Code executed at the beginning of each rule, after yytext and yyleng +extern int zconflex (void); + +#define YY_DECL int zconflex (void) +#endif /* !YY_DECL */ + +/* Code executed at the beginning of each rule, after zconftext and zconfleng * have been set up. */ #ifndef YY_USER_ACTION @@ -1928,56 +2187,58 @@ #define YY_RULE_SETUP \ YY_USER_ACTION +/** The main scanner function which does all the work. + */ YY_DECL - { +{ register yy_state_type yy_current_state; register char *yy_cp, *yy_bp; register int yy_act; - - + int str = 0; int ts, i; - - if ( yy_init ) + if ( (yy_init) ) { - yy_init = 0; + (yy_init) = 0; #ifdef YY_USER_INIT YY_USER_INIT; #endif - if ( ! yy_start ) - yy_start = 1; /* first start state */ + if ( ! (yy_start) ) + (yy_start) = 1; /* first start state */ - if ( ! yyin ) - yyin = stdin; + if ( ! zconfin ) + zconfin = stdin; - if ( ! yyout ) - yyout = stdout; + if ( ! zconfout ) + zconfout = stdout; - if ( ! yy_current_buffer ) - yy_current_buffer = - yy_create_buffer( yyin, YY_BUF_SIZE ); + if ( ! YY_CURRENT_BUFFER ) { + zconfensure_buffer_stack (); + YY_CURRENT_BUFFER_LVALUE = + zconf_create_buffer(zconfin,YY_BUF_SIZE ); + } - yy_load_buffer_state(); + zconf_load_buffer_state( ); } while ( 1 ) /* loops until end-of-file is reached */ { - yy_cp = yy_c_buf_p; + yy_cp = (yy_c_buf_p); - /* Support of yytext. */ - *yy_cp = yy_hold_char; + /* Support of zconftext. */ + *yy_cp = (yy_hold_char); /* yy_bp points to the position in yy_ch_buf of the start of * the current run. */ yy_bp = yy_cp; - yy_current_state = yy_start; + yy_current_state = (yy_start); yy_match: - while ( (yy_current_state = yy_nxt[yy_current_state][yy_ec[YY_SC_TO_UI(*yy_cp)]]) > 0 ) + while ( (yy_current_state = yy_nxt[yy_current_state][ yy_ec[YY_SC_TO_UI(*yy_cp)] ]) > 0 ) ++yy_cp; yy_current_state = -yy_current_state; @@ -1987,13 +2248,12 @@ YY_DO_BEFORE_ACTION; - do_action: /* This label is used only to access EOF actions. */ - switch ( yy_act ) { /* beginning of action switch */ case 1: +/* rule 1 can match eol */ YY_RULE_SETUP current_file->lineno++; YY_BREAK @@ -2002,6 +2262,7 @@ YY_BREAK case 3: +/* rule 3 can match eol */ YY_RULE_SETUP current_file->lineno++; return T_EOL; YY_BREAK @@ -2014,7 +2275,7 @@ case 5: YY_RULE_SETUP { - unput(yytext[0]); + unput(zconftext[0]); BEGIN(COMMAND); } YY_BREAK @@ -2093,7 +2354,7 @@ YY_BREAK case 24: YY_RULE_SETUP -BEGIN(PARAM); return T_BOOLEAN; +BEGIN(PARAM); return T_DEF_TRISTATE; YY_BREAK case 25: YY_RULE_SETUP @@ -2101,103 +2362,129 @@ YY_BREAK case 26: YY_RULE_SETUP -BEGIN(PARAM); return T_INT; +BEGIN(PARAM); return T_BOOLEAN; YY_BREAK case 27: YY_RULE_SETUP -BEGIN(PARAM); return T_HEX; +BEGIN(PARAM); return T_DEF_BOOLEAN; YY_BREAK case 28: YY_RULE_SETUP -BEGIN(PARAM); return T_STRING; +BEGIN(PARAM); return T_DEF_BOOLEAN; YY_BREAK case 29: YY_RULE_SETUP +BEGIN(PARAM); return T_INT; + YY_BREAK +case 30: +YY_RULE_SETUP +BEGIN(PARAM); return T_HEX; + YY_BREAK +case 31: +YY_RULE_SETUP +BEGIN(PARAM); return T_STRING; + YY_BREAK +case 32: +YY_RULE_SETUP +BEGIN(PARAM); return T_SELECT; + YY_BREAK +case 33: +YY_RULE_SETUP +BEGIN(PARAM); return T_SELECT; + YY_BREAK +case 34: +YY_RULE_SETUP +BEGIN(PARAM); return T_RANGE; + YY_BREAK +case 35: +YY_RULE_SETUP { - alloc_string(yytext, yyleng); + alloc_string(zconftext, zconfleng); zconflval.string = text; return T_WORD; } YY_BREAK -case 30: +case 36: YY_RULE_SETUP YY_BREAK -case 31: +case 37: +/* rule 37 can match eol */ YY_RULE_SETUP current_file->lineno++; BEGIN(INITIAL); YY_BREAK - -case 32: +case 38: YY_RULE_SETUP return T_AND; YY_BREAK -case 33: +case 39: YY_RULE_SETUP return T_OR; YY_BREAK -case 34: +case 40: YY_RULE_SETUP return T_OPEN_PAREN; YY_BREAK -case 35: +case 41: YY_RULE_SETUP return T_CLOSE_PAREN; YY_BREAK -case 36: +case 42: YY_RULE_SETUP return T_NOT; YY_BREAK -case 37: +case 43: YY_RULE_SETUP return T_EQUAL; YY_BREAK -case 38: +case 44: YY_RULE_SETUP return T_UNEQUAL; YY_BREAK -case 39: +case 45: YY_RULE_SETUP return T_IF; YY_BREAK -case 40: +case 46: YY_RULE_SETUP return T_ON; YY_BREAK -case 41: +case 47: YY_RULE_SETUP { - str = yytext[0]; + str = zconftext[0]; new_string(); BEGIN(STRING); } YY_BREAK -case 42: +case 48: +/* rule 48 can match eol */ YY_RULE_SETUP BEGIN(INITIAL); current_file->lineno++; return T_EOL; YY_BREAK -case 43: +case 49: YY_RULE_SETUP /* ignore */ YY_BREAK -case 44: +case 50: YY_RULE_SETUP { - alloc_string(yytext, yyleng); + alloc_string(zconftext, zconfleng); zconflval.string = text; return T_WORD; } YY_BREAK -case 45: +case 51: YY_RULE_SETUP /* comment */ YY_BREAK -case 46: +case 52: +/* rule 52 can match eol */ YY_RULE_SETUP current_file->lineno++; YY_BREAK -case 47: +case 53: YY_RULE_SETUP YY_BREAK @@ -2207,53 +2494,55 @@ } YY_BREAK - -case 48: -*yy_cp = yy_hold_char; /* undo effects of setting up yytext */ -yy_c_buf_p = yy_cp -= 1; -YY_DO_BEFORE_ACTION; /* set up yytext again */ +case 54: +/* rule 54 can match eol */ +*yy_cp = (yy_hold_char); /* undo effects of setting up zconftext */ +(yy_c_buf_p) = yy_cp -= 1; +YY_DO_BEFORE_ACTION; /* set up zconftext again */ YY_RULE_SETUP { - append_string(yytext, yyleng); + append_string(zconftext, zconfleng); zconflval.string = text; return T_WORD_QUOTE; } YY_BREAK -case 49: +case 55: YY_RULE_SETUP { - append_string(yytext, yyleng); + append_string(zconftext, zconfleng); } YY_BREAK -case 50: -*yy_cp = yy_hold_char; /* undo effects of setting up yytext */ -yy_c_buf_p = yy_cp -= 1; -YY_DO_BEFORE_ACTION; /* set up yytext again */ +case 56: +/* rule 56 can match eol */ +*yy_cp = (yy_hold_char); /* undo effects of setting up zconftext */ +(yy_c_buf_p) = yy_cp -= 1; +YY_DO_BEFORE_ACTION; /* set up zconftext again */ YY_RULE_SETUP { - append_string(yytext + 1, yyleng - 1); + append_string(zconftext + 1, zconfleng - 1); zconflval.string = text; return T_WORD_QUOTE; } YY_BREAK -case 51: +case 57: YY_RULE_SETUP { - append_string(yytext + 1, yyleng - 1); + append_string(zconftext + 1, zconfleng - 1); } YY_BREAK -case 52: +case 58: YY_RULE_SETUP { - if (str == yytext[0]) { + if (str == zconftext[0]) { BEGIN(PARAM); zconflval.string = text; return T_WORD_QUOTE; } else - append_string(yytext, 1); + append_string(zconftext, 1); } YY_BREAK -case 53: +case 59: +/* rule 59 can match eol */ YY_RULE_SETUP { printf("%s:%d:warning: multi-line strings not supported\n", zconf_curname(), zconf_lineno()); @@ -2268,13 +2557,12 @@ } YY_BREAK - -case 54: +case 60: YY_RULE_SETUP { ts = 0; - for (i = 0; i < yyleng; i++) { - if (yytext[i] == '\t') + for (i = 0; i < zconfleng; i++) { + if (zconftext[i] == '\t') ts = (ts & ~7) + 8; else ts++; @@ -2292,13 +2580,13 @@ } append_string(" ", ts); } - } YY_BREAK -case 55: -*yy_cp = yy_hold_char; /* undo effects of setting up yytext */ -yy_c_buf_p = yy_cp -= 1; -YY_DO_BEFORE_ACTION; /* set up yytext again */ +case 61: +/* rule 61 can match eol */ +*yy_cp = (yy_hold_char); /* undo effects of setting up zconftext */ +(yy_c_buf_p) = yy_cp -= 1; +YY_DO_BEFORE_ACTION; /* set up zconftext again */ YY_RULE_SETUP { current_file->lineno++; @@ -2306,17 +2594,18 @@ return T_HELPTEXT; } YY_BREAK -case 56: +case 62: +/* rule 62 can match eol */ YY_RULE_SETUP { current_file->lineno++; append_string("\n", 1); } YY_BREAK -case 57: +case 63: YY_RULE_SETUP { - append_string(yytext, yyleng); + append_string(zconftext, zconfleng); if (!first_ts) first_ts = last_ts; } @@ -2335,11 +2624,11 @@ zconf_endfile(); return T_EOF; } - fclose(yyin); + fclose(zconfin); yyterminate(); } YY_BREAK -case 58: +case 64: YY_RULE_SETUP YY_FATAL_ERROR( "flex scanner jammed" ); YY_BREAK @@ -2347,26 +2636,26 @@ case YY_END_OF_BUFFER: { /* Amount of text matched not including the EOB char. */ - int yy_amount_of_matched_text = (int) (yy_cp - yytext_ptr) - 1; + int yy_amount_of_matched_text = (int) (yy_cp - (yytext_ptr)) - 1; /* Undo the effects of YY_DO_BEFORE_ACTION. */ - *yy_cp = yy_hold_char; + *yy_cp = (yy_hold_char); YY_RESTORE_YY_MORE_OFFSET - if ( yy_current_buffer->yy_buffer_status == YY_BUFFER_NEW ) + if ( YY_CURRENT_BUFFER_LVALUE->yy_buffer_status == YY_BUFFER_NEW ) { /* We're scanning a new file or input source. It's * possible that this happened because the user - * just pointed yyin at a new source and called - * yylex(). If so, then we have to assure - * consistency between yy_current_buffer and our + * just pointed zconfin at a new source and called + * zconflex(). If so, then we have to assure + * consistency between YY_CURRENT_BUFFER and our * globals. Here is the right place to do so, because * this is the first action (other than possibly a * back-up) that will match for the new input source. */ - yy_n_chars = yy_current_buffer->yy_n_chars; - yy_current_buffer->yy_input_file = yyin; - yy_current_buffer->yy_buffer_status = YY_BUFFER_NORMAL; + (yy_n_chars) = YY_CURRENT_BUFFER_LVALUE->yy_n_chars; + YY_CURRENT_BUFFER_LVALUE->yy_input_file = zconfin; + YY_CURRENT_BUFFER_LVALUE->yy_buffer_status = YY_BUFFER_NORMAL; } /* Note that here we test for yy_c_buf_p "<=" to the position @@ -2376,13 +2665,13 @@ * end-of-buffer state). Contrast this with the test * in input(). */ - if ( yy_c_buf_p <= &yy_current_buffer->yy_ch_buf[yy_n_chars] ) + if ( (yy_c_buf_p) <= &YY_CURRENT_BUFFER_LVALUE->yy_ch_buf[(yy_n_chars)] ) { /* This was really a NUL. */ yy_state_type yy_next_state; - yy_c_buf_p = yytext_ptr + yy_amount_of_matched_text; + (yy_c_buf_p) = (yytext_ptr) + yy_amount_of_matched_text; - yy_current_state = yy_get_previous_state(); + yy_current_state = yy_get_previous_state( ); /* Okay, we're now positioned to make the NUL * transition. We couldn't have @@ -2395,41 +2684,41 @@ yy_next_state = yy_try_NUL_trans( yy_current_state ); - yy_bp = yytext_ptr + YY_MORE_ADJ; + yy_bp = (yytext_ptr) + YY_MORE_ADJ; if ( yy_next_state ) { /* Consume the NUL. */ - yy_cp = ++yy_c_buf_p; + yy_cp = ++(yy_c_buf_p); yy_current_state = yy_next_state; goto yy_match; } else { - yy_cp = yy_c_buf_p; + yy_cp = (yy_c_buf_p); goto yy_find_action; } } - else switch ( yy_get_next_buffer() ) + else switch ( yy_get_next_buffer( ) ) { case EOB_ACT_END_OF_FILE: { - yy_did_buffer_switch_on_eof = 0; + (yy_did_buffer_switch_on_eof) = 0; - if ( yywrap() ) + if ( zconfwrap( ) ) { /* Note: because we've taken care in * yy_get_next_buffer() to have set up - * yytext, we can now set up + * zconftext, we can now set up * yy_c_buf_p so that if some total * hoser (like flex itself) wants to * call the scanner after we return the * YY_NULL, it'll still work - another * YY_NULL will get returned. */ - yy_c_buf_p = yytext_ptr + YY_MORE_ADJ; + (yy_c_buf_p) = (yytext_ptr) + YY_MORE_ADJ; yy_act = YY_STATE_EOF(YY_START); goto do_action; @@ -2437,30 +2726,30 @@ else { - if ( ! yy_did_buffer_switch_on_eof ) + if ( ! (yy_did_buffer_switch_on_eof) ) YY_NEW_FILE; } break; } case EOB_ACT_CONTINUE_SCAN: - yy_c_buf_p = - yytext_ptr + yy_amount_of_matched_text; + (yy_c_buf_p) = + (yytext_ptr) + yy_amount_of_matched_text; - yy_current_state = yy_get_previous_state(); + yy_current_state = yy_get_previous_state( ); - yy_cp = yy_c_buf_p; - yy_bp = yytext_ptr + YY_MORE_ADJ; + yy_cp = (yy_c_buf_p); + yy_bp = (yytext_ptr) + YY_MORE_ADJ; goto yy_match; case EOB_ACT_LAST_MATCH: - yy_c_buf_p = - &yy_current_buffer->yy_ch_buf[yy_n_chars]; + (yy_c_buf_p) = + &YY_CURRENT_BUFFER_LVALUE->yy_ch_buf[(yy_n_chars)]; - yy_current_state = yy_get_previous_state(); + yy_current_state = yy_get_previous_state( ); - yy_cp = yy_c_buf_p; - yy_bp = yytext_ptr + YY_MORE_ADJ; + yy_cp = (yy_c_buf_p); + yy_bp = (yytext_ptr) + YY_MORE_ADJ; goto yy_find_action; } break; @@ -2471,8 +2760,7 @@ "fatal flex scanner internal error--no action found" ); } /* end of action switch */ } /* end of scanning one token */ - } /* end of yylex */ - +} /* end of zconflex */ /* yy_get_next_buffer - try to read in a new buffer * @@ -2481,21 +2769,20 @@ * EOB_ACT_CONTINUE_SCAN - continue scanning from current position * EOB_ACT_END_OF_FILE - end of file */ - -static int yy_get_next_buffer() - { - register char *dest = yy_current_buffer->yy_ch_buf; - register char *source = yytext_ptr; +static int yy_get_next_buffer (void) +{ + register char *dest = YY_CURRENT_BUFFER_LVALUE->yy_ch_buf; + register char *source = (yytext_ptr); register int number_to_move, i; int ret_val; - if ( yy_c_buf_p > &yy_current_buffer->yy_ch_buf[yy_n_chars + 1] ) + if ( (yy_c_buf_p) > &YY_CURRENT_BUFFER_LVALUE->yy_ch_buf[(yy_n_chars) + 1] ) YY_FATAL_ERROR( "fatal flex scanner internal error--end of buffer missed" ); - if ( yy_current_buffer->yy_fill_buffer == 0 ) + if ( YY_CURRENT_BUFFER_LVALUE->yy_fill_buffer == 0 ) { /* Don't try to fill the buffer, so this is an EOF. */ - if ( yy_c_buf_p - yytext_ptr - YY_MORE_ADJ == 1 ) + if ( (yy_c_buf_p) - (yytext_ptr) - YY_MORE_ADJ == 1 ) { /* We matched a single character, the EOB, so * treat this as a final EOF. @@ -2515,34 +2802,30 @@ /* Try to read more data. */ /* First move last chars to start of buffer. */ - number_to_move = (int) (yy_c_buf_p - yytext_ptr) - 1; + number_to_move = (int) ((yy_c_buf_p) - (yytext_ptr)) - 1; for ( i = 0; i < number_to_move; ++i ) *(dest++) = *(source++); - if ( yy_current_buffer->yy_buffer_status == YY_BUFFER_EOF_PENDING ) + if ( YY_CURRENT_BUFFER_LVALUE->yy_buffer_status == YY_BUFFER_EOF_PENDING ) /* don't do the read, it's not guaranteed to return an EOF, * just force an EOF */ - yy_current_buffer->yy_n_chars = yy_n_chars = 0; + YY_CURRENT_BUFFER_LVALUE->yy_n_chars = (yy_n_chars) = 0; else { - int num_to_read = - yy_current_buffer->yy_buf_size - number_to_move - 1; + size_t num_to_read = + YY_CURRENT_BUFFER_LVALUE->yy_buf_size - number_to_move - 1; while ( num_to_read <= 0 ) { /* Not enough room in the buffer - grow it. */ -#ifdef YY_USES_REJECT - YY_FATAL_ERROR( -"input buffer overflow, can't enlarge buffer because scanner uses REJECT" ); -#else /* just a shorter name for the current buffer */ - YY_BUFFER_STATE b = yy_current_buffer; + YY_BUFFER_STATE b = YY_CURRENT_BUFFER; int yy_c_buf_p_offset = - (int) (yy_c_buf_p - b->yy_ch_buf); + (int) ((yy_c_buf_p) - b->yy_ch_buf); if ( b->yy_is_our_buffer ) { @@ -2555,8 +2838,7 @@ b->yy_ch_buf = (char *) /* Include room in for 2 EOB chars. */ - yy_flex_realloc( (void *) b->yy_ch_buf, - b->yy_buf_size + 2 ); + zconfrealloc((void *) b->yy_ch_buf,b->yy_buf_size + 2 ); } else /* Can't grow it, we don't own it. */ @@ -2566,35 +2848,35 @@ YY_FATAL_ERROR( "fatal error - scanner input buffer overflow" ); - yy_c_buf_p = &b->yy_ch_buf[yy_c_buf_p_offset]; + (yy_c_buf_p) = &b->yy_ch_buf[yy_c_buf_p_offset]; - num_to_read = yy_current_buffer->yy_buf_size - + num_to_read = YY_CURRENT_BUFFER_LVALUE->yy_buf_size - number_to_move - 1; -#endif + } if ( num_to_read > YY_READ_BUF_SIZE ) num_to_read = YY_READ_BUF_SIZE; /* Read in more data. */ - YY_INPUT( (&yy_current_buffer->yy_ch_buf[number_to_move]), - yy_n_chars, num_to_read ); + YY_INPUT( (&YY_CURRENT_BUFFER_LVALUE->yy_ch_buf[number_to_move]), + (yy_n_chars), num_to_read ); - yy_current_buffer->yy_n_chars = yy_n_chars; + YY_CURRENT_BUFFER_LVALUE->yy_n_chars = (yy_n_chars); } - if ( yy_n_chars == 0 ) + if ( (yy_n_chars) == 0 ) { if ( number_to_move == YY_MORE_ADJ ) { ret_val = EOB_ACT_END_OF_FILE; - yyrestart( yyin ); + zconfrestart(zconfin ); } else { ret_val = EOB_ACT_LAST_MATCH; - yy_current_buffer->yy_buffer_status = + YY_CURRENT_BUFFER_LVALUE->yy_buffer_status = YY_BUFFER_EOF_PENDING; } } @@ -2602,127 +2884,112 @@ else ret_val = EOB_ACT_CONTINUE_SCAN; - yy_n_chars += number_to_move; - yy_current_buffer->yy_ch_buf[yy_n_chars] = YY_END_OF_BUFFER_CHAR; - yy_current_buffer->yy_ch_buf[yy_n_chars + 1] = YY_END_OF_BUFFER_CHAR; + (yy_n_chars) += number_to_move; + YY_CURRENT_BUFFER_LVALUE->yy_ch_buf[(yy_n_chars)] = YY_END_OF_BUFFER_CHAR; + YY_CURRENT_BUFFER_LVALUE->yy_ch_buf[(yy_n_chars) + 1] = YY_END_OF_BUFFER_CHAR; - yytext_ptr = &yy_current_buffer->yy_ch_buf[0]; + (yytext_ptr) = &YY_CURRENT_BUFFER_LVALUE->yy_ch_buf[0]; return ret_val; - } - +} /* yy_get_previous_state - get the state just before the EOB char was reached */ -static yy_state_type yy_get_previous_state() - { + static yy_state_type yy_get_previous_state (void) +{ register yy_state_type yy_current_state; register char *yy_cp; + + yy_current_state = (yy_start); - yy_current_state = yy_start; - - for ( yy_cp = yytext_ptr + YY_MORE_ADJ; yy_cp < yy_c_buf_p; ++yy_cp ) + for ( yy_cp = (yytext_ptr) + YY_MORE_ADJ; yy_cp < (yy_c_buf_p); ++yy_cp ) { yy_current_state = yy_nxt[yy_current_state][(*yy_cp ? yy_ec[YY_SC_TO_UI(*yy_cp)] : 1)]; } return yy_current_state; - } - +} /* yy_try_NUL_trans - try to make a transition on the NUL character * * synopsis * next_state = yy_try_NUL_trans( current_state ); */ - -#ifdef YY_USE_PROTOS -static yy_state_type yy_try_NUL_trans( yy_state_type yy_current_state ) -#else -static yy_state_type yy_try_NUL_trans( yy_current_state ) -yy_state_type yy_current_state; -#endif - { + static yy_state_type yy_try_NUL_trans (yy_state_type yy_current_state ) +{ register int yy_is_jam; - + yy_current_state = yy_nxt[yy_current_state][1]; yy_is_jam = (yy_current_state <= 0); return yy_is_jam ? 0 : yy_current_state; - } - +} -#ifndef YY_NO_UNPUT -#ifdef YY_USE_PROTOS -static void yyunput( int c, register char *yy_bp ) -#else -static void yyunput( c, yy_bp ) -int c; -register char *yy_bp; -#endif - { - register char *yy_cp = yy_c_buf_p; + static void yyunput (int c, register char * yy_bp ) +{ + register char *yy_cp; + + yy_cp = (yy_c_buf_p); - /* undo effects of setting up yytext */ - *yy_cp = yy_hold_char; + /* undo effects of setting up zconftext */ + *yy_cp = (yy_hold_char); - if ( yy_cp < yy_current_buffer->yy_ch_buf + 2 ) + if ( yy_cp < YY_CURRENT_BUFFER_LVALUE->yy_ch_buf + 2 ) { /* need to shift things up to make room */ /* +2 for EOB chars. */ - register int number_to_move = yy_n_chars + 2; - register char *dest = &yy_current_buffer->yy_ch_buf[ - yy_current_buffer->yy_buf_size + 2]; + register int number_to_move = (yy_n_chars) + 2; + register char *dest = &YY_CURRENT_BUFFER_LVALUE->yy_ch_buf[ + YY_CURRENT_BUFFER_LVALUE->yy_buf_size + 2]; register char *source = - &yy_current_buffer->yy_ch_buf[number_to_move]; + &YY_CURRENT_BUFFER_LVALUE->yy_ch_buf[number_to_move]; - while ( source > yy_current_buffer->yy_ch_buf ) + while ( source > YY_CURRENT_BUFFER_LVALUE->yy_ch_buf ) *--dest = *--source; yy_cp += (int) (dest - source); yy_bp += (int) (dest - source); - yy_current_buffer->yy_n_chars = - yy_n_chars = yy_current_buffer->yy_buf_size; + YY_CURRENT_BUFFER_LVALUE->yy_n_chars = + (yy_n_chars) = YY_CURRENT_BUFFER_LVALUE->yy_buf_size; - if ( yy_cp < yy_current_buffer->yy_ch_buf + 2 ) + if ( yy_cp < YY_CURRENT_BUFFER_LVALUE->yy_ch_buf + 2 ) YY_FATAL_ERROR( "flex scanner push-back overflow" ); } *--yy_cp = (char) c; + (yytext_ptr) = yy_bp; + (yy_hold_char) = *yy_cp; + (yy_c_buf_p) = yy_cp; +} - yytext_ptr = yy_bp; - yy_hold_char = *yy_cp; - yy_c_buf_p = yy_cp; - } -#endif /* ifndef YY_NO_UNPUT */ - - +#ifndef YY_NO_INPUT #ifdef __cplusplus -static int yyinput() + static int yyinput (void) #else -static int input() + static int input (void) #endif - { - int c; - *yy_c_buf_p = yy_hold_char; +{ + int c; + + *(yy_c_buf_p) = (yy_hold_char); - if ( *yy_c_buf_p == YY_END_OF_BUFFER_CHAR ) + if ( *(yy_c_buf_p) == YY_END_OF_BUFFER_CHAR ) { /* yy_c_buf_p now points to the character we want to return. * If this occurs *before* the EOB characters, then it's a * valid NUL; if not, then we've hit the end of the buffer. */ - if ( yy_c_buf_p < &yy_current_buffer->yy_ch_buf[yy_n_chars] ) + if ( (yy_c_buf_p) < &YY_CURRENT_BUFFER_LVALUE->yy_ch_buf[(yy_n_chars)] ) /* This was really a NUL. */ - *yy_c_buf_p = '\0'; + *(yy_c_buf_p) = '\0'; else { /* need more input */ - int offset = yy_c_buf_p - yytext_ptr; - ++yy_c_buf_p; + int offset = (yy_c_buf_p) - (yytext_ptr); + ++(yy_c_buf_p); - switch ( yy_get_next_buffer() ) + switch ( yy_get_next_buffer( ) ) { case EOB_ACT_LAST_MATCH: /* This happens because yy_g_n_b() @@ -2736,16 +3003,16 @@ */ /* Reset buffer status. */ - yyrestart( yyin ); + zconfrestart(zconfin ); - /* fall through */ + /*FALLTHROUGH*/ case EOB_ACT_END_OF_FILE: { - if ( yywrap() ) + if ( zconfwrap( ) ) return EOF; - if ( ! yy_did_buffer_switch_on_eof ) + if ( ! (yy_did_buffer_switch_on_eof) ) YY_NEW_FILE; #ifdef __cplusplus return yyinput(); @@ -2755,176 +3022,165 @@ } case EOB_ACT_CONTINUE_SCAN: - yy_c_buf_p = yytext_ptr + offset; + (yy_c_buf_p) = (yytext_ptr) + offset; break; } } } - c = *(unsigned char *) yy_c_buf_p; /* cast for 8-bit char's */ - *yy_c_buf_p = '\0'; /* preserve yytext */ - yy_hold_char = *++yy_c_buf_p; - + c = *(unsigned char *) (yy_c_buf_p); /* cast for 8-bit char's */ + *(yy_c_buf_p) = '\0'; /* preserve zconftext */ + (yy_hold_char) = *++(yy_c_buf_p); return c; - } - - -#ifdef YY_USE_PROTOS -void yyrestart( FILE *input_file ) -#else -void yyrestart( input_file ) -FILE *input_file; -#endif - { - if ( ! yy_current_buffer ) - yy_current_buffer = yy_create_buffer( yyin, YY_BUF_SIZE ); +} +#endif /* ifndef YY_NO_INPUT */ - yy_init_buffer( yy_current_buffer, input_file ); - yy_load_buffer_state(); +/** Immediately switch to a different input stream. + * @param input_file A readable stream. + * + * @note This function does not reset the start condition to @c INITIAL . + */ + void zconfrestart (FILE * input_file ) +{ + + if ( ! YY_CURRENT_BUFFER ){ + zconfensure_buffer_stack (); + YY_CURRENT_BUFFER_LVALUE = + zconf_create_buffer(zconfin,YY_BUF_SIZE ); } + zconf_init_buffer(YY_CURRENT_BUFFER,input_file ); + zconf_load_buffer_state( ); +} -#ifdef YY_USE_PROTOS -void yy_switch_to_buffer( YY_BUFFER_STATE new_buffer ) -#else -void yy_switch_to_buffer( new_buffer ) -YY_BUFFER_STATE new_buffer; -#endif - { - if ( yy_current_buffer == new_buffer ) +/** Switch to a different input buffer. + * @param new_buffer The new input buffer. + * + */ + void zconf_switch_to_buffer (YY_BUFFER_STATE new_buffer ) +{ + + /* TODO. We should be able to replace this entire function body + * with + * zconfpop_buffer_state(); + * zconfpush_buffer_state(new_buffer); + */ + zconfensure_buffer_stack (); + if ( YY_CURRENT_BUFFER == new_buffer ) return; - if ( yy_current_buffer ) + if ( YY_CURRENT_BUFFER ) { /* Flush out information for old buffer. */ - *yy_c_buf_p = yy_hold_char; - yy_current_buffer->yy_buf_pos = yy_c_buf_p; - yy_current_buffer->yy_n_chars = yy_n_chars; + *(yy_c_buf_p) = (yy_hold_char); + YY_CURRENT_BUFFER_LVALUE->yy_buf_pos = (yy_c_buf_p); + YY_CURRENT_BUFFER_LVALUE->yy_n_chars = (yy_n_chars); } - yy_current_buffer = new_buffer; - yy_load_buffer_state(); + YY_CURRENT_BUFFER_LVALUE = new_buffer; + zconf_load_buffer_state( ); /* We don't actually know whether we did this switch during - * EOF (yywrap()) processing, but the only time this flag - * is looked at is after yywrap() is called, so it's safe + * EOF (zconfwrap()) processing, but the only time this flag + * is looked at is after zconfwrap() is called, so it's safe * to go ahead and always set it. */ - yy_did_buffer_switch_on_eof = 1; - } - - -#ifdef YY_USE_PROTOS -void yy_load_buffer_state( void ) -#else -void yy_load_buffer_state() -#endif - { - yy_n_chars = yy_current_buffer->yy_n_chars; - yytext_ptr = yy_c_buf_p = yy_current_buffer->yy_buf_pos; - yyin = yy_current_buffer->yy_input_file; - yy_hold_char = *yy_c_buf_p; - } + (yy_did_buffer_switch_on_eof) = 1; +} +static void zconf_load_buffer_state (void) +{ + (yy_n_chars) = YY_CURRENT_BUFFER_LVALUE->yy_n_chars; + (yytext_ptr) = (yy_c_buf_p) = YY_CURRENT_BUFFER_LVALUE->yy_buf_pos; + zconfin = YY_CURRENT_BUFFER_LVALUE->yy_input_file; + (yy_hold_char) = *(yy_c_buf_p); +} -#ifdef YY_USE_PROTOS -YY_BUFFER_STATE yy_create_buffer( FILE *file, int size ) -#else -YY_BUFFER_STATE yy_create_buffer( file, size ) -FILE *file; -int size; -#endif - { +/** Allocate and initialize an input buffer state. + * @param file A readable stream. + * @param size The character buffer size in bytes. When in doubt, use @c YY_BUF_SIZE. + * + * @return the allocated buffer state. + */ + YY_BUFFER_STATE zconf_create_buffer (FILE * file, int size ) +{ YY_BUFFER_STATE b; - - b = (YY_BUFFER_STATE) yy_flex_alloc( sizeof( struct yy_buffer_state ) ); + + b = (YY_BUFFER_STATE) zconfalloc(sizeof( struct yy_buffer_state ) ); if ( ! b ) - YY_FATAL_ERROR( "out of dynamic memory in yy_create_buffer()" ); + YY_FATAL_ERROR( "out of dynamic memory in zconf_create_buffer()" ); b->yy_buf_size = size; /* yy_ch_buf has to be 2 characters longer than the size given because * we need to put in 2 end-of-buffer characters. */ - b->yy_ch_buf = (char *) yy_flex_alloc( b->yy_buf_size + 2 ); + b->yy_ch_buf = (char *) zconfalloc(b->yy_buf_size + 2 ); if ( ! b->yy_ch_buf ) - YY_FATAL_ERROR( "out of dynamic memory in yy_create_buffer()" ); + YY_FATAL_ERROR( "out of dynamic memory in zconf_create_buffer()" ); b->yy_is_our_buffer = 1; - yy_init_buffer( b, file ); + zconf_init_buffer(b,file ); return b; - } - +} -#ifdef YY_USE_PROTOS -void yy_delete_buffer( YY_BUFFER_STATE b ) -#else -void yy_delete_buffer( b ) -YY_BUFFER_STATE b; -#endif - { +/** Destroy the buffer. + * @param b a buffer created with zconf_create_buffer() + * + */ + void zconf_delete_buffer (YY_BUFFER_STATE b ) +{ + if ( ! b ) return; - if ( b == yy_current_buffer ) - yy_current_buffer = (YY_BUFFER_STATE) 0; + if ( b == YY_CURRENT_BUFFER ) /* Not sure if we should pop here. */ + YY_CURRENT_BUFFER_LVALUE = (YY_BUFFER_STATE) 0; if ( b->yy_is_our_buffer ) - yy_flex_free( (void *) b->yy_ch_buf ); - - yy_flex_free( (void *) b ); - } - + zconffree((void *) b->yy_ch_buf ); -#ifndef _WIN32 -#include -#else -#ifndef YY_ALWAYS_INTERACTIVE -#ifndef YY_NEVER_INTERACTIVE -extern int isatty YY_PROTO(( int )); -#endif -#endif -#endif - -#ifdef YY_USE_PROTOS -void yy_init_buffer( YY_BUFFER_STATE b, FILE *file ) -#else -void yy_init_buffer( b, file ) -YY_BUFFER_STATE b; -FILE *file; -#endif + zconffree((void *) b ); +} +/* Initializes or reinitializes a buffer. + * This function is sometimes called more than once on the same buffer, + * such as during a zconfrestart() or at EOF. + */ + static void zconf_init_buffer (YY_BUFFER_STATE b, FILE * file ) - { - yy_flush_buffer( b ); +{ + int oerrno = errno; + + zconf_flush_buffer(b ); b->yy_input_file = file; b->yy_fill_buffer = 1; -#if YY_ALWAYS_INTERACTIVE - b->yy_is_interactive = 1; -#else -#if YY_NEVER_INTERACTIVE - b->yy_is_interactive = 0; -#else - b->yy_is_interactive = file ? (isatty( fileno(file) ) > 0) : 0; -#endif -#endif - } - - -#ifdef YY_USE_PROTOS -void yy_flush_buffer( YY_BUFFER_STATE b ) -#else -void yy_flush_buffer( b ) -YY_BUFFER_STATE b; -#endif + /* If b is the current buffer, then zconf_init_buffer was _probably_ + * called from zconfrestart() or through yy_get_next_buffer. + * In that case, we don't want to reset the lineno or column. + */ + if (b != YY_CURRENT_BUFFER){ + b->yy_bs_lineno = 1; + b->yy_bs_column = 0; + } + + b->yy_is_interactive = 0; + + errno = oerrno; +} - { - if ( ! b ) +/** Discard all buffered characters. On the next scan, YY_INPUT will be called. + * @param b the buffer state to be flushed, usually @c YY_CURRENT_BUFFER. + * + */ + void zconf_flush_buffer (YY_BUFFER_STATE b ) +{ + if ( ! b ) return; b->yy_n_chars = 0; @@ -2941,31 +3197,123 @@ b->yy_at_bol = 1; b->yy_buffer_status = YY_BUFFER_NEW; - if ( b == yy_current_buffer ) - yy_load_buffer_state(); + if ( b == YY_CURRENT_BUFFER ) + zconf_load_buffer_state( ); +} + +/** Pushes the new state onto the stack. The new state becomes + * the current state. This function will allocate the stack + * if necessary. + * @param new_buffer The new state. + * + */ +void zconfpush_buffer_state (YY_BUFFER_STATE new_buffer ) +{ + if (new_buffer == NULL) + return; + + zconfensure_buffer_stack(); + + /* This block is copied from zconf_switch_to_buffer. */ + if ( YY_CURRENT_BUFFER ) + { + /* Flush out information for old buffer. */ + *(yy_c_buf_p) = (yy_hold_char); + YY_CURRENT_BUFFER_LVALUE->yy_buf_pos = (yy_c_buf_p); + YY_CURRENT_BUFFER_LVALUE->yy_n_chars = (yy_n_chars); + } + + /* Only push if top exists. Otherwise, replace top. */ + if (YY_CURRENT_BUFFER) + (yy_buffer_stack_top)++; + YY_CURRENT_BUFFER_LVALUE = new_buffer; + + /* copied from zconf_switch_to_buffer. */ + zconf_load_buffer_state( ); + (yy_did_buffer_switch_on_eof) = 1; +} + +/** Removes and deletes the top of the stack, if present. + * The next element becomes the new top. + * + */ +void zconfpop_buffer_state (void) +{ + if (!YY_CURRENT_BUFFER) + return; + + zconf_delete_buffer(YY_CURRENT_BUFFER ); + YY_CURRENT_BUFFER_LVALUE = NULL; + if ((yy_buffer_stack_top) > 0) + --(yy_buffer_stack_top); + + if (YY_CURRENT_BUFFER) { + zconf_load_buffer_state( ); + (yy_did_buffer_switch_on_eof) = 1; + } +} + +/* Allocates the stack if it does not exist. + * Guarantees space for at least one push. + */ +static void zconfensure_buffer_stack (void) +{ + int num_to_alloc; + + if (!(yy_buffer_stack)) { + + /* First allocation is just for 2 elements, since we don't know if this + * scanner will even need a stack. We use 2 instead of 1 to avoid an + * immediate realloc on the next call. + */ + num_to_alloc = 1; + (yy_buffer_stack) = (struct yy_buffer_state**)zconfalloc + (num_to_alloc * sizeof(struct yy_buffer_state*) + ); + + memset((yy_buffer_stack), 0, num_to_alloc * sizeof(struct yy_buffer_state*)); + + (yy_buffer_stack_max) = num_to_alloc; + (yy_buffer_stack_top) = 0; + return; } + if ((yy_buffer_stack_top) >= ((yy_buffer_stack_max)) - 1){ -#ifndef YY_NO_SCAN_BUFFER -#ifdef YY_USE_PROTOS -YY_BUFFER_STATE yy_scan_buffer( char *base, yy_size_t size ) -#else -YY_BUFFER_STATE yy_scan_buffer( base, size ) -char *base; -yy_size_t size; -#endif - { - YY_BUFFER_STATE b; + /* Increase the buffer to prepare for a possible push. */ + int grow_size = 8 /* arbitrary grow size */; + num_to_alloc = (yy_buffer_stack_max) + grow_size; + (yy_buffer_stack) = (struct yy_buffer_state**)zconfrealloc + ((yy_buffer_stack), + num_to_alloc * sizeof(struct yy_buffer_state*) + ); + + /* zero only the new slots.*/ + memset((yy_buffer_stack) + (yy_buffer_stack_max), 0, grow_size * sizeof(struct yy_buffer_state*)); + (yy_buffer_stack_max) = num_to_alloc; + } +} + +/** Setup the input buffer state to scan directly from a user-specified character buffer. + * @param base the character buffer + * @param size the size in bytes of the character buffer + * + * @return the newly allocated buffer state object. + */ +YY_BUFFER_STATE zconf_scan_buffer (char * base, yy_size_t size ) +{ + YY_BUFFER_STATE b; + if ( size < 2 || base[size-2] != YY_END_OF_BUFFER_CHAR || base[size-1] != YY_END_OF_BUFFER_CHAR ) /* They forgot to leave room for the EOB's. */ return 0; - b = (YY_BUFFER_STATE) yy_flex_alloc( sizeof( struct yy_buffer_state ) ); + b = (YY_BUFFER_STATE) zconfalloc(sizeof( struct yy_buffer_state ) ); if ( ! b ) - YY_FATAL_ERROR( "out of dynamic memory in yy_scan_buffer()" ); + YY_FATAL_ERROR( "out of dynamic memory in zconf_scan_buffer()" ); b->yy_buf_size = size - 2; /* "- 2" to take care of EOB's */ b->yy_buf_pos = b->yy_ch_buf = base; @@ -2977,58 +3325,53 @@ b->yy_fill_buffer = 0; b->yy_buffer_status = YY_BUFFER_NEW; - yy_switch_to_buffer( b ); + zconf_switch_to_buffer(b ); return b; - } -#endif - - -#ifndef YY_NO_SCAN_STRING -#ifdef YY_USE_PROTOS -YY_BUFFER_STATE yy_scan_string( yyconst char *yy_str ) -#else -YY_BUFFER_STATE yy_scan_string( yy_str ) -yyconst char *yy_str; -#endif - { - int len; - for ( len = 0; yy_str[len]; ++len ) - ; - - return yy_scan_bytes( yy_str, len ); - } -#endif +} +/** Setup the input buffer state to scan a string. The next call to zconflex() will + * scan from a @e copy of @a str. + * @param str a NUL-terminated string to scan + * + * @return the newly allocated buffer state object. + * @note If you want to scan bytes that may contain NUL values, then use + * zconf_scan_bytes() instead. + */ +YY_BUFFER_STATE zconf_scan_string (yyconst char * str ) +{ + + return zconf_scan_bytes(str,strlen(str) ); +} -#ifndef YY_NO_SCAN_BYTES -#ifdef YY_USE_PROTOS -YY_BUFFER_STATE yy_scan_bytes( yyconst char *bytes, int len ) -#else -YY_BUFFER_STATE yy_scan_bytes( bytes, len ) -yyconst char *bytes; -int len; -#endif - { +/** Setup the input buffer state to scan the given bytes. The next call to zconflex() will + * scan from a @e copy of @a bytes. + * @param bytes the byte buffer to scan + * @param len the number of bytes in the buffer pointed to by @a bytes. + * + * @return the newly allocated buffer state object. + */ +YY_BUFFER_STATE zconf_scan_bytes (yyconst char * bytes, int len ) +{ YY_BUFFER_STATE b; char *buf; yy_size_t n; int i; - + /* Get memory for full buffer, including space for trailing EOB's. */ n = len + 2; - buf = (char *) yy_flex_alloc( n ); + buf = (char *) zconfalloc(n ); if ( ! buf ) - YY_FATAL_ERROR( "out of dynamic memory in yy_scan_bytes()" ); + YY_FATAL_ERROR( "out of dynamic memory in zconf_scan_bytes()" ); for ( i = 0; i < len; ++i ) buf[i] = bytes[i]; buf[len] = buf[len+1] = YY_END_OF_BUFFER_CHAR; - b = yy_scan_buffer( buf, n ); + b = zconf_scan_buffer(buf,n ); if ( ! b ) - YY_FATAL_ERROR( "bad buffer in yy_scan_bytes()" ); + YY_FATAL_ERROR( "bad buffer in zconf_scan_bytes()" ); /* It's okay to grow etc. this buffer, and we should throw it * away when we're done. @@ -3036,148 +3379,164 @@ b->yy_is_our_buffer = 1; return b; - } -#endif - +} -#ifndef YY_NO_PUSH_STATE -#ifdef YY_USE_PROTOS -static void yy_push_state( int new_state ) -#else -static void yy_push_state( new_state ) -int new_state; +#ifndef YY_EXIT_FAILURE +#define YY_EXIT_FAILURE 2 #endif - { - if ( yy_start_stack_ptr >= yy_start_stack_depth ) - { - yy_size_t new_size; - - yy_start_stack_depth += YY_START_STACK_INCR; - new_size = yy_start_stack_depth * sizeof( int ); - if ( ! yy_start_stack ) - yy_start_stack = (int *) yy_flex_alloc( new_size ); +static void yy_fatal_error (yyconst char* msg ) +{ + (void) fprintf( stderr, "%s\n", msg ); + exit( YY_EXIT_FAILURE ); +} - else - yy_start_stack = (int *) yy_flex_realloc( - (void *) yy_start_stack, new_size ); +/* Redefine yyless() so it works in section 3 code. */ - if ( ! yy_start_stack ) - YY_FATAL_ERROR( - "out of memory expanding start-condition stack" ); - } +#undef yyless +#define yyless(n) \ + do \ + { \ + /* Undo effects of setting up zconftext. */ \ + int yyless_macro_arg = (n); \ + YY_LESS_LINENO(yyless_macro_arg);\ + zconftext[zconfleng] = (yy_hold_char); \ + (yy_c_buf_p) = zconftext + yyless_macro_arg; \ + (yy_hold_char) = *(yy_c_buf_p); \ + *(yy_c_buf_p) = '\0'; \ + zconfleng = yyless_macro_arg; \ + } \ + while ( 0 ) - yy_start_stack[yy_start_stack_ptr++] = YY_START; +/* Accessor methods (get/set functions) to struct members. */ - BEGIN(new_state); - } -#endif +/** Get the current line number. + * + */ +int zconfget_lineno (void) +{ + + return zconflineno; +} +/** Get the input stream. + * + */ +FILE *zconfget_in (void) +{ + return zconfin; +} -#ifndef YY_NO_POP_STATE -static void yy_pop_state() - { - if ( --yy_start_stack_ptr < 0 ) - YY_FATAL_ERROR( "start-condition stack underflow" ); +/** Get the output stream. + * + */ +FILE *zconfget_out (void) +{ + return zconfout; +} - BEGIN(yy_start_stack[yy_start_stack_ptr]); - } -#endif +/** Get the length of the current token. + * + */ +int zconfget_leng (void) +{ + return zconfleng; +} +/** Get the current token. + * + */ -#ifndef YY_NO_TOP_STATE -static int yy_top_state() - { - return yy_start_stack[yy_start_stack_ptr - 1]; - } -#endif +char *zconfget_text (void) +{ + return zconftext; +} -#ifndef YY_EXIT_FAILURE -#define YY_EXIT_FAILURE 2 -#endif +/** Set the current line number. + * @param line_number + * + */ +void zconfset_lineno (int line_number ) +{ + + zconflineno = line_number; +} -#ifdef YY_USE_PROTOS -static void yy_fatal_error( yyconst char msg[] ) -#else -static void yy_fatal_error( msg ) -char msg[]; -#endif - { - (void) fprintf( stderr, "%s\n", msg ); - exit( YY_EXIT_FAILURE ); - } +/** Set the input stream. This does not discard the current + * input buffer. + * @param in_str A readable stream. + * + * @see zconf_switch_to_buffer + */ +void zconfset_in (FILE * in_str ) +{ + zconfin = in_str ; +} +void zconfset_out (FILE * out_str ) +{ + zconfout = out_str ; +} +int zconfget_debug (void) +{ + return zconf_flex_debug; +} -/* Redefine yyless() so it works in section 3 code. */ +void zconfset_debug (int bdebug ) +{ + zconf_flex_debug = bdebug ; +} -#undef yyless -#define yyless(n) \ - do \ - { \ - /* Undo effects of setting up yytext. */ \ - yytext[yyleng] = yy_hold_char; \ - yy_c_buf_p = yytext + n; \ - yy_hold_char = *yy_c_buf_p; \ - *yy_c_buf_p = '\0'; \ - yyleng = n; \ - } \ - while ( 0 ) +/* zconflex_destroy is for both reentrant and non-reentrant scanners. */ +int zconflex_destroy (void) +{ + + /* Pop the buffer stack, destroying each element. */ + while(YY_CURRENT_BUFFER){ + zconf_delete_buffer(YY_CURRENT_BUFFER ); + YY_CURRENT_BUFFER_LVALUE = NULL; + zconfpop_buffer_state(); + } + + /* Destroy the stack itself. */ + zconffree((yy_buffer_stack) ); + (yy_buffer_stack) = NULL; + return 0; +} -/* Internal utility routines. */ +/* + * Internal utility routines. + */ #ifndef yytext_ptr -#ifdef YY_USE_PROTOS -static void yy_flex_strncpy( char *s1, yyconst char *s2, int n ) -#else -static void yy_flex_strncpy( s1, s2, n ) -char *s1; -yyconst char *s2; -int n; -#endif - { +static void yy_flex_strncpy (char* s1, yyconst char * s2, int n ) +{ register int i; - for ( i = 0; i < n; ++i ) + for ( i = 0; i < n; ++i ) s1[i] = s2[i]; - } +} #endif #ifdef YY_NEED_STRLEN -#ifdef YY_USE_PROTOS -static int yy_flex_strlen( yyconst char *s ) -#else -static int yy_flex_strlen( s ) -yyconst char *s; -#endif - { +static int yy_flex_strlen (yyconst char * s ) +{ register int n; - for ( n = 0; s[n]; ++n ) + for ( n = 0; s[n]; ++n ) ; return n; - } +} #endif - -#ifdef YY_USE_PROTOS -static void *yy_flex_alloc( yy_size_t size ) -#else -static void *yy_flex_alloc( size ) -yy_size_t size; -#endif - { +void *zconfalloc (yy_size_t size ) +{ return (void *) malloc( size ); - } +} -#ifdef YY_USE_PROTOS -static void *yy_flex_realloc( void *ptr, yy_size_t size ) -#else -static void *yy_flex_realloc( ptr, size ) -void *ptr; -yy_size_t size; -#endif - { +void *zconfrealloc (void * ptr, yy_size_t size ) +{ /* The cast to (char *) in the following accommodates both * implementations that use char* generic pointers, and those * that use void* generic pointers. It works with the latter @@ -3186,24 +3545,26 @@ * as though doing an assignment. */ return (void *) realloc( (char *) ptr, size ); - } +} -#ifdef YY_USE_PROTOS -static void yy_flex_free( void *ptr ) -#else -static void yy_flex_free( ptr ) -void *ptr; -#endif - { - free( ptr ); - } +void zconffree (void * ptr ) +{ + free( (char *) ptr ); /* see zconfrealloc() for (char *) cast */ +} -#if YY_MAIN -int main() - { - yylex(); - return 0; - } +#define YYTABLES_NAME "yytables" + +#undef YY_NEW_FILE +#undef YY_FLUSH_BUFFER +#undef yy_set_bol +#undef yy_new_buffer +#undef yy_set_interactive +#undef yytext_ptr +#undef YY_DO_BEFORE_ACTION + +#ifdef YY_DECL_IS_OURS +#undef YY_DECL_IS_OURS +#undef YY_DECL #endif void zconf_starthelp(void) @@ -3216,11 +3577,10 @@ static void zconf_endhelp(void) { zconflval.string = text; - BEGIN(INITIAL); + BEGIN(INITIAL); } - -/* +/* * Try to open specified file with following names: * ./name * $(srctree)/name @@ -3246,8 +3606,8 @@ void zconf_initscan(const char *name) { - yyin = zconf_fopen(name); - if (!yyin) { + zconfin = zconf_fopen(name); + if (!zconfin) { printf("can't find file %s\n", name); exit(1); } @@ -3267,12 +3627,12 @@ memset(buf, 0, sizeof(*buf)); current_buf->state = YY_CURRENT_BUFFER; - yyin = zconf_fopen(name); - if (!yyin) { + zconfin = zconf_fopen(name); + if (!zconfin) { printf("%s:%d: can't open file \"%s\"\n", zconf_curname(), zconf_lineno(), name); exit(1); } - yy_switch_to_buffer(yy_create_buffer(yyin, YY_BUF_SIZE)); + zconf_switch_to_buffer(zconf_create_buffer(zconfin,YY_BUF_SIZE)); buf->parent = current_buf; current_buf = buf; @@ -3300,9 +3660,9 @@ parent = current_buf->parent; if (parent) { - fclose(yyin); - yy_delete_buffer(YY_CURRENT_BUFFER); - yy_switch_to_buffer(parent->state); + fclose(zconfin); + zconf_delete_buffer(YY_CURRENT_BUFFER); + zconf_switch_to_buffer(parent->state); } free(current_buf); current_buf = parent; @@ -3313,7 +3673,7 @@ int zconf_lineno(void) { if (current_buf) - return current_file->lineno; + return current_file->lineno - 1; else return 0; } @@ -3325,3 +3685,4 @@ else return ""; } + diff -urN linux-2.5.70-bk7/scripts/kconfig/lkc.h linux-2.5.70-bk8/scripts/kconfig/lkc.h --- linux-2.5.70-bk7/scripts/kconfig/lkc.h 2003-05-26 18:00:20.000000000 -0700 +++ linux-2.5.70-bk8/scripts/kconfig/lkc.h 2003-06-03 04:38:40.000000000 -0700 @@ -49,9 +49,11 @@ void menu_end_menu(void); void menu_add_entry(struct symbol *sym); void menu_end_entry(void); -struct property *create_prop(enum prop_type type); void menu_add_dep(struct expr *dep); -struct property *menu_add_prop(int token, char *prompt, struct symbol *def, struct expr *dep); +struct property *menu_add_prop(enum prop_type type, char *prompt, struct expr *expr, struct expr *dep); +void menu_add_prompt(enum prop_type type, char *prompt, struct expr *dep); +void menu_add_expr(enum prop_type type, struct expr *expr, struct expr *dep); +void menu_add_symbol(enum prop_type type, struct symbol *sym, struct expr *dep); void menu_finalize(struct menu *parent); void menu_set_type(int type); struct file *file_lookup(const char *name); @@ -64,16 +66,19 @@ void sym_init(void); void sym_clear_all_valid(void); void sym_set_changed(struct symbol *sym); +struct symbol *sym_check_deps(struct symbol *sym); +struct property *prop_alloc(enum prop_type type, struct symbol *sym); +struct symbol *prop_get_symbol(struct property *prop); static inline tristate sym_get_tristate_value(struct symbol *sym) { - return S_TRI(sym->curr); + return sym->curr.tri; } static inline struct symbol *sym_get_choice_value(struct symbol *sym) { - return (struct symbol *)S_VAL(sym->curr); + return (struct symbol *)sym->curr.val; } static inline bool sym_set_choice_value(struct symbol *ch, struct symbol *chval) @@ -98,7 +103,6 @@ static inline bool sym_has_value(struct symbol *sym) { - //return S_VAL(sym->def) != NULL; return sym->flags & SYMBOL_NEW ? false : true; } diff -urN linux-2.5.70-bk7/scripts/kconfig/lkc_proto.h linux-2.5.70-bk8/scripts/kconfig/lkc_proto.h --- linux-2.5.70-bk7/scripts/kconfig/lkc_proto.h 2003-05-26 18:00:37.000000000 -0700 +++ linux-2.5.70-bk8/scripts/kconfig/lkc_proto.h 2003-06-03 04:38:40.000000000 -0700 @@ -18,13 +18,14 @@ P(sym_lookup,struct symbol *,(const char *name, int isconst)); P(sym_find,struct symbol *,(const char *name)); -P(sym_type_name,const char *,(int type)); +P(sym_type_name,const char *,(enum symbol_type type)); P(sym_calc_value,void,(struct symbol *sym)); -P(sym_get_type,int,(struct symbol *sym)); +P(sym_get_type,enum symbol_type,(struct symbol *sym)); P(sym_tristate_within_range,bool,(struct symbol *sym,tristate tri)); P(sym_set_tristate_value,bool,(struct symbol *sym,tristate tri)); P(sym_toggle_tristate_value,tristate,(struct symbol *sym)); P(sym_string_valid,bool,(struct symbol *sym, const char *newval)); +P(sym_string_within_range,bool,(struct symbol *sym, const char *str)); P(sym_set_string_value,bool,(struct symbol *sym, const char *newval)); P(sym_is_changable,bool,(struct symbol *sym)); P(sym_get_choice_prop,struct property *,(struct symbol *sym)); diff -urN linux-2.5.70-bk7/scripts/kconfig/mconf.c linux-2.5.70-bk8/scripts/kconfig/mconf.c --- linux-2.5.70-bk7/scripts/kconfig/mconf.c 2003-05-26 18:00:26.000000000 -0700 +++ linux-2.5.70-bk8/scripts/kconfig/mconf.c 2003-06-03 04:38:40.000000000 -0700 @@ -384,7 +384,10 @@ switch (type) { case S_BOOLEAN: cprint("t%p", menu); - cprint1("[%c]", val == no ? ' ' : '*'); + if (sym_is_changable(sym)) + cprint1("[%c]", val == no ? ' ' : '*'); + else + cprint1("---"); break; case S_TRISTATE: cprint("t%p", menu); @@ -393,7 +396,10 @@ case mod: ch = 'M'; break; default: ch = ' '; break; } - cprint1("<%c>", ch); + if (sym_is_changable(sym)) + cprint1("<%c>", ch); + else + cprint1("---"); break; default: cprint("s%p", menu); @@ -402,13 +408,15 @@ if (tmp < 0) tmp = 0; cprint1("%*c%s%s", tmp, ' ', menu_get_prompt(menu), - sym_has_value(sym) ? "" : " (NEW)"); + (sym_has_value(sym) || !sym_is_changable(sym)) ? + "" : " (NEW)"); cprint_done(); goto conf_childs; } } cprint1("%*c%s%s", indent + 1, ' ', menu_get_prompt(menu), - sym_has_value(sym) ? "" : " (NEW)"); + (sym_has_value(sym) || !sym_is_changable(sym)) ? + "" : " (NEW)"); if (menu->prompt->type == P_MENU) { cprint1(" --->"); cprint_done(); @@ -780,10 +788,12 @@ conf_write(NULL); printf("\n\n" "*** End of Linux kernel configuration.\n" - "*** Check the top-level Makefile for additional configuration.\n" - "*** Next, you may run 'make bzImage', 'make bzdisk', or 'make install'.\n\n"); + "*** Execute 'make' to build the kernel or try 'make help'." + "\n\n"); } else - printf("\n\nYour kernel configuration changes were NOT saved.\n\n"); + printf("\n\n" + "Your kernel configuration changes were NOT saved." + "\n\n"); return 0; } diff -urN linux-2.5.70-bk7/scripts/kconfig/menu.c linux-2.5.70-bk8/scripts/kconfig/menu.c --- linux-2.5.70-bk7/scripts/kconfig/menu.c 2003-05-26 18:00:57.000000000 -0700 +++ linux-2.5.70-bk8/scripts/kconfig/menu.c 2003-06-03 04:38:40.000000000 -0700 @@ -94,56 +94,43 @@ sym->type = type; return; } - fprintf(stderr, "%s:%d: type of '%s' redefined from '%s' to '%s'\n", + fprintf(stderr, "%s:%d:warning: type of '%s' redefined from '%s' to '%s'\n", current_entry->file->name, current_entry->lineno, sym->name ? sym->name : "", sym_type_name(sym->type), sym_type_name(type)); } -struct property *create_prop(enum prop_type type) +struct property *menu_add_prop(enum prop_type type, char *prompt, struct expr *expr, struct expr *dep) { - struct property *prop; - - prop = malloc(sizeof(*prop)); - memset(prop, 0, sizeof(*prop)); - prop->type = type; - prop->file = current_file; - prop->lineno = zconf_lineno(); - - return prop; -} - -struct property *menu_add_prop(int token, char *prompt, struct symbol *def, struct expr *dep) -{ - struct property *prop = create_prop(token); - struct property **propp; + struct property *prop = prop_alloc(type, current_entry->sym); - prop->sym = current_entry->sym; prop->menu = current_entry; prop->text = prompt; - prop->def = def; - E_EXPR(prop->visible) = menu_check_dep(dep); + prop->expr = expr; + prop->visible.expr = menu_check_dep(dep); - if (prompt) + if (prompt) { + if (current_entry->prompt) + fprintf(stderr, "%s:%d: prompt redefined\n", + current_entry->file->name, current_entry->lineno); current_entry->prompt = prop; - - /* append property to the prop list of symbol */ - if (prop->sym) { - for (propp = &prop->sym->prop; *propp; propp = &(*propp)->next) - ; - *propp = prop; } return prop; } -void menu_add_prompt(int token, char *prompt, struct expr *dep) +void menu_add_prompt(enum prop_type type, char *prompt, struct expr *dep) { - current_entry->prompt = menu_add_prop(token, prompt, NULL, dep); + menu_add_prop(type, prompt, NULL, dep); } -void menu_add_default(int token, struct symbol *def, struct expr *dep) +void menu_add_expr(enum prop_type type, struct expr *expr, struct expr *dep) { - current_entry->prompt = menu_add_prop(token, NULL, def, dep); + menu_add_prop(type, NULL, expr, dep); +} + +void menu_add_symbol(enum prop_type type, struct symbol *sym, struct expr *dep) +{ + menu_add_prop(type, NULL, expr_alloc_symbol(sym), dep); } void menu_finalize(struct menu *parent) @@ -151,7 +138,7 @@ struct menu *menu, *last_menu; struct symbol *sym; struct property *prop; - struct expr *parentdep, *basedep, *dep, *dep2; + struct expr *parentdep, *basedep, *dep, *dep2, **ep; sym = parent->sym; if (parent->list) { @@ -168,7 +155,7 @@ } parentdep = expr_alloc_symbol(sym); } else if (parent->prompt) - parentdep = E_EXPR(parent->prompt->visible); + parentdep = parent->prompt->visible.expr; else parentdep = parent->dep; @@ -184,23 +171,28 @@ for (; prop; prop = prop->next) { if (prop->menu != menu) continue; - dep = expr_transform(E_EXPR(prop->visible)); + dep = expr_transform(prop->visible.expr); dep = expr_alloc_and(expr_copy(basedep), dep); dep = expr_eliminate_dups(dep); if (menu->sym && menu->sym->type != S_TRISTATE) dep = expr_trans_bool(dep); - E_EXPR(prop->visible) = dep; + prop->visible.expr = dep; + if (prop->type == P_SELECT) { + struct symbol *es = prop_get_symbol(prop); + es->rev_dep.expr = expr_alloc_or(es->rev_dep.expr, + expr_alloc_and(expr_alloc_symbol(menu->sym), expr_copy(dep))); + } } } for (menu = parent->list; menu; menu = menu->next) menu_finalize(menu); } else if (sym) { - basedep = parent->prompt ? E_EXPR(parent->prompt->visible) : NULL; + basedep = parent->prompt ? parent->prompt->visible.expr : NULL; basedep = expr_trans_compare(basedep, E_UNEQUAL, &symbol_no); basedep = expr_eliminate_dups(expr_transform(basedep)); last_menu = NULL; for (menu = parent->next; menu; menu = menu->next) { - dep = menu->prompt ? E_EXPR(menu->prompt->visible) : menu->dep; + dep = menu->prompt ? menu->prompt->visible.expr : menu->dep; if (!expr_contains_symbol(dep, sym)) break; if (expr_depends_symbol(dep, sym)) @@ -229,14 +221,20 @@ for (menu = parent->list; menu; menu = menu->next) { if (sym && sym_is_choice(sym) && menu->sym) { menu->sym->flags |= SYMBOL_CHOICEVAL; + for (prop = menu->sym->prop; prop; prop = prop->next) { + if (prop->type != P_DEFAULT) + continue; + fprintf(stderr, "%s:%d:warning: defaults for choice values not supported\n", + prop->file->name, prop->lineno); + } current_entry = menu; menu_set_type(sym->type); - menu_add_prop(P_CHOICE, NULL, parent->sym, NULL); - prop = sym_get_choice_prop(parent->sym); - //dep = expr_alloc_one(E_CHOICE, dep); - //dep->right.sym = menu->sym; - prop->dep = expr_alloc_one(E_CHOICE, prop->dep); - prop->dep->right.sym = menu->sym; + menu_add_symbol(P_CHOICE, sym, NULL); + prop = sym_get_choice_prop(sym); + for (ep = &prop->expr; *ep; ep = &(*ep)->left.expr) + ; + *ep = expr_alloc_one(E_CHOICE, NULL); + (*ep)->right.sym = menu->sym; } if (menu->list && (!menu->prompt || !menu->prompt->text)) { for (last_menu = menu->list; ; last_menu = last_menu->next) { @@ -249,20 +247,87 @@ menu->list = NULL; } } + + if (sym && !(sym->flags & SYMBOL_WARNED)) { + struct symbol *sym2; + if (sym->type == S_UNKNOWN) + fprintf(stderr, "%s:%d:warning: config symbol defined without type\n", + parent->file->name, parent->lineno); + + if (sym_is_choice(sym) && !parent->prompt) + fprintf(stderr, "%s:%d:warning: choice must have a prompt\n", + parent->file->name, parent->lineno); + + for (prop = sym->prop; prop; prop = prop->next) { + switch (prop->type) { + case P_DEFAULT: + if ((sym->type == S_STRING || sym->type == S_INT || sym->type == S_HEX) && + prop->expr->type != E_SYMBOL) + fprintf(stderr, "%s:%d:warning: default must be a single symbol\n", + prop->file->name, prop->lineno); + break; + case P_SELECT: + sym2 = prop_get_symbol(prop); + if ((sym->type != S_BOOLEAN && sym->type != S_TRISTATE) || + (sym2->type != S_BOOLEAN && sym2->type != S_TRISTATE)) + fprintf(stderr, "%s:%d:warning: enable is only allowed with boolean and tristate symbols\n", + prop->file->name, prop->lineno); + break; + case P_RANGE: + if (sym->type != S_INT && sym->type != S_HEX) + fprintf(stderr, "%s:%d:warning: range is only allowed for int or hex symbols\n", + prop->file->name, prop->lineno); + if (!sym_string_valid(sym, prop->expr->left.sym->name) || + !sym_string_valid(sym, prop->expr->right.sym->name)) + fprintf(stderr, "%s:%d:warning: range is invalid\n", + prop->file->name, prop->lineno); + break; + default: + ; + } + } + sym->flags |= SYMBOL_WARNED; + } + + if (sym && !sym_is_optional(sym) && parent->prompt) { + sym->rev_dep.expr = expr_alloc_or(sym->rev_dep.expr, + expr_alloc_and(parent->prompt->visible.expr, + expr_alloc_symbol(&symbol_mod))); + } } bool menu_is_visible(struct menu *menu) { + struct menu *child; + struct symbol *sym; tristate visible; if (!menu->prompt) return false; - if (menu->sym) { - sym_calc_value(menu->sym); - visible = E_TRI(menu->prompt->visible); + sym = menu->sym; + if (sym) { + sym_calc_value(sym); + visible = menu->prompt->visible.tri; } else - visible = E_CALC(menu->prompt->visible); - return visible != no; + visible = menu->prompt->visible.tri = expr_calc_value(menu->prompt->visible.expr); + + if (sym && sym_is_choice(sym)) { + for (child = menu->list; child; child = child->next) + if (menu_is_visible(child)) + break; + if (!child) + return false; + } + + if (visible != no) + return true; + if (!sym || sym_get_tristate_value(menu->sym) == no) + return false; + + for (child = menu->list; child; child = child->next) + if (menu_is_visible(child)) + return true; + return false; } const char *menu_get_prompt(struct menu *menu) @@ -285,7 +350,7 @@ for (; menu != &rootmenu; menu = menu->parent) { type = menu->prompt ? menu->prompt->type : 0; - if (type == P_MENU || type == P_ROOTMENU) + if (type == P_MENU) break; } return menu; diff -urN linux-2.5.70-bk7/scripts/kconfig/qconf.cc linux-2.5.70-bk8/scripts/kconfig/qconf.cc --- linux-2.5.70-bk7/scripts/kconfig/qconf.cc 2003-05-26 18:00:21.000000000 -0700 +++ linux-2.5.70-bk8/scripts/kconfig/qconf.cc 2003-06-03 04:38:40.000000000 -0700 @@ -65,11 +65,11 @@ switch (mode) { case menuMode: - if (type != P_ROOTMENU) + if (!(child->flags & MENU_ROOT)) goto hide; break; case symbolMode: - if (type == P_ROOTMENU) + if (child->flags & MENU_ROOT) goto hide; break; default: @@ -83,8 +83,7 @@ else item->testUpdateMenu(visible); - if (mode == fullMode || mode == menuMode || - (type != P_MENU && type != P_ROOTMENU)) + if (mode == fullMode || mode == menuMode || type != P_MENU) updateMenuList(item, child); else updateMenuList(item, 0); @@ -140,7 +139,6 @@ if (prop) switch (prop->type) { case P_MENU: - case P_ROOTMENU: if (list->mode == singleMode || list->mode == symbolMode) { /* a menuconfig entry is displayed differently * depending whether it's at the view root or a child. @@ -172,6 +170,7 @@ char ch; if (!sym_is_changable(sym) && !list->showAll) { + setPixmap(promptColIdx, 0); setText(noColIdx, 0); setText(modColIdx, 0); setText(yesColIdx, 0); @@ -288,7 +287,7 @@ ConfigItem::~ConfigItem(void) { if (menu) { - ConfigItem** ip = &(ConfigItem*)menu->data; + ConfigItem** ip = (ConfigItem**)&menu->data; for (; *ip; ip = &(*ip)->nextItem) { if (*ip == this) { *ip = nextItem; @@ -333,7 +332,7 @@ updateAll(false), symbolYesPix(xpm_symbol_yes), symbolModPix(xpm_symbol_mod), symbolNoPix(xpm_symbol_no), choiceYesPix(xpm_choice_yes), choiceNoPix(xpm_choice_no), - menuPix(xpm_menu), menuInvPix(xpm_menu_inv), menuBackPix(xpm_menuback), + menuPix(xpm_menu), menuInvPix(xpm_menu_inv), menuBackPix(xpm_menuback), voidPix(xpm_void), showAll(false), showName(false), showRange(false), showData(false), rootEntry(0) { @@ -392,7 +391,7 @@ if (!menu) return; type = menu->prompt ? menu->prompt->type : P_UNKNOWN; - if (mode == menuMode && (type == P_MENU || type == P_ROOTMENU)) + if (mode == menuMode && type == P_MENU) emit menuSelected(menu); } @@ -403,7 +402,8 @@ if (!rootEntry) goto update; - if ((mode == singleMode || mode == symbolMode) && rootEntry != &rootmenu) { + if (rootEntry != &rootmenu && (mode == singleMode || + (mode == symbolMode && rootEntry->parent != &rootmenu))) { item = firstChild(); if (!item) item = new ConfigItem(this, 0, true); @@ -507,7 +507,7 @@ if (rootEntry == menu) return; type = menu && menu->prompt ? menu->prompt->type : P_UNKNOWN; - if (type != P_MENU && type != P_ROOTMENU) + if (type != P_MENU) return; updateMenuList(this, 0); rootEntry = menu; @@ -518,13 +518,12 @@ void ConfigList::setParentMenu(void) { ConfigItem* item; - struct menu *oldroot, *newroot; + struct menu *oldroot; oldroot = rootEntry; - newroot = menu_get_parent_menu(oldroot); - if (newroot == oldroot) + if (rootEntry == &rootmenu) return; - setRootMenu(newroot); + setRootMenu(menu_get_parent_menu(rootEntry->parent)); QListViewItemIterator it(this); for (; (item = (ConfigItem*)it.current()); it++) { @@ -566,7 +565,8 @@ if (!menu) break; type = menu->prompt ? menu->prompt->type : P_UNKNOWN; - if ((type == P_MENU || type == P_ROOTMENU) && mode != fullMode) { + if (type == P_MENU && rootEntry != menu && + mode != fullMode && mode != menuMode) { emit menuSelected(menu); break; } @@ -601,6 +601,7 @@ QPoint p(contentsToViewport(e->pos())); ConfigItem* item = (ConfigItem*)itemAt(p); struct menu *menu; + enum prop_type ptype; const QPixmap* pm; int idx, x; @@ -617,14 +618,17 @@ int off = header()->sectionPos(0) + itemMargin() + treeStepSize() * (item->depth() + (rootIsDecorated() ? 1 : 0)); if (x >= off && x < off + pm->width()) { - if (item->goParent) + if (item->goParent) { emit parentSelected(); - else if (!menu) break; - else if (menu->sym) - changeValue(item); - else + } else if (!menu) + break; + ptype = menu->prompt ? menu->prompt->type : P_UNKNOWN; + if (ptype == P_MENU && rootEntry != menu && + mode != fullMode && mode != menuMode) emit menuSelected(menu); + else + changeValue(item); } } break; @@ -671,8 +675,7 @@ if (!menu) goto skip; ptype = menu->prompt ? menu->prompt->type : P_UNKNOWN; - if ((ptype == P_ROOTMENU || ptype == P_MENU) && - (mode == singleMode || mode == symbolMode)) + if (ptype == P_MENU && (mode == singleMode || mode == symbolMode)) emit menuSelected(menu); else if (menu->sym) changeValue(item); @@ -880,7 +883,6 @@ connect(menuList, SIGNAL(gotFocus(void)), SLOT(listFocusChanged(void))); - //showFullView(); showSplitView(); } @@ -959,36 +961,54 @@ if (showDebug) { debug += "type: "; debug += print_filter(sym_type_name(sym->type)); + if (sym_is_choice(sym)) + debug += " (choice)"; debug += "
"; + if (sym->rev_dep.expr) { + debug += "reverse dep: "; + expr_print(sym->rev_dep.expr, expr_print_help, &debug, E_NONE); + debug += "
"; + } for (struct property *prop = sym->prop; prop; prop = prop->next) { switch (prop->type) { case P_PROMPT: + case P_MENU: debug += "prompt: "; debug += print_filter(prop->text); debug += "
"; - if (prop->visible.expr) { - debug += "  dep: "; - expr_print(prop->visible.expr, expr_print_help, &debug, E_NONE); - debug += "
"; - } break; case P_DEFAULT: debug += "default: "; - debug += print_filter(prop->def->name); + expr_print(prop->expr, expr_print_help, &debug, E_NONE); debug += "
"; - if (prop->visible.expr) { - debug += "  dep: "; - expr_print(prop->visible.expr, expr_print_help, &debug, E_NONE); + break; + case P_CHOICE: + if (sym_is_choice(sym)) { + debug += "choice: "; + expr_print(prop->expr, expr_print_help, &debug, E_NONE); debug += "
"; } break; - case P_CHOICE: + case P_SELECT: + debug += "select: "; + expr_print(prop->expr, expr_print_help, &debug, E_NONE); + debug += "
"; + break; + case P_RANGE: + debug += "range: "; + expr_print(prop->expr, expr_print_help, &debug, E_NONE); + debug += "
"; break; default: debug += "unknown property: "; debug += prop_get_type_name(prop->type); debug += "
"; } + if (prop->visible.expr) { + debug += "    dep: "; + expr_print(prop->visible.expr, expr_print_help, &debug, E_NONE); + debug += "
"; + } } debug += "
"; } @@ -1002,10 +1022,12 @@ if (menu->prompt->visible.expr) { debug += "  dep: "; expr_print(menu->prompt->visible.expr, expr_print_help, &debug, E_NONE); - debug += "
"; + debug += "

"; } } } + if (showDebug) + debug += QString().sprintf("defined at %s:%d

", menu->file->name, menu->lineno); helpText->setText(head + debug + help); } @@ -1133,6 +1155,8 @@ return; configList->showName = b; configList->reinit(); + menuList->showName = b; + menuList->reinit(); } void ConfigMainWindow::setShowRange(bool b) @@ -1141,6 +1165,8 @@ return; configList->showRange = b; configList->reinit(); + menuList->showRange = b; + menuList->reinit(); } void ConfigMainWindow::setShowData(bool b) @@ -1149,6 +1175,8 @@ return; configList->showData = b; configList->reinit(); + menuList->showData = b; + menuList->reinit(); } /* @@ -1206,12 +1234,25 @@ void fixup_rootmenu(struct menu *menu) { struct menu *child; + static int menu_cnt = 0; - if (!menu->prompt || menu->prompt->type != P_MENU) - return; - menu->prompt->type = P_ROOTMENU; - for (child = menu->list; child; child = child->next) - fixup_rootmenu(child); + menu->flags |= MENU_ROOT; + for (child = menu->list; child; child = child->next) { + if (child->prompt && child->prompt->type == P_MENU) { + menu_cnt++; + fixup_rootmenu(child); + menu_cnt--; + } else if (!menu_cnt) + fixup_rootmenu(child); + } +} + +static const char *progname; + +static void usage(void) +{ + printf("%s \n", progname); + exit(0); } int main(int ac, char** av) @@ -1223,23 +1264,23 @@ kconfig_load(); #endif + progname = av[0]; configApp = new QApplication(ac, av); #if QT_VERSION >= 300 configSettings = new QSettings; #endif if (ac > 1 && av[1][0] == '-') { switch (av[1][1]) { - case 'a': - //showAll = 1; - break; case 'h': case '?': - printf("%s \n", av[0]); - exit(0); + usage(); } name = av[2]; } else name = av[1]; + if (!name) + usage(); + conf_parse(name); fixup_rootmenu(&rootmenu); conf_read(NULL); diff -urN linux-2.5.70-bk7/scripts/kconfig/qconf.h linux-2.5.70-bk8/scripts/kconfig/qconf.h --- linux-2.5.70-bk7/scripts/kconfig/qconf.h 2003-05-26 18:00:39.000000000 -0700 +++ linux-2.5.70-bk8/scripts/kconfig/qconf.h 2003-06-03 04:38:40.000000000 -0700 @@ -108,7 +108,7 @@ QPixmap symbolYesPix, symbolModPix, symbolNoPix; QPixmap choiceYesPix, choiceNoPix; - QPixmap menuPix, menuInvPix, menuBackPix; + QPixmap menuPix, menuInvPix, menuBackPix, voidPix; bool showAll, showName, showRange, showData; enum listMode mode; diff -urN linux-2.5.70-bk7/scripts/kconfig/symbol.c linux-2.5.70-bk8/scripts/kconfig/symbol.c --- linux-2.5.70-bk7/scripts/kconfig/symbol.c 2003-05-26 18:00:26.000000000 -0700 +++ linux-2.5.70-bk8/scripts/kconfig/symbol.c 2003-06-03 04:38:40.000000000 -0700 @@ -34,18 +34,9 @@ void sym_add_default(struct symbol *sym, const char *def) { - struct property *prop = create_prop(P_DEFAULT); - struct property **propp; - - prop->sym = sym; - prop->def = sym_lookup(def, 1); + struct property *prop = prop_alloc(P_DEFAULT, sym); - /* append property to the prop list of symbol */ - if (prop->sym) { - for (propp = &prop->sym->prop; *propp; propp = &(*propp)->next) - ; - *propp = prop; - } + prop->expr = expr_alloc_symbol(sym_lookup(def, 1)); } void sym_init(void) @@ -81,22 +72,23 @@ sym_add_default(sym, uts.release); } -int sym_get_type(struct symbol *sym) +enum symbol_type sym_get_type(struct symbol *sym) { - int type = sym->type; + enum symbol_type type = sym->type; + if (type == S_TRISTATE) { if (sym_is_choice_value(sym) && sym->visible == yes) type = S_BOOLEAN; else { sym_calc_value(modules_sym); - if (S_TRI(modules_sym->curr) == no) + if (modules_sym->curr.tri == no) type = S_BOOLEAN; } } return type; } -const char *sym_type_name(int type) +const char *sym_type_name(enum symbol_type type) { switch (type) { case S_BOOLEAN: @@ -111,6 +103,8 @@ return "string"; case S_UNKNOWN: return "unknown"; + case S_OTHER: + break; } return "???"; } @@ -127,37 +121,93 @@ struct property *sym_get_default_prop(struct symbol *sym) { struct property *prop; - tristate visible; for_all_defaults(sym, prop) { - visible = E_CALC(prop->visible); - if (visible != no) + prop->visible.tri = expr_calc_value(prop->visible.expr); + if (prop->visible.tri != no) + return prop; + } + return NULL; +} + +struct property *sym_get_range_prop(struct symbol *sym) +{ + struct property *prop; + + for_all_properties(sym, prop, P_RANGE) { + prop->visible.tri = expr_calc_value(prop->visible.expr); + if (prop->visible.tri != no) return prop; } return NULL; } -void sym_calc_visibility(struct symbol *sym) +static void sym_calc_visibility(struct symbol *sym) { struct property *prop; - tristate visible, oldvisible; + tristate tri; /* any prompt visible? */ - oldvisible = sym->visible; - visible = no; - for_all_prompts(sym, prop) - visible = E_OR(visible, E_CALC(prop->visible)); - if (oldvisible != visible) { - sym->visible = visible; + tri = no; + for_all_prompts(sym, prop) { + prop->visible.tri = expr_calc_value(prop->visible.expr); + tri = E_OR(tri, prop->visible.tri); + } + if (sym->visible != tri) { + sym->visible = tri; + sym_set_changed(sym); + } + if (sym_is_choice_value(sym)) + return; + tri = no; + if (sym->rev_dep.expr) + tri = expr_calc_value(sym->rev_dep.expr); + if (sym->rev_dep.tri != tri) { + sym->rev_dep.tri = tri; sym_set_changed(sym); } } +static struct symbol *sym_calc_choice(struct symbol *sym) +{ + struct symbol *def_sym; + struct property *prop; + struct expr *e; + + /* is the user choice visible? */ + def_sym = sym->user.val; + if (def_sym) { + sym_calc_visibility(def_sym); + if (def_sym->visible != no) + return def_sym; + } + + /* any of the defaults visible? */ + for_all_defaults(sym, prop) { + prop->visible.tri = expr_calc_value(prop->visible.expr); + if (prop->visible.tri == no) + continue; + def_sym = prop_get_symbol(prop); + sym_calc_visibility(def_sym); + if (def_sym->visible != no) + return def_sym; + } + + /* just get the first visible value */ + prop = sym_get_choice_prop(sym); + for (e = prop->expr; e; e = e->left.expr) { + def_sym = e->right.sym; + sym_calc_visibility(def_sym); + if (def_sym->visible != no) + return def_sym; + } + return NULL; +} + void sym_calc_value(struct symbol *sym) { struct symbol_value newval, oldval; - struct property *prop, *def_prop; - struct symbol *def_sym; + struct property *prop; struct expr *e; if (!sym) @@ -165,6 +215,7 @@ if (sym->flags & SYMBOL_VALID) return; + sym->flags |= SYMBOL_VALID; oldval = sym->curr; @@ -179,17 +230,10 @@ newval = symbol_no.curr; break; default: - S_VAL(newval) = sym->name; - S_TRI(newval) = no; - if (sym->flags & SYMBOL_CONST) { - goto out; - } - //newval = symbol_empty.curr; - // generate warning somewhere here later - //S_TRI(newval) = yes; - goto out; + sym->curr.val = sym->name; + sym->curr.tri = no; + return; } - sym->flags |= SYMBOL_VALID; if (!sym_is_choice_value(sym)) sym->flags &= ~SYMBOL_WRITE; @@ -198,95 +242,71 @@ /* set default if recursively called */ sym->curr = newval; - if (sym->visible != no) { - sym->flags |= SYMBOL_WRITE; - if (!sym_has_value(sym)) { - if (!sym_is_choice(sym)) { - prop = sym_get_default_prop(sym); - if (prop) { - sym_calc_value(prop->def); - newval = prop->def->curr; - } - } else - S_TRI(newval) = S_TRI(sym->def); - } else - newval = sym->def; - - S_TRI(newval) = E_AND(S_TRI(newval), sym->visible); - /* if the symbol is visible and not optionial, - * possibly ignore old user choice. */ - if (!sym_is_optional(sym) && S_TRI(newval) == no) - S_TRI(newval) = sym->visible; + switch (sym_get_type(sym)) { + case S_BOOLEAN: + case S_TRISTATE: if (sym_is_choice_value(sym) && sym->visible == yes) { prop = sym_get_choice_prop(sym); - S_TRI(newval) = (S_VAL(prop->def->curr) == sym) ? yes : no; - } - } else { - prop = sym_get_default_prop(sym); - if (prop) { + newval.tri = (prop_get_symbol(prop)->curr.val == sym) ? yes : no; + } else if (E_OR(sym->visible, sym->rev_dep.tri) != no) { sym->flags |= SYMBOL_WRITE; - sym_calc_value(prop->def); - newval = prop->def->curr; + if (sym_has_value(sym)) + newval.tri = sym->user.tri; + else if (!sym_is_choice(sym)) { + prop = sym_get_default_prop(sym); + if (prop) + newval.tri = expr_calc_value(prop->expr); + } + newval.tri = E_OR(E_AND(newval.tri, sym->visible), sym->rev_dep.tri); + } else if (!sym_is_choice(sym)) { + prop = sym_get_default_prop(sym); + if (prop) { + sym->flags |= SYMBOL_WRITE; + newval.tri = expr_calc_value(prop->expr); + } + } + if (sym_get_type(sym) == S_BOOLEAN) { + if (newval.tri == mod) + newval.tri = yes; + if (sym->rev_dep.tri == mod) + sym->rev_dep.tri = yes; } - } - - switch (sym_get_type(sym)) { - case S_TRISTATE: - if (S_TRI(newval) != mod) - break; - sym_calc_value(modules_sym); - if (S_TRI(modules_sym->curr) == no) - S_TRI(newval) = yes; break; - case S_BOOLEAN: - if (S_TRI(newval) == mod) - S_TRI(newval) = yes; - } - -out: - sym->curr = newval; - - if (sym_is_choice(sym) && S_TRI(newval) == yes) { - def_sym = S_VAL(sym->def); - if (def_sym) { - sym_calc_visibility(def_sym); - if (def_sym->visible == no) - def_sym = NULL; - } - if (!def_sym) { - for_all_defaults(sym, def_prop) { - if (E_CALC(def_prop->visible) == no) - continue; - sym_calc_visibility(def_prop->def); - if (def_prop->def->visible != no) { - def_sym = def_prop->def; - break; - } + case S_STRING: + case S_HEX: + case S_INT: + if (sym->visible != no) { + sym->flags |= SYMBOL_WRITE; + if (sym_has_value(sym)) { + newval.val = sym->user.val; + break; } } - - if (!def_sym) { - prop = sym_get_choice_prop(sym); - for (e = prop->dep; e; e = e->left.expr) { - sym_calc_visibility(e->right.sym); - if (e->right.sym->visible != no) { - def_sym = e->right.sym; - break; - } + prop = sym_get_default_prop(sym); + if (prop) { + struct symbol *ds = prop_get_symbol(prop); + if (ds) { + sym->flags |= SYMBOL_WRITE; + sym_calc_value(ds); + newval.val = ds->curr.val; } } - - S_VAL(newval) = def_sym; + break; + default: + ; } - if (memcmp(&oldval, &newval, sizeof(newval))) - sym_set_changed(sym); sym->curr = newval; + if (sym_is_choice(sym) && newval.tri == yes) + sym->curr.val = sym_calc_choice(sym); + + if (memcmp(&oldval, &sym->curr, sizeof(oldval))) + sym_set_changed(sym); if (sym_is_choice(sym)) { int flags = sym->flags & (SYMBOL_CHANGED | SYMBOL_WRITE); prop = sym_get_choice_prop(sym); - for (e = prop->dep; e; e = e->left.expr) { + for (e = prop->expr; e; e = e->left.expr) { e->right.sym->flags |= flags; if (flags & SYMBOL_CHANGED) sym_set_changed(e->right.sym); @@ -334,19 +354,13 @@ if (type != S_BOOLEAN && type != S_TRISTATE) return false; - switch (val) { - case no: - if (sym_is_choice_value(sym) && sym->visible == yes) - return false; - return sym_is_optional(sym); - case mod: - if (sym_is_choice_value(sym) && sym->visible == yes) - return false; - return type == S_TRISTATE; - case yes: - return type == S_BOOLEAN || sym->visible == yes; - } - return false; + if (type == S_BOOLEAN && val == mod) + return false; + if (sym->visible <= sym->rev_dep.tri) + return false; + if (sym_is_choice_value(sym) && sym->visible == yes) + return val == yes; + return val >= sym->rev_dep.tri && val <= sym->visible; } bool sym_set_tristate_value(struct symbol *sym, tristate val) @@ -361,13 +375,13 @@ sym_set_changed(sym); } if (sym_is_choice_value(sym) && val == yes) { - struct property *prop = sym_get_choice_prop(sym); + struct symbol *cs = prop_get_symbol(sym_get_choice_prop(sym)); - S_VAL(prop->def->def) = sym; - prop->def->flags &= ~SYMBOL_NEW; + cs->user.val = sym; + cs->flags &= ~SYMBOL_NEW; } - S_TRI(sym->def) = val; + sym->user.tri = val; if (oldval != val) { sym_clear_all_valid(); if (sym == modules_sym) @@ -432,14 +446,51 @@ case S_BOOLEAN: case S_TRISTATE: switch (str[0]) { - case 'y': - case 'Y': + case 'y': case 'Y': + case 'm': case 'M': + case 'n': case 'N': + return true; + } + return false; + default: + return false; + } +} + +bool sym_string_within_range(struct symbol *sym, const char *str) +{ + struct property *prop; + int val; + + switch (sym->type) { + case S_STRING: + return sym_string_valid(sym, str); + case S_INT: + if (!sym_string_valid(sym, str)) + return false; + prop = sym_get_range_prop(sym); + if (!prop) + return true; + val = strtol(str, NULL, 10); + return val >= strtol(prop->expr->left.sym->name, NULL, 10) && + val <= strtol(prop->expr->right.sym->name, NULL, 10); + case S_HEX: + if (!sym_string_valid(sym, str)) + return false; + prop = sym_get_range_prop(sym); + if (!prop) + return true; + val = strtol(str, NULL, 16); + return val >= strtol(prop->expr->left.sym->name, NULL, 16) && + val <= strtol(prop->expr->right.sym->name, NULL, 16); + case S_BOOLEAN: + case S_TRISTATE: + switch (str[0]) { + case 'y': case 'Y': return sym_tristate_within_range(sym, yes); - case 'm': - case 'M': + case 'm': case 'M': return sym_tristate_within_range(sym, mod); - case 'n': - case 'N': + case 'n': case 'N': return sym_tristate_within_range(sym, no); } return false; @@ -458,14 +509,11 @@ case S_BOOLEAN: case S_TRISTATE: switch (newval[0]) { - case 'y': - case 'Y': + case 'y': case 'Y': return sym_set_tristate_value(sym, yes); - case 'm': - case 'M': + case 'm': case 'M': return sym_set_tristate_value(sym, mod); - case 'n': - case 'N': + case 'n': case 'N': return sym_set_tristate_value(sym, no); } return false; @@ -473,7 +521,7 @@ ; } - if (!sym_string_valid(sym, newval)) + if (!sym_string_within_range(sym, newval)) return false; if (sym->flags & SYMBOL_NEW) { @@ -481,15 +529,15 @@ sym_set_changed(sym); } - oldval = S_VAL(sym->def); + oldval = sym->user.val; size = strlen(newval) + 1; if (sym->type == S_HEX && (newval[0] != '0' || (newval[1] != 'x' && newval[1] != 'X'))) { size += 2; - S_VAL(sym->def) = val = malloc(size); + sym->user.val = val = malloc(size); *val++ = '0'; *val++ = 'x'; } else if (!oldval || strcmp(oldval, newval)) - S_VAL(sym->def) = val = malloc(size); + sym->user.val = val = malloc(size); else return true; @@ -520,20 +568,12 @@ default: ; } - return (const char *)S_VAL(sym->curr); + return (const char *)sym->curr.val; } bool sym_is_changable(struct symbol *sym) { - if (sym->visible == no) - return false; - /* at least 'n' and 'y'/'m' is selectable */ - if (sym_is_optional(sym)) - return true; - /* no 'n', so 'y' and 'm' must be selectable */ - if (sym_get_type(sym) == S_TRISTATE && sym->visible == yes) - return true; - return false; + return sym->visible > sym->rev_dep.tri; } struct symbol *sym_lookup(const char *name, int isconst) @@ -611,6 +651,104 @@ return symbol; } +struct symbol *sym_check_deps(struct symbol *sym); + +static struct symbol *sym_check_expr_deps(struct expr *e) +{ + struct symbol *sym; + + if (!e) + return NULL; + switch (e->type) { + case E_OR: + case E_AND: + sym = sym_check_expr_deps(e->left.expr); + if (sym) + return sym; + return sym_check_expr_deps(e->right.expr); + case E_NOT: + return sym_check_expr_deps(e->left.expr); + case E_EQUAL: + case E_UNEQUAL: + sym = sym_check_deps(e->left.sym); + if (sym) + return sym; + return sym_check_deps(e->right.sym); + case E_SYMBOL: + return sym_check_deps(e->left.sym); + default: + break; + } + printf("Oops! How to check %d?\n", e->type); + return NULL; +} + +struct symbol *sym_check_deps(struct symbol *sym) +{ + struct symbol *sym2; + struct property *prop; + + if (sym->flags & SYMBOL_CHECK_DONE) + return NULL; + if (sym->flags & SYMBOL_CHECK) { + printf("Warning! Found recursive dependency: %s", sym->name); + return sym; + } + + sym->flags |= (SYMBOL_CHECK | SYMBOL_CHECKED); + sym2 = sym_check_expr_deps(sym->rev_dep.expr); + if (sym2) + goto out; + + for (prop = sym->prop; prop; prop = prop->next) { + if (prop->type == P_CHOICE) + continue; + sym2 = sym_check_expr_deps(prop->visible.expr); + if (sym2) + goto out; + if (prop->type != P_DEFAULT || sym_is_choice(sym)) + continue; + sym2 = sym_check_expr_deps(prop->expr); + if (sym2) + goto out; + } +out: + if (sym2) + printf(" %s", sym->name); + sym->flags &= ~SYMBOL_CHECK; + return sym2; +} + +struct property *prop_alloc(enum prop_type type, struct symbol *sym) +{ + struct property *prop; + struct property **propp; + + prop = malloc(sizeof(*prop)); + memset(prop, 0, sizeof(*prop)); + prop->type = type; + prop->sym = sym; + prop->file = current_file; + prop->lineno = zconf_lineno(); + + /* append property to the prop list of symbol */ + if (sym) { + for (propp = &sym->prop; *propp; propp = &(*propp)->next) + ; + *propp = prop; + } + + return prop; +} + +struct symbol *prop_get_symbol(struct property *prop) +{ + if (prop->expr && (prop->expr->type == E_SYMBOL || + prop->expr->type == E_CHOICE)) + return prop->expr->left.sym; + return NULL; +} + const char *prop_get_type_name(enum prop_type type) { switch (type) { @@ -620,13 +758,16 @@ return "comment"; case P_MENU: return "menu"; - case P_ROOTMENU: - return "rootmenu"; case P_DEFAULT: return "default"; case P_CHOICE: return "choice"; - default: - return "unknown"; + case P_SELECT: + return "select"; + case P_RANGE: + return "range"; + case P_UNKNOWN: + break; } + return "unknown"; } diff -urN linux-2.5.70-bk7/scripts/kconfig/zconf.l linux-2.5.70-bk8/scripts/kconfig/zconf.l --- linux-2.5.70-bk7/scripts/kconfig/zconf.l 2003-05-26 18:00:45.000000000 -0700 +++ linux-2.5.70-bk8/scripts/kconfig/zconf.l 2003-06-03 04:38:40.000000000 -0700 @@ -106,11 +106,17 @@ "default" BEGIN(PARAM); return T_DEFAULT; "prompt" BEGIN(PARAM); return T_PROMPT; "tristate" BEGIN(PARAM); return T_TRISTATE; + "def_tristate" BEGIN(PARAM); return T_DEF_TRISTATE; "bool" BEGIN(PARAM); return T_BOOLEAN; "boolean" BEGIN(PARAM); return T_BOOLEAN; + "def_bool" BEGIN(PARAM); return T_DEF_BOOLEAN; + "def_boolean" BEGIN(PARAM); return T_DEF_BOOLEAN; "int" BEGIN(PARAM); return T_INT; "hex" BEGIN(PARAM); return T_HEX; "string" BEGIN(PARAM); return T_STRING; + "select" BEGIN(PARAM); return T_SELECT; + "enable" BEGIN(PARAM); return T_SELECT; + "range" BEGIN(PARAM); return T_RANGE; {n}+ { alloc_string(yytext, yyleng); zconflval.string = text; @@ -208,7 +214,6 @@ } append_string(" ", ts); } - } [ \t]*\n/[^ \t\n] { current_file->lineno++; @@ -250,11 +255,11 @@ static void zconf_endhelp(void) { zconflval.string = text; - BEGIN(INITIAL); + BEGIN(INITIAL); } -/* +/* * Try to open specified file with following names: * ./name * $(srctree)/name @@ -347,7 +352,7 @@ int zconf_lineno(void) { if (current_buf) - return current_file->lineno; + return current_file->lineno - 1; else return 0; } diff -urN linux-2.5.70-bk7/scripts/kconfig/zconf.tab.c_shipped linux-2.5.70-bk8/scripts/kconfig/zconf.tab.c_shipped --- linux-2.5.70-bk7/scripts/kconfig/zconf.tab.c_shipped 2003-05-26 18:00:47.000000000 -0700 +++ linux-2.5.70-bk8/scripts/kconfig/zconf.tab.c_shipped 2003-06-03 04:38:40.000000000 -0700 @@ -81,22 +81,26 @@ T_PROMPT = 274, T_DEFAULT = 275, T_TRISTATE = 276, - T_BOOLEAN = 277, - T_STRING = 278, - T_INT = 279, - T_HEX = 280, - T_WORD = 281, - T_WORD_QUOTE = 282, - T_UNEQUAL = 283, - T_EOF = 284, - T_EOL = 285, - T_CLOSE_PAREN = 286, - T_OPEN_PAREN = 287, - T_ON = 288, - T_OR = 289, - T_AND = 290, - T_EQUAL = 291, - T_NOT = 292 + T_DEF_TRISTATE = 277, + T_BOOLEAN = 278, + T_DEF_BOOLEAN = 279, + T_STRING = 280, + T_INT = 281, + T_HEX = 282, + T_WORD = 283, + T_WORD_QUOTE = 284, + T_UNEQUAL = 285, + T_EOF = 286, + T_EOL = 287, + T_CLOSE_PAREN = 288, + T_OPEN_PAREN = 289, + T_ON = 290, + T_SELECT = 291, + T_RANGE = 292, + T_OR = 293, + T_AND = 294, + T_EQUAL = 295, + T_NOT = 296 }; #endif #define T_MAINMENU 258 @@ -118,22 +122,26 @@ #define T_PROMPT 274 #define T_DEFAULT 275 #define T_TRISTATE 276 -#define T_BOOLEAN 277 -#define T_STRING 278 -#define T_INT 279 -#define T_HEX 280 -#define T_WORD 281 -#define T_WORD_QUOTE 282 -#define T_UNEQUAL 283 -#define T_EOF 284 -#define T_EOL 285 -#define T_CLOSE_PAREN 286 -#define T_OPEN_PAREN 287 -#define T_ON 288 -#define T_OR 289 -#define T_AND 290 -#define T_EQUAL 291 -#define T_NOT 292 +#define T_DEF_TRISTATE 277 +#define T_BOOLEAN 278 +#define T_DEF_BOOLEAN 279 +#define T_STRING 280 +#define T_INT 281 +#define T_HEX 282 +#define T_WORD 283 +#define T_WORD_QUOTE 284 +#define T_UNEQUAL 285 +#define T_EOF 286 +#define T_EOL 287 +#define T_CLOSE_PAREN 288 +#define T_OPEN_PAREN 289 +#define T_ON 290 +#define T_SELECT 291 +#define T_RANGE 292 +#define T_OR 293 +#define T_AND 294 +#define T_EQUAL 295 +#define T_NOT 296 @@ -172,7 +180,7 @@ /* Enabling traces. */ #ifndef YYDEBUG -# define YYDEBUG 1 +# define YYDEBUG 0 #endif /* Enabling verbose error messages. */ @@ -308,20 +316,20 @@ /* YYFINAL -- State number of the termination state. */ #define YYFINAL 2 /* YYLAST -- Last index in YYTABLE. */ -#define YYLAST 160 +#define YYLAST 201 /* YYNTOKENS -- Number of terminals. */ -#define YYNTOKENS 38 +#define YYNTOKENS 42 /* YYNNTS -- Number of nonterminals. */ #define YYNNTS 41 /* YYNRULES -- Number of rules. */ -#define YYNRULES 99 +#define YYNRULES 104 /* YYNRULES -- Number of states. */ -#define YYNSTATES 152 +#define YYNSTATES 182 /* YYTRANSLATE(YYLEX) -- Bison symbol number corresponding to YYLEX. */ #define YYUNDEFTOK 2 -#define YYMAXUTOK 292 +#define YYMAXUTOK 296 #define YYTRANSLATE(YYX) \ ((unsigned int) (YYX) <= YYMAXUTOK ? yytranslate[YYX] : YYUNDEFTOK) @@ -358,7 +366,7 @@ 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30, 31, 32, 33, 34, - 35, 36, 37 + 35, 36, 37, 38, 39, 40, 41 }; #if YYDEBUG @@ -367,64 +375,69 @@ static const unsigned short yyprhs[] = { 0, 0, 3, 4, 7, 9, 11, 13, 17, 19, - 21, 23, 26, 28, 30, 32, 34, 36, 38, 41, - 45, 48, 52, 53, 57, 61, 64, 67, 70, 73, - 76, 79, 82, 86, 90, 92, 96, 98, 103, 106, - 107, 111, 115, 118, 121, 125, 127, 131, 132, 135, - 138, 140, 146, 150, 151, 154, 157, 160, 163, 167, - 169, 174, 177, 178, 181, 184, 187, 191, 194, 197, - 200, 204, 207, 210, 211, 215, 218, 222, 225, 228, - 229, 231, 235, 237, 239, 241, 243, 245, 247, 249, - 250, 253, 255, 259, 263, 267, 270, 274, 278, 280 + 21, 23, 26, 28, 30, 32, 34, 36, 38, 42, + 45, 49, 52, 53, 56, 59, 62, 65, 69, 74, + 78, 83, 87, 91, 95, 100, 105, 110, 116, 119, + 122, 124, 128, 131, 132, 135, 138, 141, 144, 149, + 153, 157, 160, 165, 166, 169, 173, 175, 179, 182, + 183, 186, 189, 192, 196, 199, 201, 205, 208, 209, + 212, 215, 218, 222, 226, 228, 232, 235, 238, 241, + 242, 245, 248, 253, 257, 261, 262, 265, 267, 269, + 272, 275, 278, 280, 282, 283, 286, 288, 292, 296, + 300, 303, 307, 311, 313 }; /* YYRHS -- A `-1'-separated list of the rules' RHS. */ static const yysigned_char yyrhs[] = { - 39, 0, -1, -1, 39, 40, -1, 41, -1, 51, - -1, 62, -1, 3, 73, 75, -1, 5, -1, 15, - -1, 8, -1, 1, 75, -1, 57, -1, 67, -1, - 43, -1, 45, -1, 65, -1, 75, -1, 10, 26, - -1, 42, 30, 46, -1, 11, 26, -1, 44, 30, - 46, -1, -1, 46, 47, 30, -1, 46, 71, 30, - -1, 46, 69, -1, 46, 30, -1, 21, 72, -1, - 22, 72, -1, 24, 72, -1, 25, 72, -1, 23, - 72, -1, 19, 73, 76, -1, 20, 78, 76, -1, - 7, -1, 48, 30, 52, -1, 74, -1, 49, 54, - 50, 30, -1, 49, 54, -1, -1, 52, 53, 30, - -1, 52, 71, 30, -1, 52, 69, -1, 52, 30, - -1, 19, 73, 76, -1, 18, -1, 20, 78, 76, - -1, -1, 54, 41, -1, 14, 77, -1, 74, -1, - 55, 30, 58, 56, 30, -1, 55, 30, 58, -1, - -1, 58, 41, -1, 58, 62, -1, 58, 51, -1, - 4, 73, -1, 59, 30, 70, -1, 74, -1, 60, - 63, 61, 30, -1, 60, 63, -1, -1, 63, 41, - -1, 63, 62, -1, 63, 51, -1, 63, 1, 30, - -1, 6, 73, -1, 64, 30, -1, 9, 73, -1, - 66, 30, 70, -1, 12, 30, -1, 68, 13, -1, - -1, 70, 71, 30, -1, 70, 30, -1, 16, 33, - 77, -1, 16, 77, -1, 17, 77, -1, -1, 73, - -1, 73, 14, 77, -1, 26, -1, 27, -1, 5, - -1, 8, -1, 15, -1, 30, -1, 29, -1, -1, - 14, 77, -1, 78, -1, 78, 36, 78, -1, 78, - 28, 78, -1, 32, 77, 31, -1, 37, 77, -1, - 77, 34, 77, -1, 77, 35, 77, -1, 26, -1, - 27, -1 + 43, 0, -1, -1, 43, 44, -1, 45, -1, 55, + -1, 66, -1, 3, 77, 79, -1, 5, -1, 15, + -1, 8, -1, 1, 79, -1, 61, -1, 71, -1, + 47, -1, 49, -1, 69, -1, 79, -1, 10, 28, + 32, -1, 46, 50, -1, 11, 28, 32, -1, 48, + 50, -1, -1, 50, 51, -1, 50, 75, -1, 50, + 73, -1, 50, 32, -1, 21, 76, 32, -1, 22, + 81, 80, 32, -1, 23, 76, 32, -1, 24, 81, + 80, 32, -1, 26, 76, 32, -1, 27, 76, 32, + -1, 25, 76, 32, -1, 19, 77, 80, 32, -1, + 20, 81, 80, 32, -1, 36, 28, 80, 32, -1, + 37, 82, 82, 80, 32, -1, 7, 32, -1, 52, + 56, -1, 78, -1, 53, 58, 54, -1, 53, 58, + -1, -1, 56, 57, -1, 56, 75, -1, 56, 73, + -1, 56, 32, -1, 19, 77, 80, 32, -1, 21, + 76, 32, -1, 23, 76, 32, -1, 18, 32, -1, + 20, 28, 80, 32, -1, -1, 58, 45, -1, 14, + 81, 32, -1, 78, -1, 59, 62, 60, -1, 59, + 62, -1, -1, 62, 45, -1, 62, 66, -1, 62, + 55, -1, 4, 77, 32, -1, 63, 74, -1, 78, + -1, 64, 67, 65, -1, 64, 67, -1, -1, 67, + 45, -1, 67, 66, -1, 67, 55, -1, 67, 1, + 32, -1, 6, 77, 32, -1, 68, -1, 9, 77, + 32, -1, 70, 74, -1, 12, 32, -1, 72, 13, + -1, -1, 74, 75, -1, 74, 32, -1, 16, 35, + 81, 32, -1, 16, 81, 32, -1, 17, 81, 32, + -1, -1, 77, 80, -1, 28, -1, 29, -1, 5, + 79, -1, 8, 79, -1, 15, 79, -1, 32, -1, + 31, -1, -1, 14, 81, -1, 82, -1, 82, 40, + 82, -1, 82, 30, 82, -1, 34, 81, 33, -1, + 41, 81, -1, 81, 38, 81, -1, 81, 39, 81, + -1, 28, -1, 29, -1 }; /* YYRLINE[YYN] -- source line where rule number YYN was defined. */ static const unsigned short yyrline[] = { - 0, 90, 90, 91, 94, 95, 96, 97, 98, 99, - 100, 101, 105, 106, 107, 108, 109, 110, 116, 124, - 130, 138, 148, 150, 151, 152, 153, 156, 162, 168, - 174, 180, 186, 192, 200, 209, 215, 224, 225, 231, - 233, 234, 235, 236, 239, 245, 251, 257, 259, 264, - 273, 282, 283, 289, 291, 292, 293, 298, 305, 311, - 320, 321, 327, 329, 330, 331, 332, 335, 341, 348, - 355, 362, 368, 375, 376, 377, 380, 385, 390, 398, - 400, 404, 409, 410, 413, 414, 415, 419, 419, 421, - 422, 425, 426, 427, 428, 429, 430, 431, 434, 435 + 0, 94, 94, 95, 98, 99, 100, 101, 102, 103, + 104, 105, 109, 110, 111, 112, 113, 114, 120, 128, + 134, 142, 152, 154, 155, 156, 157, 160, 166, 173, + 179, 186, 192, 198, 204, 210, 216, 222, 230, 239, + 245, 254, 255, 261, 263, 264, 265, 266, 269, 275, + 281, 287, 293, 299, 301, 306, 315, 324, 325, 331, + 333, 334, 335, 340, 347, 353, 362, 363, 369, 371, + 372, 373, 374, 377, 383, 390, 397, 404, 410, 417, + 418, 419, 422, 427, 432, 440, 442, 447, 448, 451, + 452, 453, 457, 457, 459, 460, 463, 464, 465, 466, + 467, 468, 469, 472, 473 }; #endif @@ -437,9 +450,10 @@ "T_SOURCE", "T_CHOICE", "T_ENDCHOICE", "T_COMMENT", "T_CONFIG", "T_MENUCONFIG", "T_HELP", "T_HELPTEXT", "T_IF", "T_ENDIF", "T_DEPENDS", "T_REQUIRES", "T_OPTIONAL", "T_PROMPT", "T_DEFAULT", "T_TRISTATE", - "T_BOOLEAN", "T_STRING", "T_INT", "T_HEX", "T_WORD", "T_WORD_QUOTE", - "T_UNEQUAL", "T_EOF", "T_EOL", "T_CLOSE_PAREN", "T_OPEN_PAREN", "T_ON", - "T_OR", "T_AND", "T_EQUAL", "T_NOT", "$accept", "input", "block", + "T_DEF_TRISTATE", "T_BOOLEAN", "T_DEF_BOOLEAN", "T_STRING", "T_INT", + "T_HEX", "T_WORD", "T_WORD_QUOTE", "T_UNEQUAL", "T_EOF", "T_EOL", + "T_CLOSE_PAREN", "T_OPEN_PAREN", "T_ON", "T_SELECT", "T_RANGE", "T_OR", + "T_AND", "T_EQUAL", "T_NOT", "$accept", "input", "block", "common_block", "config_entry_start", "config_stmt", "menuconfig_entry_start", "menuconfig_stmt", "config_option_list", "config_option", "choice", "choice_entry", "choice_end", "choice_stmt", @@ -459,38 +473,41 @@ 0, 256, 257, 258, 259, 260, 261, 262, 263, 264, 265, 266, 267, 268, 269, 270, 271, 272, 273, 274, 275, 276, 277, 278, 279, 280, 281, 282, 283, 284, - 285, 286, 287, 288, 289, 290, 291, 292 + 285, 286, 287, 288, 289, 290, 291, 292, 293, 294, + 295, 296 }; # endif /* YYR1[YYN] -- Symbol number of symbol that rule YYN derives. */ static const unsigned char yyr1[] = { - 0, 38, 39, 39, 40, 40, 40, 40, 40, 40, - 40, 40, 41, 41, 41, 41, 41, 41, 42, 43, - 44, 45, 46, 46, 46, 46, 46, 47, 47, 47, - 47, 47, 47, 47, 48, 49, 50, 51, 51, 52, - 52, 52, 52, 52, 53, 53, 53, 54, 54, 55, - 56, 57, 57, 58, 58, 58, 58, 59, 60, 61, - 62, 62, 63, 63, 63, 63, 63, 64, 65, 66, - 67, 68, 69, 70, 70, 70, 71, 71, 71, 72, - 72, 72, 73, 73, 74, 74, 74, 75, 75, 76, - 76, 77, 77, 77, 77, 77, 77, 77, 78, 78 + 0, 42, 43, 43, 44, 44, 44, 44, 44, 44, + 44, 44, 45, 45, 45, 45, 45, 45, 46, 47, + 48, 49, 50, 50, 50, 50, 50, 51, 51, 51, + 51, 51, 51, 51, 51, 51, 51, 51, 52, 53, + 54, 55, 55, 56, 56, 56, 56, 56, 57, 57, + 57, 57, 57, 58, 58, 59, 60, 61, 61, 62, + 62, 62, 62, 63, 64, 65, 66, 66, 67, 67, + 67, 67, 67, 68, 69, 70, 71, 72, 73, 74, + 74, 74, 75, 75, 75, 76, 76, 77, 77, 78, + 78, 78, 79, 79, 80, 80, 81, 81, 81, 81, + 81, 81, 81, 82, 82 }; /* YYR2[YYN] -- Number of symbols composing right hand side of rule YYN. */ static const unsigned char yyr2[] = { 0, 2, 0, 2, 1, 1, 1, 3, 1, 1, - 1, 2, 1, 1, 1, 1, 1, 1, 2, 3, - 2, 3, 0, 3, 3, 2, 2, 2, 2, 2, - 2, 2, 3, 3, 1, 3, 1, 4, 2, 0, - 3, 3, 2, 2, 3, 1, 3, 0, 2, 2, - 1, 5, 3, 0, 2, 2, 2, 2, 3, 1, - 4, 2, 0, 2, 2, 2, 3, 2, 2, 2, - 3, 2, 2, 0, 3, 2, 3, 2, 2, 0, - 1, 3, 1, 1, 1, 1, 1, 1, 1, 0, - 2, 1, 3, 3, 3, 2, 3, 3, 1, 1 + 1, 2, 1, 1, 1, 1, 1, 1, 3, 2, + 3, 2, 0, 2, 2, 2, 2, 3, 4, 3, + 4, 3, 3, 3, 4, 4, 4, 5, 2, 2, + 1, 3, 2, 0, 2, 2, 2, 2, 4, 3, + 3, 2, 4, 0, 2, 3, 1, 3, 2, 0, + 2, 2, 2, 3, 2, 1, 3, 2, 0, 2, + 2, 2, 3, 3, 1, 3, 2, 2, 2, 0, + 2, 2, 4, 3, 3, 0, 2, 1, 1, 2, + 2, 2, 1, 1, 0, 2, 1, 3, 3, 3, + 2, 3, 3, 1, 1 }; /* YYDEFACT[STATE-NAME] -- Default rule to reduce with in state @@ -498,134 +515,151 @@ means the default is an error. */ static const unsigned char yydefact[] = { - 2, 0, 1, 0, 0, 0, 8, 0, 34, 10, - 0, 0, 0, 0, 9, 88, 87, 3, 4, 0, - 14, 0, 15, 0, 47, 5, 0, 12, 0, 62, - 6, 0, 16, 0, 13, 17, 11, 82, 83, 0, - 57, 67, 69, 18, 20, 98, 99, 0, 0, 49, - 91, 22, 22, 39, 38, 53, 73, 0, 68, 73, - 7, 0, 95, 0, 0, 0, 0, 19, 21, 35, - 84, 85, 86, 48, 0, 36, 52, 58, 0, 63, - 65, 0, 64, 59, 70, 94, 96, 97, 93, 92, - 0, 0, 0, 0, 0, 79, 79, 79, 79, 79, - 26, 0, 0, 25, 0, 45, 0, 0, 43, 0, - 42, 0, 37, 54, 56, 0, 55, 50, 75, 0, - 66, 60, 71, 0, 77, 78, 89, 89, 27, 80, - 28, 31, 29, 30, 23, 72, 24, 89, 89, 40, - 41, 51, 74, 76, 0, 32, 33, 0, 44, 46, - 90, 81 + 2, 0, 1, 0, 0, 0, 8, 0, 0, 10, + 0, 0, 0, 0, 9, 93, 92, 3, 4, 22, + 14, 22, 15, 43, 53, 5, 59, 12, 79, 68, + 6, 74, 16, 79, 13, 17, 11, 87, 88, 0, + 0, 0, 38, 0, 0, 0, 103, 104, 0, 0, + 0, 96, 19, 21, 39, 42, 58, 64, 0, 76, + 7, 63, 73, 75, 18, 20, 0, 100, 55, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 85, 0, + 85, 0, 85, 85, 85, 26, 0, 0, 23, 0, + 25, 24, 0, 0, 0, 85, 85, 47, 44, 46, + 45, 0, 0, 0, 54, 41, 40, 60, 62, 57, + 61, 56, 81, 80, 0, 69, 71, 66, 70, 65, + 99, 101, 102, 98, 97, 77, 0, 0, 0, 94, + 94, 0, 94, 94, 0, 94, 0, 0, 0, 94, + 0, 78, 51, 94, 94, 0, 0, 89, 90, 91, + 72, 0, 83, 84, 0, 0, 0, 27, 86, 0, + 29, 0, 33, 31, 32, 0, 94, 0, 0, 49, + 50, 82, 95, 34, 35, 28, 30, 36, 0, 48, + 52, 37 }; /* YYDEFGOTO[NTERM-NUM]. */ static const short yydefgoto[] = { - -1, 1, 17, 18, 19, 20, 21, 22, 67, 101, - 23, 24, 74, 25, 69, 109, 54, 26, 115, 27, - 76, 28, 29, 81, 30, 57, 31, 32, 33, 34, - 102, 103, 77, 104, 128, 129, 75, 35, 145, 49, - 50 + -1, 1, 17, 18, 19, 20, 21, 22, 52, 88, + 23, 24, 105, 25, 54, 98, 55, 26, 109, 27, + 56, 28, 29, 117, 30, 58, 31, 32, 33, 34, + 89, 90, 57, 91, 131, 132, 106, 35, 155, 50, + 51 }; /* YYPACT[STATE-NUM] -- Index in YYTABLE of the portion describing STATE-NUM. */ -#define YYPACT_NINF -121 +#define YYPACT_NINF -99 static const short yypact[] = { - -121, 25, -121, -18, -11, -11, -121, -11, -121, -121, - -11, 21, 27, 112, -121, -121, -121, -121, -121, 51, - -121, 54, -121, 57, -121, -121, 58, -121, 62, -121, - -121, 80, -121, 96, -121, -121, -121, -121, -121, -18, - -121, -121, -121, -121, -121, -121, -121, 112, 112, 17, - 77, -121, -121, -121, 85, -121, -121, 56, -121, -121, - -121, -21, -121, 112, 112, 42, 42, 100, 100, 115, - -121, -121, -121, -121, 98, -121, 68, 28, 99, -121, - -121, 111, -121, -121, 28, -121, 105, -121, -121, -121, - 116, 110, 112, -11, 42, -11, -11, -11, -11, -11, - -121, 118, 137, -121, 121, -121, -11, 42, -121, 122, - -121, 123, -121, -121, -121, 124, -121, -121, -121, 125, - -121, -121, -121, 112, 17, 17, 142, 142, -121, 143, - -121, -121, -121, -121, -121, -121, -121, 142, 142, -121, - -121, -121, -121, 17, 112, -121, -121, 112, -121, -121, - 17, 17 + -99, 48, -99, 38, 46, 46, -99, 46, -29, -99, + 46, -17, -3, -11, -99, -99, -99, -99, -99, -99, + -99, -99, -99, -99, -99, -99, -99, -99, -99, -99, + -99, -99, -99, -99, -99, -99, -99, -99, -99, 38, + 12, 15, -99, 18, 51, 62, -99, -99, -11, -11, + 4, -24, 138, 138, 160, 121, 110, -4, 81, -4, + -99, -99, -99, -99, -99, -99, -19, -99, -99, -11, + -11, 70, 70, 73, 32, -11, 46, -11, 46, -11, + 46, -11, 46, 46, 46, -99, 36, 70, -99, 95, + -99, -99, 96, 46, 106, 46, 46, -99, -99, -99, + -99, 38, 38, 38, -99, -99, -99, -99, -99, -99, + -99, -99, -99, -99, 112, -99, -99, -99, -99, -99, + -99, 117, -99, -99, -99, -99, -11, 33, 65, 131, + 1, 119, 131, 1, 136, 1, 153, 154, 155, 131, + 70, -99, -99, 131, 131, 156, 157, -99, -99, -99, + -99, 101, -99, -99, -11, 158, 159, -99, -99, 161, + -99, 162, -99, -99, -99, 163, 131, 164, 165, -99, + -99, -99, 99, -99, -99, -99, -99, -99, 166, -99, + -99, -99 }; /* YYPGOTO[NTERM-NUM]. */ -static const yysigned_char yypgoto[] = +static const short yypgoto[] = { - -121, -121, -121, -35, -121, -121, -121, -121, 106, -121, - -121, -121, -121, -34, -121, -121, -121, -121, -121, -121, - -121, -121, -121, -121, -33, -121, -121, -121, -121, -121, - -121, 90, 101, 34, 10, -4, -30, -1, -120, -43, - -57 + -99, -99, -99, 111, -99, -99, -99, -99, 178, -99, + -99, -99, -99, 91, -99, -99, -99, -99, -99, -99, + -99, -99, -99, -99, 115, -99, -99, -99, -99, -99, + -99, 146, 168, 89, 27, 0, 126, -1, -98, -48, + -63 }; /* YYTABLE[YYPACT[STATE-NUM]]. What to do in state STATE-NUM. If positive, shift that token. If negative, reduce the rule which number is the opposite. If zero, do what YYDEFACT says. If YYTABLE_NINF, syntax error. */ -#define YYTABLE_NINF -62 +#define YYTABLE_NINF -68 static const short yytable[] = { - 39, 40, 36, 41, 61, 62, 42, 146, 88, 89, - 85, 15, 16, 63, 64, 37, 38, 148, 149, 73, - 86, 87, 79, 80, 82, 2, 3, 83, 4, 5, - 6, 7, 8, 9, 10, 11, 12, 127, 60, 13, - 14, 113, 114, 116, 91, 92, 117, 43, 124, 125, - 138, 63, 64, 44, 15, 16, -61, 78, 118, -61, - 5, 70, 7, 8, 71, 10, 11, 12, 45, 46, - 13, 72, 5, 70, 7, 8, 71, 10, 11, 12, - 143, 51, 13, 72, 52, 15, 16, 53, 55, 126, - 70, 7, 56, 71, 10, 11, 12, 15, 16, 13, - 72, 150, 137, 111, 151, 65, 130, 131, 132, 133, - 58, 119, 90, 66, 15, 16, 91, 92, 119, 93, - 94, 95, 96, 97, 98, 99, 59, 90, 112, 120, - 100, 91, 92, 105, 106, 107, 45, 46, 45, 46, - 64, 121, 47, 123, 47, 108, 122, 48, 134, 48, - 135, 136, 139, 140, 141, 142, 144, 147, 68, 110, - 84 + 66, 67, 36, 42, 39, 40, 71, 41, 123, 124, + 43, 44, 74, 75, 120, 154, 72, 46, 47, 69, + 70, 121, 122, 48, 140, 45, 127, 128, 112, 130, + 49, 133, 156, 135, 158, 159, 68, 161, 60, 69, + 70, 165, 69, 70, 61, 167, 168, 62, 2, 3, + 63, 4, 5, 6, 7, 8, 9, 10, 11, 12, + 46, 47, 13, 14, 139, 152, 48, 126, 178, 15, + 16, 69, 70, 49, 37, 38, 129, 166, 151, 15, + 16, -67, 114, 64, -67, 5, 101, 7, 8, 102, + 10, 11, 12, 143, 65, 13, 103, 153, 46, 47, + 147, 148, 149, 69, 70, 125, 172, 134, 141, 136, + 137, 138, 15, 16, 5, 101, 7, 8, 102, 10, + 11, 12, 145, 146, 13, 103, 101, 7, 142, 102, + 10, 11, 12, 171, 144, 13, 103, 69, 70, 69, + 70, 15, 16, 100, 150, 154, 113, 108, 113, 116, + 73, 157, 15, 16, 74, 75, 70, 76, 77, 78, + 79, 80, 81, 82, 83, 84, 104, 107, 160, 115, + 85, 110, 73, 118, 86, 87, 74, 75, 92, 93, + 94, 95, 111, 96, 119, 162, 163, 164, 169, 170, + 173, 174, 97, 175, 176, 177, 179, 180, 181, 53, + 99, 59 }; static const unsigned char yycheck[] = { - 4, 5, 3, 7, 47, 48, 10, 127, 65, 66, - 31, 29, 30, 34, 35, 26, 27, 137, 138, 54, - 63, 64, 57, 57, 57, 0, 1, 57, 3, 4, - 5, 6, 7, 8, 9, 10, 11, 94, 39, 14, - 15, 76, 76, 76, 16, 17, 76, 26, 91, 92, - 107, 34, 35, 26, 29, 30, 0, 1, 30, 3, - 4, 5, 6, 7, 8, 9, 10, 11, 26, 27, - 14, 15, 4, 5, 6, 7, 8, 9, 10, 11, - 123, 30, 14, 15, 30, 29, 30, 30, 30, 93, - 5, 6, 30, 8, 9, 10, 11, 29, 30, 14, - 15, 144, 106, 69, 147, 28, 96, 97, 98, 99, - 30, 77, 12, 36, 29, 30, 16, 17, 84, 19, - 20, 21, 22, 23, 24, 25, 30, 12, 30, 30, - 30, 16, 17, 18, 19, 20, 26, 27, 26, 27, - 35, 30, 32, 33, 32, 30, 30, 37, 30, 37, - 13, 30, 30, 30, 30, 30, 14, 14, 52, 69, - 59 + 48, 49, 3, 32, 4, 5, 30, 7, 71, 72, + 10, 28, 16, 17, 33, 14, 40, 28, 29, 38, + 39, 69, 70, 34, 87, 28, 74, 75, 32, 77, + 41, 79, 130, 81, 132, 133, 32, 135, 39, 38, + 39, 139, 38, 39, 32, 143, 144, 32, 0, 1, + 32, 3, 4, 5, 6, 7, 8, 9, 10, 11, + 28, 29, 14, 15, 28, 32, 34, 35, 166, 31, + 32, 38, 39, 41, 28, 29, 76, 140, 126, 31, + 32, 0, 1, 32, 3, 4, 5, 6, 7, 8, + 9, 10, 11, 93, 32, 14, 15, 32, 28, 29, + 101, 102, 103, 38, 39, 32, 154, 80, 13, 82, + 83, 84, 31, 32, 4, 5, 6, 7, 8, 9, + 10, 11, 95, 96, 14, 15, 5, 6, 32, 8, + 9, 10, 11, 32, 28, 14, 15, 38, 39, 38, + 39, 31, 32, 54, 32, 14, 57, 56, 59, 58, + 12, 32, 31, 32, 16, 17, 39, 19, 20, 21, + 22, 23, 24, 25, 26, 27, 55, 56, 32, 58, + 32, 56, 12, 58, 36, 37, 16, 17, 18, 19, + 20, 21, 56, 23, 58, 32, 32, 32, 32, 32, + 32, 32, 32, 32, 32, 32, 32, 32, 32, 21, + 54, 33 }; /* YYSTOS[STATE-NUM] -- The (internal number of the) accessing symbol of state STATE-NUM. */ static const unsigned char yystos[] = { - 0, 39, 0, 1, 3, 4, 5, 6, 7, 8, - 9, 10, 11, 14, 15, 29, 30, 40, 41, 42, - 43, 44, 45, 48, 49, 51, 55, 57, 59, 60, - 62, 64, 65, 66, 67, 75, 75, 26, 27, 73, - 73, 73, 73, 26, 26, 26, 27, 32, 37, 77, - 78, 30, 30, 30, 54, 30, 30, 63, 30, 30, - 75, 77, 77, 34, 35, 28, 36, 46, 46, 52, - 5, 8, 15, 41, 50, 74, 58, 70, 1, 41, - 51, 61, 62, 74, 70, 31, 77, 77, 78, 78, - 12, 16, 17, 19, 20, 21, 22, 23, 24, 25, - 30, 47, 68, 69, 71, 18, 19, 20, 30, 53, - 69, 71, 30, 41, 51, 56, 62, 74, 30, 71, - 30, 30, 30, 33, 77, 77, 73, 78, 72, 73, - 72, 72, 72, 72, 30, 13, 30, 73, 78, 30, - 30, 30, 30, 77, 14, 76, 76, 14, 76, 76, - 77, 77 + 0, 43, 0, 1, 3, 4, 5, 6, 7, 8, + 9, 10, 11, 14, 15, 31, 32, 44, 45, 46, + 47, 48, 49, 52, 53, 55, 59, 61, 63, 64, + 66, 68, 69, 70, 71, 79, 79, 28, 29, 77, + 77, 77, 32, 77, 28, 28, 28, 29, 34, 41, + 81, 82, 50, 50, 56, 58, 62, 74, 67, 74, + 79, 32, 32, 32, 32, 32, 81, 81, 32, 38, + 39, 30, 40, 12, 16, 17, 19, 20, 21, 22, + 23, 24, 25, 26, 27, 32, 36, 37, 51, 72, + 73, 75, 18, 19, 20, 21, 23, 32, 57, 73, + 75, 5, 8, 15, 45, 54, 78, 45, 55, 60, + 66, 78, 32, 75, 1, 45, 55, 65, 66, 78, + 33, 81, 81, 82, 82, 32, 35, 81, 81, 77, + 81, 76, 77, 81, 76, 81, 76, 76, 76, 28, + 82, 13, 32, 77, 28, 76, 76, 79, 79, 79, + 32, 81, 32, 32, 14, 80, 80, 32, 80, 80, + 32, 80, 32, 32, 32, 80, 82, 80, 80, 32, + 32, 32, 81, 32, 32, 32, 32, 32, 80, 32, + 32, 32 }; #if ! defined (YYSIZE_T) && defined (__SIZE_TYPE__) @@ -1258,10 +1292,10 @@ case 18: { - struct symbol *sym = sym_lookup(yyvsp[0].string, 0); + struct symbol *sym = sym_lookup(yyvsp[-1].string, 0); sym->flags |= SYMBOL_OPTIONAL; menu_add_entry(sym); - printd(DEBUG_PARSE, "%s:%d:config %s\n", zconf_curname(), zconf_lineno(), yyvsp[0].string); + printd(DEBUG_PARSE, "%s:%d:config %s\n", zconf_curname(), zconf_lineno(), yyvsp[-1].string); ;} break; @@ -1276,10 +1310,10 @@ case 20: { - struct symbol *sym = sym_lookup(yyvsp[0].string, 0); + struct symbol *sym = sym_lookup(yyvsp[-1].string, 0); sym->flags |= SYMBOL_OPTIONAL; menu_add_entry(sym); - printd(DEBUG_PARSE, "%s:%d:menuconfig %s\n", zconf_curname(), zconf_lineno(), yyvsp[0].string); + printd(DEBUG_PARSE, "%s:%d:menuconfig %s\n", zconf_curname(), zconf_lineno(), yyvsp[-1].string); ;} break; @@ -1295,11 +1329,6 @@ ;} break; - case 26: - - { ;} - break; - case 27: { @@ -1311,12 +1340,30 @@ case 28: { + menu_add_expr(P_DEFAULT, yyvsp[-2].expr, yyvsp[-1].expr); + menu_set_type(S_TRISTATE); + printd(DEBUG_PARSE, "%s:%d:def_boolean\n", zconf_curname(), zconf_lineno()); +;} + break; + + case 29: + + { menu_set_type(S_BOOLEAN); printd(DEBUG_PARSE, "%s:%d:boolean\n", zconf_curname(), zconf_lineno()); ;} break; - case 29: + case 30: + + { + menu_add_expr(P_DEFAULT, yyvsp[-2].expr, yyvsp[-1].expr); + menu_set_type(S_BOOLEAN); + printd(DEBUG_PARSE, "%s:%d:def_boolean\n", zconf_curname(), zconf_lineno()); +;} + break; + + case 31: { menu_set_type(S_INT); @@ -1324,7 +1371,7 @@ ;} break; - case 30: + case 32: { menu_set_type(S_HEX); @@ -1332,7 +1379,7 @@ ;} break; - case 31: + case 33: { menu_set_type(S_STRING); @@ -1340,34 +1387,50 @@ ;} break; - case 32: + case 34: { - menu_add_prop(P_PROMPT, yyvsp[-1].string, NULL, yyvsp[0].expr); + menu_add_prompt(P_PROMPT, yyvsp[-2].string, yyvsp[-1].expr); printd(DEBUG_PARSE, "%s:%d:prompt\n", zconf_curname(), zconf_lineno()); ;} break; - case 33: + case 35: { - menu_add_prop(P_DEFAULT, NULL, yyvsp[-1].symbol, yyvsp[0].expr); + menu_add_expr(P_DEFAULT, yyvsp[-2].expr, yyvsp[-1].expr); printd(DEBUG_PARSE, "%s:%d:default\n", zconf_curname(), zconf_lineno()); ;} break; - case 34: + case 36: + + { + menu_add_symbol(P_SELECT, sym_lookup(yyvsp[-2].string, 0), yyvsp[-1].expr); + printd(DEBUG_PARSE, "%s:%d:select\n", zconf_curname(), zconf_lineno()); +;} + break; + + case 37: + + { + menu_add_expr(P_RANGE, expr_alloc_comp(E_RANGE,yyvsp[-3].symbol, yyvsp[-2].symbol), yyvsp[-1].expr); + printd(DEBUG_PARSE, "%s:%d:range\n", zconf_curname(), zconf_lineno()); +;} + break; + + case 38: { struct symbol *sym = sym_lookup(NULL, 0); sym->flags |= SYMBOL_CHOICE; menu_add_entry(sym); - menu_add_prop(P_CHOICE, NULL, NULL, NULL); + menu_add_expr(P_CHOICE, NULL, NULL); printd(DEBUG_PARSE, "%s:%d:choice\n", zconf_curname(), zconf_lineno()); ;} break; - case 35: + case 39: { menu_end_entry(); @@ -1375,7 +1438,7 @@ ;} break; - case 36: + case 40: { if (zconf_endtoken(yyvsp[0].token, T_CHOICE, T_ENDCHOICE)) { @@ -1385,7 +1448,7 @@ ;} break; - case 38: + case 42: { printf("%s:%d: missing 'endchoice' for this 'choice' statement\n", current_menu->file->name, current_menu->lineno); @@ -1393,15 +1456,31 @@ ;} break; - case 44: + case 48: { - menu_add_prop(P_PROMPT, yyvsp[-1].string, NULL, yyvsp[0].expr); + menu_add_prompt(P_PROMPT, yyvsp[-2].string, yyvsp[-1].expr); printd(DEBUG_PARSE, "%s:%d:prompt\n", zconf_curname(), zconf_lineno()); ;} break; - case 45: + case 49: + + { + menu_set_type(S_TRISTATE); + printd(DEBUG_PARSE, "%s:%d:tristate\n", zconf_curname(), zconf_lineno()); +;} + break; + + case 50: + + { + menu_set_type(S_BOOLEAN); + printd(DEBUG_PARSE, "%s:%d:boolean\n", zconf_curname(), zconf_lineno()); +;} + break; + + case 51: { current_entry->sym->flags |= SYMBOL_OPTIONAL; @@ -1409,26 +1488,26 @@ ;} break; - case 46: + case 52: { - menu_add_prop(P_DEFAULT, NULL, yyvsp[-1].symbol, yyvsp[0].expr); + menu_add_symbol(P_DEFAULT, sym_lookup(yyvsp[-2].string, 0), yyvsp[-1].expr); printd(DEBUG_PARSE, "%s:%d:default\n", zconf_curname(), zconf_lineno()); ;} break; - case 49: + case 55: { printd(DEBUG_PARSE, "%s:%d:if\n", zconf_curname(), zconf_lineno()); menu_add_entry(NULL); - menu_add_dep(yyvsp[0].expr); + menu_add_dep(yyvsp[-1].expr); menu_end_entry(); menu_add_menu(); ;} break; - case 50: + case 56: { if (zconf_endtoken(yyvsp[0].token, T_IF, T_ENDIF)) { @@ -1438,7 +1517,7 @@ ;} break; - case 52: + case 58: { printf("%s:%d: missing 'endif' for this 'if' statement\n", current_menu->file->name, current_menu->lineno); @@ -1446,16 +1525,16 @@ ;} break; - case 57: + case 63: { menu_add_entry(NULL); - menu_add_prop(P_MENU, yyvsp[0].string, NULL, NULL); + menu_add_prop(P_MENU, yyvsp[-1].string, NULL, NULL); printd(DEBUG_PARSE, "%s:%d:menu\n", zconf_curname(), zconf_lineno()); ;} break; - case 58: + case 64: { menu_end_entry(); @@ -1463,7 +1542,7 @@ ;} break; - case 59: + case 65: { if (zconf_endtoken(yyvsp[0].token, T_MENU, T_ENDMENU)) { @@ -1473,7 +1552,7 @@ ;} break; - case 61: + case 67: { printf("%s:%d: missing 'endmenu' for this 'menu' statement\n", current_menu->file->name, current_menu->lineno); @@ -1481,43 +1560,43 @@ ;} break; - case 66: + case 72: { zconfprint("invalid menu option"); yyerrok; ;} break; - case 67: + case 73: { - yyval.string = yyvsp[0].string; - printd(DEBUG_PARSE, "%s:%d:source %s\n", zconf_curname(), zconf_lineno(), yyvsp[0].string); + yyval.string = yyvsp[-1].string; + printd(DEBUG_PARSE, "%s:%d:source %s\n", zconf_curname(), zconf_lineno(), yyvsp[-1].string); ;} break; - case 68: + case 74: { - zconf_nextfile(yyvsp[-1].string); + zconf_nextfile(yyvsp[0].string); ;} break; - case 69: + case 75: { menu_add_entry(NULL); - menu_add_prop(P_COMMENT, yyvsp[0].string, NULL, NULL); + menu_add_prop(P_COMMENT, yyvsp[-1].string, NULL, NULL); printd(DEBUG_PARSE, "%s:%d:comment\n", zconf_curname(), zconf_lineno()); ;} break; - case 70: + case 76: { menu_end_entry(); ;} break; - case 71: + case 77: { printd(DEBUG_PARSE, "%s:%d:help\n", zconf_curname(), zconf_lineno()); @@ -1525,122 +1604,110 @@ ;} break; - case 72: + case 78: { current_entry->sym->help = yyvsp[0].string; ;} break; - case 75: - - { ;} - break; - - case 76: + case 82: { - menu_add_dep(yyvsp[0].expr); + menu_add_dep(yyvsp[-1].expr); printd(DEBUG_PARSE, "%s:%d:depends on\n", zconf_curname(), zconf_lineno()); ;} break; - case 77: + case 83: { - menu_add_dep(yyvsp[0].expr); + menu_add_dep(yyvsp[-1].expr); printd(DEBUG_PARSE, "%s:%d:depends\n", zconf_curname(), zconf_lineno()); ;} break; - case 78: + case 84: { - menu_add_dep(yyvsp[0].expr); + menu_add_dep(yyvsp[-1].expr); printd(DEBUG_PARSE, "%s:%d:requires\n", zconf_curname(), zconf_lineno()); ;} break; - case 80: - - { - menu_add_prop(P_PROMPT, yyvsp[0].string, NULL, NULL); -;} - break; - - case 81: + case 86: { - menu_add_prop(P_PROMPT, yyvsp[-2].string, NULL, yyvsp[0].expr); + menu_add_prop(P_PROMPT, yyvsp[-1].string, NULL, yyvsp[0].expr); ;} break; - case 84: + case 89: { yyval.token = T_ENDMENU; ;} break; - case 85: + case 90: { yyval.token = T_ENDCHOICE; ;} break; - case 86: + case 91: { yyval.token = T_ENDIF; ;} break; - case 89: + case 94: { yyval.expr = NULL; ;} break; - case 90: + case 95: { yyval.expr = yyvsp[0].expr; ;} break; - case 91: + case 96: { yyval.expr = expr_alloc_symbol(yyvsp[0].symbol); ;} break; - case 92: + case 97: { yyval.expr = expr_alloc_comp(E_EQUAL, yyvsp[-2].symbol, yyvsp[0].symbol); ;} break; - case 93: + case 98: { yyval.expr = expr_alloc_comp(E_UNEQUAL, yyvsp[-2].symbol, yyvsp[0].symbol); ;} break; - case 94: + case 99: { yyval.expr = yyvsp[-1].expr; ;} break; - case 95: + case 100: { yyval.expr = expr_alloc_one(E_NOT, yyvsp[0].expr); ;} break; - case 96: + case 101: { yyval.expr = expr_alloc_two(E_OR, yyvsp[-2].expr, yyvsp[0].expr); ;} break; - case 97: + case 102: { yyval.expr = expr_alloc_two(E_AND, yyvsp[-2].expr, yyvsp[0].expr); ;} break; - case 98: + case 103: { yyval.symbol = sym_lookup(yyvsp[0].string, 0); free(yyvsp[0].string); ;} break; - case 99: + case 104: { yyval.symbol = sym_lookup(yyvsp[0].string, 1); free(yyvsp[0].string); ;} break; @@ -1848,6 +1915,9 @@ void conf_parse(const char *name) { + struct symbol *sym; + int i; + zconf_initscan(name); sym_init(); @@ -1860,6 +1930,12 @@ if (zconfnerrs) exit(1); menu_finalize(&rootmenu); + for_all_symbols(i, sym) { + if (!(sym->flags & SYMBOL_CHECKED) && sym_check_deps(sym)) + printf("\n"); + else + sym->flags |= SYMBOL_CHECK_DONE; + } sym_change_count = 1; } @@ -1875,7 +1951,7 @@ case T_ENDIF: return "endif"; } return ""; -} +} static bool zconf_endtoken(int token, int starttoken, int endtoken) { @@ -1897,7 +1973,7 @@ { va_list ap; - fprintf(stderr, "%s:%d: ", zconf_curname(), zconf_lineno()); + fprintf(stderr, "%s:%d: ", zconf_curname(), zconf_lineno() + 1); va_start(ap, err); vfprintf(stderr, err, ap); va_end(ap); @@ -1906,7 +1982,7 @@ static void zconferror(const char *err) { - fprintf(stderr, "%s:%d: %s\n", zconf_curname(), zconf_lineno(), err); + fprintf(stderr, "%s:%d: %s\n", zconf_curname(), zconf_lineno() + 1, err); } void print_quoted_string(FILE *out, const char *str) @@ -1931,8 +2007,6 @@ struct symbol *sym = menu->sym; struct property *prop; - //sym->flags |= SYMBOL_PRINTED; - if (sym_is_choice(sym)) fprintf(out, "choice\n"); else @@ -1957,13 +2031,6 @@ fputs(" ???\n", out); break; } -#if 0 - if (!expr_is_yes(sym->dep)) { - fputs(" depends ", out); - expr_fprint(sym->dep, out); - fputc('\n', out); - } -#endif for (prop = sym->prop; prop; prop = prop->next) { if (prop->menu != menu) continue; @@ -1971,25 +2038,18 @@ case P_PROMPT: fputs(" prompt ", out); print_quoted_string(out, prop->text); - if (prop->def) { - fputc(' ', out); - if (prop->def->flags & SYMBOL_CONST) - print_quoted_string(out, prop->def->name); - else - fputs(prop->def->name, out); - } - if (!expr_is_yes(E_EXPR(prop->visible))) { + if (!expr_is_yes(prop->visible.expr)) { fputs(" if ", out); - expr_fprint(E_EXPR(prop->visible), out); + expr_fprint(prop->visible.expr, out); } fputc('\n', out); break; case P_DEFAULT: fputs( " default ", out); - print_quoted_string(out, prop->def->name); - if (!expr_is_yes(E_EXPR(prop->visible))) { + expr_fprint(prop->expr, out); + if (!expr_is_yes(prop->visible.expr)) { fputs(" if ", out); - expr_fprint(E_EXPR(prop->visible), out); + expr_fprint(prop->visible.expr, out); } fputc('\n', out); break; @@ -2012,7 +2072,6 @@ void zconfdump(FILE *out) { - //struct file *file; struct property *prop; struct symbol *sym; struct menu *menu; @@ -2023,11 +2082,6 @@ print_symbol(out, menu); else if ((prop = menu->prompt)) { switch (prop->type) { - //case T_MAINMENU: - // fputs("\nmainmenu ", out); - // print_quoted_string(out, prop->text); - // fputs("\n", out); - // break; case P_COMMENT: fputs("\ncomment ", out); print_quoted_string(out, prop->text); @@ -2038,19 +2092,12 @@ print_quoted_string(out, prop->text); fputs("\n", out); break; - //case T_SOURCE: - // fputs("\nsource ", out); - // print_quoted_string(out, prop->text); - // fputs("\n", out); - // break; - //case T_IF: - // fputs("\nif\n", out); default: ; } - if (!expr_is_yes(E_EXPR(prop->visible))) { + if (!expr_is_yes(prop->visible.expr)) { fputs(" depends ", out); - expr_fprint(E_EXPR(prop->visible), out); + expr_fprint(prop->visible.expr, out); fputc('\n', out); } fputs("\n", out); diff -urN linux-2.5.70-bk7/scripts/kconfig/zconf.y linux-2.5.70-bk8/scripts/kconfig/zconf.y --- linux-2.5.70-bk7/scripts/kconfig/zconf.y 2003-05-26 18:00:57.000000000 -0700 +++ linux-2.5.70-bk8/scripts/kconfig/zconf.y 2003-06-03 04:38:40.000000000 -0700 @@ -57,7 +57,9 @@ %token T_PROMPT %token T_DEFAULT %token T_TRISTATE +%token T_DEF_TRISTATE %token T_BOOLEAN +%token T_DEF_BOOLEAN %token T_STRING %token T_INT %token T_HEX @@ -69,6 +71,8 @@ %token T_CLOSE_PAREN %token T_OPEN_PAREN %token T_ON +%token T_SELECT +%token T_RANGE %left T_OR %left T_AND @@ -113,7 +117,7 @@ /* config/menuconfig entry */ -config_entry_start: T_CONFIG T_WORD +config_entry_start: T_CONFIG T_WORD T_EOL { struct symbol *sym = sym_lookup($2, 0); sym->flags |= SYMBOL_OPTIONAL; @@ -121,13 +125,13 @@ printd(DEBUG_PARSE, "%s:%d:config %s\n", zconf_curname(), zconf_lineno(), $2); }; -config_stmt: config_entry_start T_EOL config_option_list +config_stmt: config_entry_start config_option_list { menu_end_entry(); printd(DEBUG_PARSE, "%s:%d:endconfig\n", zconf_curname(), zconf_lineno()); }; -menuconfig_entry_start: T_MENUCONFIG T_WORD +menuconfig_entry_start: T_MENUCONFIG T_WORD T_EOL { struct symbol *sym = sym_lookup($2, 0); sym->flags |= SYMBOL_OPTIONAL; @@ -135,7 +139,7 @@ printd(DEBUG_PARSE, "%s:%d:menuconfig %s\n", zconf_curname(), zconf_lineno(), $2); }; -menuconfig_stmt: menuconfig_entry_start T_EOL config_option_list +menuconfig_stmt: menuconfig_entry_start config_option_list { if (current_entry->prompt) current_entry->prompt->type = P_MENU; @@ -147,66 +151,92 @@ config_option_list: /* empty */ - | config_option_list config_option T_EOL - | config_option_list depends T_EOL + | config_option_list config_option + | config_option_list depends | config_option_list help | config_option_list T_EOL -{ }; +; -config_option: T_TRISTATE prompt_stmt_opt +config_option: T_TRISTATE prompt_stmt_opt T_EOL { menu_set_type(S_TRISTATE); printd(DEBUG_PARSE, "%s:%d:tristate\n", zconf_curname(), zconf_lineno()); }; -config_option: T_BOOLEAN prompt_stmt_opt +config_option: T_DEF_TRISTATE expr if_expr T_EOL +{ + menu_add_expr(P_DEFAULT, $2, $3); + menu_set_type(S_TRISTATE); + printd(DEBUG_PARSE, "%s:%d:def_boolean\n", zconf_curname(), zconf_lineno()); +}; + +config_option: T_BOOLEAN prompt_stmt_opt T_EOL { menu_set_type(S_BOOLEAN); printd(DEBUG_PARSE, "%s:%d:boolean\n", zconf_curname(), zconf_lineno()); }; -config_option: T_INT prompt_stmt_opt +config_option: T_DEF_BOOLEAN expr if_expr T_EOL +{ + menu_add_expr(P_DEFAULT, $2, $3); + menu_set_type(S_BOOLEAN); + printd(DEBUG_PARSE, "%s:%d:def_boolean\n", zconf_curname(), zconf_lineno()); +}; + +config_option: T_INT prompt_stmt_opt T_EOL { menu_set_type(S_INT); printd(DEBUG_PARSE, "%s:%d:int\n", zconf_curname(), zconf_lineno()); }; -config_option: T_HEX prompt_stmt_opt +config_option: T_HEX prompt_stmt_opt T_EOL { menu_set_type(S_HEX); printd(DEBUG_PARSE, "%s:%d:hex\n", zconf_curname(), zconf_lineno()); }; -config_option: T_STRING prompt_stmt_opt +config_option: T_STRING prompt_stmt_opt T_EOL { menu_set_type(S_STRING); printd(DEBUG_PARSE, "%s:%d:string\n", zconf_curname(), zconf_lineno()); }; -config_option: T_PROMPT prompt if_expr +config_option: T_PROMPT prompt if_expr T_EOL { - menu_add_prop(P_PROMPT, $2, NULL, $3); + menu_add_prompt(P_PROMPT, $2, $3); printd(DEBUG_PARSE, "%s:%d:prompt\n", zconf_curname(), zconf_lineno()); }; -config_option: T_DEFAULT symbol if_expr +config_option: T_DEFAULT expr if_expr T_EOL { - menu_add_prop(P_DEFAULT, NULL, $2, $3); + menu_add_expr(P_DEFAULT, $2, $3); printd(DEBUG_PARSE, "%s:%d:default\n", zconf_curname(), zconf_lineno()); }; +config_option: T_SELECT T_WORD if_expr T_EOL +{ + menu_add_symbol(P_SELECT, sym_lookup($2, 0), $3); + printd(DEBUG_PARSE, "%s:%d:select\n", zconf_curname(), zconf_lineno()); +}; + +config_option: T_RANGE symbol symbol if_expr T_EOL +{ + menu_add_expr(P_RANGE, expr_alloc_comp(E_RANGE,$2, $3), $4); + printd(DEBUG_PARSE, "%s:%d:range\n", zconf_curname(), zconf_lineno()); +}; + /* choice entry */ -choice: T_CHOICE +choice: T_CHOICE T_EOL { struct symbol *sym = sym_lookup(NULL, 0); sym->flags |= SYMBOL_CHOICE; menu_add_entry(sym); - menu_add_prop(P_CHOICE, NULL, NULL, NULL); + menu_add_expr(P_CHOICE, NULL, NULL); printd(DEBUG_PARSE, "%s:%d:choice\n", zconf_curname(), zconf_lineno()); }; -choice_entry: choice T_EOL choice_option_list +choice_entry: choice choice_option_list { menu_end_entry(); menu_add_menu(); @@ -221,7 +251,7 @@ }; choice_stmt: - choice_entry choice_block choice_end T_EOL + choice_entry choice_block choice_end | choice_entry choice_block { printf("%s:%d: missing 'endchoice' for this 'choice' statement\n", current_menu->file->name, current_menu->lineno); @@ -230,27 +260,39 @@ choice_option_list: /* empty */ - | choice_option_list choice_option T_EOL - | choice_option_list depends T_EOL + | choice_option_list choice_option + | choice_option_list depends | choice_option_list help | choice_option_list T_EOL ; -choice_option: T_PROMPT prompt if_expr +choice_option: T_PROMPT prompt if_expr T_EOL { - menu_add_prop(P_PROMPT, $2, NULL, $3); + menu_add_prompt(P_PROMPT, $2, $3); printd(DEBUG_PARSE, "%s:%d:prompt\n", zconf_curname(), zconf_lineno()); }; -choice_option: T_OPTIONAL +choice_option: T_TRISTATE prompt_stmt_opt T_EOL +{ + menu_set_type(S_TRISTATE); + printd(DEBUG_PARSE, "%s:%d:tristate\n", zconf_curname(), zconf_lineno()); +}; + +choice_option: T_BOOLEAN prompt_stmt_opt T_EOL +{ + menu_set_type(S_BOOLEAN); + printd(DEBUG_PARSE, "%s:%d:boolean\n", zconf_curname(), zconf_lineno()); +}; + +choice_option: T_OPTIONAL T_EOL { current_entry->sym->flags |= SYMBOL_OPTIONAL; printd(DEBUG_PARSE, "%s:%d:optional\n", zconf_curname(), zconf_lineno()); }; -choice_option: T_DEFAULT symbol if_expr +choice_option: T_DEFAULT T_WORD if_expr T_EOL { - menu_add_prop(P_DEFAULT, NULL, $2, $3); + menu_add_symbol(P_DEFAULT, sym_lookup($2, 0), $3); printd(DEBUG_PARSE, "%s:%d:default\n", zconf_curname(), zconf_lineno()); }; @@ -261,7 +303,7 @@ /* if entry */ -if: T_IF expr +if: T_IF expr T_EOL { printd(DEBUG_PARSE, "%s:%d:if\n", zconf_curname(), zconf_lineno()); menu_add_entry(NULL); @@ -279,8 +321,8 @@ }; if_stmt: - if T_EOL if_block if_end T_EOL - | if T_EOL if_block + if if_block if_end + | if if_block { printf("%s:%d: missing 'endif' for this 'if' statement\n", current_menu->file->name, current_menu->lineno); zconfnerrs++; @@ -295,14 +337,14 @@ /* menu entry */ -menu: T_MENU prompt +menu: T_MENU prompt T_EOL { menu_add_entry(NULL); menu_add_prop(P_MENU, $2, NULL, NULL); printd(DEBUG_PARSE, "%s:%d:menu\n", zconf_curname(), zconf_lineno()); }; -menu_entry: menu T_EOL depends_list +menu_entry: menu depends_list { menu_end_entry(); menu_add_menu(); @@ -317,7 +359,7 @@ }; menu_stmt: - menu_entry menu_block menu_end T_EOL + menu_entry menu_block menu_end | menu_entry menu_block { printf("%s:%d: missing 'endmenu' for this 'menu' statement\n", current_menu->file->name, current_menu->lineno); @@ -332,27 +374,27 @@ | menu_block error T_EOL { zconfprint("invalid menu option"); yyerrok; } ; -source: T_SOURCE prompt +source: T_SOURCE prompt T_EOL { $$ = $2; printd(DEBUG_PARSE, "%s:%d:source %s\n", zconf_curname(), zconf_lineno(), $2); }; -source_stmt: source T_EOL +source_stmt: source { zconf_nextfile($1); }; /* comment entry */ -comment: T_COMMENT prompt +comment: T_COMMENT prompt T_EOL { menu_add_entry(NULL); menu_add_prop(P_COMMENT, $2, NULL, NULL); printd(DEBUG_PARSE, "%s:%d:comment\n", zconf_curname(), zconf_lineno()); }; -comment_stmt: comment T_EOL depends_list +comment_stmt: comment depends_list { menu_end_entry(); }; @@ -373,21 +415,21 @@ /* depends option */ depends_list: /* empty */ - | depends_list depends T_EOL + | depends_list depends | depends_list T_EOL -{ }; +; -depends: T_DEPENDS T_ON expr +depends: T_DEPENDS T_ON expr T_EOL { menu_add_dep($3); printd(DEBUG_PARSE, "%s:%d:depends on\n", zconf_curname(), zconf_lineno()); } - | T_DEPENDS expr + | T_DEPENDS expr T_EOL { menu_add_dep($2); printd(DEBUG_PARSE, "%s:%d:depends\n", zconf_curname(), zconf_lineno()); } - | T_REQUIRES expr + | T_REQUIRES expr T_EOL { menu_add_dep($2); printd(DEBUG_PARSE, "%s:%d:requires\n", zconf_curname(), zconf_lineno()); @@ -397,22 +439,18 @@ prompt_stmt_opt: /* empty */ - | prompt + | prompt if_expr { - menu_add_prop(P_PROMPT, $1, NULL, NULL); -} - | prompt T_IF expr -{ - menu_add_prop(P_PROMPT, $1, NULL, $3); + menu_add_prop(P_PROMPT, $1, NULL, $2); }; prompt: T_WORD | T_WORD_QUOTE ; -end: T_ENDMENU { $$ = T_ENDMENU; } - | T_ENDCHOICE { $$ = T_ENDCHOICE; } - | T_ENDIF { $$ = T_ENDIF; } +end: T_ENDMENU nl_or_eof { $$ = T_ENDMENU; } + | T_ENDCHOICE nl_or_eof { $$ = T_ENDCHOICE; } + | T_ENDIF nl_or_eof { $$ = T_ENDIF; } ; nl_or_eof: @@ -439,6 +477,9 @@ void conf_parse(const char *name) { + struct symbol *sym; + int i; + zconf_initscan(name); sym_init(); @@ -451,6 +492,12 @@ if (zconfnerrs) exit(1); menu_finalize(&rootmenu); + for_all_symbols(i, sym) { + if (!(sym->flags & SYMBOL_CHECKED) && sym_check_deps(sym)) + printf("\n"); + else + sym->flags |= SYMBOL_CHECK_DONE; + } sym_change_count = 1; } @@ -466,7 +513,7 @@ case T_ENDIF: return "endif"; } return ""; -} +} static bool zconf_endtoken(int token, int starttoken, int endtoken) { @@ -488,7 +535,7 @@ { va_list ap; - fprintf(stderr, "%s:%d: ", zconf_curname(), zconf_lineno()); + fprintf(stderr, "%s:%d: ", zconf_curname(), zconf_lineno() + 1); va_start(ap, err); vfprintf(stderr, err, ap); va_end(ap); @@ -497,7 +544,7 @@ static void zconferror(const char *err) { - fprintf(stderr, "%s:%d: %s\n", zconf_curname(), zconf_lineno(), err); + fprintf(stderr, "%s:%d: %s\n", zconf_curname(), zconf_lineno() + 1, err); } void print_quoted_string(FILE *out, const char *str) @@ -522,8 +569,6 @@ struct symbol *sym = menu->sym; struct property *prop; - //sym->flags |= SYMBOL_PRINTED; - if (sym_is_choice(sym)) fprintf(out, "choice\n"); else @@ -548,13 +593,6 @@ fputs(" ???\n", out); break; } -#if 0 - if (!expr_is_yes(sym->dep)) { - fputs(" depends ", out); - expr_fprint(sym->dep, out); - fputc('\n', out); - } -#endif for (prop = sym->prop; prop; prop = prop->next) { if (prop->menu != menu) continue; @@ -562,25 +600,18 @@ case P_PROMPT: fputs(" prompt ", out); print_quoted_string(out, prop->text); - if (prop->def) { - fputc(' ', out); - if (prop->def->flags & SYMBOL_CONST) - print_quoted_string(out, prop->def->name); - else - fputs(prop->def->name, out); - } - if (!expr_is_yes(E_EXPR(prop->visible))) { + if (!expr_is_yes(prop->visible.expr)) { fputs(" if ", out); - expr_fprint(E_EXPR(prop->visible), out); + expr_fprint(prop->visible.expr, out); } fputc('\n', out); break; case P_DEFAULT: fputs( " default ", out); - print_quoted_string(out, prop->def->name); - if (!expr_is_yes(E_EXPR(prop->visible))) { + expr_fprint(prop->expr, out); + if (!expr_is_yes(prop->visible.expr)) { fputs(" if ", out); - expr_fprint(E_EXPR(prop->visible), out); + expr_fprint(prop->visible.expr, out); } fputc('\n', out); break; @@ -603,7 +634,6 @@ void zconfdump(FILE *out) { - //struct file *file; struct property *prop; struct symbol *sym; struct menu *menu; @@ -614,11 +644,6 @@ print_symbol(out, menu); else if ((prop = menu->prompt)) { switch (prop->type) { - //case T_MAINMENU: - // fputs("\nmainmenu ", out); - // print_quoted_string(out, prop->text); - // fputs("\n", out); - // break; case P_COMMENT: fputs("\ncomment ", out); print_quoted_string(out, prop->text); @@ -629,19 +654,12 @@ print_quoted_string(out, prop->text); fputs("\n", out); break; - //case T_SOURCE: - // fputs("\nsource ", out); - // print_quoted_string(out, prop->text); - // fputs("\n", out); - // break; - //case T_IF: - // fputs("\nif\n", out); default: ; } - if (!expr_is_yes(E_EXPR(prop->visible))) { + if (!expr_is_yes(prop->visible.expr)) { fputs(" depends ", out); - expr_fprint(E_EXPR(prop->visible), out); + expr_fprint(prop->visible.expr, out); fputc('\n', out); } fputs("\n", out); diff -urN linux-2.5.70-bk7/security/Kconfig linux-2.5.70-bk8/security/Kconfig --- linux-2.5.70-bk7/security/Kconfig 2003-05-26 18:00:43.000000000 -0700 +++ linux-2.5.70-bk8/security/Kconfig 2003-06-03 04:38:40.000000000 -0700 @@ -33,7 +33,7 @@ config SECURITY_ROOTPLUG tristate "Root Plug Support" - depends on SECURITY!=n + depends on USB && SECURITY!=n help This is a sample LSM module that should only be used as such. It prevents any programs running with egid == 0 if a specific diff -urN linux-2.5.70-bk7/security/root_plug.c linux-2.5.70-bk8/security/root_plug.c --- linux-2.5.70-bk7/security/root_plug.c 2003-05-26 18:00:59.000000000 -0700 +++ linux-2.5.70-bk8/security/root_plug.c 2003-06-03 04:38:40.000000000 -0700 @@ -54,7 +54,7 @@ #define MY_NAME "root_plug" #endif -#define dbg(fmt, arg...) \ +#define root_dbg(fmt, arg...) \ do { \ if (debug) \ printk(KERN_DEBUG "%s: %s: " fmt , \ @@ -62,70 +62,21 @@ ## arg); \ } while (0) -extern struct list_head usb_bus_list; -extern struct semaphore usb_bus_list_lock; - -static int match_device (struct usb_device *dev) -{ - int retval = -ENODEV; - int child; - - dbg ("looking at vendor %d, product %d\n", - dev->descriptor.idVendor, - dev->descriptor.idProduct); - - /* see if this device matches */ - if ((dev->descriptor.idVendor == vendor_id) && - (dev->descriptor.idProduct == product_id)) { - dbg ("found the device!\n"); - retval = 0; - goto exit; - } - - /* look through all of the children of this device */ - for (child = 0; child < dev->maxchild; ++child) { - if (dev->children[child]) { - retval = match_device (dev->children[child]); - if (retval == 0) - goto exit; - } - } -exit: - return retval; -} - -static int find_usb_device (void) -{ - struct list_head *buslist; - struct usb_bus *bus; - int retval = -ENODEV; - - down (&usb_bus_list_lock); - for (buslist = usb_bus_list.next; - buslist != &usb_bus_list; - buslist = buslist->next) { - bus = container_of (buslist, struct usb_bus, bus_list); - retval = match_device(bus->root_hub); - if (retval == 0) - goto exit; - } -exit: - up (&usb_bus_list_lock); - return retval; -} - - static int rootplug_bprm_check_security (struct linux_binprm *bprm) { - dbg ("file %s, e_uid = %d, e_gid = %d\n", - bprm->filename, bprm->e_uid, bprm->e_gid); + struct usb_device *dev; + + root_dbg("file %s, e_uid = %d, e_gid = %d\n", + bprm->filename, bprm->e_uid, bprm->e_gid); if (bprm->e_gid == 0) { - if (find_usb_device() != 0) { - dbg ("e_gid = 0, and device not found, " - "task not allowed to run...\n"); + dev = usb_find_device(vendor_id, product_id); + if (!dev) { + root_dbg("e_gid = 0, and device not found, " + "task not allowed to run...\n"); return -EPERM; } + usb_put_dev(dev); } return 0; diff -urN linux-2.5.70-bk7/sound/core/ioctl32/pcm32.c linux-2.5.70-bk8/sound/core/ioctl32/pcm32.c --- linux-2.5.70-bk7/sound/core/ioctl32/pcm32.c 2003-06-03 04:38:32.000000000 -0700 +++ linux-2.5.70-bk8/sound/core/ioctl32/pcm32.c 2003-05-26 18:00:41.000000000 -0700 @@ -21,6 +21,7 @@ #include #include #include +#include #include #include #include "ioctl32.h" @@ -136,15 +137,10 @@ COPY(step);\ } -struct timeval32 { - s32 tv_sec; - s32 tv_usec; -} __attribute__((packed)); - struct sndrv_pcm_status32 { s32 state; - struct timeval32 trigger_tstamp; - struct timeval32 tstamp; + struct compat_timespec trigger_tstamp; + struct compat_timespec tstamp; u32 appl_ptr; u32 hw_ptr; s32 delay; @@ -159,9 +155,9 @@ {\ COPY(state);\ COPY(trigger_tstamp.tv_sec);\ - COPY(trigger_tstamp.tv_usec);\ + COPY(trigger_tstamp.tv_nsec);\ COPY(tstamp.tv_sec);\ - COPY(tstamp.tv_usec);\ + COPY(tstamp.tv_nsec);\ COPY(appl_ptr);\ COPY(hw_ptr);\ COPY(delay);\ diff -urN linux-2.5.70-bk7/sound/core/ioctl32/rawmidi32.c linux-2.5.70-bk8/sound/core/ioctl32/rawmidi32.c --- linux-2.5.70-bk7/sound/core/ioctl32/rawmidi32.c 2003-06-03 04:38:32.000000000 -0700 +++ linux-2.5.70-bk8/sound/core/ioctl32/rawmidi32.c 2003-05-26 18:00:40.000000000 -0700 @@ -21,6 +21,7 @@ #include #include #include +#include #include #include #include @@ -42,14 +43,9 @@ COPY(no_active_sensing);\ } -struct timeval32 { - s32 tv_sec; - s32 tv_usec; -} __attribute__((packed)); - struct sndrv_rawmidi_status32 { s32 stream; - struct timeval32 tstamp; + struct compat_timespec tstamp; u32 avail; u32 xruns; unsigned char reserved[16]; @@ -59,7 +55,7 @@ {\ COPY(stream);\ COPY(tstamp.tv_sec);\ - COPY(tstamp.tv_usec);\ + COPY(tstamp.tv_nsec);\ COPY(avail);\ COPY(xruns);\ } diff -urN linux-2.5.70-bk7/sound/core/ioctl32/timer32.c linux-2.5.70-bk8/sound/core/ioctl32/timer32.c --- linux-2.5.70-bk7/sound/core/ioctl32/timer32.c 2003-06-03 04:38:32.000000000 -0700 +++ linux-2.5.70-bk8/sound/core/ioctl32/timer32.c 2003-05-26 18:00:40.000000000 -0700 @@ -21,6 +21,7 @@ #include #include #include +#include #include #include #include @@ -31,7 +32,7 @@ s32 card; unsigned char id[64]; unsigned char name[80]; - u32 ticks; + u32 reserved0; u32 resolution; unsigned char reserved[64]; }; @@ -42,17 +43,11 @@ COPY(card);\ memcpy(dst->id, src->id, sizeof(src->id));\ memcpy(dst->name, src->name, sizeof(src->name));\ - COPY(ticks);\ COPY(resolution);\ } -struct timeval32 { - s32 tv_sec; - s32 tv_usec; -}; - struct sndrv_timer_status32 { - struct timeval32 tstamp; + struct compat_timespec tstamp; u32 resolution; u32 lost; u32 overrun; @@ -63,7 +58,7 @@ #define CVT_sndrv_timer_status()\ {\ COPY(tstamp.tv_sec);\ - COPY(tstamp.tv_usec);\ + COPY(tstamp.tv_nsec);\ COPY(resolution);\ COPY(lost);\ COPY(overrun);\ diff -urN linux-2.5.70-bk7/sound/drivers/vx/vx_core.c linux-2.5.70-bk8/sound/drivers/vx/vx_core.c --- linux-2.5.70-bk7/sound/drivers/vx/vx_core.c 2003-06-03 04:38:32.000000000 -0700 +++ linux-2.5.70-bk8/sound/drivers/vx/vx_core.c 2003-06-03 04:38:40.000000000 -0700 @@ -24,6 +24,7 @@ #include #include #include +#include #include #include #include diff -urN linux-2.5.70-bk7/sound/sparc/cs4231.c linux-2.5.70-bk8/sound/sparc/cs4231.c --- linux-2.5.70-bk7/sound/sparc/cs4231.c 2003-05-26 18:00:21.000000000 -0700 +++ linux-2.5.70-bk8/sound/sparc/cs4231.c 2003-06-03 04:38:41.000000000 -0700 @@ -716,10 +716,12 @@ case SNDRV_PCM_TRIGGER_STOP: { unsigned int what = 0; - snd_pcm_substream_t *s = substream; + snd_pcm_substream_t *s; + struct list_head *pos; unsigned long flags; - do { + snd_pcm_group_for_each(pos, substream) { + s = snd_pcm_group_substream_entry(pos); if (s == chip->playback_substream) { what |= CS4231_PLAYBACK_ENABLE; snd_pcm_trigger_done(s, substream); @@ -727,8 +729,7 @@ what |= CS4231_RECORD_ENABLE; snd_pcm_trigger_done(s, substream); } - s = s->link_next; - } while (s != substream); + } #if 0 printk("TRIGGER: what[%x] on(%d)\n",