Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

Merge branch 'timers-core-for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/tip

Pull timer updates from Thomas Gleixner:
"The time/timekeeping/timer folks deliver with this update:

- Fix a reintroduced signed/unsigned issue and cleanup the whole
signed/unsigned mess in the timekeeping core so this wont happen
accidentaly again.

- Add a new trace clock based on boot time

- Prevent injection of random sleep times when PM tracing abuses the
RTC for storage

- Make posix timers configurable for real tiny systems

- Add tracepoints for the alarm timer subsystem so timer based
suspend wakeups can be instrumented

- The usual pile of fixes and updates to core and drivers"

* 'timers-core-for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/tip: (23 commits)
timekeeping: Use mul_u64_u32_shr() instead of open coding it
timekeeping: Get rid of pointless typecasts
timekeeping: Make the conversion call chain consistently unsigned
timekeeping_Force_unsigned_clocksource_to_nanoseconds_conversion
alarmtimer: Add tracepoints for alarm timers
trace: Update documentation for mono, mono_raw and boot clock
trace: Add an option for boot clock as trace clock
timekeeping: Add a fast and NMI safe boot clock
timekeeping/clocksource_cyc2ns: Document intended range limitation
timekeeping: Ignore the bogus sleep time if pm_trace is enabled
selftests/timers: Fix spelling mistake "Asyncrhonous" -> "Asynchronous"
clocksource/drivers/bcm2835_timer: Unmap region obtained by of_iomap
clocksource/drivers/arm_arch_timer: Map frame with of_io_request_and_map()
arm64: dts: rockchip: Arch counter doesn't tick in system suspend
clocksource/drivers/arm_arch_timer: Don't assume clock runs in suspend
posix-timers: Make them configurable
posix_cpu_timers: Move the add_device_randomness() call to a proper place
timer: Move sys_alarm from timer.c to itimer.c
ptp_clock: Allow for it to be optional
Kconfig: Regenerate *.c_shipped files after previous changes
...

+1548 -1110
+5
Documentation/devicetree/bindings/arm/arch_timer.txt
··· 38 38 architecturally-defined reset values. Only supported for 32-bit 39 39 systems which follow the ARMv7 architected reset values. 40 40 41 + - arm,no-tick-in-suspend : The main counter does not tick when the system is in 42 + low-power system suspend on some SoCs. This behavior does not match the 43 + Architecture Reference Manual's specification that the system counter "must 44 + be implemented in an always-on power domain." 45 + 41 46 42 47 Example: 43 48
+29
Documentation/kbuild/kconfig-language.txt
··· 113 113 That will limit the usefulness but on the other hand avoid 114 114 the illegal configurations all over. 115 115 116 + - weak reverse dependencies: "imply" <symbol> ["if" <expr>] 117 + This is similar to "select" as it enforces a lower limit on another 118 + symbol except that the "implied" symbol's value may still be set to n 119 + from a direct dependency or with a visible prompt. 120 + 121 + Given the following example: 122 + 123 + config FOO 124 + tristate 125 + imply BAZ 126 + 127 + config BAZ 128 + tristate 129 + depends on BAR 130 + 131 + The following values are possible: 132 + 133 + FOO BAR BAZ's default choice for BAZ 134 + --- --- ------------- -------------- 135 + n y n N/m/y 136 + m y m M/y/n 137 + y y y Y/n 138 + y n * N 139 + 140 + This is useful e.g. with multiple drivers that want to indicate their 141 + ability to hook into a secondary subsystem while allowing the user to 142 + configure that subsystem out without also having to unset these drivers. 143 + 116 144 - limiting menu display: "visible if" <expr> 117 145 This attribute is only applicable to menu blocks, if the condition is 118 146 false, the menu block is not displayed to the user (the symbols ··· 509 481 b) Match dependency semantics: 510 482 b1) Swap all "select FOO" to "depends on FOO" or, 511 483 b2) Swap all "depends on FOO" to "select FOO" 484 + c) Consider the use of "imply" instead of "select" 512 485 513 486 The resolution to a) can be tested with the sample Kconfig file 514 487 Documentation/kbuild/Kconfig.recursion-issue-01 through the removal
+20
Documentation/trace/ftrace.txt
··· 362 362 to correlate events across hypervisor/guest if 363 363 tb_offset is known. 364 364 365 + mono: This uses the fast monotonic clock (CLOCK_MONOTONIC) 366 + which is monotonic and is subject to NTP rate adjustments. 367 + 368 + mono_raw: 369 + This is the raw monotonic clock (CLOCK_MONOTONIC_RAW) 370 + which is montonic but is not subject to any rate adjustments 371 + and ticks at the same rate as the hardware clocksource. 372 + 373 + boot: This is the boot clock (CLOCK_BOOTTIME) and is based on the 374 + fast monotonic clock, but also accounts for time spent in 375 + suspend. Since the clock access is designed for use in 376 + tracing in the suspend path, some side effects are possible 377 + if clock is accessed after the suspend time is accounted before 378 + the fast mono clock is updated. In this case, the clock update 379 + appears to happen slightly sooner than it normally would have. 380 + Also on 32-bit systems, it's possible that the 64-bit boot offset 381 + sees a partial update. These effects are rare and post 382 + processing should be able to handle them. See comments in the 383 + ktime_get_boot_fast_ns() function for more information. 384 + 365 385 To set a clock, simply echo the clock name into this file. 366 386 367 387 echo global > trace_clock
+8
arch/alpha/kernel/osf_sys.c
··· 1029 1029 return do_sys_settimeofday(tv ? &kts : NULL, tz ? &ktz : NULL); 1030 1030 } 1031 1031 1032 + asmlinkage long sys_ni_posix_timers(void); 1033 + 1032 1034 SYSCALL_DEFINE2(osf_getitimer, int, which, struct itimerval32 __user *, it) 1033 1035 { 1034 1036 struct itimerval kit; 1035 1037 int error; 1038 + 1039 + if (!IS_ENABLED(CONFIG_POSIX_TIMERS)) 1040 + return sys_ni_posix_timers(); 1036 1041 1037 1042 error = do_getitimer(which, &kit); 1038 1043 if (!error && put_it32(it, &kit)) ··· 1051 1046 { 1052 1047 struct itimerval kin, kout; 1053 1048 int error; 1049 + 1050 + if (!IS_ENABLED(CONFIG_POSIX_TIMERS)) 1051 + return sys_ni_posix_timers(); 1054 1052 1055 1053 if (in) { 1056 1054 if (get_it32(&kin, in))
+1
arch/arm64/boot/dts/rockchip/rk3399.dtsi
··· 174 174 <GIC_PPI 14 IRQ_TYPE_LEVEL_LOW 0>, 175 175 <GIC_PPI 11 IRQ_TYPE_LEVEL_LOW 0>, 176 176 <GIC_PPI 10 IRQ_TYPE_LEVEL_LOW 0>; 177 + arm,no-tick-in-suspend; 177 178 }; 178 179 179 180 xin24m: xin24m {
+9
arch/x86/kernel/rtc.c
··· 64 64 unsigned int status, year, mon, day, hour, min, sec, century = 0; 65 65 unsigned long flags; 66 66 67 + /* 68 + * If pm_trace abused the RTC as storage, set the timespec to 0, 69 + * which tells the caller that this RTC value is unusable. 70 + */ 71 + if (!pm_trace_rtc_valid()) { 72 + now->tv_sec = now->tv_nsec = 0; 73 + return; 74 + } 75 + 67 76 spin_lock_irqsave(&rtc_lock, flags); 68 77 69 78 /*
+1 -1
drivers/Makefile
··· 107 107 obj-$(CONFIG_RTC_LIB) += rtc/ 108 108 obj-y += i2c/ media/ 109 109 obj-$(CONFIG_PPS) += pps/ 110 - obj-$(CONFIG_PTP_1588_CLOCK) += ptp/ 110 + obj-y += ptp/ 111 111 obj-$(CONFIG_W1) += w1/ 112 112 obj-y += power/ 113 113 obj-$(CONFIG_HWMON) += hwmon/
+27
drivers/base/power/trace.c
··· 10 10 #include <linux/pm-trace.h> 11 11 #include <linux/export.h> 12 12 #include <linux/rtc.h> 13 + #include <linux/suspend.h> 13 14 14 15 #include <linux/mc146818rtc.h> 15 16 ··· 75 74 76 75 #define DEVSEED (7919) 77 76 77 + bool pm_trace_rtc_abused __read_mostly; 78 + EXPORT_SYMBOL_GPL(pm_trace_rtc_abused); 79 + 78 80 static unsigned int dev_hash_value; 79 81 80 82 static int set_magic_time(unsigned int user, unsigned int file, unsigned int device) ··· 108 104 time.tm_min = (n % 20) * 3; 109 105 n /= 20; 110 106 mc146818_set_time(&time); 107 + pm_trace_rtc_abused = true; 111 108 return n ? -1 : 0; 112 109 } 113 110 ··· 244 239 return ret; 245 240 } 246 241 242 + static int 243 + pm_trace_notify(struct notifier_block *nb, unsigned long mode, void *_unused) 244 + { 245 + switch (mode) { 246 + case PM_POST_HIBERNATION: 247 + case PM_POST_SUSPEND: 248 + if (pm_trace_rtc_abused) { 249 + pm_trace_rtc_abused = false; 250 + pr_warn("Possible incorrect RTC due to pm_trace, please use 'ntpdate' or 'rdate' to reset it.\n"); 251 + } 252 + break; 253 + default: 254 + break; 255 + } 256 + return 0; 257 + } 258 + 259 + static struct notifier_block pm_trace_nb = { 260 + .notifier_call = pm_trace_notify, 261 + }; 262 + 247 263 static int early_resume_init(void) 248 264 { 249 265 hash_value_early_read = read_magic_time(); 266 + register_pm_notifier(&pm_trace_nb); 250 267 return 0; 251 268 } 252 269
+1
drivers/char/Kconfig
··· 542 542 config MMTIMER 543 543 tristate "MMTIMER Memory mapped RTC for SGI Altix" 544 544 depends on IA64_GENERIC || IA64_SGI_SN2 545 + depends on POSIX_TIMERS 545 546 default y 546 547 help 547 548 The mmtimer device allows direct userspace access to the
+11 -3
drivers/clocksource/arm_arch_timer.c
··· 81 81 static enum ppi_nr arch_timer_uses_ppi = VIRT_PPI; 82 82 static bool arch_timer_c3stop; 83 83 static bool arch_timer_mem_use_virtual; 84 + static bool arch_counter_suspend_stop; 84 85 85 86 static bool evtstrm_enable = IS_ENABLED(CONFIG_ARM_ARCH_TIMER_EVTSTREAM); 86 87 ··· 577 576 .rating = 400, 578 577 .read = arch_counter_read, 579 578 .mask = CLOCKSOURCE_MASK(56), 580 - .flags = CLOCK_SOURCE_IS_CONTINUOUS | CLOCK_SOURCE_SUSPEND_NONSTOP, 579 + .flags = CLOCK_SOURCE_IS_CONTINUOUS, 581 580 }; 582 581 583 582 static struct cyclecounter cyclecounter = { ··· 617 616 arch_timer_read_counter = arch_counter_get_cntvct_mem; 618 617 } 619 618 619 + if (!arch_counter_suspend_stop) 620 + clocksource_counter.flags |= CLOCK_SOURCE_SUSPEND_NONSTOP; 620 621 start_count = arch_timer_read_counter(); 621 622 clocksource_register_hz(&clocksource_counter, arch_timer_rate); 622 623 cyclecounter.mult = clocksource_counter.mult; ··· 910 907 of_property_read_bool(np, "arm,cpu-registers-not-fw-configured")) 911 908 arch_timer_uses_ppi = PHYS_SECURE_PPI; 912 909 910 + /* On some systems, the counter stops ticking when in suspend. */ 911 + arch_counter_suspend_stop = of_property_read_bool(np, 912 + "arm,no-tick-in-suspend"); 913 + 913 914 return arch_timer_init(); 914 915 } 915 916 CLOCKSOURCE_OF_DECLARE(armv7_arch_timer, "arm,armv7-timer", arch_timer_of_init); ··· 971 964 } 972 965 973 966 ret= -ENXIO; 974 - base = arch_counter_base = of_iomap(best_frame, 0); 975 - if (!base) { 967 + base = arch_counter_base = of_io_request_and_map(best_frame, 0, 968 + "arch_mem_timer"); 969 + if (IS_ERR(base)) { 976 970 pr_err("arch_timer: Can't map frame's registers\n"); 977 971 goto out; 978 972 }
+10 -4
drivers/clocksource/bcm2835_timer.c
··· 96 96 ret = of_property_read_u32(node, "clock-frequency", &freq); 97 97 if (ret) { 98 98 pr_err("Can't read clock-frequency"); 99 - return ret; 99 + goto err_iounmap; 100 100 } 101 101 102 102 system_clock = base + REG_COUNTER_LO; ··· 108 108 irq = irq_of_parse_and_map(node, DEFAULT_TIMER); 109 109 if (irq <= 0) { 110 110 pr_err("Can't parse IRQ"); 111 - return -EINVAL; 111 + ret = -EINVAL; 112 + goto err_iounmap; 112 113 } 113 114 114 115 timer = kzalloc(sizeof(*timer), GFP_KERNEL); 115 116 if (!timer) { 116 117 pr_err("Can't allocate timer struct\n"); 117 - return -ENOMEM; 118 + ret = -ENOMEM; 119 + goto err_iounmap; 118 120 } 119 121 120 122 timer->control = base + REG_CONTROL; ··· 135 133 ret = setup_irq(irq, &timer->act); 136 134 if (ret) { 137 135 pr_err("Can't set up timer IRQ\n"); 138 - return ret; 136 + goto err_iounmap; 139 137 } 140 138 141 139 clockevents_config_and_register(&timer->evt, freq, 0xf, 0xffffffff); ··· 143 141 pr_info("bcm2835: system timer (irq = %d)\n", irq); 144 142 145 143 return 0; 144 + 145 + err_iounmap: 146 + iounmap(base); 147 + return ret; 146 148 } 147 149 CLOCKSOURCE_OF_DECLARE(bcm2835, "brcm,bcm2835-system-timer", 148 150 bcm2835_timer_init);
+1 -1
drivers/net/ethernet/adi/Kconfig
··· 58 58 config BFIN_MAC_USE_HWSTAMP 59 59 bool "Use IEEE 1588 hwstamp" 60 60 depends on BFIN_MAC && BF518 61 - select PTP_1588_CLOCK 61 + imply PTP_1588_CLOCK 62 62 default y 63 63 ---help--- 64 64 To support the IEEE 1588 Precision Time Protocol (PTP), select y here
+1 -1
drivers/net/ethernet/amd/Kconfig
··· 177 177 depends on X86 || ARM64 || COMPILE_TEST 178 178 select BITREVERSE 179 179 select CRC32 180 - select PTP_1588_CLOCK 181 180 select PHYLIB 182 181 select AMD_XGBE_HAVE_ECC if X86 182 + imply PTP_1588_CLOCK 183 183 ---help--- 184 184 This driver supports the AMD 10GbE Ethernet device found on an 185 185 AMD SoC.
+4 -2
drivers/net/ethernet/amd/xgbe/xgbe-main.c
··· 422 422 goto err_wq; 423 423 } 424 424 425 - xgbe_ptp_register(pdata); 425 + if (IS_REACHABLE(CONFIG_PTP_1588_CLOCK)) 426 + xgbe_ptp_register(pdata); 426 427 427 428 xgbe_debugfs_init(pdata); 428 429 ··· 449 448 450 449 xgbe_debugfs_exit(pdata); 451 450 452 - xgbe_ptp_unregister(pdata); 451 + if (IS_REACHABLE(CONFIG_PTP_1588_CLOCK)) 452 + xgbe_ptp_unregister(pdata); 453 453 454 454 pdata->phy_if.phy_exit(pdata); 455 455
+2 -2
drivers/net/ethernet/broadcom/Kconfig
··· 110 110 depends on PCI 111 111 select PHYLIB 112 112 select HWMON 113 - select PTP_1588_CLOCK 113 + imply PTP_1588_CLOCK 114 114 ---help--- 115 115 This driver supports Broadcom Tigon3 based gigabit Ethernet cards. 116 116 ··· 120 120 config BNX2X 121 121 tristate "Broadcom NetXtremeII 10Gb support" 122 122 depends on PCI 123 - select PTP_1588_CLOCK 123 + imply PTP_1588_CLOCK 124 124 select FW_LOADER 125 125 select ZLIB_INFLATE 126 126 select LIBCRC32C
+1 -1
drivers/net/ethernet/cavium/Kconfig
··· 53 53 config LIQUIDIO 54 54 tristate "Cavium LiquidIO support" 55 55 depends on 64BIT 56 - select PTP_1588_CLOCK 56 + imply PTP_1588_CLOCK 57 57 select FW_LOADER 58 58 select LIBCRC32C 59 59 ---help---
+1 -1
drivers/net/ethernet/freescale/Kconfig
··· 25 25 ARCH_MXC || SOC_IMX28) 26 26 default ARCH_MXC || SOC_IMX28 if ARM 27 27 select PHYLIB 28 - select PTP_1588_CLOCK 28 + imply PTP_1588_CLOCK 29 29 ---help--- 30 30 Say Y here if you want to use the built-in 10/100 Fast ethernet 31 31 controller on some Motorola ColdFire and Freescale i.MX processors.
+5 -5
drivers/net/ethernet/intel/Kconfig
··· 58 58 tristate "Intel(R) PRO/1000 PCI-Express Gigabit Ethernet support" 59 59 depends on PCI && (!SPARC32 || BROKEN) 60 60 select CRC32 61 - select PTP_1588_CLOCK 61 + imply PTP_1588_CLOCK 62 62 ---help--- 63 63 This driver supports the PCI-Express Intel(R) PRO/1000 gigabit 64 64 ethernet family of adapters. For PCI or PCI-X e1000 adapters, ··· 83 83 config IGB 84 84 tristate "Intel(R) 82575/82576 PCI-Express Gigabit Ethernet support" 85 85 depends on PCI 86 - select PTP_1588_CLOCK 86 + imply PTP_1588_CLOCK 87 87 select I2C 88 88 select I2C_ALGOBIT 89 89 ---help--- ··· 156 156 tristate "Intel(R) 10GbE PCI Express adapters support" 157 157 depends on PCI 158 158 select MDIO 159 - select PTP_1588_CLOCK 159 + imply PTP_1588_CLOCK 160 160 ---help--- 161 161 This driver supports Intel(R) 10GbE PCI Express family of 162 162 adapters. For more information on how to identify your adapter, go ··· 213 213 214 214 config I40E 215 215 tristate "Intel(R) Ethernet Controller XL710 Family support" 216 - select PTP_1588_CLOCK 216 + imply PTP_1588_CLOCK 217 217 depends on PCI 218 218 ---help--- 219 219 This driver supports Intel(R) Ethernet Controller XL710 Family of ··· 264 264 tristate "Intel(R) FM10000 Ethernet Switch Host Interface Support" 265 265 default n 266 266 depends on PCI_MSI 267 - select PTP_1588_CLOCK 267 + imply PTP_1588_CLOCK 268 268 ---help--- 269 269 This driver supports Intel(R) FM10000 Ethernet Switch Host 270 270 Interface. For more information on how to identify your adapter,
+1 -1
drivers/net/ethernet/mellanox/mlx4/Kconfig
··· 7 7 depends on MAY_USE_DEVLINK 8 8 depends on PCI 9 9 select MLX4_CORE 10 - select PTP_1588_CLOCK 10 + imply PTP_1588_CLOCK 11 11 ---help--- 12 12 This driver supports Mellanox Technologies ConnectX Ethernet 13 13 devices.
+1 -1
drivers/net/ethernet/mellanox/mlx5/core/Kconfig
··· 14 14 config MLX5_CORE_EN 15 15 bool "Mellanox Technologies ConnectX-4 Ethernet support" 16 16 depends on NETDEVICES && ETHERNET && PCI && MLX5_CORE 17 - select PTP_1588_CLOCK 17 + imply PTP_1588_CLOCK 18 18 default n 19 19 ---help--- 20 20 Ethernet support in Mellanox Technologies ConnectX-4 NIC.
+1 -1
drivers/net/ethernet/renesas/Kconfig
··· 37 37 select MII 38 38 select MDIO_BITBANG 39 39 select PHYLIB 40 - select PTP_1588_CLOCK 40 + imply PTP_1588_CLOCK 41 41 help 42 42 Renesas Ethernet AVB device driver. 43 43 This driver supports the following SoCs:
+1 -1
drivers/net/ethernet/samsung/Kconfig
··· 21 21 depends on HAS_IOMEM && HAS_DMA 22 22 select PHYLIB 23 23 select CRC32 24 - select PTP_1588_CLOCK 24 + imply PTP_1588_CLOCK 25 25 ---help--- 26 26 This is the driver for the SXGBE 10G Ethernet IP block found on 27 27 Samsung platforms.
+1 -1
drivers/net/ethernet/sfc/Kconfig
··· 5 5 select CRC32 6 6 select I2C 7 7 select I2C_ALGOBIT 8 - select PTP_1588_CLOCK 8 + imply PTP_1588_CLOCK 9 9 ---help--- 10 10 This driver supports 10/40-gigabit Ethernet cards based on 11 11 the Solarflare SFC9000-family and SFC9100-family controllers.
+1 -1
drivers/net/ethernet/stmicro/stmmac/Kconfig
··· 4 4 select MII 5 5 select PHYLIB 6 6 select CRC32 7 - select PTP_1588_CLOCK 7 + imply PTP_1588_CLOCK 8 8 select RESET_CONTROLLER 9 9 ---help--- 10 10 This is the driver for the Ethernet IPs are built around a
+1 -1
drivers/net/ethernet/ti/Kconfig
··· 76 76 config TI_CPTS 77 77 tristate "TI Common Platform Time Sync (CPTS) Support" 78 78 depends on TI_CPSW || TI_KEYSTONE_NETCP 79 - select PTP_1588_CLOCK 79 + imply PTP_1588_CLOCK 80 80 ---help--- 81 81 This driver supports the Common Platform Time Sync unit of 82 82 the CPSW Ethernet Switch and Keystone 2 1g/10g Switch Subsystem.
+1 -1
drivers/net/ethernet/tile/Kconfig
··· 9 9 select CRC32 10 10 select TILE_GXIO_MPIPE if TILEGX 11 11 select HIGH_RES_TIMERS if TILEGX 12 - select PTP_1588_CLOCK if TILEGX 12 + imply PTP_1588_CLOCK if TILEGX 13 13 ---help--- 14 14 This is a standard Linux network device driver for the 15 15 on-chip Tilera Gigabit Ethernet and XAUI interfaces.
+5 -5
drivers/ptp/Kconfig
··· 6 6 7 7 config PTP_1588_CLOCK 8 8 tristate "PTP clock support" 9 - depends on NET 9 + depends on NET && POSIX_TIMERS 10 10 select PPS 11 11 select NET_PTP_CLASSIFY 12 12 help ··· 28 28 config PTP_1588_CLOCK_GIANFAR 29 29 tristate "Freescale eTSEC as PTP clock" 30 30 depends on GIANFAR 31 - select PTP_1588_CLOCK 31 + depends on PTP_1588_CLOCK 32 32 default y 33 33 help 34 34 This driver adds support for using the eTSEC as a PTP ··· 42 42 config PTP_1588_CLOCK_IXP46X 43 43 tristate "Intel IXP46x as PTP clock" 44 44 depends on IXP4XX_ETH 45 - select PTP_1588_CLOCK 45 + depends on PTP_1588_CLOCK 46 46 default y 47 47 help 48 48 This driver adds support for using the IXP46X as a PTP ··· 60 60 tristate "Driver for the National Semiconductor DP83640 PHYTER" 61 61 depends on NETWORK_PHY_TIMESTAMPING 62 62 depends on PHYLIB 63 - select PTP_1588_CLOCK 63 + depends on PTP_1588_CLOCK 64 64 ---help--- 65 65 Supports the DP83640 PHYTER with IEEE 1588 features. 66 66 ··· 76 76 tristate "Intel PCH EG20T as PTP clock" 77 77 depends on X86_32 || COMPILE_TEST 78 78 depends on HAS_IOMEM && NET 79 - select PTP_1588_CLOCK 79 + imply PTP_1588_CLOCK 80 80 help 81 81 This driver adds support for using the PCH EG20T as a PTP 82 82 clock. The hardware supports time stamping of PTP packets
+7
drivers/rtc/rtc-cmos.c
··· 191 191 192 192 static int cmos_read_time(struct device *dev, struct rtc_time *t) 193 193 { 194 + /* 195 + * If pm_trace abused the RTC for storage, set the timespec to 0, 196 + * which tells the caller that this RTC value is unusable. 197 + */ 198 + if (!pm_trace_rtc_valid()) 199 + return -EIO; 200 + 194 201 /* REVISIT: if the clock has a "century" register, use 195 202 * that instead of the heuristic in mc146818_get_time(). 196 203 * That'll make Y3K compatility (year > 2070) easy!
+2
fs/exec.c
··· 1169 1169 /* we have changed execution domain */ 1170 1170 tsk->exit_signal = SIGCHLD; 1171 1171 1172 + #ifdef CONFIG_POSIX_TIMERS 1172 1173 exit_itimers(sig); 1173 1174 flush_itimer_signals(); 1175 + #endif 1174 1176 1175 1177 if (atomic_read(&oldsighand->count) != 1) { 1176 1178 struct sighand_struct *newsighand;
+5
include/linux/alarmtimer.h
··· 10 10 ALARM_REALTIME, 11 11 ALARM_BOOTTIME, 12 12 13 + /* Supported types end here */ 13 14 ALARM_NUMTYPE, 15 + 16 + /* Used for tracing information. No usable types. */ 17 + ALARM_REALTIME_FREEZER, 18 + ALARM_BOOTTIME_FREEZER, 14 19 }; 15 20 16 21 enum alarmtimer_restart {
+4 -1
include/linux/clocksource.h
··· 169 169 * @mult: cycle to nanosecond multiplier 170 170 * @shift: cycle to nanosecond divisor (power of two) 171 171 * 172 - * Converts cycles to nanoseconds, using the given mult and shift. 172 + * Converts clocksource cycles to nanoseconds, using the given @mult and @shift. 173 + * The code is optimized for performance and is not intended to work 174 + * with absolute clocksource cycles (as those will easily overflow), 175 + * but is only intended to be used with relative (delta) clocksource cycles. 173 176 * 174 177 * XXX - This could use some mult_lxl_ll() asm optimization 175 178 */
+1
include/linux/mc146818rtc.h
··· 16 16 #include <asm/mc146818rtc.h> /* register access macros */ 17 17 #include <linux/bcd.h> 18 18 #include <linux/delay.h> 19 + #include <linux/pm-trace.h> 19 20 20 21 #ifdef __KERNEL__ 21 22 #include <linux/spinlock.h> /* spinlock_t */
+8 -1
include/linux/pm-trace.h
··· 1 1 #ifndef PM_TRACE_H 2 2 #define PM_TRACE_H 3 3 4 + #include <linux/types.h> 4 5 #ifdef CONFIG_PM_TRACE 5 6 #include <asm/pm-trace.h> 6 - #include <linux/types.h> 7 7 8 8 extern int pm_trace_enabled; 9 + extern bool pm_trace_rtc_abused; 10 + 11 + static inline bool pm_trace_rtc_valid(void) 12 + { 13 + return !pm_trace_rtc_abused; 14 + } 9 15 10 16 static inline int pm_trace_is_enabled(void) 11 17 { ··· 30 24 31 25 #else 32 26 27 + static inline bool pm_trace_rtc_valid(void) { return true; } 33 28 static inline int pm_trace_is_enabled(void) { return 0; } 34 29 35 30 #define TRACE_DEVICE(dev) do { } while (0)
+41 -24
include/linux/ptp_clock_kernel.h
··· 130 130 131 131 struct ptp_clock; 132 132 133 - /** 134 - * ptp_clock_register() - register a PTP hardware clock driver 135 - * 136 - * @info: Structure describing the new clock. 137 - * @parent: Pointer to the parent device of the new clock. 138 - * 139 - * Returns a valid pointer on success or PTR_ERR on failure. If PHC 140 - * support is missing at the configuration level, this function 141 - * returns NULL, and drivers are expected to gracefully handle that 142 - * case separately. 143 - */ 144 - 145 - extern struct ptp_clock *ptp_clock_register(struct ptp_clock_info *info, 146 - struct device *parent); 147 - 148 - /** 149 - * ptp_clock_unregister() - unregister a PTP hardware clock driver 150 - * 151 - * @ptp: The clock to remove from service. 152 - */ 153 - 154 - extern int ptp_clock_unregister(struct ptp_clock *ptp); 155 - 156 - 157 133 enum ptp_clock_events { 158 134 PTP_CLOCK_ALARM, 159 135 PTP_CLOCK_EXTTS, ··· 154 178 struct pps_event_time pps_times; 155 179 }; 156 180 }; 181 + 182 + #if IS_REACHABLE(CONFIG_PTP_1588_CLOCK) 183 + 184 + /** 185 + * ptp_clock_register() - register a PTP hardware clock driver 186 + * 187 + * @info: Structure describing the new clock. 188 + * @parent: Pointer to the parent device of the new clock. 189 + * 190 + * Returns a valid pointer on success or PTR_ERR on failure. If PHC 191 + * support is missing at the configuration level, this function 192 + * returns NULL, and drivers are expected to gracefully handle that 193 + * case separately. 194 + */ 195 + 196 + extern struct ptp_clock *ptp_clock_register(struct ptp_clock_info *info, 197 + struct device *parent); 198 + 199 + /** 200 + * ptp_clock_unregister() - unregister a PTP hardware clock driver 201 + * 202 + * @ptp: The clock to remove from service. 203 + */ 204 + 205 + extern int ptp_clock_unregister(struct ptp_clock *ptp); 157 206 158 207 /** 159 208 * ptp_clock_event() - notify the PTP layer about an event ··· 210 209 211 210 int ptp_find_pin(struct ptp_clock *ptp, 212 211 enum ptp_pin_function func, unsigned int chan); 212 + 213 + #else 214 + static inline struct ptp_clock *ptp_clock_register(struct ptp_clock_info *info, 215 + struct device *parent) 216 + { return NULL; } 217 + static inline int ptp_clock_unregister(struct ptp_clock *ptp) 218 + { return 0; } 219 + static inline void ptp_clock_event(struct ptp_clock *ptp, 220 + struct ptp_clock_event *event) 221 + { } 222 + static inline int ptp_clock_index(struct ptp_clock *ptp) 223 + { return -1; } 224 + static inline int ptp_find_pin(struct ptp_clock *ptp, 225 + enum ptp_pin_function func, unsigned int chan) 226 + { return -1; } 227 + #endif 213 228 214 229 #endif
-2
include/linux/time.h
··· 172 172 struct itimerval *ovalue); 173 173 extern int do_getitimer(int which, struct itimerval *value); 174 174 175 - extern unsigned int alarm_setitimer(unsigned int seconds); 176 - 177 175 extern long do_utimes(int dfd, const char __user *filename, struct timespec *times, int flags); 178 176 179 177 struct tms;
+1
include/linux/timekeeping.h
··· 249 249 250 250 extern u64 ktime_get_mono_fast_ns(void); 251 251 extern u64 ktime_get_raw_fast_ns(void); 252 + extern u64 ktime_get_boot_fast_ns(void); 252 253 253 254 /* 254 255 * Timespec interfaces utilizing the ktime based ones
+96
include/trace/events/alarmtimer.h
··· 1 + #undef TRACE_SYSTEM 2 + #define TRACE_SYSTEM alarmtimer 3 + 4 + #if !defined(_TRACE_ALARMTIMER_H) || defined(TRACE_HEADER_MULTI_READ) 5 + #define _TRACE_ALARMTIMER_H 6 + 7 + #include <linux/alarmtimer.h> 8 + #include <linux/rtc.h> 9 + #include <linux/tracepoint.h> 10 + 11 + TRACE_DEFINE_ENUM(ALARM_REALTIME); 12 + TRACE_DEFINE_ENUM(ALARM_BOOTTIME); 13 + TRACE_DEFINE_ENUM(ALARM_REALTIME_FREEZER); 14 + TRACE_DEFINE_ENUM(ALARM_BOOTTIME_FREEZER); 15 + 16 + #define show_alarm_type(type) __print_flags(type, " | ", \ 17 + { 1 << ALARM_REALTIME, "REALTIME" }, \ 18 + { 1 << ALARM_BOOTTIME, "BOOTTIME" }, \ 19 + { 1 << ALARM_REALTIME_FREEZER, "REALTIME Freezer" }, \ 20 + { 1 << ALARM_BOOTTIME_FREEZER, "BOOTTIME Freezer" }) 21 + 22 + TRACE_EVENT(alarmtimer_suspend, 23 + 24 + TP_PROTO(ktime_t expires, int flag), 25 + 26 + TP_ARGS(expires, flag), 27 + 28 + TP_STRUCT__entry( 29 + __field(s64, expires) 30 + __field(unsigned char, alarm_type) 31 + ), 32 + 33 + TP_fast_assign( 34 + __entry->expires = expires.tv64; 35 + __entry->alarm_type = flag; 36 + ), 37 + 38 + TP_printk("alarmtimer type:%s expires:%llu", 39 + show_alarm_type((1 << __entry->alarm_type)), 40 + __entry->expires 41 + ) 42 + ); 43 + 44 + DECLARE_EVENT_CLASS(alarm_class, 45 + 46 + TP_PROTO(struct alarm *alarm, ktime_t now), 47 + 48 + TP_ARGS(alarm, now), 49 + 50 + TP_STRUCT__entry( 51 + __field(void *, alarm) 52 + __field(unsigned char, alarm_type) 53 + __field(s64, expires) 54 + __field(s64, now) 55 + ), 56 + 57 + TP_fast_assign( 58 + __entry->alarm = alarm; 59 + __entry->alarm_type = alarm->type; 60 + __entry->expires = alarm->node.expires.tv64; 61 + __entry->now = now.tv64; 62 + ), 63 + 64 + TP_printk("alarmtimer:%p type:%s expires:%llu now:%llu", 65 + __entry->alarm, 66 + show_alarm_type((1 << __entry->alarm_type)), 67 + __entry->expires, 68 + __entry->now 69 + ) 70 + ); 71 + 72 + DEFINE_EVENT(alarm_class, alarmtimer_fired, 73 + 74 + TP_PROTO(struct alarm *alarm, ktime_t now), 75 + 76 + TP_ARGS(alarm, now) 77 + ); 78 + 79 + DEFINE_EVENT(alarm_class, alarmtimer_start, 80 + 81 + TP_PROTO(struct alarm *alarm, ktime_t now), 82 + 83 + TP_ARGS(alarm, now) 84 + ); 85 + 86 + DEFINE_EVENT(alarm_class, alarmtimer_cancel, 87 + 88 + TP_PROTO(struct alarm *alarm, ktime_t now), 89 + 90 + TP_ARGS(alarm, now) 91 + ); 92 + 93 + #endif /* _TRACE_ALARMTIMER_H */ 94 + 95 + /* This part must be outside protection */ 96 + #include <trace/define_trace.h>
+17
init/Kconfig
··· 1457 1457 1458 1458 If unsure say N here. 1459 1459 1460 + config POSIX_TIMERS 1461 + bool "Posix Clocks & timers" if EXPERT 1462 + default y 1463 + help 1464 + This includes native support for POSIX timers to the kernel. 1465 + Some embedded systems have no use for them and therefore they 1466 + can be configured out to reduce the size of the kernel image. 1467 + 1468 + When this option is disabled, the following syscalls won't be 1469 + available: timer_create, timer_gettime: timer_getoverrun, 1470 + timer_settime, timer_delete, clock_adjtime, getitimer, 1471 + setitimer, alarm. Furthermore, the clock_settime, clock_gettime, 1472 + clock_getres and clock_nanosleep syscalls will be limited to 1473 + CLOCK_REALTIME, CLOCK_MONOTONIC and CLOCK_BOOTTIME only. 1474 + 1475 + If unsure say y. 1476 + 1460 1477 config KALLSYMS 1461 1478 bool "Load all symbols for debugging/ksymoops" if EXPERT 1462 1479 default y
+8
kernel/compat.c
··· 307 307 __put_user(i->it_value.tv_usec, &o->it_value.tv_usec))); 308 308 } 309 309 310 + asmlinkage long sys_ni_posix_timers(void); 311 + 310 312 COMPAT_SYSCALL_DEFINE2(getitimer, int, which, 311 313 struct compat_itimerval __user *, it) 312 314 { 313 315 struct itimerval kit; 314 316 int error; 317 + 318 + if (!IS_ENABLED(CONFIG_POSIX_TIMERS)) 319 + return sys_ni_posix_timers(); 315 320 316 321 error = do_getitimer(which, &kit); 317 322 if (!error && put_compat_itimerval(it, &kit)) ··· 330 325 { 331 326 struct itimerval kin, kout; 332 327 int error; 328 + 329 + if (!IS_ENABLED(CONFIG_POSIX_TIMERS)) 330 + return sys_ni_posix_timers(); 333 331 334 332 if (in) { 335 333 if (get_compat_itimerval(&kin, in))
+13 -2
kernel/exit.c
··· 54 54 #include <linux/writeback.h> 55 55 #include <linux/shm.h> 56 56 #include <linux/kcov.h> 57 + #include <linux/random.h> 57 58 58 59 #include <asm/uaccess.h> 59 60 #include <asm/unistd.h> ··· 92 91 lockdep_tasklist_lock_is_held()); 93 92 spin_lock(&sighand->siglock); 94 93 94 + #ifdef CONFIG_POSIX_TIMERS 95 95 posix_cpu_timers_exit(tsk); 96 96 if (group_dead) { 97 97 posix_cpu_timers_exit_group(tsk); 98 - tty = sig->tty; 99 - sig->tty = NULL; 100 98 } else { 101 99 /* 102 100 * This can only happen if the caller is de_thread(). ··· 104 104 */ 105 105 if (unlikely(has_group_leader_pid(tsk))) 106 106 posix_cpu_timers_exit_group(tsk); 107 + } 108 + #endif 107 109 110 + if (group_dead) { 111 + tty = sig->tty; 112 + sig->tty = NULL; 113 + } else { 108 114 /* 109 115 * If there is any task waiting for the group exit 110 116 * then notify it: ··· 121 115 if (tsk == sig->curr_target) 122 116 sig->curr_target = next_thread(tsk); 123 117 } 118 + 119 + add_device_randomness((const void*) &tsk->se.sum_exec_runtime, 120 + sizeof(unsigned long long)); 124 121 125 122 /* 126 123 * Accumulate here the counters for all threads as they die. We could ··· 808 799 acct_update_integrals(tsk); 809 800 group_dead = atomic_dec_and_test(&tsk->signal->live); 810 801 if (group_dead) { 802 + #ifdef CONFIG_POSIX_TIMERS 811 803 hrtimer_cancel(&tsk->signal->real_timer); 812 804 exit_itimers(tsk->signal); 805 + #endif 813 806 if (tsk->mm) 814 807 setmax_mm_hiwater_rss(&tsk->signal->maxrss, tsk->mm); 815 808 }
+2
kernel/fork.c
··· 1347 1347 seqlock_init(&sig->stats_lock); 1348 1348 prev_cputime_init(&sig->prev_cputime); 1349 1349 1350 + #ifdef CONFIG_POSIX_TIMERS 1350 1351 hrtimer_init(&sig->real_timer, CLOCK_MONOTONIC, HRTIMER_MODE_REL); 1351 1352 sig->real_timer.function = it_real_fn; 1353 + #endif 1352 1354 1353 1355 task_lock(current->group_leader); 1354 1356 memcpy(sig->rlim, current->signal->rlim, sizeof sig->rlim);
+6
kernel/signal.c
··· 427 427 spin_unlock_irqrestore(&t->sighand->siglock, flags); 428 428 } 429 429 430 + #ifdef CONFIG_POSIX_TIMERS 430 431 static void __flush_itimer_signals(struct sigpending *pending) 431 432 { 432 433 sigset_t signal, retain; ··· 461 460 __flush_itimer_signals(&tsk->signal->shared_pending); 462 461 spin_unlock_irqrestore(&tsk->sighand->siglock, flags); 463 462 } 463 + #endif 464 464 465 465 void ignore_signals(struct task_struct *t) 466 466 { ··· 569 567 if (!signr) { 570 568 signr = __dequeue_signal(&tsk->signal->shared_pending, 571 569 mask, info); 570 + #ifdef CONFIG_POSIX_TIMERS 572 571 /* 573 572 * itimer signal ? 574 573 * ··· 593 590 hrtimer_restart(tmr); 594 591 } 595 592 } 593 + #endif 596 594 } 597 595 598 596 recalc_sigpending(); ··· 615 611 */ 616 612 current->jobctl |= JOBCTL_STOP_DEQUEUED; 617 613 } 614 + #ifdef CONFIG_POSIX_TIMERS 618 615 if ((info->si_code & __SI_MASK) == __SI_TIMER && info->si_sys_private) { 619 616 /* 620 617 * Release the siglock to ensure proper locking order ··· 627 622 do_schedule_next_timer(info); 628 623 spin_lock(&tsk->sighand->siglock); 629 624 } 625 + #endif 630 626 return signr; 631 627 } 632 628
+2 -1
kernel/sys.c
··· 1416 1416 * applications, so we live with it 1417 1417 */ 1418 1418 if (!retval && new_rlim && resource == RLIMIT_CPU && 1419 - new_rlim->rlim_cur != RLIM_INFINITY) 1419 + new_rlim->rlim_cur != RLIM_INFINITY && 1420 + IS_ENABLED(CONFIG_POSIX_TIMERS)) 1420 1421 update_rlimit_cpu(tsk, new_rlim->rlim_cur); 1421 1422 out: 1422 1423 read_unlock(&tasklist_lock);
+8 -2
kernel/time/Makefile
··· 1 - obj-y += time.o timer.o hrtimer.o itimer.o posix-timers.o posix-cpu-timers.o 1 + obj-y += time.o timer.o hrtimer.o 2 2 obj-y += timekeeping.o ntp.o clocksource.o jiffies.o timer_list.o 3 - obj-y += timeconv.o timecounter.o posix-clock.o alarmtimer.o 3 + obj-y += timeconv.o timecounter.o alarmtimer.o 4 + 5 + ifeq ($(CONFIG_POSIX_TIMERS),y) 6 + obj-y += posix-timers.o posix-cpu-timers.o posix-clock.o itimer.o 7 + else 8 + obj-y += posix-stubs.o 9 + endif 4 10 5 11 obj-$(CONFIG_GENERIC_CLOCKEVENTS) += clockevents.o tick-common.o 6 12 ifeq ($(CONFIG_GENERIC_CLOCKEVENTS_BROADCAST),y)
+47 -12
kernel/time/alarmtimer.c
··· 26 26 #include <linux/workqueue.h> 27 27 #include <linux/freezer.h> 28 28 29 + #define CREATE_TRACE_POINTS 30 + #include <trace/events/alarmtimer.h> 31 + 29 32 /** 30 33 * struct alarm_base - Alarm timer bases 31 34 * @lock: Lock for syncrhonized access to the base ··· 43 40 clockid_t base_clockid; 44 41 } alarm_bases[ALARM_NUMTYPE]; 45 42 46 - /* freezer delta & lock used to handle clock_nanosleep triggered wakeups */ 43 + /* freezer information to handle clock_nanosleep triggered wakeups */ 44 + static enum alarmtimer_type freezer_alarmtype; 45 + static ktime_t freezer_expires; 47 46 static ktime_t freezer_delta; 48 47 static DEFINE_SPINLOCK(freezer_delta_lock); 49 48 ··· 199 194 } 200 195 spin_unlock_irqrestore(&base->lock, flags); 201 196 197 + trace_alarmtimer_fired(alarm, base->gettime()); 202 198 return ret; 203 199 204 200 } ··· 224 218 */ 225 219 static int alarmtimer_suspend(struct device *dev) 226 220 { 227 - struct rtc_time tm; 228 - ktime_t min, now; 229 - unsigned long flags; 221 + ktime_t min, now, expires; 222 + int i, ret, type; 230 223 struct rtc_device *rtc; 231 - int i; 232 - int ret; 224 + unsigned long flags; 225 + struct rtc_time tm; 233 226 234 227 spin_lock_irqsave(&freezer_delta_lock, flags); 235 228 min = freezer_delta; 229 + expires = freezer_expires; 230 + type = freezer_alarmtype; 236 231 freezer_delta = ktime_set(0, 0); 237 232 spin_unlock_irqrestore(&freezer_delta_lock, flags); 238 233 ··· 254 247 if (!next) 255 248 continue; 256 249 delta = ktime_sub(next->expires, base->gettime()); 257 - if (!min.tv64 || (delta.tv64 < min.tv64)) 250 + if (!min.tv64 || (delta.tv64 < min.tv64)) { 251 + expires = next->expires; 258 252 min = delta; 253 + type = i; 254 + } 259 255 } 260 256 if (min.tv64 == 0) 261 257 return 0; ··· 267 257 __pm_wakeup_event(ws, 2 * MSEC_PER_SEC); 268 258 return -EBUSY; 269 259 } 260 + 261 + trace_alarmtimer_suspend(expires, type); 270 262 271 263 /* Setup an rtc timer to fire that far in the future */ 272 264 rtc_timer_cancel(rtc, &rtctimer); ··· 307 295 308 296 static void alarmtimer_freezerset(ktime_t absexp, enum alarmtimer_type type) 309 297 { 310 - ktime_t delta; 298 + struct alarm_base *base; 311 299 unsigned long flags; 312 - struct alarm_base *base = &alarm_bases[type]; 300 + ktime_t delta; 301 + 302 + switch(type) { 303 + case ALARM_REALTIME: 304 + base = &alarm_bases[ALARM_REALTIME]; 305 + type = ALARM_REALTIME_FREEZER; 306 + break; 307 + case ALARM_BOOTTIME: 308 + base = &alarm_bases[ALARM_BOOTTIME]; 309 + type = ALARM_BOOTTIME_FREEZER; 310 + break; 311 + default: 312 + WARN_ONCE(1, "Invalid alarm type: %d\n", type); 313 + return; 314 + } 313 315 314 316 delta = ktime_sub(absexp, base->gettime()); 315 317 316 318 spin_lock_irqsave(&freezer_delta_lock, flags); 317 - if (!freezer_delta.tv64 || (delta.tv64 < freezer_delta.tv64)) 319 + if (!freezer_delta.tv64 || (delta.tv64 < freezer_delta.tv64)) { 318 320 freezer_delta = delta; 321 + freezer_expires = absexp; 322 + freezer_alarmtype = type; 323 + } 319 324 spin_unlock_irqrestore(&freezer_delta_lock, flags); 320 325 } 321 326 ··· 371 342 alarmtimer_enqueue(base, alarm); 372 343 hrtimer_start(&alarm->timer, alarm->node.expires, HRTIMER_MODE_ABS); 373 344 spin_unlock_irqrestore(&base->lock, flags); 345 + 346 + trace_alarmtimer_start(alarm, base->gettime()); 374 347 } 375 348 EXPORT_SYMBOL_GPL(alarm_start); 376 349 ··· 421 390 if (ret >= 0) 422 391 alarmtimer_dequeue(base, alarm); 423 392 spin_unlock_irqrestore(&base->lock, flags); 393 + 394 + trace_alarmtimer_cancel(alarm, base->gettime()); 424 395 return ret; 425 396 } 426 397 EXPORT_SYMBOL_GPL(alarm_try_to_cancel); ··· 879 846 880 847 alarmtimer_rtc_timer_init(); 881 848 882 - posix_timers_register_clock(CLOCK_REALTIME_ALARM, &alarm_clock); 883 - posix_timers_register_clock(CLOCK_BOOTTIME_ALARM, &alarm_clock); 849 + if (IS_ENABLED(CONFIG_POSIX_TIMERS)) { 850 + posix_timers_register_clock(CLOCK_REALTIME_ALARM, &alarm_clock); 851 + posix_timers_register_clock(CLOCK_BOOTTIME_ALARM, &alarm_clock); 852 + } 884 853 885 854 /* Initialize alarm bases */ 886 855 alarm_bases[ALARM_REALTIME].base_clockid = CLOCK_REALTIME;
+14 -6
kernel/time/hrtimer.c
··· 1742 1742 * You can set the task state as follows - 1743 1743 * 1744 1744 * %TASK_UNINTERRUPTIBLE - at least @timeout time is guaranteed to 1745 - * pass before the routine returns. 1745 + * pass before the routine returns unless the current task is explicitly 1746 + * woken up, (e.g. by wake_up_process()). 1746 1747 * 1747 1748 * %TASK_INTERRUPTIBLE - the routine may return early if a signal is 1748 - * delivered to the current task. 1749 + * delivered to the current task or the current task is explicitly woken 1750 + * up. 1749 1751 * 1750 1752 * The current task state is guaranteed to be TASK_RUNNING when this 1751 1753 * routine returns. 1752 1754 * 1753 - * Returns 0 when the timer has expired otherwise -EINTR 1755 + * Returns 0 when the timer has expired. If the task was woken before the 1756 + * timer expired by a signal (only possible in state TASK_INTERRUPTIBLE) or 1757 + * by an explicit wakeup, it returns -EINTR. 1754 1758 */ 1755 1759 int __sched schedule_hrtimeout_range(ktime_t *expires, u64 delta, 1756 1760 const enum hrtimer_mode mode) ··· 1776 1772 * You can set the task state as follows - 1777 1773 * 1778 1774 * %TASK_UNINTERRUPTIBLE - at least @timeout time is guaranteed to 1779 - * pass before the routine returns. 1775 + * pass before the routine returns unless the current task is explicitly 1776 + * woken up, (e.g. by wake_up_process()). 1780 1777 * 1781 1778 * %TASK_INTERRUPTIBLE - the routine may return early if a signal is 1782 - * delivered to the current task. 1779 + * delivered to the current task or the current task is explicitly woken 1780 + * up. 1783 1781 * 1784 1782 * The current task state is guaranteed to be TASK_RUNNING when this 1785 1783 * routine returns. 1786 1784 * 1787 - * Returns 0 when the timer has expired otherwise -EINTR 1785 + * Returns 0 when the timer has expired. If the task was woken before the 1786 + * timer expired by a signal (only possible in state TASK_INTERRUPTIBLE) or 1787 + * by an explicit wakeup, it returns -EINTR. 1788 1788 */ 1789 1789 int __sched schedule_hrtimeout(ktime_t *expires, 1790 1790 const enum hrtimer_mode mode)
+14 -1
kernel/time/itimer.c
··· 238 238 return 0; 239 239 } 240 240 241 + #ifdef __ARCH_WANT_SYS_ALARM 242 + 241 243 /** 242 244 * alarm_setitimer - set alarm in seconds 243 245 * ··· 252 250 * On 32 bit machines the seconds value is limited to (INT_MAX/2) to avoid 253 251 * negative timeval settings which would cause immediate expiry. 254 252 */ 255 - unsigned int alarm_setitimer(unsigned int seconds) 253 + static unsigned int alarm_setitimer(unsigned int seconds) 256 254 { 257 255 struct itimerval it_new, it_old; 258 256 ··· 276 274 277 275 return it_old.it_value.tv_sec; 278 276 } 277 + 278 + /* 279 + * For backwards compatibility? This can be done in libc so Alpha 280 + * and all newer ports shouldn't need it. 281 + */ 282 + SYSCALL_DEFINE1(alarm, unsigned int, seconds) 283 + { 284 + return alarm_setitimer(seconds); 285 + } 286 + 287 + #endif 279 288 280 289 SYSCALL_DEFINE3(setitimer, int, which, struct itimerval __user *, value, 281 290 struct itimerval __user *, ovalue)
-4
kernel/time/posix-cpu-timers.c
··· 9 9 #include <asm/uaccess.h> 10 10 #include <linux/kernel_stat.h> 11 11 #include <trace/events/timer.h> 12 - #include <linux/random.h> 13 12 #include <linux/tick.h> 14 13 #include <linux/workqueue.h> 15 14 ··· 446 447 */ 447 448 void posix_cpu_timers_exit(struct task_struct *tsk) 448 449 { 449 - add_device_randomness((const void*) &tsk->se.sum_exec_runtime, 450 - sizeof(unsigned long long)); 451 450 cleanup_timers(tsk->cpu_timers); 452 - 453 451 } 454 452 void posix_cpu_timers_exit_group(struct task_struct *tsk) 455 453 {
+123
kernel/time/posix-stubs.c
··· 1 + /* 2 + * Dummy stubs used when CONFIG_POSIX_TIMERS=n 3 + * 4 + * Created by: Nicolas Pitre, July 2016 5 + * Copyright: (C) 2016 Linaro Limited 6 + * 7 + * This program is free software; you can redistribute it and/or modify 8 + * it under the terms of the GNU General Public License version 2 as 9 + * published by the Free Software Foundation. 10 + */ 11 + 12 + #include <linux/linkage.h> 13 + #include <linux/kernel.h> 14 + #include <linux/sched.h> 15 + #include <linux/errno.h> 16 + #include <linux/syscalls.h> 17 + #include <linux/ktime.h> 18 + #include <linux/timekeeping.h> 19 + #include <linux/posix-timers.h> 20 + 21 + asmlinkage long sys_ni_posix_timers(void) 22 + { 23 + pr_err_once("process %d (%s) attempted a POSIX timer syscall " 24 + "while CONFIG_POSIX_TIMERS is not set\n", 25 + current->pid, current->comm); 26 + return -ENOSYS; 27 + } 28 + 29 + #define SYS_NI(name) SYSCALL_ALIAS(sys_##name, sys_ni_posix_timers) 30 + 31 + SYS_NI(timer_create); 32 + SYS_NI(timer_gettime); 33 + SYS_NI(timer_getoverrun); 34 + SYS_NI(timer_settime); 35 + SYS_NI(timer_delete); 36 + SYS_NI(clock_adjtime); 37 + SYS_NI(getitimer); 38 + SYS_NI(setitimer); 39 + #ifdef __ARCH_WANT_SYS_ALARM 40 + SYS_NI(alarm); 41 + #endif 42 + 43 + /* 44 + * We preserve minimal support for CLOCK_REALTIME and CLOCK_MONOTONIC 45 + * as it is easy to remain compatible with little code. CLOCK_BOOTTIME 46 + * is also included for convenience as at least systemd uses it. 47 + */ 48 + 49 + SYSCALL_DEFINE2(clock_settime, const clockid_t, which_clock, 50 + const struct timespec __user *, tp) 51 + { 52 + struct timespec new_tp; 53 + 54 + if (which_clock != CLOCK_REALTIME) 55 + return -EINVAL; 56 + if (copy_from_user(&new_tp, tp, sizeof (*tp))) 57 + return -EFAULT; 58 + return do_sys_settimeofday(&new_tp, NULL); 59 + } 60 + 61 + SYSCALL_DEFINE2(clock_gettime, const clockid_t, which_clock, 62 + struct timespec __user *,tp) 63 + { 64 + struct timespec kernel_tp; 65 + 66 + switch (which_clock) { 67 + case CLOCK_REALTIME: ktime_get_real_ts(&kernel_tp); break; 68 + case CLOCK_MONOTONIC: ktime_get_ts(&kernel_tp); break; 69 + case CLOCK_BOOTTIME: get_monotonic_boottime(&kernel_tp); break; 70 + default: return -EINVAL; 71 + } 72 + if (copy_to_user(tp, &kernel_tp, sizeof (kernel_tp))) 73 + return -EFAULT; 74 + return 0; 75 + } 76 + 77 + SYSCALL_DEFINE2(clock_getres, const clockid_t, which_clock, struct timespec __user *, tp) 78 + { 79 + struct timespec rtn_tp = { 80 + .tv_sec = 0, 81 + .tv_nsec = hrtimer_resolution, 82 + }; 83 + 84 + switch (which_clock) { 85 + case CLOCK_REALTIME: 86 + case CLOCK_MONOTONIC: 87 + case CLOCK_BOOTTIME: 88 + if (copy_to_user(tp, &rtn_tp, sizeof(rtn_tp))) 89 + return -EFAULT; 90 + return 0; 91 + default: 92 + return -EINVAL; 93 + } 94 + } 95 + 96 + SYSCALL_DEFINE4(clock_nanosleep, const clockid_t, which_clock, int, flags, 97 + const struct timespec __user *, rqtp, 98 + struct timespec __user *, rmtp) 99 + { 100 + struct timespec t; 101 + 102 + switch (which_clock) { 103 + case CLOCK_REALTIME: 104 + case CLOCK_MONOTONIC: 105 + case CLOCK_BOOTTIME: 106 + if (copy_from_user(&t, rqtp, sizeof (struct timespec))) 107 + return -EFAULT; 108 + if (!timespec_valid(&t)) 109 + return -EINVAL; 110 + return hrtimer_nanosleep(&t, rmtp, flags & TIMER_ABSTIME ? 111 + HRTIMER_MODE_ABS : HRTIMER_MODE_REL, 112 + which_clock); 113 + default: 114 + return -EINVAL; 115 + } 116 + } 117 + 118 + #ifdef CONFIG_COMPAT 119 + long clock_nanosleep_restart(struct restart_block *restart_block) 120 + { 121 + return hrtimer_nanosleep_restart(restart_block); 122 + } 123 + #endif
+51 -39
kernel/time/timekeeping.c
··· 258 258 tk->cycle_interval = interval; 259 259 260 260 /* Go back from cycles -> shifted ns */ 261 - tk->xtime_interval = (u64) interval * clock->mult; 261 + tk->xtime_interval = interval * clock->mult; 262 262 tk->xtime_remainder = ntpinterval - tk->xtime_interval; 263 - tk->raw_interval = 264 - ((u64) interval * clock->mult) >> clock->shift; 263 + tk->raw_interval = (interval * clock->mult) >> clock->shift; 265 264 266 265 /* if changing clocks, convert xtime_nsec shift units */ 267 266 if (old_clock) { ··· 298 299 static inline u32 arch_gettimeoffset(void) { return 0; } 299 300 #endif 300 301 301 - static inline s64 timekeeping_delta_to_ns(struct tk_read_base *tkr, 302 + static inline u64 timekeeping_delta_to_ns(struct tk_read_base *tkr, 302 303 cycle_t delta) 303 304 { 304 - s64 nsec; 305 + u64 nsec; 305 306 306 307 nsec = delta * tkr->mult + tkr->xtime_nsec; 307 308 nsec >>= tkr->shift; ··· 310 311 return nsec + arch_gettimeoffset(); 311 312 } 312 313 313 - static inline s64 timekeeping_get_ns(struct tk_read_base *tkr) 314 + static inline u64 timekeeping_get_ns(struct tk_read_base *tkr) 314 315 { 315 316 cycle_t delta; 316 317 ··· 318 319 return timekeeping_delta_to_ns(tkr, delta); 319 320 } 320 321 321 - static inline s64 timekeeping_cycles_to_ns(struct tk_read_base *tkr, 322 - cycle_t cycles) 322 + static inline u64 timekeeping_cycles_to_ns(struct tk_read_base *tkr, 323 + cycle_t cycles) 323 324 { 324 325 cycle_t delta; 325 326 ··· 423 424 return __ktime_get_fast_ns(&tk_fast_raw); 424 425 } 425 426 EXPORT_SYMBOL_GPL(ktime_get_raw_fast_ns); 427 + 428 + /** 429 + * ktime_get_boot_fast_ns - NMI safe and fast access to boot clock. 430 + * 431 + * To keep it NMI safe since we're accessing from tracing, we're not using a 432 + * separate timekeeper with updates to monotonic clock and boot offset 433 + * protected with seqlocks. This has the following minor side effects: 434 + * 435 + * (1) Its possible that a timestamp be taken after the boot offset is updated 436 + * but before the timekeeper is updated. If this happens, the new boot offset 437 + * is added to the old timekeeping making the clock appear to update slightly 438 + * earlier: 439 + * CPU 0 CPU 1 440 + * timekeeping_inject_sleeptime64() 441 + * __timekeeping_inject_sleeptime(tk, delta); 442 + * timestamp(); 443 + * timekeeping_update(tk, TK_CLEAR_NTP...); 444 + * 445 + * (2) On 32-bit systems, the 64-bit boot offset (tk->offs_boot) may be 446 + * partially updated. Since the tk->offs_boot update is a rare event, this 447 + * should be a rare occurrence which postprocessing should be able to handle. 448 + */ 449 + u64 notrace ktime_get_boot_fast_ns(void) 450 + { 451 + struct timekeeper *tk = &tk_core.timekeeper; 452 + 453 + return (ktime_get_mono_fast_ns() + ktime_to_ns(tk->offs_boot)); 454 + } 455 + EXPORT_SYMBOL_GPL(ktime_get_boot_fast_ns); 426 456 427 457 /* Suspend-time cycles value for halted fast timekeeper. */ 428 458 static cycle_t cycles_at_suspend; ··· 651 623 { 652 624 struct clocksource *clock = tk->tkr_mono.clock; 653 625 cycle_t cycle_now, delta; 654 - s64 nsec; 626 + u64 nsec; 655 627 656 628 cycle_now = tk->tkr_mono.read(clock); 657 629 delta = clocksource_delta(cycle_now, tk->tkr_mono.cycle_last, tk->tkr_mono.mask); ··· 680 652 { 681 653 struct timekeeper *tk = &tk_core.timekeeper; 682 654 unsigned long seq; 683 - s64 nsecs = 0; 655 + u64 nsecs; 684 656 685 657 do { 686 658 seq = read_seqcount_begin(&tk_core.seq); ··· 720 692 struct timekeeper *tk = &tk_core.timekeeper; 721 693 unsigned int seq; 722 694 ktime_t base; 723 - s64 nsecs; 695 + u64 nsecs; 724 696 725 697 WARN_ON(timekeeping_suspended); 726 698 ··· 763 735 struct timekeeper *tk = &tk_core.timekeeper; 764 736 unsigned int seq; 765 737 ktime_t base, *offset = offsets[offs]; 766 - s64 nsecs; 738 + u64 nsecs; 767 739 768 740 WARN_ON(timekeeping_suspended); 769 741 ··· 807 779 struct timekeeper *tk = &tk_core.timekeeper; 808 780 unsigned int seq; 809 781 ktime_t base; 810 - s64 nsecs; 782 + u64 nsecs; 811 783 812 784 do { 813 785 seq = read_seqcount_begin(&tk_core.seq); ··· 832 804 { 833 805 struct timekeeper *tk = &tk_core.timekeeper; 834 806 struct timespec64 tomono; 835 - s64 nsec; 836 807 unsigned int seq; 808 + u64 nsec; 837 809 838 810 WARN_ON(timekeeping_suspended); 839 811 ··· 921 893 unsigned long seq; 922 894 ktime_t base_raw; 923 895 ktime_t base_real; 924 - s64 nsec_raw; 925 - s64 nsec_real; 896 + u64 nsec_raw; 897 + u64 nsec_real; 926 898 cycle_t now; 927 899 928 900 WARN_ON_ONCE(timekeeping_suspended); ··· 1080 1052 cycle_t cycles, now, interval_start; 1081 1053 unsigned int clock_was_set_seq = 0; 1082 1054 ktime_t base_real, base_raw; 1083 - s64 nsec_real, nsec_raw; 1055 + u64 nsec_real, nsec_raw; 1084 1056 u8 cs_was_changed_seq; 1085 1057 unsigned long seq; 1086 1058 bool do_interp; ··· 1393 1365 struct timekeeper *tk = &tk_core.timekeeper; 1394 1366 struct timespec64 ts64; 1395 1367 unsigned long seq; 1396 - s64 nsecs; 1368 + u64 nsecs; 1397 1369 1398 1370 do { 1399 1371 seq = read_seqcount_begin(&tk_core.seq); ··· 1644 1616 struct clocksource *clock = tk->tkr_mono.clock; 1645 1617 unsigned long flags; 1646 1618 struct timespec64 ts_new, ts_delta; 1647 - cycle_t cycle_now, cycle_delta; 1619 + cycle_t cycle_now; 1648 1620 1649 1621 sleeptime_injected = false; 1650 1622 read_persistent_clock64(&ts_new); ··· 1670 1642 cycle_now = tk->tkr_mono.read(clock); 1671 1643 if ((clock->flags & CLOCK_SOURCE_SUSPEND_NONSTOP) && 1672 1644 cycle_now > tk->tkr_mono.cycle_last) { 1673 - u64 num, max = ULLONG_MAX; 1674 - u32 mult = clock->mult; 1675 - u32 shift = clock->shift; 1676 - s64 nsec = 0; 1645 + u64 nsec, cyc_delta; 1677 1646 1678 - cycle_delta = clocksource_delta(cycle_now, tk->tkr_mono.cycle_last, 1679 - tk->tkr_mono.mask); 1680 - 1681 - /* 1682 - * "cycle_delta * mutl" may cause 64 bits overflow, if the 1683 - * suspended time is too long. In that case we need do the 1684 - * 64 bits math carefully 1685 - */ 1686 - do_div(max, mult); 1687 - if (cycle_delta > max) { 1688 - num = div64_u64(cycle_delta, max); 1689 - nsec = (((u64) max * mult) >> shift) * num; 1690 - cycle_delta -= num * max; 1691 - } 1692 - nsec += ((u64) cycle_delta * mult) >> shift; 1693 - 1647 + cyc_delta = clocksource_delta(cycle_now, tk->tkr_mono.cycle_last, 1648 + tk->tkr_mono.mask); 1649 + nsec = mul_u64_u32_shr(cyc_delta, clock->mult, clock->shift); 1694 1650 ts_delta = ns_to_timespec64(nsec); 1695 1651 sleeptime_injected = true; 1696 1652 } else if (timespec64_compare(&ts_new, &timekeeping_suspend_time) > 0) {
+18 -30
kernel/time/timer.c
··· 1615 1615 irq_work_tick(); 1616 1616 #endif 1617 1617 scheduler_tick(); 1618 - run_posix_cpu_timers(p); 1618 + if (IS_ENABLED(CONFIG_POSIX_TIMERS)) 1619 + run_posix_cpu_timers(p); 1619 1620 } 1620 1621 1621 1622 /** ··· 1677 1676 raise_softirq(TIMER_SOFTIRQ); 1678 1677 } 1679 1678 1680 - #ifdef __ARCH_WANT_SYS_ALARM 1681 - 1682 - /* 1683 - * For backwards compatibility? This can be done in libc so Alpha 1684 - * and all newer ports shouldn't need it. 1685 - */ 1686 - SYSCALL_DEFINE1(alarm, unsigned int, seconds) 1687 - { 1688 - return alarm_setitimer(seconds); 1689 - } 1690 - 1691 - #endif 1692 - 1693 1679 static void process_timeout(unsigned long __data) 1694 1680 { 1695 1681 wake_up_process((struct task_struct *)__data); ··· 1693 1705 * You can set the task state as follows - 1694 1706 * 1695 1707 * %TASK_UNINTERRUPTIBLE - at least @timeout jiffies are guaranteed to 1696 - * pass before the routine returns. The routine will return 0 1708 + * pass before the routine returns unless the current task is explicitly 1709 + * woken up, (e.g. by wake_up_process())". 1697 1710 * 1698 1711 * %TASK_INTERRUPTIBLE - the routine may return early if a signal is 1699 - * delivered to the current task. In this case the remaining time 1700 - * in jiffies will be returned, or 0 if the timer expired in time 1712 + * delivered to the current task or the current task is explicitly woken 1713 + * up. 1701 1714 * 1702 1715 * The current task state is guaranteed to be TASK_RUNNING when this 1703 1716 * routine returns. ··· 1707 1718 * the CPU away without a bound on the timeout. In this case the return 1708 1719 * value will be %MAX_SCHEDULE_TIMEOUT. 1709 1720 * 1710 - * In all cases the return value is guaranteed to be non-negative. 1721 + * Returns 0 when the timer has expired otherwise the remaining time in 1722 + * jiffies will be returned. In all cases the return value is guaranteed 1723 + * to be non-negative. 1711 1724 */ 1712 1725 signed long __sched schedule_timeout(signed long timeout) 1713 1726 { ··· 1901 1910 1902 1911 EXPORT_SYMBOL(msleep_interruptible); 1903 1912 1904 - static void __sched do_usleep_range(unsigned long min, unsigned long max) 1905 - { 1906 - ktime_t kmin; 1907 - u64 delta; 1908 - 1909 - kmin = ktime_set(0, min * NSEC_PER_USEC); 1910 - delta = (u64)(max - min) * NSEC_PER_USEC; 1911 - schedule_hrtimeout_range(&kmin, delta, HRTIMER_MODE_REL); 1912 - } 1913 - 1914 1913 /** 1915 1914 * usleep_range - Sleep for an approximate time 1916 1915 * @min: Minimum time in usecs to sleep ··· 1914 1933 */ 1915 1934 void __sched usleep_range(unsigned long min, unsigned long max) 1916 1935 { 1917 - __set_current_state(TASK_UNINTERRUPTIBLE); 1918 - do_usleep_range(min, max); 1936 + ktime_t exp = ktime_add_us(ktime_get(), min); 1937 + u64 delta = (u64)(max - min) * NSEC_PER_USEC; 1938 + 1939 + for (;;) { 1940 + __set_current_state(TASK_UNINTERRUPTIBLE); 1941 + /* Do not return before the requested sleep time has elapsed */ 1942 + if (!schedule_hrtimeout_range(&exp, delta, HRTIMER_MODE_ABS)) 1943 + break; 1944 + } 1919 1945 } 1920 1946 EXPORT_SYMBOL(usleep_range);
+1
kernel/trace/trace.c
··· 1125 1125 { trace_clock, "perf", 1 }, 1126 1126 { ktime_get_mono_fast_ns, "mono", 1 }, 1127 1127 { ktime_get_raw_fast_ns, "mono_raw", 1 }, 1128 + { ktime_get_boot_fast_ns, "boot", 1 }, 1128 1129 ARCH_TRACE_CLOCKS 1129 1130 }; 1130 1131
+2
scripts/kconfig/expr.h
··· 85 85 struct property *prop; 86 86 struct expr_value dir_dep; 87 87 struct expr_value rev_dep; 88 + struct expr_value implied; 88 89 }; 89 90 90 91 #define for_all_symbols(i, sym) for (i = 0; i < SYMBOL_HASHSIZE; i++) for (sym = symbol_hash[i]; sym; sym = sym->next) if (sym->type != S_OTHER) ··· 137 136 P_DEFAULT, /* default y */ 138 137 P_CHOICE, /* choice value */ 139 138 P_SELECT, /* select BAR */ 139 + P_IMPLY, /* imply BAR */ 140 140 P_RANGE, /* range 7..100 (for a symbol) */ 141 141 P_ENV, /* value from environment variable */ 142 142 P_SYMBOL, /* where a symbol is defined */
+39 -16
scripts/kconfig/menu.c
··· 233 233 { 234 234 struct property *prop; 235 235 struct symbol *sym2; 236 + char *use; 237 + 236 238 for (prop = sym->prop; prop; prop = prop->next) { 237 239 switch (prop->type) { 238 240 case P_DEFAULT: ··· 254 252 } 255 253 break; 256 254 case P_SELECT: 255 + case P_IMPLY: 256 + use = prop->type == P_SELECT ? "select" : "imply"; 257 257 sym2 = prop_get_symbol(prop); 258 258 if (sym->type != S_BOOLEAN && sym->type != S_TRISTATE) 259 259 prop_warn(prop, 260 - "config symbol '%s' uses select, but is " 261 - "not boolean or tristate", sym->name); 260 + "config symbol '%s' uses %s, but is " 261 + "not boolean or tristate", sym->name, use); 262 262 else if (sym2->type != S_UNKNOWN && 263 263 sym2->type != S_BOOLEAN && 264 264 sym2->type != S_TRISTATE) 265 265 prop_warn(prop, 266 - "'%s' has wrong type. 'select' only " 266 + "'%s' has wrong type. '%s' only " 267 267 "accept arguments of boolean and " 268 - "tristate type", sym2->name); 268 + "tristate type", sym2->name, use); 269 269 break; 270 270 case P_RANGE: 271 271 if (sym->type != S_INT && sym->type != S_HEX) ··· 336 332 if (prop->type == P_SELECT) { 337 333 struct symbol *es = prop_get_symbol(prop); 338 334 es->rev_dep.expr = expr_alloc_or(es->rev_dep.expr, 335 + expr_alloc_and(expr_alloc_symbol(menu->sym), expr_copy(dep))); 336 + } else if (prop->type == P_IMPLY) { 337 + struct symbol *es = prop_get_symbol(prop); 338 + es->implied.expr = expr_alloc_or(es->implied.expr, 339 339 expr_alloc_and(expr_alloc_symbol(menu->sym), expr_copy(dep))); 340 340 } 341 341 } ··· 620 612 return prop; 621 613 } 622 614 615 + static void get_symbol_props_str(struct gstr *r, struct symbol *sym, 616 + enum prop_type tok, const char *prefix) 617 + { 618 + bool hit = false; 619 + struct property *prop; 620 + 621 + for_all_properties(sym, prop, tok) { 622 + if (!hit) { 623 + str_append(r, prefix); 624 + hit = true; 625 + } else 626 + str_printf(r, " && "); 627 + expr_gstr_print(prop->expr, r); 628 + } 629 + if (hit) 630 + str_append(r, "\n"); 631 + } 632 + 623 633 /* 624 634 * head is optional and may be NULL 625 635 */ 626 636 static void get_symbol_str(struct gstr *r, struct symbol *sym, 627 637 struct list_head *head) 628 638 { 629 - bool hit; 630 639 struct property *prop; 631 640 632 641 if (sym && sym->name) { ··· 673 648 } 674 649 } 675 650 676 - hit = false; 677 - for_all_properties(sym, prop, P_SELECT) { 678 - if (!hit) { 679 - str_append(r, " Selects: "); 680 - hit = true; 681 - } else 682 - str_printf(r, " && "); 683 - expr_gstr_print(prop->expr, r); 684 - } 685 - if (hit) 686 - str_append(r, "\n"); 651 + get_symbol_props_str(r, sym, P_SELECT, _(" Selects: ")); 687 652 if (sym->rev_dep.expr) { 688 653 str_append(r, _(" Selected by: ")); 689 654 expr_gstr_print(sym->rev_dep.expr, r); 690 655 str_append(r, "\n"); 691 656 } 657 + 658 + get_symbol_props_str(r, sym, P_IMPLY, _(" Implies: ")); 659 + if (sym->implied.expr) { 660 + str_append(r, _(" Implied by: ")); 661 + expr_gstr_print(sym->implied.expr, r); 662 + str_append(r, "\n"); 663 + } 664 + 692 665 str_append(r, "\n\n"); 693 666 } 694 667
+23 -1
scripts/kconfig/symbol.c
··· 258 258 sym->rev_dep.tri = tri; 259 259 sym_set_changed(sym); 260 260 } 261 + tri = no; 262 + if (sym->implied.expr && sym->dir_dep.tri != no) 263 + tri = expr_calc_value(sym->implied.expr); 264 + if (tri == mod && sym_get_type(sym) == S_BOOLEAN) 265 + tri = yes; 266 + if (sym->implied.tri != tri) { 267 + sym->implied.tri = tri; 268 + sym_set_changed(sym); 269 + } 261 270 } 262 271 263 272 /* ··· 406 397 newval.tri = EXPR_AND(expr_calc_value(prop->expr), 407 398 prop->visible.tri); 408 399 } 400 + if (sym->implied.tri != no) { 401 + sym->flags |= SYMBOL_WRITE; 402 + newval.tri = EXPR_OR(newval.tri, sym->implied.tri); 403 + } 409 404 } 410 405 calc_newval: 411 406 if (sym->dir_dep.tri == no && sym->rev_dep.tri != no) { ··· 426 413 } 427 414 newval.tri = EXPR_OR(newval.tri, sym->rev_dep.tri); 428 415 } 429 - if (newval.tri == mod && sym_get_type(sym) == S_BOOLEAN) 416 + if (newval.tri == mod && 417 + (sym_get_type(sym) == S_BOOLEAN || sym->implied.tri == yes)) 430 418 newval.tri = yes; 431 419 break; 432 420 case S_STRING: ··· 511 497 if (type == S_BOOLEAN && val == mod) 512 498 return false; 513 499 if (sym->visible <= sym->rev_dep.tri) 500 + return false; 501 + if (sym->implied.tri == yes && val == mod) 514 502 return false; 515 503 if (sym_is_choice_value(sym) && sym->visible == yes) 516 504 return val == yes; ··· 765 749 /* transpose mod to yes if type is bool */ 766 750 if (sym->type == S_BOOLEAN && val == mod) 767 751 val = yes; 752 + 753 + /* adjust the default value if this symbol is implied by another */ 754 + if (val < sym->implied.tri) 755 + val = sym->implied.tri; 768 756 769 757 switch (sym->type) { 770 758 case S_BOOLEAN: ··· 1372 1352 return "choice"; 1373 1353 case P_SELECT: 1374 1354 return "select"; 1355 + case P_IMPLY: 1356 + return "imply"; 1375 1357 case P_RANGE: 1376 1358 return "range"; 1377 1359 case P_SYMBOL:
+1
scripts/kconfig/zconf.gperf
··· 38 38 hex, T_TYPE, TF_COMMAND, S_HEX 39 39 string, T_TYPE, TF_COMMAND, S_STRING 40 40 select, T_SELECT, TF_COMMAND 41 + imply, T_IMPLY, TF_COMMAND 41 42 range, T_RANGE, TF_COMMAND 42 43 visible, T_VISIBLE, TF_COMMAND 43 44 option, T_OPTION, TF_COMMAND
+17 -13
scripts/kconfig/zconf.hash.c_shipped
··· 55 55 73, 73, 73, 73, 73, 73, 73, 73, 73, 73, 56 56 73, 73, 73, 73, 73, 73, 73, 73, 73, 73, 57 57 73, 73, 73, 73, 73, 73, 73, 73, 73, 73, 58 - 73, 73, 73, 73, 73, 73, 73, 5, 25, 25, 58 + 73, 73, 73, 73, 73, 73, 73, 10, 25, 25, 59 59 0, 0, 0, 5, 0, 0, 73, 73, 5, 0, 60 60 10, 5, 45, 73, 20, 20, 0, 15, 15, 73, 61 - 20, 5, 73, 73, 73, 73, 73, 73, 73, 73, 61 + 20, 0, 73, 73, 73, 73, 73, 73, 73, 73, 62 62 73, 73, 73, 73, 73, 73, 73, 73, 73, 73, 63 63 73, 73, 73, 73, 73, 73, 73, 73, 73, 73, 64 64 73, 73, 73, 73, 73, 73, 73, 73, 73, 73, ··· 120 120 char kconf_id_strings_str43[sizeof("hex")]; 121 121 char kconf_id_strings_str46[sizeof("config")]; 122 122 char kconf_id_strings_str47[sizeof("boolean")]; 123 + char kconf_id_strings_str50[sizeof("imply")]; 123 124 char kconf_id_strings_str51[sizeof("string")]; 124 125 char kconf_id_strings_str54[sizeof("help")]; 125 126 char kconf_id_strings_str56[sizeof("prompt")]; ··· 158 157 "hex", 159 158 "config", 160 159 "boolean", 160 + "imply", 161 161 "string", 162 162 "help", 163 163 "prompt", ··· 176 174 { 177 175 enum 178 176 { 179 - TOTAL_KEYWORDS = 34, 177 + TOTAL_KEYWORDS = 35, 180 178 MIN_WORD_LENGTH = 2, 181 179 MAX_WORD_LENGTH = 14, 182 180 MIN_HASH_VALUE = 2, ··· 207 205 {(int)(long)&((struct kconf_id_strings_t *)0)->kconf_id_strings_str12, T_DEFAULT, TF_COMMAND, S_TRISTATE}, 208 206 #line 36 "scripts/kconfig/zconf.gperf" 209 207 {(int)(long)&((struct kconf_id_strings_t *)0)->kconf_id_strings_str13, T_DEFAULT, TF_COMMAND, S_BOOLEAN}, 210 - #line 46 "scripts/kconfig/zconf.gperf" 208 + #line 47 "scripts/kconfig/zconf.gperf" 211 209 {(int)(long)&((struct kconf_id_strings_t *)0)->kconf_id_strings_str14, T_OPT_DEFCONFIG_LIST,TF_OPTION}, 212 210 {-1}, {-1}, 213 - #line 44 "scripts/kconfig/zconf.gperf" 211 + #line 45 "scripts/kconfig/zconf.gperf" 214 212 {(int)(long)&((struct kconf_id_strings_t *)0)->kconf_id_strings_str17, T_ON, TF_PARAM}, 215 213 #line 29 "scripts/kconfig/zconf.gperf" 216 214 {(int)(long)&((struct kconf_id_strings_t *)0)->kconf_id_strings_str18, T_OPTIONAL, TF_COMMAND}, 217 215 {-1}, {-1}, 218 - #line 43 "scripts/kconfig/zconf.gperf" 216 + #line 44 "scripts/kconfig/zconf.gperf" 219 217 {(int)(long)&((struct kconf_id_strings_t *)0)->kconf_id_strings_str21, T_OPTION, TF_COMMAND}, 220 218 #line 17 "scripts/kconfig/zconf.gperf" 221 219 {(int)(long)&((struct kconf_id_strings_t *)0)->kconf_id_strings_str22, T_ENDMENU, TF_COMMAND}, ··· 225 223 #line 23 "scripts/kconfig/zconf.gperf" 226 224 {(int)(long)&((struct kconf_id_strings_t *)0)->kconf_id_strings_str25, T_MENUCONFIG, TF_COMMAND}, 227 225 {-1}, 228 - #line 45 "scripts/kconfig/zconf.gperf" 226 + #line 46 "scripts/kconfig/zconf.gperf" 229 227 {(int)(long)&((struct kconf_id_strings_t *)0)->kconf_id_strings_str27, T_OPT_MODULES, TF_OPTION}, 230 - #line 48 "scripts/kconfig/zconf.gperf" 228 + #line 49 "scripts/kconfig/zconf.gperf" 231 229 {(int)(long)&((struct kconf_id_strings_t *)0)->kconf_id_strings_str28, T_OPT_ALLNOCONFIG_Y,TF_OPTION}, 232 230 #line 16 "scripts/kconfig/zconf.gperf" 233 231 {(int)(long)&((struct kconf_id_strings_t *)0)->kconf_id_strings_str29, T_MENU, TF_COMMAND}, ··· 236 234 {(int)(long)&((struct kconf_id_strings_t *)0)->kconf_id_strings_str31, T_SELECT, TF_COMMAND}, 237 235 #line 21 "scripts/kconfig/zconf.gperf" 238 236 {(int)(long)&((struct kconf_id_strings_t *)0)->kconf_id_strings_str32, T_COMMENT, TF_COMMAND}, 239 - #line 47 "scripts/kconfig/zconf.gperf" 237 + #line 48 "scripts/kconfig/zconf.gperf" 240 238 {(int)(long)&((struct kconf_id_strings_t *)0)->kconf_id_strings_str33, T_OPT_ENV, TF_OPTION}, 241 239 {-1}, 242 - #line 41 "scripts/kconfig/zconf.gperf" 240 + #line 42 "scripts/kconfig/zconf.gperf" 243 241 {(int)(long)&((struct kconf_id_strings_t *)0)->kconf_id_strings_str35, T_RANGE, TF_COMMAND}, 244 242 #line 19 "scripts/kconfig/zconf.gperf" 245 243 {(int)(long)&((struct kconf_id_strings_t *)0)->kconf_id_strings_str36, T_CHOICE, TF_COMMAND}, ··· 249 247 {-1}, 250 248 #line 18 "scripts/kconfig/zconf.gperf" 251 249 {(int)(long)&((struct kconf_id_strings_t *)0)->kconf_id_strings_str41, T_SOURCE, TF_COMMAND}, 252 - #line 42 "scripts/kconfig/zconf.gperf" 250 + #line 43 "scripts/kconfig/zconf.gperf" 253 251 {(int)(long)&((struct kconf_id_strings_t *)0)->kconf_id_strings_str42, T_VISIBLE, TF_COMMAND}, 254 252 #line 38 "scripts/kconfig/zconf.gperf" 255 253 {(int)(long)&((struct kconf_id_strings_t *)0)->kconf_id_strings_str43, T_TYPE, TF_COMMAND, S_HEX}, ··· 258 256 {(int)(long)&((struct kconf_id_strings_t *)0)->kconf_id_strings_str46, T_CONFIG, TF_COMMAND}, 259 257 #line 35 "scripts/kconfig/zconf.gperf" 260 258 {(int)(long)&((struct kconf_id_strings_t *)0)->kconf_id_strings_str47, T_TYPE, TF_COMMAND, S_BOOLEAN}, 261 - {-1}, {-1}, {-1}, 259 + {-1}, {-1}, 260 + #line 41 "scripts/kconfig/zconf.gperf" 261 + {(int)(long)&((struct kconf_id_strings_t *)0)->kconf_id_strings_str50, T_IMPLY, TF_COMMAND}, 262 262 #line 39 "scripts/kconfig/zconf.gperf" 263 263 {(int)(long)&((struct kconf_id_strings_t *)0)->kconf_id_strings_str51, T_TYPE, TF_COMMAND, S_STRING}, 264 264 {-1}, {-1}, ··· 293 289 } 294 290 return 0; 295 291 } 296 - #line 49 "scripts/kconfig/zconf.gperf" 292 + #line 50 "scripts/kconfig/zconf.gperf" 297 293
+805 -914
scripts/kconfig/zconf.tab.c_shipped
··· 1 - /* A Bison parser, made by GNU Bison 2.5.1. */ 1 + /* A Bison parser, made by GNU Bison 3.0.4. */ 2 2 3 3 /* Bison implementation for Yacc-like parsers in C 4 - 5 - Copyright (C) 1984, 1989-1990, 2000-2012 Free Software Foundation, Inc. 6 - 4 + 5 + Copyright (C) 1984, 1989-1990, 2000-2015 Free Software Foundation, Inc. 6 + 7 7 This program is free software: you can redistribute it and/or modify 8 8 it under the terms of the GNU General Public License as published by 9 9 the Free Software Foundation, either version 3 of the License, or 10 10 (at your option) any later version. 11 - 11 + 12 12 This program is distributed in the hope that it will be useful, 13 13 but WITHOUT ANY WARRANTY; without even the implied warranty of 14 14 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 15 15 GNU General Public License for more details. 16 - 16 + 17 17 You should have received a copy of the GNU General Public License 18 18 along with this program. If not, see <http://www.gnu.org/licenses/>. */ 19 19 ··· 26 26 special exception, which will cause the skeleton and the resulting 27 27 Bison output files to be licensed under the GNU General Public 28 28 License without this special exception. 29 - 29 + 30 30 This special exception was added by the Free Software Foundation in 31 31 version 2.2 of Bison. */ 32 32 ··· 44 44 #define YYBISON 1 45 45 46 46 /* Bison version. */ 47 - #define YYBISON_VERSION "2.5.1" 47 + #define YYBISON_VERSION "3.0.4" 48 48 49 49 /* Skeleton name. */ 50 50 #define YYSKELETON_NAME "yacc.c" ··· 58 58 /* Pull parsers. */ 59 59 #define YYPULL 1 60 60 61 - /* Using locations. */ 62 - #define YYLSP_NEEDED 0 63 61 64 62 /* Substitute the variable and function names. */ 65 63 #define yyparse zconfparse 66 64 #define yylex zconflex 67 65 #define yyerror zconferror 68 - #define yylval zconflval 69 - #define yychar zconfchar 70 66 #define yydebug zconfdebug 71 67 #define yynerrs zconfnerrs 72 68 69 + #define yylval zconflval 70 + #define yychar zconfchar 73 71 74 72 /* Copy the first part of user declarations. */ 75 73 ··· 106 108 107 109 108 110 109 - # ifndef YY_NULL 111 + # ifndef YY_NULLPTR 110 112 # if defined __cplusplus && 201103L <= __cplusplus 111 - # define YY_NULL nullptr 113 + # define YY_NULLPTR nullptr 112 114 # else 113 - # define YY_NULL 0 115 + # define YY_NULLPTR 0 114 116 # endif 115 117 # endif 116 - 117 - /* Enabling traces. */ 118 - #ifndef YYDEBUG 119 - # define YYDEBUG 1 120 - #endif 121 118 122 119 /* Enabling verbose error messages. */ 123 120 #ifdef YYERROR_VERBOSE ··· 122 129 # define YYERROR_VERBOSE 0 123 130 #endif 124 131 125 - /* Enabling the token table. */ 126 - #ifndef YYTOKEN_TABLE 127 - # define YYTOKEN_TABLE 0 132 + 133 + /* Debug traces. */ 134 + #ifndef YYDEBUG 135 + # define YYDEBUG 1 136 + #endif 137 + #if YYDEBUG 138 + extern int zconfdebug; 128 139 #endif 129 140 130 - 131 - /* Tokens. */ 141 + /* Token type. */ 132 142 #ifndef YYTOKENTYPE 133 143 # define YYTOKENTYPE 134 - /* Put the tokens into the symbol table, so that GDB and other debuggers 135 - know about them. */ 136 - enum yytokentype { 137 - T_MAINMENU = 258, 138 - T_MENU = 259, 139 - T_ENDMENU = 260, 140 - T_SOURCE = 261, 141 - T_CHOICE = 262, 142 - T_ENDCHOICE = 263, 143 - T_COMMENT = 264, 144 - T_CONFIG = 265, 145 - T_MENUCONFIG = 266, 146 - T_HELP = 267, 147 - T_HELPTEXT = 268, 148 - T_IF = 269, 149 - T_ENDIF = 270, 150 - T_DEPENDS = 271, 151 - T_OPTIONAL = 272, 152 - T_PROMPT = 273, 153 - T_TYPE = 274, 154 - T_DEFAULT = 275, 155 - T_SELECT = 276, 156 - T_RANGE = 277, 157 - T_VISIBLE = 278, 158 - T_OPTION = 279, 159 - T_ON = 280, 160 - T_WORD = 281, 161 - T_WORD_QUOTE = 282, 162 - T_UNEQUAL = 283, 163 - T_LESS = 284, 164 - T_LESS_EQUAL = 285, 165 - T_GREATER = 286, 166 - T_GREATER_EQUAL = 287, 167 - T_CLOSE_PAREN = 288, 168 - T_OPEN_PAREN = 289, 169 - T_EOL = 290, 170 - T_OR = 291, 171 - T_AND = 292, 172 - T_EQUAL = 293, 173 - T_NOT = 294 174 - }; 144 + enum yytokentype 145 + { 146 + T_MAINMENU = 258, 147 + T_MENU = 259, 148 + T_ENDMENU = 260, 149 + T_SOURCE = 261, 150 + T_CHOICE = 262, 151 + T_ENDCHOICE = 263, 152 + T_COMMENT = 264, 153 + T_CONFIG = 265, 154 + T_MENUCONFIG = 266, 155 + T_HELP = 267, 156 + T_HELPTEXT = 268, 157 + T_IF = 269, 158 + T_ENDIF = 270, 159 + T_DEPENDS = 271, 160 + T_OPTIONAL = 272, 161 + T_PROMPT = 273, 162 + T_TYPE = 274, 163 + T_DEFAULT = 275, 164 + T_SELECT = 276, 165 + T_IMPLY = 277, 166 + T_RANGE = 278, 167 + T_VISIBLE = 279, 168 + T_OPTION = 280, 169 + T_ON = 281, 170 + T_WORD = 282, 171 + T_WORD_QUOTE = 283, 172 + T_UNEQUAL = 284, 173 + T_LESS = 285, 174 + T_LESS_EQUAL = 286, 175 + T_GREATER = 287, 176 + T_GREATER_EQUAL = 288, 177 + T_CLOSE_PAREN = 289, 178 + T_OPEN_PAREN = 290, 179 + T_EOL = 291, 180 + T_OR = 292, 181 + T_AND = 293, 182 + T_EQUAL = 294, 183 + T_NOT = 295 184 + }; 175 185 #endif 176 186 177 - 178 - 187 + /* Value type. */ 179 188 #if ! defined YYSTYPE && ! defined YYSTYPE_IS_DECLARED 180 - typedef union YYSTYPE 189 + 190 + union YYSTYPE 181 191 { 182 192 183 193 ··· 192 196 const struct kconf_id *id; 193 197 194 198 199 + }; 195 200 196 - } YYSTYPE; 201 + typedef union YYSTYPE YYSTYPE; 197 202 # define YYSTYPE_IS_TRIVIAL 1 198 - # define yystype YYSTYPE /* obsolescent; will be withdrawn */ 199 203 # define YYSTYPE_IS_DECLARED 1 200 204 #endif 205 + 206 + 207 + extern YYSTYPE zconflval; 208 + 209 + int zconfparse (void); 210 + 201 211 202 212 203 213 /* Copy the second part of user declarations. */ ··· 226 224 227 225 #ifdef YYTYPE_INT8 228 226 typedef YYTYPE_INT8 yytype_int8; 229 - #elif (defined __STDC__ || defined __C99__FUNC__ \ 230 - || defined __cplusplus || defined _MSC_VER) 231 - typedef signed char yytype_int8; 232 227 #else 233 - typedef short int yytype_int8; 228 + typedef signed char yytype_int8; 234 229 #endif 235 230 236 231 #ifdef YYTYPE_UINT16 ··· 247 248 # define YYSIZE_T __SIZE_TYPE__ 248 249 # elif defined size_t 249 250 # define YYSIZE_T size_t 250 - # elif ! defined YYSIZE_T && (defined __STDC__ || defined __C99__FUNC__ \ 251 - || defined __cplusplus || defined _MSC_VER) 251 + # elif ! defined YYSIZE_T 252 252 # include <stddef.h> /* INFRINGES ON USER NAME SPACE */ 253 253 # define YYSIZE_T size_t 254 254 # else ··· 261 263 # if defined YYENABLE_NLS && YYENABLE_NLS 262 264 # if ENABLE_NLS 263 265 # include <libintl.h> /* INFRINGES ON USER NAME SPACE */ 264 - # define YY_(msgid) dgettext ("bison-runtime", msgid) 266 + # define YY_(Msgid) dgettext ("bison-runtime", Msgid) 265 267 # endif 266 268 # endif 267 269 # ifndef YY_ 268 - # define YY_(msgid) msgid 270 + # define YY_(Msgid) Msgid 271 + # endif 272 + #endif 273 + 274 + #ifndef YY_ATTRIBUTE 275 + # if (defined __GNUC__ \ 276 + && (2 < __GNUC__ || (__GNUC__ == 2 && 96 <= __GNUC_MINOR__))) \ 277 + || defined __SUNPRO_C && 0x5110 <= __SUNPRO_C 278 + # define YY_ATTRIBUTE(Spec) __attribute__(Spec) 279 + # else 280 + # define YY_ATTRIBUTE(Spec) /* empty */ 281 + # endif 282 + #endif 283 + 284 + #ifndef YY_ATTRIBUTE_PURE 285 + # define YY_ATTRIBUTE_PURE YY_ATTRIBUTE ((__pure__)) 286 + #endif 287 + 288 + #ifndef YY_ATTRIBUTE_UNUSED 289 + # define YY_ATTRIBUTE_UNUSED YY_ATTRIBUTE ((__unused__)) 290 + #endif 291 + 292 + #if !defined _Noreturn \ 293 + && (!defined __STDC_VERSION__ || __STDC_VERSION__ < 201112) 294 + # if defined _MSC_VER && 1200 <= _MSC_VER 295 + # define _Noreturn __declspec (noreturn) 296 + # else 297 + # define _Noreturn YY_ATTRIBUTE ((__noreturn__)) 269 298 # endif 270 299 #endif 271 300 272 301 /* Suppress unused-variable warnings by "using" E. */ 273 302 #if ! defined lint || defined __GNUC__ 274 - # define YYUSE(e) ((void) (e)) 303 + # define YYUSE(E) ((void) (E)) 275 304 #else 276 - # define YYUSE(e) /* empty */ 305 + # define YYUSE(E) /* empty */ 277 306 #endif 278 307 279 - /* Identity function, used to suppress warnings about constant conditions. */ 280 - #ifndef lint 281 - # define YYID(n) (n) 308 + #if defined __GNUC__ && 407 <= __GNUC__ * 100 + __GNUC_MINOR__ 309 + /* Suppress an incorrect diagnostic about yylval being uninitialized. */ 310 + # define YY_IGNORE_MAYBE_UNINITIALIZED_BEGIN \ 311 + _Pragma ("GCC diagnostic push") \ 312 + _Pragma ("GCC diagnostic ignored \"-Wuninitialized\"")\ 313 + _Pragma ("GCC diagnostic ignored \"-Wmaybe-uninitialized\"") 314 + # define YY_IGNORE_MAYBE_UNINITIALIZED_END \ 315 + _Pragma ("GCC diagnostic pop") 282 316 #else 283 - #if (defined __STDC__ || defined __C99__FUNC__ \ 284 - || defined __cplusplus || defined _MSC_VER) 285 - static int 286 - YYID (int yyi) 287 - #else 288 - static int 289 - YYID (yyi) 290 - int yyi; 317 + # define YY_INITIAL_VALUE(Value) Value 291 318 #endif 292 - { 293 - return yyi; 294 - } 319 + #ifndef YY_IGNORE_MAYBE_UNINITIALIZED_BEGIN 320 + # define YY_IGNORE_MAYBE_UNINITIALIZED_BEGIN 321 + # define YY_IGNORE_MAYBE_UNINITIALIZED_END 295 322 #endif 323 + #ifndef YY_INITIAL_VALUE 324 + # define YY_INITIAL_VALUE(Value) /* Nothing. */ 325 + #endif 326 + 296 327 297 328 #if ! defined yyoverflow || YYERROR_VERBOSE 298 329 ··· 340 313 # define alloca _alloca 341 314 # else 342 315 # define YYSTACK_ALLOC alloca 343 - # if ! defined _ALLOCA_H && ! defined EXIT_SUCCESS && (defined __STDC__ || defined __C99__FUNC__ \ 344 - || defined __cplusplus || defined _MSC_VER) 316 + # if ! defined _ALLOCA_H && ! defined EXIT_SUCCESS 345 317 # include <stdlib.h> /* INFRINGES ON USER NAME SPACE */ 346 318 /* Use EXIT_SUCCESS as a witness for stdlib.h. */ 347 319 # ifndef EXIT_SUCCESS ··· 352 326 # endif 353 327 354 328 # ifdef YYSTACK_ALLOC 355 - /* Pacify GCC's `empty if-body' warning. */ 356 - # define YYSTACK_FREE(Ptr) do { /* empty */; } while (YYID (0)) 329 + /* Pacify GCC's 'empty if-body' warning. */ 330 + # define YYSTACK_FREE(Ptr) do { /* empty */; } while (0) 357 331 # ifndef YYSTACK_ALLOC_MAXIMUM 358 332 /* The OS might guarantee only one guard page at the bottom of the stack, 359 333 and a page size can be as small as 4096 bytes. So we cannot safely ··· 369 343 # endif 370 344 # if (defined __cplusplus && ! defined EXIT_SUCCESS \ 371 345 && ! ((defined YYMALLOC || defined malloc) \ 372 - && (defined YYFREE || defined free))) 346 + && (defined YYFREE || defined free))) 373 347 # include <stdlib.h> /* INFRINGES ON USER NAME SPACE */ 374 348 # ifndef EXIT_SUCCESS 375 349 # define EXIT_SUCCESS 0 ··· 377 351 # endif 378 352 # ifndef YYMALLOC 379 353 # define YYMALLOC malloc 380 - # if ! defined malloc && ! defined EXIT_SUCCESS && (defined __STDC__ || defined __C99__FUNC__ \ 381 - || defined __cplusplus || defined _MSC_VER) 354 + # if ! defined malloc && ! defined EXIT_SUCCESS 382 355 void *malloc (YYSIZE_T); /* INFRINGES ON USER NAME SPACE */ 383 356 # endif 384 357 # endif 385 358 # ifndef YYFREE 386 359 # define YYFREE free 387 - # if ! defined free && ! defined EXIT_SUCCESS && (defined __STDC__ || defined __C99__FUNC__ \ 388 - || defined __cplusplus || defined _MSC_VER) 360 + # if ! defined free && ! defined EXIT_SUCCESS 389 361 void free (void *); /* INFRINGES ON USER NAME SPACE */ 390 362 # endif 391 363 # endif ··· 393 369 394 370 #if (! defined yyoverflow \ 395 371 && (! defined __cplusplus \ 396 - || (defined YYSTYPE_IS_TRIVIAL && YYSTYPE_IS_TRIVIAL))) 372 + || (defined YYSTYPE_IS_TRIVIAL && YYSTYPE_IS_TRIVIAL))) 397 373 398 374 /* A type that is properly aligned for any stack member. */ 399 375 union yyalloc ··· 418 394 elements in the stack, and YYPTR gives the new location of the 419 395 stack. Advance YYPTR to a properly aligned location for the next 420 396 stack. */ 421 - # define YYSTACK_RELOCATE(Stack_alloc, Stack) \ 422 - do \ 423 - { \ 424 - YYSIZE_T yynewbytes; \ 425 - YYCOPY (&yyptr->Stack_alloc, Stack, yysize); \ 426 - Stack = &yyptr->Stack_alloc; \ 427 - yynewbytes = yystacksize * sizeof (*Stack) + YYSTACK_GAP_MAXIMUM; \ 428 - yyptr += yynewbytes / sizeof (*yyptr); \ 429 - } \ 430 - while (YYID (0)) 397 + # define YYSTACK_RELOCATE(Stack_alloc, Stack) \ 398 + do \ 399 + { \ 400 + YYSIZE_T yynewbytes; \ 401 + YYCOPY (&yyptr->Stack_alloc, Stack, yysize); \ 402 + Stack = &yyptr->Stack_alloc; \ 403 + yynewbytes = yystacksize * sizeof (*Stack) + YYSTACK_GAP_MAXIMUM; \ 404 + yyptr += yynewbytes / sizeof (*yyptr); \ 405 + } \ 406 + while (0) 431 407 432 408 #endif 433 409 ··· 446 422 for (yyi = 0; yyi < (Count); yyi++) \ 447 423 (Dst)[yyi] = (Src)[yyi]; \ 448 424 } \ 449 - while (YYID (0)) 425 + while (0) 450 426 # endif 451 427 # endif 452 428 #endif /* !YYCOPY_NEEDED */ ··· 454 430 /* YYFINAL -- State number of the termination state. */ 455 431 #define YYFINAL 11 456 432 /* YYLAST -- Last index in YYTABLE. */ 457 - #define YYLAST 298 433 + #define YYLAST 301 458 434 459 435 /* YYNTOKENS -- Number of terminals. */ 460 - #define YYNTOKENS 40 436 + #define YYNTOKENS 41 461 437 /* YYNNTS -- Number of nonterminals. */ 462 438 #define YYNNTS 50 463 439 /* YYNRULES -- Number of rules. */ 464 - #define YYNRULES 122 465 - /* YYNRULES -- Number of states. */ 466 - #define YYNSTATES 199 440 + #define YYNRULES 124 441 + /* YYNSTATES -- Number of states. */ 442 + #define YYNSTATES 204 467 443 468 - /* YYTRANSLATE(YYLEX) -- Bison symbol number corresponding to YYLEX. */ 444 + /* YYTRANSLATE[YYX] -- Symbol number corresponding to YYX as returned 445 + by yylex, with out-of-bounds checking. */ 469 446 #define YYUNDEFTOK 2 470 - #define YYMAXUTOK 294 447 + #define YYMAXUTOK 295 471 448 472 - #define YYTRANSLATE(YYX) \ 449 + #define YYTRANSLATE(YYX) \ 473 450 ((unsigned int) (YYX) <= YYMAXUTOK ? yytranslate[YYX] : YYUNDEFTOK) 474 451 475 - /* YYTRANSLATE[YYLEX] -- Bison symbol number corresponding to YYLEX. */ 452 + /* YYTRANSLATE[TOKEN-NUM] -- Symbol number corresponding to TOKEN-NUM 453 + as returned by yylex, without out-of-bounds checking. */ 476 454 static const yytype_uint8 yytranslate[] = 477 455 { 478 456 0, 2, 2, 2, 2, 2, 2, 2, 2, 2, ··· 506 480 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 507 481 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 508 482 25, 26, 27, 28, 29, 30, 31, 32, 33, 34, 509 - 35, 36, 37, 38, 39 483 + 35, 36, 37, 38, 39, 40 510 484 }; 511 485 512 486 #if YYDEBUG 513 - /* YYPRHS[YYN] -- Index of the first RHS symbol of rule number YYN in 514 - YYRHS. */ 515 - static const yytype_uint16 yyprhs[] = 516 - { 517 - 0, 0, 3, 6, 8, 11, 13, 14, 17, 20, 518 - 23, 26, 31, 36, 40, 42, 44, 46, 48, 50, 519 - 52, 54, 56, 58, 60, 62, 64, 66, 68, 72, 520 - 75, 79, 82, 86, 89, 90, 93, 96, 99, 102, 521 - 105, 108, 112, 117, 122, 127, 133, 137, 138, 142, 522 - 143, 146, 150, 153, 155, 159, 160, 163, 166, 169, 523 - 172, 175, 180, 184, 187, 192, 193, 196, 200, 202, 524 - 206, 207, 210, 213, 216, 220, 224, 228, 230, 234, 525 - 235, 238, 241, 244, 248, 252, 255, 258, 261, 262, 526 - 265, 268, 271, 276, 277, 280, 283, 286, 287, 290, 527 - 292, 294, 297, 300, 303, 305, 308, 309, 312, 314, 528 - 318, 322, 326, 330, 334, 338, 342, 345, 349, 353, 529 - 355, 357, 358 530 - }; 531 - 532 - /* YYRHS -- A `-1'-separated list of the rules' RHS. */ 533 - static const yytype_int8 yyrhs[] = 534 - { 535 - 41, 0, -1, 85, 42, -1, 42, -1, 67, 43, 536 - -1, 43, -1, -1, 43, 45, -1, 43, 59, -1, 537 - 43, 71, -1, 43, 84, -1, 43, 26, 1, 35, 538 - -1, 43, 44, 1, 35, -1, 43, 1, 35, -1, 539 - 16, -1, 18, -1, 19, -1, 21, -1, 17, -1, 540 - 22, -1, 20, -1, 23, -1, 35, -1, 65, -1, 541 - 75, -1, 48, -1, 50, -1, 73, -1, 26, 1, 542 - 35, -1, 1, 35, -1, 10, 26, 35, -1, 47, 543 - 51, -1, 11, 26, 35, -1, 49, 51, -1, -1, 544 - 51, 52, -1, 51, 53, -1, 51, 79, -1, 51, 545 - 77, -1, 51, 46, -1, 51, 35, -1, 19, 82, 546 - 35, -1, 18, 83, 86, 35, -1, 20, 87, 86, 547 - 35, -1, 21, 26, 86, 35, -1, 22, 88, 88, 548 - 86, 35, -1, 24, 54, 35, -1, -1, 54, 26, 549 - 55, -1, -1, 38, 83, -1, 7, 89, 35, -1, 550 - 56, 60, -1, 84, -1, 57, 62, 58, -1, -1, 551 - 60, 61, -1, 60, 79, -1, 60, 77, -1, 60, 552 - 35, -1, 60, 46, -1, 18, 83, 86, 35, -1, 553 - 19, 82, 35, -1, 17, 35, -1, 20, 26, 86, 554 - 35, -1, -1, 62, 45, -1, 14, 87, 85, -1, 555 - 84, -1, 63, 66, 64, -1, -1, 66, 45, -1, 556 - 66, 71, -1, 66, 59, -1, 3, 83, 85, -1, 557 - 4, 83, 35, -1, 68, 80, 78, -1, 84, -1, 558 - 69, 72, 70, -1, -1, 72, 45, -1, 72, 71, 559 - -1, 72, 59, -1, 6, 83, 35, -1, 9, 83, 560 - 35, -1, 74, 78, -1, 12, 35, -1, 76, 13, 561 - -1, -1, 78, 79, -1, 78, 35, -1, 78, 46, 562 - -1, 16, 25, 87, 35, -1, -1, 80, 81, -1, 563 - 80, 35, -1, 23, 86, -1, -1, 83, 86, -1, 564 - 26, -1, 27, -1, 5, 35, -1, 8, 35, -1, 565 - 15, 35, -1, 35, -1, 85, 35, -1, -1, 14, 566 - 87, -1, 88, -1, 88, 29, 88, -1, 88, 30, 567 - 88, -1, 88, 31, 88, -1, 88, 32, 88, -1, 568 - 88, 38, 88, -1, 88, 28, 88, -1, 34, 87, 569 - 33, -1, 39, 87, -1, 87, 36, 87, -1, 87, 570 - 37, 87, -1, 26, -1, 27, -1, -1, 26, -1 571 - }; 572 - 573 - /* YYRLINE[YYN] -- source line where rule number YYN was defined. */ 487 + /* YYRLINE[YYN] -- Source line where rule number YYN was defined. */ 574 488 static const yytype_uint16 yyrline[] = 575 489 { 576 - 0, 108, 108, 108, 110, 110, 112, 114, 115, 116, 577 - 117, 118, 119, 123, 127, 127, 127, 127, 127, 127, 578 - 127, 127, 131, 132, 133, 134, 135, 136, 140, 141, 579 - 147, 155, 161, 169, 179, 181, 182, 183, 184, 185, 580 - 186, 189, 197, 203, 213, 219, 225, 228, 230, 241, 581 - 242, 247, 256, 261, 269, 272, 274, 275, 276, 277, 582 - 278, 281, 287, 298, 304, 314, 316, 321, 329, 337, 583 - 340, 342, 343, 344, 349, 356, 363, 368, 376, 379, 584 - 381, 382, 383, 386, 394, 401, 408, 414, 421, 423, 585 - 424, 425, 428, 436, 438, 439, 442, 449, 451, 456, 586 - 457, 460, 461, 462, 466, 467, 470, 471, 474, 475, 587 - 476, 477, 478, 479, 480, 481, 482, 483, 484, 487, 588 - 488, 491, 492 490 + 0, 109, 109, 109, 111, 111, 113, 115, 116, 117, 491 + 118, 119, 120, 124, 128, 128, 128, 128, 128, 128, 492 + 128, 128, 128, 132, 133, 134, 135, 136, 137, 141, 493 + 142, 148, 156, 162, 170, 180, 182, 183, 184, 185, 494 + 186, 187, 190, 198, 204, 214, 220, 226, 232, 235, 495 + 237, 248, 249, 254, 263, 268, 276, 279, 281, 282, 496 + 283, 284, 285, 288, 294, 305, 311, 321, 323, 328, 497 + 336, 344, 347, 349, 350, 351, 356, 363, 370, 375, 498 + 383, 386, 388, 389, 390, 393, 401, 408, 415, 421, 499 + 428, 430, 431, 432, 435, 443, 445, 446, 449, 456, 500 + 458, 463, 464, 467, 468, 469, 473, 474, 477, 478, 501 + 481, 482, 483, 484, 485, 486, 487, 488, 489, 490, 502 + 491, 494, 495, 498, 499 589 503 }; 590 504 #endif 591 505 592 - #if YYDEBUG || YYERROR_VERBOSE || YYTOKEN_TABLE 506 + #if YYDEBUG || YYERROR_VERBOSE || 0 593 507 /* YYTNAME[SYMBOL-NUM] -- String name of the symbol SYMBOL-NUM. 594 508 First, the terminals, then, starting at YYNTOKENS, nonterminals. */ 595 509 static const char *const yytname[] = ··· 537 571 "$end", "error", "$undefined", "T_MAINMENU", "T_MENU", "T_ENDMENU", 538 572 "T_SOURCE", "T_CHOICE", "T_ENDCHOICE", "T_COMMENT", "T_CONFIG", 539 573 "T_MENUCONFIG", "T_HELP", "T_HELPTEXT", "T_IF", "T_ENDIF", "T_DEPENDS", 540 - "T_OPTIONAL", "T_PROMPT", "T_TYPE", "T_DEFAULT", "T_SELECT", "T_RANGE", 541 - "T_VISIBLE", "T_OPTION", "T_ON", "T_WORD", "T_WORD_QUOTE", "T_UNEQUAL", 542 - "T_LESS", "T_LESS_EQUAL", "T_GREATER", "T_GREATER_EQUAL", 574 + "T_OPTIONAL", "T_PROMPT", "T_TYPE", "T_DEFAULT", "T_SELECT", "T_IMPLY", 575 + "T_RANGE", "T_VISIBLE", "T_OPTION", "T_ON", "T_WORD", "T_WORD_QUOTE", 576 + "T_UNEQUAL", "T_LESS", "T_LESS_EQUAL", "T_GREATER", "T_GREATER_EQUAL", 543 577 "T_CLOSE_PAREN", "T_OPEN_PAREN", "T_EOL", "T_OR", "T_AND", "T_EQUAL", 544 578 "T_NOT", "$accept", "input", "start", "stmt_list", "option_name", 545 579 "common_stmt", "option_error", "config_entry_start", "config_stmt", ··· 551 585 "menu_entry", "menu_end", "menu_stmt", "menu_block", "source_stmt", 552 586 "comment", "comment_stmt", "help_start", "help", "depends_list", 553 587 "depends", "visibility_list", "visible", "prompt_stmt_opt", "prompt", 554 - "end", "nl", "if_expr", "expr", "symbol", "word_opt", YY_NULL 588 + "end", "nl", "if_expr", "expr", "symbol", "word_opt", YY_NULLPTR 555 589 }; 556 590 #endif 557 591 558 592 # ifdef YYPRINT 559 - /* YYTOKNUM[YYLEX-NUM] -- Internal token number corresponding to 560 - token YYLEX-NUM. */ 593 + /* YYTOKNUM[NUM] -- (External) token number corresponding to the 594 + (internal) symbol number NUM (which must be that of a token). */ 561 595 static const yytype_uint16 yytoknum[] = 562 596 { 563 597 0, 256, 257, 258, 259, 260, 261, 262, 263, 264, 564 598 265, 266, 267, 268, 269, 270, 271, 272, 273, 274, 565 599 275, 276, 277, 278, 279, 280, 281, 282, 283, 284, 566 - 285, 286, 287, 288, 289, 290, 291, 292, 293, 294 600 + 285, 286, 287, 288, 289, 290, 291, 292, 293, 294, 601 + 295 567 602 }; 568 603 # endif 569 604 570 - /* YYR1[YYN] -- Symbol number of symbol that rule YYN derives. */ 571 - static const yytype_uint8 yyr1[] = 605 + #define YYPACT_NINF -92 606 + 607 + #define yypact_value_is_default(Yystate) \ 608 + (!!((Yystate) == (-92))) 609 + 610 + #define YYTABLE_NINF -88 611 + 612 + #define yytable_value_is_error(Yytable_value) \ 613 + 0 614 + 615 + /* YYPACT[STATE-NUM] -- Index in YYTABLE of the portion describing 616 + STATE-NUM. */ 617 + static const yytype_int16 yypact[] = 572 618 { 573 - 0, 40, 41, 41, 42, 42, 43, 43, 43, 43, 574 - 43, 43, 43, 43, 44, 44, 44, 44, 44, 44, 575 - 44, 44, 45, 45, 45, 45, 45, 45, 46, 46, 576 - 47, 48, 49, 50, 51, 51, 51, 51, 51, 51, 577 - 51, 52, 52, 52, 52, 52, 53, 54, 54, 55, 578 - 55, 56, 57, 58, 59, 60, 60, 60, 60, 60, 579 - 60, 61, 61, 61, 61, 62, 62, 63, 64, 65, 580 - 66, 66, 66, 66, 67, 68, 69, 70, 71, 72, 581 - 72, 72, 72, 73, 74, 75, 76, 77, 78, 78, 582 - 78, 78, 79, 80, 80, 80, 81, 82, 82, 83, 583 - 83, 84, 84, 84, 85, 85, 86, 86, 87, 87, 584 - 87, 87, 87, 87, 87, 87, 87, 87, 87, 88, 585 - 88, 89, 89 619 + 17, 41, -92, 15, -92, 150, -92, 19, -92, -92, 620 + -13, -92, 28, 41, 38, 41, 50, 47, 41, 79, 621 + 82, 44, 76, -92, -92, -92, -92, -92, -92, -92, 622 + -92, -92, 118, -92, 129, -92, -92, -92, -92, -92, 623 + -92, -92, -92, -92, -92, -92, -92, -92, -92, -92, 624 + -92, -92, 184, -92, -92, 107, -92, 111, -92, 113, 625 + -92, 116, -92, 139, 140, 151, -92, -92, 44, 44, 626 + 142, 256, -92, 160, 173, 27, 117, 80, 51, 255, 627 + -15, 255, 217, -92, -92, -92, -92, -92, -92, -8, 628 + -92, 44, 44, 107, 87, 87, 87, 87, 87, 87, 629 + -92, -92, 174, 176, 187, 41, 41, 44, 188, 189, 630 + 87, -92, 213, -92, -92, -92, -92, 206, -92, -92, 631 + 193, 41, 41, 203, -92, -92, -92, -92, -92, -92, 632 + -92, -92, -92, -92, -92, -92, -92, 229, -92, 241, 633 + -92, -92, -92, -92, -92, -92, -92, -92, -92, -92, 634 + 216, -92, -92, -92, -92, -92, -92, -92, -92, -92, 635 + 44, 229, 222, 229, 64, 229, 229, 87, 31, 231, 636 + -92, -92, 229, 236, 229, 44, -92, 145, 242, -92, 637 + -92, 243, 244, 245, 229, 251, -92, -92, 247, -92, 638 + 257, 125, -92, -92, -92, -92, -92, 260, 41, -92, 639 + -92, -92, -92, -92 586 640 }; 587 641 588 - /* YYR2[YYN] -- Number of symbols composing right hand side of rule YYN. */ 642 + /* YYDEFACT[STATE-NUM] -- Default reduction number in state STATE-NUM. 643 + Performed when YYTABLE does not specify something else to do. Zero 644 + means the default is an error. */ 645 + static const yytype_uint8 yydefact[] = 646 + { 647 + 6, 0, 106, 0, 3, 0, 6, 6, 101, 102, 648 + 0, 1, 0, 0, 0, 0, 123, 0, 0, 0, 649 + 0, 0, 0, 14, 19, 15, 16, 21, 17, 18, 650 + 20, 22, 0, 23, 0, 7, 35, 26, 35, 27, 651 + 57, 67, 8, 72, 24, 95, 81, 9, 28, 90, 652 + 25, 10, 0, 107, 2, 76, 13, 0, 103, 0, 653 + 124, 0, 104, 0, 0, 0, 121, 122, 0, 0, 654 + 0, 110, 105, 0, 0, 0, 0, 0, 0, 0, 655 + 90, 0, 0, 77, 85, 53, 86, 31, 33, 0, 656 + 118, 0, 0, 69, 0, 0, 0, 0, 0, 0, 657 + 11, 12, 0, 0, 0, 0, 99, 0, 0, 0, 658 + 0, 49, 0, 41, 40, 36, 37, 0, 39, 38, 659 + 0, 0, 99, 0, 61, 62, 58, 60, 59, 68, 660 + 56, 55, 73, 75, 71, 74, 70, 108, 97, 0, 661 + 96, 82, 84, 80, 83, 79, 92, 93, 91, 117, 662 + 119, 120, 116, 111, 112, 113, 114, 115, 30, 88, 663 + 0, 108, 0, 108, 108, 108, 108, 0, 0, 0, 664 + 89, 65, 108, 0, 108, 0, 98, 0, 0, 42, 665 + 100, 0, 0, 0, 108, 51, 48, 29, 0, 64, 666 + 0, 109, 94, 43, 44, 45, 46, 0, 0, 50, 667 + 63, 66, 47, 52 668 + }; 669 + 670 + /* YYPGOTO[NTERM-NUM]. */ 671 + static const yytype_int16 yypgoto[] = 672 + { 673 + -92, -92, 285, 291, -92, 32, -66, -92, -92, -92, 674 + -92, 261, -92, -92, -92, -92, -92, -92, -92, 1, 675 + -92, -92, -92, -92, -92, -92, -92, -92, -92, -92, 676 + -92, 24, -92, -92, -92, -92, -92, 221, 220, -64, 677 + -92, -92, 179, -1, 67, 0, 110, -67, -91, -92 678 + }; 679 + 680 + /* YYDEFGOTO[NTERM-NUM]. */ 681 + static const yytype_int16 yydefgoto[] = 682 + { 683 + -1, 3, 4, 5, 34, 35, 114, 36, 37, 38, 684 + 39, 75, 115, 116, 168, 199, 40, 41, 130, 42, 685 + 77, 126, 78, 43, 134, 44, 79, 6, 45, 46, 686 + 143, 47, 81, 48, 49, 50, 117, 118, 82, 119, 687 + 80, 140, 162, 163, 51, 7, 176, 70, 71, 61 688 + }; 689 + 690 + /* YYTABLE[YYPACT[STATE-NUM]] -- What to do in state STATE-NUM. If 691 + positive, shift that token. If negative, reduce the rule whose 692 + number is the opposite. If YYTABLE_NINF, syntax error. */ 693 + static const yytype_int16 yytable[] = 694 + { 695 + 10, 89, 90, 152, 153, 154, 155, 156, 157, 137, 696 + 55, 125, 57, 128, 59, 11, 147, 63, 148, 167, 697 + 1, 138, 1, 2, 150, 151, 149, -32, 102, 91, 698 + 92, -32, -32, -32, -32, -32, -32, -32, -32, 103, 699 + 164, -32, -32, 104, -32, 105, 106, 107, 108, 109, 700 + 110, -32, 111, 2, 112, 53, 14, 15, 185, 17, 701 + 18, 19, 20, 113, 56, 21, 22, 186, 8, 9, 702 + 93, 66, 67, 147, 58, 148, 184, 60, 175, 68, 703 + 133, 102, 142, 62, 69, -54, -54, 33, -54, -54, 704 + -54, -54, 103, 177, -54, -54, 104, 120, 121, 122, 705 + 123, 91, 92, 135, 161, 144, 64, 112, 191, 65, 706 + 129, 132, 72, 141, 66, 67, 124, -34, 102, 73, 707 + 172, -34, -34, -34, -34, -34, -34, -34, -34, 103, 708 + 74, -34, -34, 104, -34, 105, 106, 107, 108, 109, 709 + 110, -34, 111, 53, 112, 131, 136, 83, 145, 84, 710 + -5, 12, 85, 113, 13, 14, 15, 16, 17, 18, 711 + 19, 20, 91, 92, 21, 22, 23, 24, 25, 26, 712 + 27, 28, 29, 30, 31, 86, 87, 32, 2, 91, 713 + 92, 192, 91, 92, -4, 12, 33, 88, 13, 14, 714 + 15, 16, 17, 18, 19, 20, 100, 203, 21, 22, 715 + 23, 24, 25, 26, 27, 28, 29, 30, 31, 101, 716 + 158, 32, 159, 160, 169, 165, 166, -87, 102, 170, 717 + 33, -87, -87, -87, -87, -87, -87, -87, -87, 171, 718 + 174, -87, -87, 104, -87, -87, -87, -87, -87, -87, 719 + -87, -87, 102, 175, 112, -78, -78, -78, -78, -78, 720 + -78, -78, -78, 146, 92, -78, -78, 104, 179, 13, 721 + 14, 15, 16, 17, 18, 19, 20, 187, 112, 21, 722 + 22, 178, 189, 180, 181, 182, 183, 146, 193, 194, 723 + 195, 196, 188, 200, 190, 94, 95, 96, 97, 98, 724 + 198, 33, 54, 201, 197, 99, 202, 52, 127, 76, 725 + 139, 173 726 + }; 727 + 728 + static const yytype_uint8 yycheck[] = 729 + { 730 + 1, 68, 69, 94, 95, 96, 97, 98, 99, 24, 731 + 10, 77, 13, 77, 15, 0, 82, 18, 82, 110, 732 + 3, 36, 3, 36, 91, 92, 34, 0, 1, 37, 733 + 38, 4, 5, 6, 7, 8, 9, 10, 11, 12, 734 + 107, 14, 15, 16, 17, 18, 19, 20, 21, 22, 735 + 23, 24, 25, 36, 27, 36, 5, 6, 27, 8, 736 + 9, 10, 11, 36, 36, 14, 15, 36, 27, 28, 737 + 70, 27, 28, 139, 36, 139, 167, 27, 14, 35, 738 + 79, 1, 81, 36, 40, 5, 6, 36, 8, 9, 739 + 10, 11, 12, 160, 14, 15, 16, 17, 18, 19, 740 + 20, 37, 38, 79, 105, 81, 27, 27, 175, 27, 741 + 78, 79, 36, 81, 27, 28, 36, 0, 1, 1, 742 + 121, 4, 5, 6, 7, 8, 9, 10, 11, 12, 743 + 1, 14, 15, 16, 17, 18, 19, 20, 21, 22, 744 + 23, 24, 25, 36, 27, 78, 79, 36, 81, 36, 745 + 0, 1, 36, 36, 4, 5, 6, 7, 8, 9, 746 + 10, 11, 37, 38, 14, 15, 16, 17, 18, 19, 747 + 20, 21, 22, 23, 24, 36, 36, 27, 36, 37, 748 + 38, 36, 37, 38, 0, 1, 36, 36, 4, 5, 749 + 6, 7, 8, 9, 10, 11, 36, 198, 14, 15, 750 + 16, 17, 18, 19, 20, 21, 22, 23, 24, 36, 751 + 36, 27, 36, 26, 1, 27, 27, 0, 1, 13, 752 + 36, 4, 5, 6, 7, 8, 9, 10, 11, 36, 753 + 27, 14, 15, 16, 17, 18, 19, 20, 21, 22, 754 + 23, 24, 1, 14, 27, 4, 5, 6, 7, 8, 755 + 9, 10, 11, 36, 38, 14, 15, 16, 36, 4, 756 + 5, 6, 7, 8, 9, 10, 11, 36, 27, 14, 757 + 15, 161, 36, 163, 164, 165, 166, 36, 36, 36, 758 + 36, 36, 172, 36, 174, 29, 30, 31, 32, 33, 759 + 39, 36, 7, 36, 184, 39, 36, 6, 77, 38, 760 + 80, 122 761 + }; 762 + 763 + /* YYSTOS[STATE-NUM] -- The (internal number of the) accessing 764 + symbol of state STATE-NUM. */ 765 + static const yytype_uint8 yystos[] = 766 + { 767 + 0, 3, 36, 42, 43, 44, 68, 86, 27, 28, 768 + 84, 0, 1, 4, 5, 6, 7, 8, 9, 10, 769 + 11, 14, 15, 16, 17, 18, 19, 20, 21, 22, 770 + 23, 24, 27, 36, 45, 46, 48, 49, 50, 51, 771 + 57, 58, 60, 64, 66, 69, 70, 72, 74, 75, 772 + 76, 85, 44, 36, 43, 86, 36, 84, 36, 84, 773 + 27, 90, 36, 84, 27, 27, 27, 28, 35, 40, 774 + 88, 89, 36, 1, 1, 52, 52, 61, 63, 67, 775 + 81, 73, 79, 36, 36, 36, 36, 36, 36, 88, 776 + 88, 37, 38, 86, 29, 30, 31, 32, 33, 39, 777 + 36, 36, 1, 12, 16, 18, 19, 20, 21, 22, 778 + 23, 25, 27, 36, 47, 53, 54, 77, 78, 80, 779 + 17, 18, 19, 20, 36, 47, 62, 78, 80, 46, 780 + 59, 85, 46, 60, 65, 72, 85, 24, 36, 79, 781 + 82, 46, 60, 71, 72, 85, 36, 47, 80, 34, 782 + 88, 88, 89, 89, 89, 89, 89, 89, 36, 36, 783 + 26, 84, 83, 84, 88, 27, 27, 89, 55, 1, 784 + 13, 36, 84, 83, 27, 14, 87, 88, 87, 36, 785 + 87, 87, 87, 87, 89, 27, 36, 36, 87, 36, 786 + 87, 88, 36, 36, 36, 36, 36, 87, 39, 56, 787 + 36, 36, 36, 84 788 + }; 789 + 790 + /* YYR1[YYN] -- Symbol number of symbol that rule YYN derives. */ 791 + static const yytype_uint8 yyr1[] = 792 + { 793 + 0, 41, 42, 42, 43, 43, 44, 44, 44, 44, 794 + 44, 44, 44, 44, 45, 45, 45, 45, 45, 45, 795 + 45, 45, 45, 46, 46, 46, 46, 46, 46, 47, 796 + 47, 48, 49, 50, 51, 52, 52, 52, 52, 52, 797 + 52, 52, 53, 53, 53, 53, 53, 53, 54, 55, 798 + 55, 56, 56, 57, 58, 59, 60, 61, 61, 61, 799 + 61, 61, 61, 62, 62, 62, 62, 63, 63, 64, 800 + 65, 66, 67, 67, 67, 67, 68, 69, 70, 71, 801 + 72, 73, 73, 73, 73, 74, 75, 76, 77, 78, 802 + 79, 79, 79, 79, 80, 81, 81, 81, 82, 83, 803 + 83, 84, 84, 85, 85, 85, 86, 86, 87, 87, 804 + 88, 88, 88, 88, 88, 88, 88, 88, 88, 88, 805 + 88, 89, 89, 90, 90 806 + }; 807 + 808 + /* YYR2[YYN] -- Number of symbols on the right hand side of rule YYN. */ 589 809 static const yytype_uint8 yyr2[] = 590 810 { 591 811 0, 2, 2, 1, 2, 1, 0, 2, 2, 2, 592 812 2, 4, 4, 3, 1, 1, 1, 1, 1, 1, 593 - 1, 1, 1, 1, 1, 1, 1, 1, 3, 2, 594 - 3, 2, 3, 2, 0, 2, 2, 2, 2, 2, 595 - 2, 3, 4, 4, 4, 5, 3, 0, 3, 0, 596 - 2, 3, 2, 1, 3, 0, 2, 2, 2, 2, 597 - 2, 4, 3, 2, 4, 0, 2, 3, 1, 3, 598 - 0, 2, 2, 2, 3, 3, 3, 1, 3, 0, 599 - 2, 2, 2, 3, 3, 2, 2, 2, 0, 2, 600 - 2, 2, 4, 0, 2, 2, 2, 0, 2, 1, 601 - 1, 2, 2, 2, 1, 2, 0, 2, 1, 3, 602 - 3, 3, 3, 3, 3, 3, 2, 3, 3, 1, 603 - 1, 0, 1 813 + 1, 1, 1, 1, 1, 1, 1, 1, 1, 3, 814 + 2, 3, 2, 3, 2, 0, 2, 2, 2, 2, 815 + 2, 2, 3, 4, 4, 4, 4, 5, 3, 0, 816 + 3, 0, 2, 3, 2, 1, 3, 0, 2, 2, 817 + 2, 2, 2, 4, 3, 2, 4, 0, 2, 3, 818 + 1, 3, 0, 2, 2, 2, 3, 3, 3, 1, 819 + 3, 0, 2, 2, 2, 3, 3, 2, 2, 2, 820 + 0, 2, 2, 2, 4, 0, 2, 2, 2, 0, 821 + 2, 1, 1, 2, 2, 2, 1, 2, 0, 2, 822 + 1, 3, 3, 3, 3, 3, 3, 3, 2, 3, 823 + 3, 1, 1, 0, 1 604 824 }; 605 825 606 - /* YYDEFACT[STATE-NAME] -- Default reduction number in state STATE-NUM. 607 - Performed when YYTABLE doesn't specify something else to do. Zero 608 - means the default is an error. */ 609 - static const yytype_uint8 yydefact[] = 610 - { 611 - 6, 0, 104, 0, 3, 0, 6, 6, 99, 100, 612 - 0, 1, 0, 0, 0, 0, 121, 0, 0, 0, 613 - 0, 0, 0, 14, 18, 15, 16, 20, 17, 19, 614 - 21, 0, 22, 0, 7, 34, 25, 34, 26, 55, 615 - 65, 8, 70, 23, 93, 79, 9, 27, 88, 24, 616 - 10, 0, 105, 2, 74, 13, 0, 101, 0, 122, 617 - 0, 102, 0, 0, 0, 119, 120, 0, 0, 0, 618 - 108, 103, 0, 0, 0, 0, 0, 0, 0, 88, 619 - 0, 0, 75, 83, 51, 84, 30, 32, 0, 116, 620 - 0, 0, 67, 0, 0, 0, 0, 0, 0, 11, 621 - 12, 0, 0, 0, 0, 97, 0, 0, 0, 47, 622 - 0, 40, 39, 35, 36, 0, 38, 37, 0, 0, 623 - 97, 0, 59, 60, 56, 58, 57, 66, 54, 53, 624 - 71, 73, 69, 72, 68, 106, 95, 0, 94, 80, 625 - 82, 78, 81, 77, 90, 91, 89, 115, 117, 118, 626 - 114, 109, 110, 111, 112, 113, 29, 86, 0, 106, 627 - 0, 106, 106, 106, 0, 0, 0, 87, 63, 106, 628 - 0, 106, 0, 96, 0, 0, 41, 98, 0, 0, 629 - 106, 49, 46, 28, 0, 62, 0, 107, 92, 42, 630 - 43, 44, 0, 0, 48, 61, 64, 45, 50 631 - }; 632 826 633 - /* YYDEFGOTO[NTERM-NUM]. */ 634 - static const yytype_int16 yydefgoto[] = 635 - { 636 - -1, 3, 4, 5, 33, 34, 112, 35, 36, 37, 637 - 38, 74, 113, 114, 165, 194, 39, 40, 128, 41, 638 - 76, 124, 77, 42, 132, 43, 78, 6, 44, 45, 639 - 141, 46, 80, 47, 48, 49, 115, 116, 81, 117, 640 - 79, 138, 160, 161, 50, 7, 173, 69, 70, 60 641 - }; 827 + #define yyerrok (yyerrstatus = 0) 828 + #define yyclearin (yychar = YYEMPTY) 829 + #define YYEMPTY (-2) 830 + #define YYEOF 0 642 831 643 - /* YYPACT[STATE-NUM] -- Index in YYTABLE of the portion describing 644 - STATE-NUM. */ 645 - #define YYPACT_NINF -91 646 - static const yytype_int16 yypact[] = 647 - { 648 - 19, 37, -91, 13, -91, 79, -91, 20, -91, -91, 649 - -16, -91, 21, 37, 25, 37, 41, 36, 37, 78, 650 - 83, 31, 56, -91, -91, -91, -91, -91, -91, -91, 651 - -91, 116, -91, 127, -91, -91, -91, -91, -91, -91, 652 - -91, -91, -91, -91, -91, -91, -91, -91, -91, -91, 653 - -91, 147, -91, -91, 105, -91, 109, -91, 111, -91, 654 - 114, -91, 136, 137, 142, -91, -91, 31, 31, 76, 655 - 254, -91, 143, 146, 27, 115, 207, 258, 243, -14, 656 - 243, 179, -91, -91, -91, -91, -91, -91, -7, -91, 657 - 31, 31, 105, 51, 51, 51, 51, 51, 51, -91, 658 - -91, 156, 168, 181, 37, 37, 31, 178, 51, -91, 659 - 206, -91, -91, -91, -91, 196, -91, -91, 175, 37, 660 - 37, 185, -91, -91, -91, -91, -91, -91, -91, -91, 661 - -91, -91, -91, -91, -91, 214, -91, 230, -91, -91, 662 - -91, -91, -91, -91, -91, -91, -91, -91, 183, -91, 663 - -91, -91, -91, -91, -91, -91, -91, -91, 31, 214, 664 - 194, 214, 45, 214, 51, 26, 195, -91, -91, 214, 665 - 197, 214, 31, -91, 139, 208, -91, -91, 220, 224, 666 - 214, 222, -91, -91, 226, -91, 227, 123, -91, -91, 667 - -91, -91, 235, 37, -91, -91, -91, -91, -91 668 - }; 832 + #define YYACCEPT goto yyacceptlab 833 + #define YYABORT goto yyabortlab 834 + #define YYERROR goto yyerrorlab 669 835 670 - /* YYPGOTO[NTERM-NUM]. */ 671 - static const yytype_int16 yypgoto[] = 672 - { 673 - -91, -91, 264, 268, -91, 30, -65, -91, -91, -91, 674 - -91, 238, -91, -91, -91, -91, -91, -91, -91, -12, 675 - -91, -91, -91, -91, -91, -91, -91, -91, -91, -91, 676 - -91, -5, -91, -91, -91, -91, -91, 200, 209, -61, 677 - -91, -91, 170, -1, 65, 0, 118, -66, -90, -91 678 - }; 679 - 680 - /* YYTABLE[YYPACT[STATE-NUM]]. What to do in state STATE-NUM. If 681 - positive, shift that token. If negative, reduce the rule which 682 - number is the opposite. If YYTABLE_NINF, syntax error. */ 683 - #define YYTABLE_NINF -86 684 - static const yytype_int16 yytable[] = 685 - { 686 - 10, 88, 89, 150, 151, 152, 153, 154, 155, 135, 687 - 54, 123, 56, 11, 58, 126, 145, 62, 164, 2, 688 - 146, 136, 1, 1, 148, 149, 147, -31, 101, 90, 689 - 91, -31, -31, -31, -31, -31, -31, -31, -31, 102, 690 - 162, -31, -31, 103, -31, 104, 105, 106, 107, 108, 691 - -31, 109, 181, 110, 2, 52, 55, 65, 66, 172, 692 - 57, 182, 111, 8, 9, 67, 131, 59, 140, 92, 693 - 68, 61, 145, 133, 180, 142, 146, 65, 66, -5, 694 - 12, 90, 91, 13, 14, 15, 16, 17, 18, 19, 695 - 20, 71, 174, 21, 22, 23, 24, 25, 26, 27, 696 - 28, 29, 30, 159, 63, 31, 187, 127, 130, 64, 697 - 139, 2, 90, 91, 32, -33, 101, 72, 169, -33, 698 - -33, -33, -33, -33, -33, -33, -33, 102, 73, -33, 699 - -33, 103, -33, 104, 105, 106, 107, 108, -33, 109, 700 - 52, 110, 129, 134, 82, 143, 83, -4, 12, 84, 701 - 111, 13, 14, 15, 16, 17, 18, 19, 20, 90, 702 - 91, 21, 22, 23, 24, 25, 26, 27, 28, 29, 703 - 30, 85, 86, 31, 188, 90, 91, 87, 99, -85, 704 - 101, 100, 32, -85, -85, -85, -85, -85, -85, -85, 705 - -85, 156, 198, -85, -85, 103, -85, -85, -85, -85, 706 - -85, -85, -85, 157, 163, 110, 158, 166, 101, 167, 707 - 168, 171, -52, -52, 144, -52, -52, -52, -52, 102, 708 - 91, -52, -52, 103, 118, 119, 120, 121, 172, 176, 709 - 183, 101, 185, 110, -76, -76, -76, -76, -76, -76, 710 - -76, -76, 122, 189, -76, -76, 103, 13, 14, 15, 711 - 16, 17, 18, 19, 20, 190, 110, 21, 22, 191, 712 - 193, 195, 196, 14, 15, 144, 17, 18, 19, 20, 713 - 197, 53, 21, 22, 51, 75, 125, 175, 32, 177, 714 - 178, 179, 93, 94, 95, 96, 97, 184, 137, 186, 715 - 170, 0, 98, 32, 0, 0, 0, 0, 192 716 - }; 717 - 718 - #define yypact_value_is_default(yystate) \ 719 - ((yystate) == (-91)) 720 - 721 - #define yytable_value_is_error(yytable_value) \ 722 - YYID (0) 723 - 724 - static const yytype_int16 yycheck[] = 725 - { 726 - 1, 67, 68, 93, 94, 95, 96, 97, 98, 23, 727 - 10, 76, 13, 0, 15, 76, 81, 18, 108, 35, 728 - 81, 35, 3, 3, 90, 91, 33, 0, 1, 36, 729 - 37, 4, 5, 6, 7, 8, 9, 10, 11, 12, 730 - 106, 14, 15, 16, 17, 18, 19, 20, 21, 22, 731 - 23, 24, 26, 26, 35, 35, 35, 26, 27, 14, 732 - 35, 35, 35, 26, 27, 34, 78, 26, 80, 69, 733 - 39, 35, 137, 78, 164, 80, 137, 26, 27, 0, 734 - 1, 36, 37, 4, 5, 6, 7, 8, 9, 10, 735 - 11, 35, 158, 14, 15, 16, 17, 18, 19, 20, 736 - 21, 22, 23, 104, 26, 26, 172, 77, 78, 26, 737 - 80, 35, 36, 37, 35, 0, 1, 1, 119, 4, 738 - 5, 6, 7, 8, 9, 10, 11, 12, 1, 14, 739 - 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 740 - 35, 26, 77, 78, 35, 80, 35, 0, 1, 35, 741 - 35, 4, 5, 6, 7, 8, 9, 10, 11, 36, 742 - 37, 14, 15, 16, 17, 18, 19, 20, 21, 22, 743 - 23, 35, 35, 26, 35, 36, 37, 35, 35, 0, 744 - 1, 35, 35, 4, 5, 6, 7, 8, 9, 10, 745 - 11, 35, 193, 14, 15, 16, 17, 18, 19, 20, 746 - 21, 22, 23, 35, 26, 26, 25, 1, 1, 13, 747 - 35, 26, 5, 6, 35, 8, 9, 10, 11, 12, 748 - 37, 14, 15, 16, 17, 18, 19, 20, 14, 35, 749 - 35, 1, 35, 26, 4, 5, 6, 7, 8, 9, 750 - 10, 11, 35, 35, 14, 15, 16, 4, 5, 6, 751 - 7, 8, 9, 10, 11, 35, 26, 14, 15, 35, 752 - 38, 35, 35, 5, 6, 35, 8, 9, 10, 11, 753 - 35, 7, 14, 15, 6, 37, 76, 159, 35, 161, 754 - 162, 163, 28, 29, 30, 31, 32, 169, 79, 171, 755 - 120, -1, 38, 35, -1, -1, -1, -1, 180 756 - }; 757 - 758 - /* YYSTOS[STATE-NUM] -- The (internal number of the) accessing 759 - symbol of state STATE-NUM. */ 760 - static const yytype_uint8 yystos[] = 761 - { 762 - 0, 3, 35, 41, 42, 43, 67, 85, 26, 27, 763 - 83, 0, 1, 4, 5, 6, 7, 8, 9, 10, 764 - 11, 14, 15, 16, 17, 18, 19, 20, 21, 22, 765 - 23, 26, 35, 44, 45, 47, 48, 49, 50, 56, 766 - 57, 59, 63, 65, 68, 69, 71, 73, 74, 75, 767 - 84, 43, 35, 42, 85, 35, 83, 35, 83, 26, 768 - 89, 35, 83, 26, 26, 26, 27, 34, 39, 87, 769 - 88, 35, 1, 1, 51, 51, 60, 62, 66, 80, 770 - 72, 78, 35, 35, 35, 35, 35, 35, 87, 87, 771 - 36, 37, 85, 28, 29, 30, 31, 32, 38, 35, 772 - 35, 1, 12, 16, 18, 19, 20, 21, 22, 24, 773 - 26, 35, 46, 52, 53, 76, 77, 79, 17, 18, 774 - 19, 20, 35, 46, 61, 77, 79, 45, 58, 84, 775 - 45, 59, 64, 71, 84, 23, 35, 78, 81, 45, 776 - 59, 70, 71, 84, 35, 46, 79, 33, 87, 87, 777 - 88, 88, 88, 88, 88, 88, 35, 35, 25, 83, 778 - 82, 83, 87, 26, 88, 54, 1, 13, 35, 83, 779 - 82, 26, 14, 86, 87, 86, 35, 86, 86, 86, 780 - 88, 26, 35, 35, 86, 35, 86, 87, 35, 35, 781 - 35, 35, 86, 38, 55, 35, 35, 35, 83 782 - }; 783 - 784 - #define yyerrok (yyerrstatus = 0) 785 - #define yyclearin (yychar = YYEMPTY) 786 - #define YYEMPTY (-2) 787 - #define YYEOF 0 788 - 789 - #define YYACCEPT goto yyacceptlab 790 - #define YYABORT goto yyabortlab 791 - #define YYERROR goto yyerrorlab 792 - 793 - 794 - /* Like YYERROR except do call yyerror. This remains here temporarily 795 - to ease the transition to the new meaning of YYERROR, for GCC. 796 - Once GCC version 2 has supplanted version 1, this can go. However, 797 - YYFAIL appears to be in use. Nevertheless, it is formally deprecated 798 - in Bison 2.4.2's NEWS entry, where a plan to phase it out is 799 - discussed. */ 800 - 801 - #define YYFAIL goto yyerrlab 802 - #if defined YYFAIL 803 - /* This is here to suppress warnings from the GCC cpp's 804 - -Wunused-macros. Normally we don't worry about that warning, but 805 - some users do, and we want to make it easy for users to remove 806 - YYFAIL uses, which will produce warnings from Bison 2.5. */ 807 - #endif 808 836 809 837 #define YYRECOVERING() (!!yyerrstatus) 810 838 ··· 815 855 else \ 816 856 { \ 817 857 yyerror (YY_("syntax error: cannot back up")); \ 818 - YYERROR; \ 819 - } \ 820 - while (YYID (0)) 858 + YYERROR; \ 859 + } \ 860 + while (0) 861 + 862 + /* Error token number */ 863 + #define YYTERROR 1 864 + #define YYERRCODE 256 821 865 822 866 823 - #define YYTERROR 1 824 - #define YYERRCODE 256 825 - 826 - 827 - /* YYLLOC_DEFAULT -- Set CURRENT to span from RHS[1] to RHS[N]. 828 - If N is 0, then set CURRENT to the empty location which ends 829 - the previous symbol: RHS[0] (always defined). */ 830 - 831 - #define YYRHSLOC(Rhs, K) ((Rhs)[K]) 832 - #ifndef YYLLOC_DEFAULT 833 - # define YYLLOC_DEFAULT(Current, Rhs, N) \ 834 - do \ 835 - if (YYID (N)) \ 836 - { \ 837 - (Current).first_line = YYRHSLOC (Rhs, 1).first_line; \ 838 - (Current).first_column = YYRHSLOC (Rhs, 1).first_column; \ 839 - (Current).last_line = YYRHSLOC (Rhs, N).last_line; \ 840 - (Current).last_column = YYRHSLOC (Rhs, N).last_column; \ 841 - } \ 842 - else \ 843 - { \ 844 - (Current).first_line = (Current).last_line = \ 845 - YYRHSLOC (Rhs, 0).last_line; \ 846 - (Current).first_column = (Current).last_column = \ 847 - YYRHSLOC (Rhs, 0).last_column; \ 848 - } \ 849 - while (YYID (0)) 850 - #endif 851 - 852 - 853 - /* This macro is provided for backward compatibility. */ 854 - 855 - #ifndef YY_LOCATION_PRINT 856 - # define YY_LOCATION_PRINT(File, Loc) ((void) 0) 857 - #endif 858 - 859 - 860 - /* YYLEX -- calling `yylex' with the right arguments. */ 861 - 862 - #ifdef YYLEX_PARAM 863 - # define YYLEX yylex (YYLEX_PARAM) 864 - #else 865 - # define YYLEX yylex () 866 - #endif 867 867 868 868 /* Enable debugging if requested. */ 869 869 #if YYDEBUG ··· 833 913 # define YYFPRINTF fprintf 834 914 # endif 835 915 836 - # define YYDPRINTF(Args) \ 837 - do { \ 838 - if (yydebug) \ 839 - YYFPRINTF Args; \ 840 - } while (YYID (0)) 916 + # define YYDPRINTF(Args) \ 917 + do { \ 918 + if (yydebug) \ 919 + YYFPRINTF Args; \ 920 + } while (0) 841 921 842 - # define YY_SYMBOL_PRINT(Title, Type, Value, Location) \ 843 - do { \ 844 - if (yydebug) \ 845 - { \ 846 - YYFPRINTF (stderr, "%s ", Title); \ 847 - yy_symbol_print (stderr, \ 848 - Type, Value); \ 849 - YYFPRINTF (stderr, "\n"); \ 850 - } \ 851 - } while (YYID (0)) 922 + /* This macro is provided for backward compatibility. */ 923 + #ifndef YY_LOCATION_PRINT 924 + # define YY_LOCATION_PRINT(File, Loc) ((void) 0) 925 + #endif 852 926 853 927 854 - /*--------------------------------. 855 - | Print this symbol on YYOUTPUT. | 856 - `--------------------------------*/ 928 + # define YY_SYMBOL_PRINT(Title, Type, Value, Location) \ 929 + do { \ 930 + if (yydebug) \ 931 + { \ 932 + YYFPRINTF (stderr, "%s ", Title); \ 933 + yy_symbol_print (stderr, \ 934 + Type, Value); \ 935 + YYFPRINTF (stderr, "\n"); \ 936 + } \ 937 + } while (0) 857 938 858 - /*ARGSUSED*/ 859 - #if (defined __STDC__ || defined __C99__FUNC__ \ 860 - || defined __cplusplus || defined _MSC_VER) 939 + 940 + /*----------------------------------------. 941 + | Print this symbol's value on YYOUTPUT. | 942 + `----------------------------------------*/ 943 + 861 944 static void 862 945 yy_symbol_value_print (FILE *yyoutput, int yytype, YYSTYPE const * const yyvaluep) 863 - #else 864 - static void 865 - yy_symbol_value_print (yyoutput, yytype, yyvaluep) 866 - FILE *yyoutput; 867 - int yytype; 868 - YYSTYPE const * const yyvaluep; 869 - #endif 870 946 { 871 947 FILE *yyo = yyoutput; 872 948 YYUSE (yyo); ··· 871 955 # ifdef YYPRINT 872 956 if (yytype < YYNTOKENS) 873 957 YYPRINT (yyoutput, yytoknum[yytype], *yyvaluep); 874 - # else 875 - YYUSE (yyoutput); 876 958 # endif 877 - switch (yytype) 878 - { 879 - default: 880 - break; 881 - } 959 + YYUSE (yytype); 882 960 } 883 961 884 962 ··· 880 970 | Print this symbol on YYOUTPUT. | 881 971 `--------------------------------*/ 882 972 883 - #if (defined __STDC__ || defined __C99__FUNC__ \ 884 - || defined __cplusplus || defined _MSC_VER) 885 973 static void 886 974 yy_symbol_print (FILE *yyoutput, int yytype, YYSTYPE const * const yyvaluep) 887 - #else 888 - static void 889 - yy_symbol_print (yyoutput, yytype, yyvaluep) 890 - FILE *yyoutput; 891 - int yytype; 892 - YYSTYPE const * const yyvaluep; 893 - #endif 894 975 { 895 - if (yytype < YYNTOKENS) 896 - YYFPRINTF (yyoutput, "token %s (", yytname[yytype]); 897 - else 898 - YYFPRINTF (yyoutput, "nterm %s (", yytname[yytype]); 976 + YYFPRINTF (yyoutput, "%s %s (", 977 + yytype < YYNTOKENS ? "token" : "nterm", yytname[yytype]); 899 978 900 979 yy_symbol_value_print (yyoutput, yytype, yyvaluep); 901 980 YYFPRINTF (yyoutput, ")"); ··· 895 996 | TOP (included). | 896 997 `------------------------------------------------------------------*/ 897 998 898 - #if (defined __STDC__ || defined __C99__FUNC__ \ 899 - || defined __cplusplus || defined _MSC_VER) 900 999 static void 901 1000 yy_stack_print (yytype_int16 *yybottom, yytype_int16 *yytop) 902 - #else 903 - static void 904 - yy_stack_print (yybottom, yytop) 905 - yytype_int16 *yybottom; 906 - yytype_int16 *yytop; 907 - #endif 908 1001 { 909 1002 YYFPRINTF (stderr, "Stack now"); 910 1003 for (; yybottom <= yytop; yybottom++) ··· 907 1016 YYFPRINTF (stderr, "\n"); 908 1017 } 909 1018 910 - # define YY_STACK_PRINT(Bottom, Top) \ 911 - do { \ 912 - if (yydebug) \ 913 - yy_stack_print ((Bottom), (Top)); \ 914 - } while (YYID (0)) 1019 + # define YY_STACK_PRINT(Bottom, Top) \ 1020 + do { \ 1021 + if (yydebug) \ 1022 + yy_stack_print ((Bottom), (Top)); \ 1023 + } while (0) 915 1024 916 1025 917 1026 /*------------------------------------------------. 918 1027 | Report that the YYRULE is going to be reduced. | 919 1028 `------------------------------------------------*/ 920 1029 921 - #if (defined __STDC__ || defined __C99__FUNC__ \ 922 - || defined __cplusplus || defined _MSC_VER) 923 1030 static void 924 - yy_reduce_print (YYSTYPE *yyvsp, int yyrule) 925 - #else 926 - static void 927 - yy_reduce_print (yyvsp, yyrule) 928 - YYSTYPE *yyvsp; 929 - int yyrule; 930 - #endif 1031 + yy_reduce_print (yytype_int16 *yyssp, YYSTYPE *yyvsp, int yyrule) 931 1032 { 1033 + unsigned long int yylno = yyrline[yyrule]; 932 1034 int yynrhs = yyr2[yyrule]; 933 1035 int yyi; 934 - unsigned long int yylno = yyrline[yyrule]; 935 1036 YYFPRINTF (stderr, "Reducing stack by rule %d (line %lu):\n", 936 - yyrule - 1, yylno); 1037 + yyrule - 1, yylno); 937 1038 /* The symbols being reduced. */ 938 1039 for (yyi = 0; yyi < yynrhs; yyi++) 939 1040 { 940 1041 YYFPRINTF (stderr, " $%d = ", yyi + 1); 941 - yy_symbol_print (stderr, yyrhs[yyprhs[yyrule] + yyi], 942 - &(yyvsp[(yyi + 1) - (yynrhs)]) 943 - ); 1042 + yy_symbol_print (stderr, 1043 + yystos[yyssp[yyi + 1 - yynrhs]], 1044 + &(yyvsp[(yyi + 1) - (yynrhs)]) 1045 + ); 944 1046 YYFPRINTF (stderr, "\n"); 945 1047 } 946 1048 } 947 1049 948 - # define YY_REDUCE_PRINT(Rule) \ 949 - do { \ 950 - if (yydebug) \ 951 - yy_reduce_print (yyvsp, Rule); \ 952 - } while (YYID (0)) 1050 + # define YY_REDUCE_PRINT(Rule) \ 1051 + do { \ 1052 + if (yydebug) \ 1053 + yy_reduce_print (yyssp, yyvsp, Rule); \ 1054 + } while (0) 953 1055 954 1056 /* Nonzero means print parse trace. It is left uninitialized so that 955 1057 multiple parsers can coexist. */ ··· 956 1072 957 1073 958 1074 /* YYINITDEPTH -- initial size of the parser's stacks. */ 959 - #ifndef YYINITDEPTH 1075 + #ifndef YYINITDEPTH 960 1076 # define YYINITDEPTH 200 961 1077 #endif 962 1078 ··· 979 1095 # define yystrlen strlen 980 1096 # else 981 1097 /* Return the length of YYSTR. */ 982 - #if (defined __STDC__ || defined __C99__FUNC__ \ 983 - || defined __cplusplus || defined _MSC_VER) 984 1098 static YYSIZE_T 985 1099 yystrlen (const char *yystr) 986 - #else 987 - static YYSIZE_T 988 - yystrlen (yystr) 989 - const char *yystr; 990 - #endif 991 1100 { 992 1101 YYSIZE_T yylen; 993 1102 for (yylen = 0; yystr[yylen]; yylen++) ··· 996 1119 # else 997 1120 /* Copy YYSRC to YYDEST, returning the address of the terminating '\0' in 998 1121 YYDEST. */ 999 - #if (defined __STDC__ || defined __C99__FUNC__ \ 1000 - || defined __cplusplus || defined _MSC_VER) 1001 1122 static char * 1002 1123 yystpcpy (char *yydest, const char *yysrc) 1003 - #else 1004 - static char * 1005 - yystpcpy (yydest, yysrc) 1006 - char *yydest; 1007 - const char *yysrc; 1008 - #endif 1009 1124 { 1010 1125 char *yyd = yydest; 1011 1126 const char *yys = yysrc; ··· 1027 1158 char const *yyp = yystr; 1028 1159 1029 1160 for (;;) 1030 - switch (*++yyp) 1031 - { 1032 - case '\'': 1033 - case ',': 1034 - goto do_not_strip_quotes; 1161 + switch (*++yyp) 1162 + { 1163 + case '\'': 1164 + case ',': 1165 + goto do_not_strip_quotes; 1035 1166 1036 - case '\\': 1037 - if (*++yyp != '\\') 1038 - goto do_not_strip_quotes; 1039 - /* Fall through. */ 1040 - default: 1041 - if (yyres) 1042 - yyres[yyn] = *yyp; 1043 - yyn++; 1044 - break; 1167 + case '\\': 1168 + if (*++yyp != '\\') 1169 + goto do_not_strip_quotes; 1170 + /* Fall through. */ 1171 + default: 1172 + if (yyres) 1173 + yyres[yyn] = *yyp; 1174 + yyn++; 1175 + break; 1045 1176 1046 - case '"': 1047 - if (yyres) 1048 - yyres[yyn] = '\0'; 1049 - return yyn; 1050 - } 1177 + case '"': 1178 + if (yyres) 1179 + yyres[yyn] = '\0'; 1180 + return yyn; 1181 + } 1051 1182 do_not_strip_quotes: ; 1052 1183 } 1053 1184 ··· 1070 1201 yysyntax_error (YYSIZE_T *yymsg_alloc, char **yymsg, 1071 1202 yytype_int16 *yyssp, int yytoken) 1072 1203 { 1073 - YYSIZE_T yysize0 = yytnamerr (YY_NULL, yytname[yytoken]); 1204 + YYSIZE_T yysize0 = yytnamerr (YY_NULLPTR, yytname[yytoken]); 1074 1205 YYSIZE_T yysize = yysize0; 1075 - YYSIZE_T yysize1; 1076 1206 enum { YYERROR_VERBOSE_ARGS_MAXIMUM = 5 }; 1077 1207 /* Internationalized format string. */ 1078 - const char *yyformat = YY_NULL; 1208 + const char *yyformat = YY_NULLPTR; 1079 1209 /* Arguments of yyformat. */ 1080 1210 char const *yyarg[YYERROR_VERBOSE_ARGS_MAXIMUM]; 1081 1211 /* Number of reported tokens (one for the "unexpected", one per ··· 1082 1214 int yycount = 0; 1083 1215 1084 1216 /* There are many possibilities here to consider: 1085 - - Assume YYFAIL is not used. It's too flawed to consider. See 1086 - <http://lists.gnu.org/archive/html/bison-patches/2009-12/msg00024.html> 1087 - for details. YYERROR is fine as it does not invoke this 1088 - function. 1089 1217 - If this state is a consistent state with a default action, then 1090 1218 the only way this function was invoked is if the default action 1091 1219 is an error action. In that case, don't check for expected ··· 1130 1266 break; 1131 1267 } 1132 1268 yyarg[yycount++] = yytname[yyx]; 1133 - yysize1 = yysize + yytnamerr (YY_NULL, yytname[yyx]); 1134 - if (! (yysize <= yysize1 1135 - && yysize1 <= YYSTACK_ALLOC_MAXIMUM)) 1136 - return 2; 1137 - yysize = yysize1; 1269 + { 1270 + YYSIZE_T yysize1 = yysize + yytnamerr (YY_NULLPTR, yytname[yyx]); 1271 + if (! (yysize <= yysize1 1272 + && yysize1 <= YYSTACK_ALLOC_MAXIMUM)) 1273 + return 2; 1274 + yysize = yysize1; 1275 + } 1138 1276 } 1139 1277 } 1140 1278 } ··· 1156 1290 # undef YYCASE_ 1157 1291 } 1158 1292 1159 - yysize1 = yysize + yystrlen (yyformat); 1160 - if (! (yysize <= yysize1 && yysize1 <= YYSTACK_ALLOC_MAXIMUM)) 1161 - return 2; 1162 - yysize = yysize1; 1293 + { 1294 + YYSIZE_T yysize1 = yysize + yystrlen (yyformat); 1295 + if (! (yysize <= yysize1 && yysize1 <= YYSTACK_ALLOC_MAXIMUM)) 1296 + return 2; 1297 + yysize = yysize1; 1298 + } 1163 1299 1164 1300 if (*yymsg_alloc < yysize) 1165 1301 { ··· 1198 1330 | Release the memory associated to this symbol. | 1199 1331 `-----------------------------------------------*/ 1200 1332 1201 - /*ARGSUSED*/ 1202 - #if (defined __STDC__ || defined __C99__FUNC__ \ 1203 - || defined __cplusplus || defined _MSC_VER) 1204 1333 static void 1205 1334 yydestruct (const char *yymsg, int yytype, YYSTYPE *yyvaluep) 1206 - #else 1207 - static void 1208 - yydestruct (yymsg, yytype, yyvaluep) 1209 - const char *yymsg; 1210 - int yytype; 1211 - YYSTYPE *yyvaluep; 1212 - #endif 1213 1335 { 1214 1336 YYUSE (yyvaluep); 1215 - 1216 1337 if (!yymsg) 1217 1338 yymsg = "Deleting"; 1218 1339 YY_SYMBOL_PRINT (yymsg, yytype, yyvaluep, yylocationp); 1219 1340 1341 + YY_IGNORE_MAYBE_UNINITIALIZED_BEGIN 1220 1342 switch (yytype) 1221 1343 { 1222 - case 57: /* "choice_entry" */ 1344 + case 58: /* choice_entry */ 1223 1345 1224 - { 1346 + { 1225 1347 fprintf(stderr, "%s:%d: missing end statement for this entry\n", 1226 - (yyvaluep->menu)->file->name, (yyvaluep->menu)->lineno); 1227 - if (current_menu == (yyvaluep->menu)) 1348 + ((*yyvaluep).menu)->file->name, ((*yyvaluep).menu)->lineno); 1349 + if (current_menu == ((*yyvaluep).menu)) 1228 1350 menu_end_menu(); 1229 - }; 1351 + } 1230 1352 1231 - break; 1232 - case 63: /* "if_entry" */ 1353 + break; 1233 1354 1234 - { 1355 + case 64: /* if_entry */ 1356 + 1357 + { 1235 1358 fprintf(stderr, "%s:%d: missing end statement for this entry\n", 1236 - (yyvaluep->menu)->file->name, (yyvaluep->menu)->lineno); 1237 - if (current_menu == (yyvaluep->menu)) 1359 + ((*yyvaluep).menu)->file->name, ((*yyvaluep).menu)->lineno); 1360 + if (current_menu == ((*yyvaluep).menu)) 1238 1361 menu_end_menu(); 1239 - }; 1362 + } 1240 1363 1241 - break; 1242 - case 69: /* "menu_entry" */ 1364 + break; 1243 1365 1244 - { 1366 + case 70: /* menu_entry */ 1367 + 1368 + { 1245 1369 fprintf(stderr, "%s:%d: missing end statement for this entry\n", 1246 - (yyvaluep->menu)->file->name, (yyvaluep->menu)->lineno); 1247 - if (current_menu == (yyvaluep->menu)) 1370 + ((*yyvaluep).menu)->file->name, ((*yyvaluep).menu)->lineno); 1371 + if (current_menu == ((*yyvaluep).menu)) 1248 1372 menu_end_menu(); 1249 - }; 1373 + } 1250 1374 1251 - break; 1375 + break; 1376 + 1252 1377 1253 1378 default: 1254 - break; 1379 + break; 1255 1380 } 1381 + YY_IGNORE_MAYBE_UNINITIALIZED_END 1256 1382 } 1257 1383 1258 1384 1259 - /* Prevent warnings from -Wmissing-prototypes. */ 1260 - #ifdef YYPARSE_PARAM 1261 - #if defined __STDC__ || defined __cplusplus 1262 - int yyparse (void *YYPARSE_PARAM); 1263 - #else 1264 - int yyparse (); 1265 - #endif 1266 - #else /* ! YYPARSE_PARAM */ 1267 - #if defined __STDC__ || defined __cplusplus 1268 - int yyparse (void); 1269 - #else 1270 - int yyparse (); 1271 - #endif 1272 - #endif /* ! YYPARSE_PARAM */ 1273 1385 1274 1386 1275 1387 /* The lookahead symbol. */ ··· 1257 1409 1258 1410 /* The semantic value of the lookahead symbol. */ 1259 1411 YYSTYPE yylval; 1260 - 1261 1412 /* Number of syntax errors so far. */ 1262 1413 int yynerrs; 1263 1414 ··· 1265 1418 | yyparse. | 1266 1419 `----------*/ 1267 1420 1268 - #ifdef YYPARSE_PARAM 1269 - #if (defined __STDC__ || defined __C99__FUNC__ \ 1270 - || defined __cplusplus || defined _MSC_VER) 1271 - int 1272 - yyparse (void *YYPARSE_PARAM) 1273 - #else 1274 - int 1275 - yyparse (YYPARSE_PARAM) 1276 - void *YYPARSE_PARAM; 1277 - #endif 1278 - #else /* ! YYPARSE_PARAM */ 1279 - #if (defined __STDC__ || defined __C99__FUNC__ \ 1280 - || defined __cplusplus || defined _MSC_VER) 1281 1421 int 1282 1422 yyparse (void) 1283 - #else 1284 - int 1285 - yyparse () 1286 - 1287 - #endif 1288 - #endif 1289 1423 { 1290 1424 int yystate; 1291 1425 /* Number of tokens to shift before error messages enabled. */ 1292 1426 int yyerrstatus; 1293 1427 1294 1428 /* The stacks and their tools: 1295 - `yyss': related to states. 1296 - `yyvs': related to semantic values. 1429 + 'yyss': related to states. 1430 + 'yyvs': related to semantic values. 1297 1431 1298 1432 Refer to the stacks through separate pointers, to allow yyoverflow 1299 1433 to reallocate them elsewhere. */ ··· 1294 1466 int yyn; 1295 1467 int yyresult; 1296 1468 /* Lookahead token as an internal (translated) token number. */ 1297 - int yytoken; 1469 + int yytoken = 0; 1298 1470 /* The variables used to return semantic value and location from the 1299 1471 action routines. */ 1300 1472 YYSTYPE yyval; ··· 1312 1484 Keep to zero when no symbol should be popped. */ 1313 1485 int yylen = 0; 1314 1486 1315 - yytoken = 0; 1316 - yyss = yyssa; 1317 - yyvs = yyvsa; 1487 + yyssp = yyss = yyssa; 1488 + yyvsp = yyvs = yyvsa; 1318 1489 yystacksize = YYINITDEPTH; 1319 1490 1320 1491 YYDPRINTF ((stderr, "Starting parse\n")); ··· 1322 1495 yyerrstatus = 0; 1323 1496 yynerrs = 0; 1324 1497 yychar = YYEMPTY; /* Cause a token to be read. */ 1325 - 1326 - /* Initialize stack pointers. 1327 - Waste one element of value and location stack 1328 - so that they stay on the same level as the state stack. 1329 - The wasted elements are never initialized. */ 1330 - yyssp = yyss; 1331 - yyvsp = yyvs; 1332 - 1333 1498 goto yysetstate; 1334 1499 1335 1500 /*------------------------------------------------------------. ··· 1342 1523 1343 1524 #ifdef yyoverflow 1344 1525 { 1345 - /* Give user a chance to reallocate the stack. Use copies of 1346 - these so that the &'s don't force the real ones into 1347 - memory. */ 1348 - YYSTYPE *yyvs1 = yyvs; 1349 - yytype_int16 *yyss1 = yyss; 1526 + /* Give user a chance to reallocate the stack. Use copies of 1527 + these so that the &'s don't force the real ones into 1528 + memory. */ 1529 + YYSTYPE *yyvs1 = yyvs; 1530 + yytype_int16 *yyss1 = yyss; 1350 1531 1351 - /* Each stack pointer address is followed by the size of the 1352 - data in use in that stack, in bytes. This used to be a 1353 - conditional around just the two extra args, but that might 1354 - be undefined if yyoverflow is a macro. */ 1355 - yyoverflow (YY_("memory exhausted"), 1356 - &yyss1, yysize * sizeof (*yyssp), 1357 - &yyvs1, yysize * sizeof (*yyvsp), 1358 - &yystacksize); 1532 + /* Each stack pointer address is followed by the size of the 1533 + data in use in that stack, in bytes. This used to be a 1534 + conditional around just the two extra args, but that might 1535 + be undefined if yyoverflow is a macro. */ 1536 + yyoverflow (YY_("memory exhausted"), 1537 + &yyss1, yysize * sizeof (*yyssp), 1538 + &yyvs1, yysize * sizeof (*yyvsp), 1539 + &yystacksize); 1359 1540 1360 - yyss = yyss1; 1361 - yyvs = yyvs1; 1541 + yyss = yyss1; 1542 + yyvs = yyvs1; 1362 1543 } 1363 1544 #else /* no yyoverflow */ 1364 1545 # ifndef YYSTACK_RELOCATE ··· 1366 1547 # else 1367 1548 /* Extend the stack our own way. */ 1368 1549 if (YYMAXDEPTH <= yystacksize) 1369 - goto yyexhaustedlab; 1550 + goto yyexhaustedlab; 1370 1551 yystacksize *= 2; 1371 1552 if (YYMAXDEPTH < yystacksize) 1372 - yystacksize = YYMAXDEPTH; 1553 + yystacksize = YYMAXDEPTH; 1373 1554 1374 1555 { 1375 - yytype_int16 *yyss1 = yyss; 1376 - union yyalloc *yyptr = 1377 - (union yyalloc *) YYSTACK_ALLOC (YYSTACK_BYTES (yystacksize)); 1378 - if (! yyptr) 1379 - goto yyexhaustedlab; 1380 - YYSTACK_RELOCATE (yyss_alloc, yyss); 1381 - YYSTACK_RELOCATE (yyvs_alloc, yyvs); 1556 + yytype_int16 *yyss1 = yyss; 1557 + union yyalloc *yyptr = 1558 + (union yyalloc *) YYSTACK_ALLOC (YYSTACK_BYTES (yystacksize)); 1559 + if (! yyptr) 1560 + goto yyexhaustedlab; 1561 + YYSTACK_RELOCATE (yyss_alloc, yyss); 1562 + YYSTACK_RELOCATE (yyvs_alloc, yyvs); 1382 1563 # undef YYSTACK_RELOCATE 1383 - if (yyss1 != yyssa) 1384 - YYSTACK_FREE (yyss1); 1564 + if (yyss1 != yyssa) 1565 + YYSTACK_FREE (yyss1); 1385 1566 } 1386 1567 # endif 1387 1568 #endif /* no yyoverflow */ ··· 1390 1571 yyvsp = yyvs + yysize - 1; 1391 1572 1392 1573 YYDPRINTF ((stderr, "Stack size increased to %lu\n", 1393 - (unsigned long int) yystacksize)); 1574 + (unsigned long int) yystacksize)); 1394 1575 1395 1576 if (yyss + yystacksize - 1 <= yyssp) 1396 - YYABORT; 1577 + YYABORT; 1397 1578 } 1398 1579 1399 1580 YYDPRINTF ((stderr, "Entering state %d\n", yystate)); ··· 1422 1603 if (yychar == YYEMPTY) 1423 1604 { 1424 1605 YYDPRINTF ((stderr, "Reading a token: ")); 1425 - yychar = YYLEX; 1606 + yychar = yylex (); 1426 1607 } 1427 1608 1428 1609 if (yychar <= YYEOF) ··· 1462 1643 yychar = YYEMPTY; 1463 1644 1464 1645 yystate = yyn; 1646 + YY_IGNORE_MAYBE_UNINITIALIZED_BEGIN 1465 1647 *++yyvsp = yylval; 1648 + YY_IGNORE_MAYBE_UNINITIALIZED_END 1466 1649 1467 1650 goto yynewstate; 1468 1651 ··· 1487 1666 yylen = yyr2[yyn]; 1488 1667 1489 1668 /* If YYLEN is nonzero, implement the default value of the action: 1490 - `$$ = $1'. 1669 + '$$ = $1'. 1491 1670 1492 1671 Otherwise, the following line sets YYVAL to garbage. 1493 1672 This behavior is undocumented and Bison ··· 1503 1682 case 10: 1504 1683 1505 1684 { zconf_error("unexpected end statement"); } 1685 + 1506 1686 break; 1507 1687 1508 1688 case 11: 1509 1689 1510 - { zconf_error("unknown statement \"%s\"", (yyvsp[(2) - (4)].string)); } 1690 + { zconf_error("unknown statement \"%s\"", (yyvsp[-2].string)); } 1691 + 1511 1692 break; 1512 1693 1513 1694 case 12: 1514 1695 1515 1696 { 1516 - zconf_error("unexpected option \"%s\"", kconf_id_strings + (yyvsp[(2) - (4)].id)->name); 1697 + zconf_error("unexpected option \"%s\"", kconf_id_strings + (yyvsp[-2].id)->name); 1517 1698 } 1699 + 1518 1700 break; 1519 1701 1520 1702 case 13: 1521 1703 1522 1704 { zconf_error("invalid statement"); } 1523 - break; 1524 1705 1525 - case 28: 1526 - 1527 - { zconf_error("unknown option \"%s\"", (yyvsp[(1) - (3)].string)); } 1528 1706 break; 1529 1707 1530 1708 case 29: 1531 1709 1532 - { zconf_error("invalid option"); } 1710 + { zconf_error("unknown option \"%s\"", (yyvsp[-2].string)); } 1711 + 1533 1712 break; 1534 1713 1535 1714 case 30: 1536 1715 1537 - { 1538 - struct symbol *sym = sym_lookup((yyvsp[(2) - (3)].string), 0); 1539 - sym->flags |= SYMBOL_OPTIONAL; 1540 - menu_add_entry(sym); 1541 - printd(DEBUG_PARSE, "%s:%d:config %s\n", zconf_curname(), zconf_lineno(), (yyvsp[(2) - (3)].string)); 1542 - } 1716 + { zconf_error("invalid option"); } 1717 + 1543 1718 break; 1544 1719 1545 1720 case 31: 1546 1721 1547 1722 { 1548 - menu_end_entry(); 1549 - printd(DEBUG_PARSE, "%s:%d:endconfig\n", zconf_curname(), zconf_lineno()); 1723 + struct symbol *sym = sym_lookup((yyvsp[-1].string), 0); 1724 + sym->flags |= SYMBOL_OPTIONAL; 1725 + menu_add_entry(sym); 1726 + printd(DEBUG_PARSE, "%s:%d:config %s\n", zconf_curname(), zconf_lineno(), (yyvsp[-1].string)); 1550 1727 } 1728 + 1551 1729 break; 1552 1730 1553 1731 case 32: 1554 1732 1555 1733 { 1556 - struct symbol *sym = sym_lookup((yyvsp[(2) - (3)].string), 0); 1557 - sym->flags |= SYMBOL_OPTIONAL; 1558 - menu_add_entry(sym); 1559 - printd(DEBUG_PARSE, "%s:%d:menuconfig %s\n", zconf_curname(), zconf_lineno(), (yyvsp[(2) - (3)].string)); 1734 + menu_end_entry(); 1735 + printd(DEBUG_PARSE, "%s:%d:endconfig\n", zconf_curname(), zconf_lineno()); 1560 1736 } 1737 + 1561 1738 break; 1562 1739 1563 1740 case 33: 1741 + 1742 + { 1743 + struct symbol *sym = sym_lookup((yyvsp[-1].string), 0); 1744 + sym->flags |= SYMBOL_OPTIONAL; 1745 + menu_add_entry(sym); 1746 + printd(DEBUG_PARSE, "%s:%d:menuconfig %s\n", zconf_curname(), zconf_lineno(), (yyvsp[-1].string)); 1747 + } 1748 + 1749 + break; 1750 + 1751 + case 34: 1564 1752 1565 1753 { 1566 1754 if (current_entry->prompt) ··· 1579 1749 menu_end_entry(); 1580 1750 printd(DEBUG_PARSE, "%s:%d:endconfig\n", zconf_curname(), zconf_lineno()); 1581 1751 } 1582 - break; 1583 1752 1584 - case 41: 1585 - 1586 - { 1587 - menu_set_type((yyvsp[(1) - (3)].id)->stype); 1588 - printd(DEBUG_PARSE, "%s:%d:type(%u)\n", 1589 - zconf_curname(), zconf_lineno(), 1590 - (yyvsp[(1) - (3)].id)->stype); 1591 - } 1592 1753 break; 1593 1754 1594 1755 case 42: 1595 1756 1596 1757 { 1597 - menu_add_prompt(P_PROMPT, (yyvsp[(2) - (4)].string), (yyvsp[(3) - (4)].expr)); 1598 - printd(DEBUG_PARSE, "%s:%d:prompt\n", zconf_curname(), zconf_lineno()); 1758 + menu_set_type((yyvsp[-2].id)->stype); 1759 + printd(DEBUG_PARSE, "%s:%d:type(%u)\n", 1760 + zconf_curname(), zconf_lineno(), 1761 + (yyvsp[-2].id)->stype); 1599 1762 } 1763 + 1600 1764 break; 1601 1765 1602 1766 case 43: 1603 1767 1604 1768 { 1605 - menu_add_expr(P_DEFAULT, (yyvsp[(2) - (4)].expr), (yyvsp[(3) - (4)].expr)); 1606 - if ((yyvsp[(1) - (4)].id)->stype != S_UNKNOWN) 1607 - menu_set_type((yyvsp[(1) - (4)].id)->stype); 1608 - printd(DEBUG_PARSE, "%s:%d:default(%u)\n", 1609 - zconf_curname(), zconf_lineno(), 1610 - (yyvsp[(1) - (4)].id)->stype); 1769 + menu_add_prompt(P_PROMPT, (yyvsp[-2].string), (yyvsp[-1].expr)); 1770 + printd(DEBUG_PARSE, "%s:%d:prompt\n", zconf_curname(), zconf_lineno()); 1611 1771 } 1772 + 1612 1773 break; 1613 1774 1614 1775 case 44: 1615 1776 1616 1777 { 1617 - menu_add_symbol(P_SELECT, sym_lookup((yyvsp[(2) - (4)].string), 0), (yyvsp[(3) - (4)].expr)); 1618 - printd(DEBUG_PARSE, "%s:%d:select\n", zconf_curname(), zconf_lineno()); 1778 + menu_add_expr(P_DEFAULT, (yyvsp[-2].expr), (yyvsp[-1].expr)); 1779 + if ((yyvsp[-3].id)->stype != S_UNKNOWN) 1780 + menu_set_type((yyvsp[-3].id)->stype); 1781 + printd(DEBUG_PARSE, "%s:%d:default(%u)\n", 1782 + zconf_curname(), zconf_lineno(), 1783 + (yyvsp[-3].id)->stype); 1619 1784 } 1785 + 1620 1786 break; 1621 1787 1622 1788 case 45: 1623 1789 1624 1790 { 1625 - menu_add_expr(P_RANGE, expr_alloc_comp(E_RANGE,(yyvsp[(2) - (5)].symbol), (yyvsp[(3) - (5)].symbol)), (yyvsp[(4) - (5)].expr)); 1626 - printd(DEBUG_PARSE, "%s:%d:range\n", zconf_curname(), zconf_lineno()); 1791 + menu_add_symbol(P_SELECT, sym_lookup((yyvsp[-2].string), 0), (yyvsp[-1].expr)); 1792 + printd(DEBUG_PARSE, "%s:%d:select\n", zconf_curname(), zconf_lineno()); 1627 1793 } 1794 + 1628 1795 break; 1629 1796 1630 - case 48: 1797 + case 46: 1631 1798 1632 1799 { 1633 - const struct kconf_id *id = kconf_id_lookup((yyvsp[(2) - (3)].string), strlen((yyvsp[(2) - (3)].string))); 1634 - if (id && id->flags & TF_OPTION) 1635 - menu_add_option(id->token, (yyvsp[(3) - (3)].string)); 1636 - else 1637 - zconfprint("warning: ignoring unknown option %s", (yyvsp[(2) - (3)].string)); 1638 - free((yyvsp[(2) - (3)].string)); 1800 + menu_add_symbol(P_IMPLY, sym_lookup((yyvsp[-2].string), 0), (yyvsp[-1].expr)); 1801 + printd(DEBUG_PARSE, "%s:%d:imply\n", zconf_curname(), zconf_lineno()); 1639 1802 } 1803 + 1640 1804 break; 1641 1805 1642 - case 49: 1806 + case 47: 1643 1807 1644 - { (yyval.string) = NULL; } 1808 + { 1809 + menu_add_expr(P_RANGE, expr_alloc_comp(E_RANGE,(yyvsp[-3].symbol), (yyvsp[-2].symbol)), (yyvsp[-1].expr)); 1810 + printd(DEBUG_PARSE, "%s:%d:range\n", zconf_curname(), zconf_lineno()); 1811 + } 1812 + 1645 1813 break; 1646 1814 1647 1815 case 50: 1648 1816 1649 - { (yyval.string) = (yyvsp[(2) - (2)].string); } 1817 + { 1818 + const struct kconf_id *id = kconf_id_lookup((yyvsp[-1].string), strlen((yyvsp[-1].string))); 1819 + if (id && id->flags & TF_OPTION) 1820 + menu_add_option(id->token, (yyvsp[0].string)); 1821 + else 1822 + zconfprint("warning: ignoring unknown option %s", (yyvsp[-1].string)); 1823 + free((yyvsp[-1].string)); 1824 + } 1825 + 1650 1826 break; 1651 1827 1652 1828 case 51: 1653 1829 1654 - { 1655 - struct symbol *sym = sym_lookup((yyvsp[(2) - (3)].string), SYMBOL_CHOICE); 1656 - sym->flags |= SYMBOL_AUTO; 1657 - menu_add_entry(sym); 1658 - menu_add_expr(P_CHOICE, NULL, NULL); 1659 - printd(DEBUG_PARSE, "%s:%d:choice\n", zconf_curname(), zconf_lineno()); 1660 - } 1830 + { (yyval.string) = NULL; } 1831 + 1661 1832 break; 1662 1833 1663 1834 case 52: 1664 1835 1665 - { 1666 - (yyval.menu) = menu_add_menu(); 1667 - } 1836 + { (yyval.string) = (yyvsp[0].string); } 1837 + 1668 1838 break; 1669 1839 1670 1840 case 53: 1671 1841 1672 1842 { 1673 - if (zconf_endtoken((yyvsp[(1) - (1)].id), T_CHOICE, T_ENDCHOICE)) { 1843 + struct symbol *sym = sym_lookup((yyvsp[-1].string), SYMBOL_CHOICE); 1844 + sym->flags |= SYMBOL_AUTO; 1845 + menu_add_entry(sym); 1846 + menu_add_expr(P_CHOICE, NULL, NULL); 1847 + printd(DEBUG_PARSE, "%s:%d:choice\n", zconf_curname(), zconf_lineno()); 1848 + } 1849 + 1850 + break; 1851 + 1852 + case 54: 1853 + 1854 + { 1855 + (yyval.menu) = menu_add_menu(); 1856 + } 1857 + 1858 + break; 1859 + 1860 + case 55: 1861 + 1862 + { 1863 + if (zconf_endtoken((yyvsp[0].id), T_CHOICE, T_ENDCHOICE)) { 1674 1864 menu_end_menu(); 1675 1865 printd(DEBUG_PARSE, "%s:%d:endchoice\n", zconf_curname(), zconf_lineno()); 1676 1866 } 1677 1867 } 1678 - break; 1679 1868 1680 - case 61: 1681 - 1682 - { 1683 - menu_add_prompt(P_PROMPT, (yyvsp[(2) - (4)].string), (yyvsp[(3) - (4)].expr)); 1684 - printd(DEBUG_PARSE, "%s:%d:prompt\n", zconf_curname(), zconf_lineno()); 1685 - } 1686 - break; 1687 - 1688 - case 62: 1689 - 1690 - { 1691 - if ((yyvsp[(1) - (3)].id)->stype == S_BOOLEAN || (yyvsp[(1) - (3)].id)->stype == S_TRISTATE) { 1692 - menu_set_type((yyvsp[(1) - (3)].id)->stype); 1693 - printd(DEBUG_PARSE, "%s:%d:type(%u)\n", 1694 - zconf_curname(), zconf_lineno(), 1695 - (yyvsp[(1) - (3)].id)->stype); 1696 - } else 1697 - YYERROR; 1698 - } 1699 1869 break; 1700 1870 1701 1871 case 63: 1702 1872 1703 1873 { 1704 - current_entry->sym->flags |= SYMBOL_OPTIONAL; 1705 - printd(DEBUG_PARSE, "%s:%d:optional\n", zconf_curname(), zconf_lineno()); 1874 + menu_add_prompt(P_PROMPT, (yyvsp[-2].string), (yyvsp[-1].expr)); 1875 + printd(DEBUG_PARSE, "%s:%d:prompt\n", zconf_curname(), zconf_lineno()); 1706 1876 } 1877 + 1707 1878 break; 1708 1879 1709 1880 case 64: 1710 1881 1711 1882 { 1712 - if ((yyvsp[(1) - (4)].id)->stype == S_UNKNOWN) { 1713 - menu_add_symbol(P_DEFAULT, sym_lookup((yyvsp[(2) - (4)].string), 0), (yyvsp[(3) - (4)].expr)); 1883 + if ((yyvsp[-2].id)->stype == S_BOOLEAN || (yyvsp[-2].id)->stype == S_TRISTATE) { 1884 + menu_set_type((yyvsp[-2].id)->stype); 1885 + printd(DEBUG_PARSE, "%s:%d:type(%u)\n", 1886 + zconf_curname(), zconf_lineno(), 1887 + (yyvsp[-2].id)->stype); 1888 + } else 1889 + YYERROR; 1890 + } 1891 + 1892 + break; 1893 + 1894 + case 65: 1895 + 1896 + { 1897 + current_entry->sym->flags |= SYMBOL_OPTIONAL; 1898 + printd(DEBUG_PARSE, "%s:%d:optional\n", zconf_curname(), zconf_lineno()); 1899 + } 1900 + 1901 + break; 1902 + 1903 + case 66: 1904 + 1905 + { 1906 + if ((yyvsp[-3].id)->stype == S_UNKNOWN) { 1907 + menu_add_symbol(P_DEFAULT, sym_lookup((yyvsp[-2].string), 0), (yyvsp[-1].expr)); 1714 1908 printd(DEBUG_PARSE, "%s:%d:default\n", 1715 1909 zconf_curname(), zconf_lineno()); 1716 1910 } else 1717 1911 YYERROR; 1718 1912 } 1913 + 1719 1914 break; 1720 1915 1721 - case 67: 1916 + case 69: 1722 1917 1723 1918 { 1724 1919 printd(DEBUG_PARSE, "%s:%d:if\n", zconf_curname(), zconf_lineno()); 1725 1920 menu_add_entry(NULL); 1726 - menu_add_dep((yyvsp[(2) - (3)].expr)); 1921 + menu_add_dep((yyvsp[-1].expr)); 1727 1922 (yyval.menu) = menu_add_menu(); 1728 1923 } 1924 + 1729 1925 break; 1730 1926 1731 - case 68: 1927 + case 70: 1732 1928 1733 1929 { 1734 - if (zconf_endtoken((yyvsp[(1) - (1)].id), T_IF, T_ENDIF)) { 1930 + if (zconf_endtoken((yyvsp[0].id), T_IF, T_ENDIF)) { 1735 1931 menu_end_menu(); 1736 1932 printd(DEBUG_PARSE, "%s:%d:endif\n", zconf_curname(), zconf_lineno()); 1737 1933 } 1738 1934 } 1739 - break; 1740 1935 1741 - case 74: 1742 - 1743 - { 1744 - menu_add_prompt(P_MENU, (yyvsp[(2) - (3)].string), NULL); 1745 - } 1746 - break; 1747 - 1748 - case 75: 1749 - 1750 - { 1751 - menu_add_entry(NULL); 1752 - menu_add_prompt(P_MENU, (yyvsp[(2) - (3)].string), NULL); 1753 - printd(DEBUG_PARSE, "%s:%d:menu\n", zconf_curname(), zconf_lineno()); 1754 - } 1755 1936 break; 1756 1937 1757 1938 case 76: 1758 1939 1759 1940 { 1760 - (yyval.menu) = menu_add_menu(); 1941 + menu_add_prompt(P_MENU, (yyvsp[-1].string), NULL); 1761 1942 } 1943 + 1762 1944 break; 1763 1945 1764 1946 case 77: 1765 1947 1766 1948 { 1767 - if (zconf_endtoken((yyvsp[(1) - (1)].id), T_MENU, T_ENDMENU)) { 1949 + menu_add_entry(NULL); 1950 + menu_add_prompt(P_MENU, (yyvsp[-1].string), NULL); 1951 + printd(DEBUG_PARSE, "%s:%d:menu\n", zconf_curname(), zconf_lineno()); 1952 + } 1953 + 1954 + break; 1955 + 1956 + case 78: 1957 + 1958 + { 1959 + (yyval.menu) = menu_add_menu(); 1960 + } 1961 + 1962 + break; 1963 + 1964 + case 79: 1965 + 1966 + { 1967 + if (zconf_endtoken((yyvsp[0].id), T_MENU, T_ENDMENU)) { 1768 1968 menu_end_menu(); 1769 1969 printd(DEBUG_PARSE, "%s:%d:endmenu\n", zconf_curname(), zconf_lineno()); 1770 1970 } 1771 1971 } 1772 - break; 1773 1972 1774 - case 83: 1775 - 1776 - { 1777 - printd(DEBUG_PARSE, "%s:%d:source %s\n", zconf_curname(), zconf_lineno(), (yyvsp[(2) - (3)].string)); 1778 - zconf_nextfile((yyvsp[(2) - (3)].string)); 1779 - } 1780 - break; 1781 - 1782 - case 84: 1783 - 1784 - { 1785 - menu_add_entry(NULL); 1786 - menu_add_prompt(P_COMMENT, (yyvsp[(2) - (3)].string), NULL); 1787 - printd(DEBUG_PARSE, "%s:%d:comment\n", zconf_curname(), zconf_lineno()); 1788 - } 1789 1973 break; 1790 1974 1791 1975 case 85: 1792 1976 1793 1977 { 1794 - menu_end_entry(); 1978 + printd(DEBUG_PARSE, "%s:%d:source %s\n", zconf_curname(), zconf_lineno(), (yyvsp[-1].string)); 1979 + zconf_nextfile((yyvsp[-1].string)); 1795 1980 } 1981 + 1796 1982 break; 1797 1983 1798 1984 case 86: 1799 1985 1800 1986 { 1801 - printd(DEBUG_PARSE, "%s:%d:help\n", zconf_curname(), zconf_lineno()); 1802 - zconf_starthelp(); 1987 + menu_add_entry(NULL); 1988 + menu_add_prompt(P_COMMENT, (yyvsp[-1].string), NULL); 1989 + printd(DEBUG_PARSE, "%s:%d:comment\n", zconf_curname(), zconf_lineno()); 1803 1990 } 1991 + 1804 1992 break; 1805 1993 1806 1994 case 87: 1807 1995 1808 1996 { 1809 - current_entry->help = (yyvsp[(2) - (2)].string); 1997 + menu_end_entry(); 1810 1998 } 1999 + 1811 2000 break; 1812 2001 1813 - case 92: 2002 + case 88: 1814 2003 1815 2004 { 1816 - menu_add_dep((yyvsp[(3) - (4)].expr)); 2005 + printd(DEBUG_PARSE, "%s:%d:help\n", zconf_curname(), zconf_lineno()); 2006 + zconf_starthelp(); 2007 + } 2008 + 2009 + break; 2010 + 2011 + case 89: 2012 + 2013 + { 2014 + current_entry->help = (yyvsp[0].string); 2015 + } 2016 + 2017 + break; 2018 + 2019 + case 94: 2020 + 2021 + { 2022 + menu_add_dep((yyvsp[-1].expr)); 1817 2023 printd(DEBUG_PARSE, "%s:%d:depends on\n", zconf_curname(), zconf_lineno()); 1818 2024 } 1819 - break; 1820 2025 1821 - case 96: 1822 - 1823 - { 1824 - menu_add_visibility((yyvsp[(2) - (2)].expr)); 1825 - } 1826 2026 break; 1827 2027 1828 2028 case 98: 1829 2029 1830 2030 { 1831 - menu_add_prompt(P_PROMPT, (yyvsp[(1) - (2)].string), (yyvsp[(2) - (2)].expr)); 2031 + menu_add_visibility((yyvsp[0].expr)); 1832 2032 } 2033 + 1833 2034 break; 1834 2035 1835 - case 101: 2036 + case 100: 1836 2037 1837 - { (yyval.id) = (yyvsp[(1) - (2)].id); } 1838 - break; 2038 + { 2039 + menu_add_prompt(P_PROMPT, (yyvsp[-1].string), (yyvsp[0].expr)); 2040 + } 1839 2041 1840 - case 102: 1841 - 1842 - { (yyval.id) = (yyvsp[(1) - (2)].id); } 1843 2042 break; 1844 2043 1845 2044 case 103: 1846 2045 1847 - { (yyval.id) = (yyvsp[(1) - (2)].id); } 2046 + { (yyval.id) = (yyvsp[-1].id); } 2047 + 1848 2048 break; 1849 2049 1850 - case 106: 2050 + case 104: 1851 2051 1852 - { (yyval.expr) = NULL; } 2052 + { (yyval.id) = (yyvsp[-1].id); } 2053 + 1853 2054 break; 1854 2055 1855 - case 107: 2056 + case 105: 1856 2057 1857 - { (yyval.expr) = (yyvsp[(2) - (2)].expr); } 2058 + { (yyval.id) = (yyvsp[-1].id); } 2059 + 1858 2060 break; 1859 2061 1860 2062 case 108: 1861 2063 1862 - { (yyval.expr) = expr_alloc_symbol((yyvsp[(1) - (1)].symbol)); } 2064 + { (yyval.expr) = NULL; } 2065 + 1863 2066 break; 1864 2067 1865 2068 case 109: 1866 2069 1867 - { (yyval.expr) = expr_alloc_comp(E_LTH, (yyvsp[(1) - (3)].symbol), (yyvsp[(3) - (3)].symbol)); } 2070 + { (yyval.expr) = (yyvsp[0].expr); } 2071 + 1868 2072 break; 1869 2073 1870 2074 case 110: 1871 2075 1872 - { (yyval.expr) = expr_alloc_comp(E_LEQ, (yyvsp[(1) - (3)].symbol), (yyvsp[(3) - (3)].symbol)); } 2076 + { (yyval.expr) = expr_alloc_symbol((yyvsp[0].symbol)); } 2077 + 1873 2078 break; 1874 2079 1875 2080 case 111: 1876 2081 1877 - { (yyval.expr) = expr_alloc_comp(E_GTH, (yyvsp[(1) - (3)].symbol), (yyvsp[(3) - (3)].symbol)); } 2082 + { (yyval.expr) = expr_alloc_comp(E_LTH, (yyvsp[-2].symbol), (yyvsp[0].symbol)); } 2083 + 1878 2084 break; 1879 2085 1880 2086 case 112: 1881 2087 1882 - { (yyval.expr) = expr_alloc_comp(E_GEQ, (yyvsp[(1) - (3)].symbol), (yyvsp[(3) - (3)].symbol)); } 2088 + { (yyval.expr) = expr_alloc_comp(E_LEQ, (yyvsp[-2].symbol), (yyvsp[0].symbol)); } 2089 + 1883 2090 break; 1884 2091 1885 2092 case 113: 1886 2093 1887 - { (yyval.expr) = expr_alloc_comp(E_EQUAL, (yyvsp[(1) - (3)].symbol), (yyvsp[(3) - (3)].symbol)); } 2094 + { (yyval.expr) = expr_alloc_comp(E_GTH, (yyvsp[-2].symbol), (yyvsp[0].symbol)); } 2095 + 1888 2096 break; 1889 2097 1890 2098 case 114: 1891 2099 1892 - { (yyval.expr) = expr_alloc_comp(E_UNEQUAL, (yyvsp[(1) - (3)].symbol), (yyvsp[(3) - (3)].symbol)); } 2100 + { (yyval.expr) = expr_alloc_comp(E_GEQ, (yyvsp[-2].symbol), (yyvsp[0].symbol)); } 2101 + 1893 2102 break; 1894 2103 1895 2104 case 115: 1896 2105 1897 - { (yyval.expr) = (yyvsp[(2) - (3)].expr); } 2106 + { (yyval.expr) = expr_alloc_comp(E_EQUAL, (yyvsp[-2].symbol), (yyvsp[0].symbol)); } 2107 + 1898 2108 break; 1899 2109 1900 2110 case 116: 1901 2111 1902 - { (yyval.expr) = expr_alloc_one(E_NOT, (yyvsp[(2) - (2)].expr)); } 2112 + { (yyval.expr) = expr_alloc_comp(E_UNEQUAL, (yyvsp[-2].symbol), (yyvsp[0].symbol)); } 2113 + 1903 2114 break; 1904 2115 1905 2116 case 117: 1906 2117 1907 - { (yyval.expr) = expr_alloc_two(E_OR, (yyvsp[(1) - (3)].expr), (yyvsp[(3) - (3)].expr)); } 2118 + { (yyval.expr) = (yyvsp[-1].expr); } 2119 + 1908 2120 break; 1909 2121 1910 2122 case 118: 1911 2123 1912 - { (yyval.expr) = expr_alloc_two(E_AND, (yyvsp[(1) - (3)].expr), (yyvsp[(3) - (3)].expr)); } 2124 + { (yyval.expr) = expr_alloc_one(E_NOT, (yyvsp[0].expr)); } 2125 + 1913 2126 break; 1914 2127 1915 2128 case 119: 1916 2129 1917 - { (yyval.symbol) = sym_lookup((yyvsp[(1) - (1)].string), 0); free((yyvsp[(1) - (1)].string)); } 2130 + { (yyval.expr) = expr_alloc_two(E_OR, (yyvsp[-2].expr), (yyvsp[0].expr)); } 2131 + 1918 2132 break; 1919 2133 1920 2134 case 120: 1921 2135 1922 - { (yyval.symbol) = sym_lookup((yyvsp[(1) - (1)].string), SYMBOL_CONST); free((yyvsp[(1) - (1)].string)); } 2136 + { (yyval.expr) = expr_alloc_two(E_AND, (yyvsp[-2].expr), (yyvsp[0].expr)); } 2137 + 1923 2138 break; 1924 2139 1925 2140 case 121: 1926 2141 2142 + { (yyval.symbol) = sym_lookup((yyvsp[0].string), 0); free((yyvsp[0].string)); } 2143 + 2144 + break; 2145 + 2146 + case 122: 2147 + 2148 + { (yyval.symbol) = sym_lookup((yyvsp[0].string), SYMBOL_CONST); free((yyvsp[0].string)); } 2149 + 2150 + break; 2151 + 2152 + case 123: 2153 + 1927 2154 { (yyval.string) = NULL; } 2155 + 1928 2156 break; 1929 2157 1930 2158 ··· 2008 2120 2009 2121 *++yyvsp = yyval; 2010 2122 2011 - /* Now `shift' the result of the reduction. Determine what state 2123 + /* Now 'shift' the result of the reduction. Determine what state 2012 2124 that goes to, based on the state we popped back to and the rule 2013 2125 number reduced by. */ 2014 2126 ··· 2023 2135 goto yynewstate; 2024 2136 2025 2137 2026 - /*------------------------------------. 2027 - | yyerrlab -- here on detecting error | 2028 - `------------------------------------*/ 2138 + /*--------------------------------------. 2139 + | yyerrlab -- here on detecting error. | 2140 + `--------------------------------------*/ 2029 2141 yyerrlab: 2030 2142 /* Make sure we have latest lookahead translation. See comments at 2031 2143 user semantic actions for why this is necessary. */ ··· 2076 2188 if (yyerrstatus == 3) 2077 2189 { 2078 2190 /* If just tried and failed to reuse lookahead token after an 2079 - error, discard it. */ 2191 + error, discard it. */ 2080 2192 2081 2193 if (yychar <= YYEOF) 2082 - { 2083 - /* Return failure if at end of input. */ 2084 - if (yychar == YYEOF) 2085 - YYABORT; 2086 - } 2194 + { 2195 + /* Return failure if at end of input. */ 2196 + if (yychar == YYEOF) 2197 + YYABORT; 2198 + } 2087 2199 else 2088 - { 2089 - yydestruct ("Error: discarding", 2090 - yytoken, &yylval); 2091 - yychar = YYEMPTY; 2092 - } 2200 + { 2201 + yydestruct ("Error: discarding", 2202 + yytoken, &yylval); 2203 + yychar = YYEMPTY; 2204 + } 2093 2205 } 2094 2206 2095 2207 /* Else will try to reuse lookahead token after shifting the error ··· 2108 2220 if (/*CONSTCOND*/ 0) 2109 2221 goto yyerrorlab; 2110 2222 2111 - /* Do not reclaim the symbols of the rule which action triggered 2223 + /* Do not reclaim the symbols of the rule whose action triggered 2112 2224 this YYERROR. */ 2113 2225 YYPOPSTACK (yylen); 2114 2226 yylen = 0; ··· 2121 2233 | yyerrlab1 -- common code for both syntax error and YYERROR. | 2122 2234 `-------------------------------------------------------------*/ 2123 2235 yyerrlab1: 2124 - yyerrstatus = 3; /* Each real token shifted decrements this. */ 2236 + yyerrstatus = 3; /* Each real token shifted decrements this. */ 2125 2237 2126 2238 for (;;) 2127 2239 { 2128 2240 yyn = yypact[yystate]; 2129 2241 if (!yypact_value_is_default (yyn)) 2130 - { 2131 - yyn += YYTERROR; 2132 - if (0 <= yyn && yyn <= YYLAST && yycheck[yyn] == YYTERROR) 2133 - { 2134 - yyn = yytable[yyn]; 2135 - if (0 < yyn) 2136 - break; 2137 - } 2138 - } 2242 + { 2243 + yyn += YYTERROR; 2244 + if (0 <= yyn && yyn <= YYLAST && yycheck[yyn] == YYTERROR) 2245 + { 2246 + yyn = yytable[yyn]; 2247 + if (0 < yyn) 2248 + break; 2249 + } 2250 + } 2139 2251 2140 2252 /* Pop the current state because it cannot handle the error token. */ 2141 2253 if (yyssp == yyss) 2142 - YYABORT; 2254 + YYABORT; 2143 2255 2144 2256 2145 2257 yydestruct ("Error: popping", 2146 - yystos[yystate], yyvsp); 2258 + yystos[yystate], yyvsp); 2147 2259 YYPOPSTACK (1); 2148 2260 yystate = *yyssp; 2149 2261 YY_STACK_PRINT (yyss, yyssp); 2150 2262 } 2151 2263 2264 + YY_IGNORE_MAYBE_UNINITIALIZED_BEGIN 2152 2265 *++yyvsp = yylval; 2266 + YY_IGNORE_MAYBE_UNINITIALIZED_END 2153 2267 2154 2268 2155 2269 /* Shift the error token. */ ··· 2194 2304 yydestruct ("Cleanup: discarding lookahead", 2195 2305 yytoken, &yylval); 2196 2306 } 2197 - /* Do not reclaim the symbols of the rule which action triggered 2307 + /* Do not reclaim the symbols of the rule whose action triggered 2198 2308 this YYABORT or YYACCEPT. */ 2199 2309 YYPOPSTACK (yylen); 2200 2310 YY_STACK_PRINT (yyss, yyssp); 2201 2311 while (yyssp != yyss) 2202 2312 { 2203 2313 yydestruct ("Cleanup: popping", 2204 - yystos[*yyssp], yyvsp); 2314 + yystos[*yyssp], yyvsp); 2205 2315 YYPOPSTACK (1); 2206 2316 } 2207 2317 #ifndef yyoverflow ··· 2212 2322 if (yymsg != yymsgbuf) 2213 2323 YYSTACK_FREE (yymsg); 2214 2324 #endif 2215 - /* Make sure YYID is used. */ 2216 - return YYID (yyresult); 2325 + return yyresult; 2217 2326 } 2218 - 2219 - 2220 2327 2221 2328 2222 2329 ··· 2388 2501 expr_fprint(prop->expr, out); 2389 2502 fputc('\n', out); 2390 2503 break; 2504 + case P_IMPLY: 2505 + fputs( " imply ", out); 2506 + expr_fprint(prop->expr, out); 2507 + fputc('\n', out); 2508 + break; 2391 2509 case P_RANGE: 2392 2510 fputs( " range ", out); 2393 2511 expr_fprint(prop->expr, out); ··· 2469 2577 #include "expr.c" 2470 2578 #include "symbol.c" 2471 2579 #include "menu.c" 2472 -
+14 -2
scripts/kconfig/zconf.y
··· 31 31 static struct menu *current_menu, *current_entry; 32 32 33 33 %} 34 - %expect 30 34 + %expect 32 35 35 36 36 %union 37 37 { ··· 62 62 %token <id>T_TYPE 63 63 %token <id>T_DEFAULT 64 64 %token <id>T_SELECT 65 + %token <id>T_IMPLY 65 66 %token <id>T_RANGE 66 67 %token <id>T_VISIBLE 67 68 %token <id>T_OPTION ··· 125 124 ; 126 125 127 126 option_name: 128 - T_DEPENDS | T_PROMPT | T_TYPE | T_SELECT | T_OPTIONAL | T_RANGE | T_DEFAULT | T_VISIBLE 127 + T_DEPENDS | T_PROMPT | T_TYPE | T_SELECT | T_IMPLY | T_OPTIONAL | T_RANGE | T_DEFAULT | T_VISIBLE 129 128 ; 130 129 131 130 common_stmt: ··· 215 214 { 216 215 menu_add_symbol(P_SELECT, sym_lookup($2, 0), $3); 217 216 printd(DEBUG_PARSE, "%s:%d:select\n", zconf_curname(), zconf_lineno()); 217 + }; 218 + 219 + config_option: T_IMPLY T_WORD if_expr T_EOL 220 + { 221 + menu_add_symbol(P_IMPLY, sym_lookup($2, 0), $3); 222 + printd(DEBUG_PARSE, "%s:%d:imply\n", zconf_curname(), zconf_lineno()); 218 223 }; 219 224 220 225 config_option: T_RANGE symbol symbol if_expr T_EOL ··· 668 661 break; 669 662 case P_SELECT: 670 663 fputs( " select ", out); 664 + expr_fprint(prop->expr, out); 665 + fputc('\n', out); 666 + break; 667 + case P_IMPLY: 668 + fputs( " imply ", out); 671 669 expr_fprint(prop->expr, out); 672 670 fputc('\n', out); 673 671 break;
+7 -4
security/selinux/hooks.c
··· 2525 2525 rlim->rlim_cur = min(rlim->rlim_max, initrlim->rlim_cur); 2526 2526 } 2527 2527 task_unlock(current); 2528 - update_rlimit_cpu(current, rlimit(RLIMIT_CPU)); 2528 + if (IS_ENABLED(CONFIG_POSIX_TIMERS)) 2529 + update_rlimit_cpu(current, rlimit(RLIMIT_CPU)); 2529 2530 } 2530 2531 } 2531 2532 ··· 2556 2555 */ 2557 2556 rc = avc_has_perm(osid, sid, SECCLASS_PROCESS, PROCESS__SIGINH, NULL); 2558 2557 if (rc) { 2559 - memset(&itimer, 0, sizeof itimer); 2560 - for (i = 0; i < 3; i++) 2561 - do_setitimer(i, &itimer, NULL); 2558 + if (IS_ENABLED(CONFIG_POSIX_TIMERS)) { 2559 + memset(&itimer, 0, sizeof itimer); 2560 + for (i = 0; i < 3; i++) 2561 + do_setitimer(i, &itimer, NULL); 2562 + } 2562 2563 spin_lock_irq(&current->sighand->siglock); 2563 2564 if (!fatal_signal_pending(current)) { 2564 2565 flush_sigqueue(&current->pending);
+1 -1
tools/testing/selftests/timers/skew_consistency.c
··· 57 57 pid_t pid; 58 58 59 59 60 - printf("Running Asyncrhonous Frequency Changing Tests...\n"); 60 + printf("Running Asynchronous Frequency Changing Tests...\n"); 61 61 62 62 pid = fork(); 63 63 if (!pid)