History

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 ...

Linus Torvalds committed 9 years ago

Commit 9465d9c2 parents e71c397 c029a2b61 files · +1479 −1041Browse files

Unified · Split

61 files
  1. Documentation/devicetree/bindings/arm/arch_timer.txt +5 −0
  2. Documentation/kbuild/kconfig-language.txt +29 −0
  3. Documentation/trace/ftrace.txt +20 −0
  4. arch/alpha/kernel/osf_sys.c +8 −0
  5. arch/arm64/boot/dts/rockchip/rk3399.dtsi +1 −0
  6. arch/x86/kernel/rtc.c +9 −0
  7. drivers/Makefile +1 −1
  8. drivers/base/power/trace.c +27 −0
  9. drivers/char/Kconfig +1 −0
  10. drivers/clocksource/arm_arch_timer.c +11 −3
  11. drivers/clocksource/bcm2835_timer.c +10 −4
  12. drivers/net/ethernet/adi/Kconfig +1 −1
  13. drivers/net/ethernet/amd/Kconfig +1 −1
  14. drivers/net/ethernet/amd/xgbe/xgbe-main.c +4 −2
  15. drivers/net/ethernet/broadcom/Kconfig +2 −2
  16. drivers/net/ethernet/cavium/Kconfig +1 −1
  17. drivers/net/ethernet/freescale/Kconfig +1 −1
  18. drivers/net/ethernet/intel/Kconfig +5 −5
  19. drivers/net/ethernet/mellanox/mlx4/Kconfig +1 −1
  20. drivers/net/ethernet/mellanox/mlx5/core/Kconfig +1 −1
  21. drivers/net/ethernet/renesas/Kconfig +1 −1
  22. drivers/net/ethernet/samsung/Kconfig +1 −1
  23. drivers/net/ethernet/sfc/Kconfig +1 −1
  24. drivers/net/ethernet/stmicro/stmmac/Kconfig +1 −1
  25. drivers/net/ethernet/ti/Kconfig +1 −1
  26. drivers/net/ethernet/tile/Kconfig +1 −1
  27. drivers/ptp/Kconfig +5 −5
  28. drivers/rtc/rtc-cmos.c +7 −0
  29. fs/exec.c +2 −0
  30. include/linux/alarmtimer.h +5 −0
  31. include/linux/clocksource.h +4 −1
  32. include/linux/mc146818rtc.h +1 −0
  33. include/linux/pm-trace.h +8 −1
  34. include/linux/ptp_clock_kernel.h +41 −24
  35. include/linux/time.h +0 −2
  36. include/linux/timekeeping.h +1 −0
  37. include/trace/events/alarmtimer.h +96 −0
  38. init/Kconfig +17 −0
  39. kernel/compat.c +8 −0
  40. kernel/exit.c +13 −2
  41. kernel/fork.c +2 −0
  42. kernel/signal.c +6 −0
  43. kernel/sys.c +2 −1
  44. kernel/time/Makefile +8 −2
  45. kernel/time/alarmtimer.c +47 −12
  46. kernel/time/hrtimer.c +14 −6
  47. kernel/time/itimer.c +14 −1
  48. kernel/time/posix-cpu-timers.c +0 −4
  49. kernel/time/posix-stubs.c +123 −0
  50. kernel/time/timekeeping.c +51 −39
  51. kernel/time/timer.c +18 −30
  52. kernel/trace/trace.c +1 −0
  53. scripts/kconfig/expr.h +2 −0
  54. scripts/kconfig/menu.c +39 −16
  55. scripts/kconfig/symbol.c +23 −1
  56. scripts/kconfig/zconf.gperf +1 −0
  57. scripts/kconfig/zconf.hash.c_shipped +17 −13
  58. scripts/kconfig/zconf.tab.c_shipped +736 −845
  59. scripts/kconfig/zconf.y +14 −2
  60. security/selinux/hooks.c +7 −4
  61. tools/testing/selftests/timers/skew_consistency.c +1 −1
Documentation/devicetree/bindings/arm/arch_timer.txt+5−0
@@ -38,6 +38,11 @@ to deliver its interrupts via SPIs. · 37 unmodified lines
3838 architecturally-defined reset values. Only supported for 32-bit
3939 systems which follow the ARMv7 architected reset values.
4040
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+
4146
4247 Example:
4348
Documentation/kbuild/kconfig-language.txt+29−0
@@ -113,6 +113,34 @@ applicable everywhere (see syntax). · 112 unmodified lines
113113 That will limit the usefulness but on the other hand avoid
114114 the illegal configurations all over.
115115
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+
116144 - limiting menu display: "visible if" <expr>
117145 This attribute is only applicable to menu blocks, if the condition is
118146 false, the menu block is not displayed to the user (the symbols
@@ -481,6 +509,7 @@ historical issues resolved through these different solutions. · 362 unmodified lines
481509 b) Match dependency semantics:
482510 b1) Swap all "select FOO" to "depends on FOO" or,
483511 b2) Swap all "depends on FOO" to "select FOO"
512+ c) Consider the use of "imply" instead of "select"
484513
485514 The resolution to a) can be tested with the sample Kconfig file
486515 Documentation/kbuild/Kconfig.recursion-issue-01 through the removal
Documentation/trace/ftrace.txt+20−0
@@ -362,6 +362,26 @@ of ftrace. Here is a list of some of the key files: · 361 unmodified lines
362362 to correlate events across hypervisor/guest if
363363 tb_offset is known.
364364
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+
365385 To set a clock, simply echo the clock name into this file.
366386
367387 echo global > trace_clock
arch/alpha/kernel/osf_sys.c+8−0
@@ -1029,11 +1029,16 @@ SYSCALL_DEFINE2(osf_settimeofday, struct timeval32 __user *, tv, · 1028 unmodified lines
10291029 return do_sys_settimeofday(tv ? &kts : NULL, tz ? &ktz : NULL);
10301030 }
10311031
1032+asmlinkage long sys_ni_posix_timers(void);
1033+
10321034 SYSCALL_DEFINE2(osf_getitimer, int, which, struct itimerval32 __user *, it)
10331035 {
10341036 struct itimerval kit;
10351037 int error;
10361038
1039+ if (!IS_ENABLED(CONFIG_POSIX_TIMERS))
1040+ return sys_ni_posix_timers();
1041+
10371042 error = do_getitimer(which, &kit);
10381043 if (!error && put_it32(it, &kit))
10391044 error = -EFAULT;
@@ -1047,6 +1052,9 @@ SYSCALL_DEFINE3(osf_setitimer, int, which, struct itimerval32 __user *, in, · 7 unmodified lines
10471052 struct itimerval kin, kout;
10481053 int error;
10491054
1055+ if (!IS_ENABLED(CONFIG_POSIX_TIMERS))
1056+ return sys_ni_posix_timers();
1057+
10501058 if (in) {
10511059 if (get_it32(&kin, in))
10521060 return -EFAULT;
arch/arm64/boot/dts/rockchip/rk3399.dtsi+1−0
@@ -174,6 +174,7 @@ · 173 unmodified lines
174174 <GIC_PPI 14 IRQ_TYPE_LEVEL_LOW 0>,
175175 <GIC_PPI 11 IRQ_TYPE_LEVEL_LOW 0>,
176176 <GIC_PPI 10 IRQ_TYPE_LEVEL_LOW 0>;
177+ arm,no-tick-in-suspend;
177178 };
178179
179180 xin24m: xin24m {
arch/x86/kernel/rtc.c+9−0
@@ -64,6 +64,15 @@ void mach_get_cmos_time(struct timespec *now) · 63 unmodified lines
6464 unsigned int status, year, mon, day, hour, min, sec, century = 0;
6565 unsigned long flags;
6666
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+
6776 spin_lock_irqsave(&rtc_lock, flags);
6877
6978 /*
drivers/Makefile+1−1
@@ -107,7 +107,7 @@ obj-$(CONFIG_INPUT) += input/ · 106 unmodified lines
107107 obj-$(CONFIG_RTC_LIB) += rtc/
108108 obj-y += i2c/ media/
109109 obj-$(CONFIG_PPS) += pps/
110−obj-$(CONFIG_PTP_1588_CLOCK) += ptp/
110+obj-y += ptp/
111111 obj-$(CONFIG_W1) += w1/
112112 obj-y += power/
113113 obj-$(CONFIG_HWMON) += hwmon/
drivers/base/power/trace.c+27−0
@@ -10,6 +10,7 @@ · 9 unmodified lines
1010 #include <linux/pm-trace.h>
1111 #include <linux/export.h>
1212 #include <linux/rtc.h>
13+#include <linux/suspend.h>
1314
1415 #include <linux/mc146818rtc.h>
1516
@@ -74,6 +75,9 @@ · 58 unmodified lines
7475
7576 #define DEVSEED (7919)
7677
78+bool pm_trace_rtc_abused __read_mostly;
79+EXPORT_SYMBOL_GPL(pm_trace_rtc_abused);
80+
7781 static unsigned int dev_hash_value;
7882
7983 static int set_magic_time(unsigned int user, unsigned int file, unsigned int device)
@@ -104,6 +108,7 @@ static int set_magic_time(unsigned int user, unsigned int file, unsigned int dev · 24 unmodified lines
104108 time.tm_min = (n % 20) * 3;
105109 n /= 20;
106110 mc146818_set_time(&time);
111+ pm_trace_rtc_abused = true;
107112 return n ? -1 : 0;
108113 }
109114
@@ -239,9 +244,31 @@ int show_trace_dev_match(char *buf, size_t size) · 129 unmodified lines
239244 return ret;
240245 }
241246
247+static int
248+pm_trace_notify(struct notifier_block *nb, unsigned long mode, void *_unused)
249+{
250+ switch (mode) {
251+ case PM_POST_HIBERNATION:
252+ case PM_POST_SUSPEND:
253+ if (pm_trace_rtc_abused) {
254+ pm_trace_rtc_abused = false;
255+ pr_warn("Possible incorrect RTC due to pm_trace, please use 'ntpdate' or 'rdate' to reset it.\n");
256+ }
257+ break;
258+ default:
259+ break;
260+ }
261+ return 0;
262+}
263+
264+static struct notifier_block pm_trace_nb = {
265+ .notifier_call = pm_trace_notify,
266+};
267+
242268 static int early_resume_init(void)
243269 {
244270 hash_value_early_read = read_magic_time();
271+ register_pm_notifier(&pm_trace_nb);
245272 return 0;
246273 }
247274
drivers/char/Kconfig+1−0
@@ -542,6 +542,7 @@ config HANGCHECK_TIMER · 541 unmodified lines
542542 config MMTIMER
543543 tristate "MMTIMER Memory mapped RTC for SGI Altix"
544544 depends on IA64_GENERIC || IA64_SGI_SN2
545+ depends on POSIX_TIMERS
545546 default y
546547 help
547548 The mmtimer device allows direct userspace access to the
drivers/clocksource/arm_arch_timer.c+11−3
@@ -81,6 +81,7 @@ static struct clock_event_device __percpu *arch_timer_evt; · 80 unmodified lines
8181 static enum ppi_nr arch_timer_uses_ppi = VIRT_PPI;
8282 static bool arch_timer_c3stop;
8383 static bool arch_timer_mem_use_virtual;
84+static bool arch_counter_suspend_stop;
8485
8586 static bool evtstrm_enable = IS_ENABLED(CONFIG_ARM_ARCH_TIMER_EVTSTREAM);
8687
@@ -576,7 +577,7 @@ static struct clocksource clocksource_counter = { · 489 unmodified lines
576577 .rating = 400,
577578 .read = arch_counter_read,
578579 .mask = CLOCKSOURCE_MASK(56),
579− .flags = CLOCK_SOURCE_IS_CONTINUOUS | CLOCK_SOURCE_SUSPEND_NONSTOP,
580+ .flags = CLOCK_SOURCE_IS_CONTINUOUS,
580581 };
581582
582583 static struct cyclecounter cyclecounter = {
@@ -616,6 +617,8 @@ static void __init arch_counter_register(unsigned type) · 33 unmodified lines
616617 arch_timer_read_counter = arch_counter_get_cntvct_mem;
617618 }
618619
620+ if (!arch_counter_suspend_stop)
621+ clocksource_counter.flags |= CLOCK_SOURCE_SUSPEND_NONSTOP;
619622 start_count = arch_timer_read_counter();
620623 clocksource_register_hz(&clocksource_counter, arch_timer_rate);
621624 cyclecounter.mult = clocksource_counter.mult;
@@ -907,6 +910,10 @@ static int __init arch_timer_of_init(struct device_node *np) · 285 unmodified lines
907910 of_property_read_bool(np, "arm,cpu-registers-not-fw-configured"))
908911 arch_timer_uses_ppi = PHYS_SECURE_PPI;
909912
913+ /* On some systems, the counter stops ticking when in suspend. */
914+ arch_counter_suspend_stop = of_property_read_bool(np,
915+ "arm,no-tick-in-suspend");
916+
910917 return arch_timer_init();
911918 }
912919 CLOCKSOURCE_OF_DECLARE(armv7_arch_timer, "arm,armv7-timer", arch_timer_of_init);
@@ -964,8 +971,9 @@ static int __init arch_timer_mem_init(struct device_node *np) · 51 unmodified lines
964971 }
965972
966973 ret= -ENXIO;
967− base = arch_counter_base = of_iomap(best_frame, 0);
968− if (!base) {
974+ base = arch_counter_base = of_io_request_and_map(best_frame, 0,
975+ "arch_mem_timer");
976+ if (IS_ERR(base)) {
969977 pr_err("arch_timer: Can't map frame's registers\n");
970978 goto out;
971979 }
drivers/clocksource/bcm2835_timer.c+10−4
@@ -96,7 +96,7 @@ static int __init bcm2835_timer_init(struct device_node *node) · 95 unmodified lines
9696 ret = of_property_read_u32(node, "clock-frequency", &freq);
9797 if (ret) {
9898 pr_err("Can't read clock-frequency");
99− return ret;
99+ goto err_iounmap;
100100 }
101101
102102 system_clock = base + REG_COUNTER_LO;
@@ -108,13 +108,15 @@ static int __init bcm2835_timer_init(struct device_node *node) · 5 unmodified lines
108108 irq = irq_of_parse_and_map(node, DEFAULT_TIMER);
109109 if (irq <= 0) {
110110 pr_err("Can't parse IRQ");
111− return -EINVAL;
111+ ret = -EINVAL;
112+ goto err_iounmap;
112113 }
113114
114115 timer = kzalloc(sizeof(*timer), GFP_KERNEL);
115116 if (!timer) {
116117 pr_err("Can't allocate timer struct\n");
117− return -ENOMEM;
118+ ret = -ENOMEM;
119+ goto err_iounmap;
118120 }
119121
120122 timer->control = base + REG_CONTROL;
@@ -133,7 +135,7 @@ static int __init bcm2835_timer_init(struct device_node *node) · 12 unmodified lines
133135 ret = setup_irq(irq, &timer->act);
134136 if (ret) {
135137 pr_err("Can't set up timer IRQ\n");
136− return ret;
138+ goto err_iounmap;
137139 }
138140
139141 clockevents_config_and_register(&timer->evt, freq, 0xf, 0xffffffff);
@@ -141,6 +143,10 @@ static int __init bcm2835_timer_init(struct device_node *node) · 1 unmodified line
141143 pr_info("bcm2835: system timer (irq = %d)\n", irq);
142144
143145 return 0;
146+
147+err_iounmap:
148+ iounmap(base);
149+ return ret;
144150 }
145151 CLOCKSOURCE_OF_DECLARE(bcm2835, "brcm,bcm2835-system-timer",
146152 bcm2835_timer_init);
drivers/net/ethernet/adi/Kconfig+1−1
@@ -58,7 +58,7 @@ config BFIN_RX_DESC_NUM · 57 unmodified lines
5858 config BFIN_MAC_USE_HWSTAMP
5959 bool "Use IEEE 1588 hwstamp"
6060 depends on BFIN_MAC && BF518
61− select PTP_1588_CLOCK
61+ imply PTP_1588_CLOCK
6262 default y
6363 ---help---
6464 To support the IEEE 1588 Precision Time Protocol (PTP), select y here
drivers/net/ethernet/amd/Kconfig+1−1
@@ -177,9 +177,9 @@ config AMD_XGBE · 176 unmodified lines
177177 depends on X86 || ARM64 || COMPILE_TEST
178178 select BITREVERSE
179179 select CRC32
180− select PTP_1588_CLOCK
181180 select PHYLIB
182181 select AMD_XGBE_HAVE_ECC if X86
182+ imply PTP_1588_CLOCK
183183 ---help---
184184 This driver supports the AMD 10GbE Ethernet device found on an
185185 AMD SoC.
drivers/net/ethernet/amd/xgbe/xgbe-main.c+4−2
@@ -422,7 +422,8 @@ int xgbe_config_netdev(struct xgbe_prv_data *pdata) · 421 unmodified lines
422422 goto err_wq;
423423 }
424424
425− xgbe_ptp_register(pdata);
425+ if (IS_REACHABLE(CONFIG_PTP_1588_CLOCK))
426+ xgbe_ptp_register(pdata);
426427
427428 xgbe_debugfs_init(pdata);
428429
@@ -448,7 +449,8 @@ void xgbe_deconfig_netdev(struct xgbe_prv_data *pdata) · 19 unmodified lines
448449
449450 xgbe_debugfs_exit(pdata);
450451
451− xgbe_ptp_unregister(pdata);
452+ if (IS_REACHABLE(CONFIG_PTP_1588_CLOCK))
453+ xgbe_ptp_unregister(pdata);
452454
453455 pdata->phy_if.phy_exit(pdata);
454456
drivers/net/ethernet/broadcom/Kconfig+2−2
@@ -110,7 +110,7 @@ config TIGON3 · 109 unmodified lines
110110 depends on PCI
111111 select PHYLIB
112112 select HWMON
113− select PTP_1588_CLOCK
113+ imply PTP_1588_CLOCK
114114 ---help---
115115 This driver supports Broadcom Tigon3 based gigabit Ethernet cards.
116116
@@ -120,7 +120,7 @@ config TIGON3 · 3 unmodified lines
120120 config BNX2X
121121 tristate "Broadcom NetXtremeII 10Gb support"
122122 depends on PCI
123− select PTP_1588_CLOCK
123+ imply PTP_1588_CLOCK
124124 select FW_LOADER
125125 select ZLIB_INFLATE
126126 select LIBCRC32C
drivers/net/ethernet/cavium/Kconfig+1−1
@@ -53,7 +53,7 @@ config THUNDER_NIC_RGX · 52 unmodified lines
5353 config LIQUIDIO
5454 tristate "Cavium LiquidIO support"
5555 depends on 64BIT
56− select PTP_1588_CLOCK
56+ imply PTP_1588_CLOCK
5757 select FW_LOADER
5858 select LIBCRC32C
5959 ---help---
drivers/net/ethernet/freescale/Kconfig+1−1
@@ -25,7 +25,7 @@ config FEC · 24 unmodified lines
2525 ARCH_MXC || SOC_IMX28)
2626 default ARCH_MXC || SOC_IMX28 if ARM
2727 select PHYLIB
28− select PTP_1588_CLOCK
28+ imply PTP_1588_CLOCK
2929 ---help---
3030 Say Y here if you want to use the built-in 10/100 Fast ethernet
3131 controller on some Motorola ColdFire and Freescale i.MX processors.
drivers/net/ethernet/intel/Kconfig+5−5
@@ -58,7 +58,7 @@ config E1000E · 57 unmodified lines
5858 tristate "Intel(R) PRO/1000 PCI-Express Gigabit Ethernet support"
5959 depends on PCI && (!SPARC32 || BROKEN)
6060 select CRC32
61− select PTP_1588_CLOCK
61+ imply PTP_1588_CLOCK
6262 ---help---
6363 This driver supports the PCI-Express Intel(R) PRO/1000 gigabit
6464 ethernet family of adapters. For PCI or PCI-X e1000 adapters,
@@ -83,7 +83,7 @@ config E1000E_HWTS · 18 unmodified lines
8383 config IGB
8484 tristate "Intel(R) 82575/82576 PCI-Express Gigabit Ethernet support"
8585 depends on PCI
86− select PTP_1588_CLOCK
86+ imply PTP_1588_CLOCK
8787 select I2C
8888 select I2C_ALGOBIT
8989 ---help---
@@ -156,7 +156,7 @@ config IXGBE · 66 unmodified lines
156156 tristate "Intel(R) 10GbE PCI Express adapters support"
157157 depends on PCI
158158 select MDIO
159− select PTP_1588_CLOCK
159+ imply PTP_1588_CLOCK
160160 ---help---
161161 This driver supports Intel(R) 10GbE PCI Express family of
162162 adapters. For more information on how to identify your adapter, go
@@ -213,7 +213,7 @@ config IXGBEVF · 50 unmodified lines
213213
214214 config I40E
215215 tristate "Intel(R) Ethernet Controller XL710 Family support"
216− select PTP_1588_CLOCK
216+ imply PTP_1588_CLOCK
217217 depends on PCI
218218 ---help---
219219 This driver supports Intel(R) Ethernet Controller XL710 Family of
@@ -264,7 +264,7 @@ config FM10K · 44 unmodified lines
264264 tristate "Intel(R) FM10000 Ethernet Switch Host Interface Support"
265265 default n
266266 depends on PCI_MSI
267− select PTP_1588_CLOCK
267+ imply PTP_1588_CLOCK
268268 ---help---
269269 This driver supports Intel(R) FM10000 Ethernet Switch Host
270270 Interface. For more information on how to identify your adapter,
drivers/net/ethernet/mellanox/mlx4/Kconfig+1−1
@@ -7,7 +7,7 @@ config MLX4_EN · 6 unmodified lines
77 depends on MAY_USE_DEVLINK
88 depends on PCI
99 select MLX4_CORE
10− select PTP_1588_CLOCK
10+ imply PTP_1588_CLOCK
1111 ---help---
1212 This driver supports Mellanox Technologies ConnectX Ethernet
1313 devices.
drivers/net/ethernet/mellanox/mlx5/core/Kconfig+1−1
@@ -14,7 +14,7 @@ config MLX5_CORE · 13 unmodified lines
1414 config MLX5_CORE_EN
1515 bool "Mellanox Technologies ConnectX-4 Ethernet support"
1616 depends on NETDEVICES && ETHERNET && PCI && MLX5_CORE
17− select PTP_1588_CLOCK
17+ imply PTP_1588_CLOCK
1818 default n
1919 ---help---
2020 Ethernet support in Mellanox Technologies ConnectX-4 NIC.
drivers/net/ethernet/renesas/Kconfig+1−1
@@ -37,7 +37,7 @@ config RAVB · 36 unmodified lines
3737 select MII
3838 select MDIO_BITBANG
3939 select PHYLIB
40− select PTP_1588_CLOCK
40+ imply PTP_1588_CLOCK
4141 help
4242 Renesas Ethernet AVB device driver.
4343 This driver supports the following SoCs:
drivers/net/ethernet/samsung/Kconfig+1−1
@@ -21,7 +21,7 @@ config SXGBE_ETH · 20 unmodified lines
2121 depends on HAS_IOMEM && HAS_DMA
2222 select PHYLIB
2323 select CRC32
24− select PTP_1588_CLOCK
24+ imply PTP_1588_CLOCK
2525 ---help---
2626 This is the driver for the SXGBE 10G Ethernet IP block found on
2727 Samsung platforms.
drivers/net/ethernet/sfc/Kconfig+1−1
@@ -5,7 +5,7 @@ config SFC · 4 unmodified lines
55 select CRC32
66 select I2C
77 select I2C_ALGOBIT
8− select PTP_1588_CLOCK
8+ imply PTP_1588_CLOCK
99 ---help---
1010 This driver supports 10/40-gigabit Ethernet cards based on
1111 the Solarflare SFC9000-family and SFC9100-family controllers.
drivers/net/ethernet/stmicro/stmmac/Kconfig+1−1
@@ -4,7 +4,7 @@ config STMMAC_ETH · 3 unmodified lines
44 select MII
55 select PHYLIB
66 select CRC32
7− select PTP_1588_CLOCK
7+ imply PTP_1588_CLOCK
88 select RESET_CONTROLLER
99 ---help---
1010 This is the driver for the Ethernet IPs are built around a
drivers/net/ethernet/ti/Kconfig+1−1
@@ -76,7 +76,7 @@ config TI_CPSW · 75 unmodified lines
7676 config TI_CPTS
7777 tristate "TI Common Platform Time Sync (CPTS) Support"
7878 depends on TI_CPSW || TI_KEYSTONE_NETCP
79− select PTP_1588_CLOCK
79+ imply PTP_1588_CLOCK
8080 ---help---
8181 This driver supports the Common Platform Time Sync unit of
8282 the CPSW Ethernet Switch and Keystone 2 1g/10g Switch Subsystem.
drivers/net/ethernet/tile/Kconfig+1−1
@@ -9,7 +9,7 @@ config TILE_NET · 8 unmodified lines
99 select CRC32
1010 select TILE_GXIO_MPIPE if TILEGX
1111 select HIGH_RES_TIMERS if TILEGX
12− select PTP_1588_CLOCK if TILEGX
12+ imply PTP_1588_CLOCK if TILEGX
1313 ---help---
1414 This is a standard Linux network device driver for the
1515 on-chip Tilera Gigabit Ethernet and XAUI interfaces.
drivers/ptp/Kconfig+5−5
@@ -6,7 +6,7 @@ menu "PTP clock support" · 5 unmodified lines
66
77 config PTP_1588_CLOCK
88 tristate "PTP clock support"
9− depends on NET
9+ depends on NET && POSIX_TIMERS
1010 select PPS
1111 select NET_PTP_CLASSIFY
1212 help
@@ -28,7 +28,7 @@ config PTP_1588_CLOCK · 15 unmodified lines
2828 config PTP_1588_CLOCK_GIANFAR
2929 tristate "Freescale eTSEC as PTP clock"
3030 depends on GIANFAR
31− select PTP_1588_CLOCK
31+ depends on PTP_1588_CLOCK
3232 default y
3333 help
3434 This driver adds support for using the eTSEC as a PTP
@@ -42,7 +42,7 @@ config PTP_1588_CLOCK_GIANFAR · 7 unmodified lines
4242 config PTP_1588_CLOCK_IXP46X
4343 tristate "Intel IXP46x as PTP clock"
4444 depends on IXP4XX_ETH
45− select PTP_1588_CLOCK
45+ depends on PTP_1588_CLOCK
4646 default y
4747 help
4848 This driver adds support for using the IXP46X as a PTP
@@ -60,7 +60,7 @@ config DP83640_PHY · 11 unmodified lines
6060 tristate "Driver for the National Semiconductor DP83640 PHYTER"
6161 depends on NETWORK_PHY_TIMESTAMPING
6262 depends on PHYLIB
63− select PTP_1588_CLOCK
63+ depends on PTP_1588_CLOCK
6464 ---help---
6565 Supports the DP83640 PHYTER with IEEE 1588 features.
6666
@@ -76,7 +76,7 @@ config PTP_1588_CLOCK_PCH · 9 unmodified lines
7676 tristate "Intel PCH EG20T as PTP clock"
7777 depends on X86_32 || COMPILE_TEST
7878 depends on HAS_IOMEM && NET
79− select PTP_1588_CLOCK
79+ imply PTP_1588_CLOCK
8080 help
8181 This driver adds support for using the PCH EG20T as a PTP
8282 clock. The hardware supports time stamping of PTP packets
drivers/rtc/rtc-cmos.c+7−0
@@ -191,6 +191,13 @@ static inline void cmos_write_bank2(unsigned char val, unsigned char addr) · 190 unmodified lines
191191
192192 static int cmos_read_time(struct device *dev, struct rtc_time *t)
193193 {
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+
194201 /* REVISIT: if the clock has a "century" register, use
195202 * that instead of the heuristic in mc146818_get_time().
196203 * That'll make Y3K compatility (year > 2070) easy!
fs/exec.c+2−0
@@ -1169,8 +1169,10 @@ no_thread_group: · 1168 unmodified lines
11691169 /* we have changed execution domain */
11701170 tsk->exit_signal = SIGCHLD;
11711171
1172+#ifdef CONFIG_POSIX_TIMERS
11721173 exit_itimers(sig);
11731174 flush_itimer_signals();
1175+#endif
11741176
11751177 if (atomic_read(&oldsighand->count) != 1) {
11761178 struct sighand_struct *newsighand;
include/linux/alarmtimer.h+5−0
@@ -10,7 +10,12 @@ enum alarmtimer_type { · 9 unmodified lines
1010 ALARM_REALTIME,
1111 ALARM_BOOTTIME,
1212
13+ /* Supported types end here */
1314 ALARM_NUMTYPE,
15+
16+ /* Used for tracing information. No usable types. */
17+ ALARM_REALTIME_FREEZER,
18+ ALARM_BOOTTIME_FREEZER,
1419 };
1520
1621 enum alarmtimer_restart {
include/linux/clocksource.h+4−1
@@ -169,7 +169,10 @@ static inline u32 clocksource_hz2mult(u32 hz, u32 shift_constant) · 168 unmodified lines
169169 * @mult: cycle to nanosecond multiplier
170170 * @shift: cycle to nanosecond divisor (power of two)
171171 *
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.
173176 *
174177 * XXX - This could use some mult_lxl_ll() asm optimization
175178 */
include/linux/mc146818rtc.h+1−0
@@ -16,6 +16,7 @@ · 15 unmodified lines
1616 #include <asm/mc146818rtc.h> /* register access macros */
1717 #include <linux/bcd.h>
1818 #include <linux/delay.h>
19+#include <linux/pm-trace.h>
1920
2021 #ifdef __KERNEL__
2122 #include <linux/spinlock.h> /* spinlock_t */
include/linux/pm-trace.h+8−1
@@ -1,11 +1,17 @@
11 #ifndef PM_TRACE_H
22 #define PM_TRACE_H
33
4+#include <linux/types.h>
45 #ifdef CONFIG_PM_TRACE
56 #include <asm/pm-trace.h>
6−#include <linux/types.h>
77
88 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+}
915
1016 static inline int pm_trace_is_enabled(void)
1117 {
@@ -24,6 +30,7 @@ extern int show_trace_dev_match(char *buf, size_t size); · 12 unmodified lines
2430
2531 #else
2632
33+static inline bool pm_trace_rtc_valid(void) { return true; }
2734 static inline int pm_trace_is_enabled(void) { return 0; }
2835
2936 #define TRACE_DEVICE(dev) do { } while (0)
include/linux/ptp_clock_kernel.h+41−24
@@ -130,30 +130,6 @@ struct ptp_clock_info { · 129 unmodified lines
130130
131131 struct ptp_clock;
132132
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−
157133 enum ptp_clock_events {
158134 PTP_CLOCK_ALARM,
159135 PTP_CLOCK_EXTTS,
@@ -179,6 +155,31 @@ struct ptp_clock_event { · 19 unmodified lines
179155 };
180156 };
181157
158+#if IS_REACHABLE(CONFIG_PTP_1588_CLOCK)
159+
160+/**
161+ * ptp_clock_register() - register a PTP hardware clock driver
162+ *
163+ * @info: Structure describing the new clock.
164+ * @parent: Pointer to the parent device of the new clock.
165+ *
166+ * Returns a valid pointer on success or PTR_ERR on failure. If PHC
167+ * support is missing at the configuration level, this function
168+ * returns NULL, and drivers are expected to gracefully handle that
169+ * case separately.
170+ */
171+
172+extern struct ptp_clock *ptp_clock_register(struct ptp_clock_info *info,
173+ struct device *parent);
174+
175+/**
176+ * ptp_clock_unregister() - unregister a PTP hardware clock driver
177+ *
178+ * @ptp: The clock to remove from service.
179+ */
180+
181+extern int ptp_clock_unregister(struct ptp_clock *ptp);
182+
182183 /**
183184 * ptp_clock_event() - notify the PTP layer about an event
184185 *
@@ -210,4 +211,20 @@ extern int ptp_clock_index(struct ptp_clock *ptp); · 25 unmodified lines
210211 int ptp_find_pin(struct ptp_clock *ptp,
211212 enum ptp_pin_function func, unsigned int chan);
212213
214+#else
215+static inline struct ptp_clock *ptp_clock_register(struct ptp_clock_info *info,
216+ struct device *parent)
217+{ return NULL; }
218+static inline int ptp_clock_unregister(struct ptp_clock *ptp)
219+{ return 0; }
220+static inline void ptp_clock_event(struct ptp_clock *ptp,
221+ struct ptp_clock_event *event)
222+{ }
223+static inline int ptp_clock_index(struct ptp_clock *ptp)
224+{ return -1; }
225+static inline int ptp_find_pin(struct ptp_clock *ptp,
226+ enum ptp_pin_function func, unsigned int chan)
227+{ return -1; }
228+#endif
229+
213230 #endif
include/linux/time.h+0−2
@@ -172,8 +172,6 @@ extern int do_setitimer(int which, struct itimerval *value, · 171 unmodified lines
172172 struct itimerval *ovalue);
173173 extern int do_getitimer(int which, struct itimerval *value);
174174
175−extern unsigned int alarm_setitimer(unsigned int seconds);
176−
177175 extern long do_utimes(int dfd, const char __user *filename, struct timespec *times, int flags);
178176
179177 struct tms;
include/linux/timekeeping.h+1−0
@@ -249,6 +249,7 @@ static inline u64 ktime_get_raw_ns(void) · 248 unmodified lines
249249
250250 extern u64 ktime_get_mono_fast_ns(void);
251251 extern u64 ktime_get_raw_fast_ns(void);
252+extern u64 ktime_get_boot_fast_ns(void);
252253
253254 /*
254255 * Timespec interfaces utilizing the ktime based ones
include/trace/events/alarmtimer.h+96−0
@@ -0,0 +1,96 @@
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>
init/Kconfig+17−0
@@ -1457,6 +1457,23 @@ config SYSCTL_SYSCALL · 1456 unmodified lines
14571457
14581458 If unsure say N here.
14591459
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+
14601477 config KALLSYMS
14611478 bool "Load all symbols for debugging/ksymoops" if EXPERT
14621479 default y
kernel/compat.c+8−0
@@ -307,12 +307,17 @@ static inline long put_compat_itimerval(struct compat_itimerval __user *o, · 306 unmodified lines
307307 __put_user(i->it_value.tv_usec, &o->it_value.tv_usec)));
308308 }
309309
310+asmlinkage long sys_ni_posix_timers(void);
311+
310312 COMPAT_SYSCALL_DEFINE2(getitimer, int, which,
311313 struct compat_itimerval __user *, it)
312314 {
313315 struct itimerval kit;
314316 int error;
315317
318+ if (!IS_ENABLED(CONFIG_POSIX_TIMERS))
319+ return sys_ni_posix_timers();
320+
316321 error = do_getitimer(which, &kit);
317322 if (!error && put_compat_itimerval(it, &kit))
318323 error = -EFAULT;
@@ -326,6 +331,9 @@ COMPAT_SYSCALL_DEFINE3(setitimer, int, which, · 7 unmodified lines
326331 struct itimerval kin, kout;
327332 int error;
328333
334+ if (!IS_ENABLED(CONFIG_POSIX_TIMERS))
335+ return sys_ni_posix_timers();
336+
329337 if (in) {
330338 if (get_compat_itimerval(&kin, in))
331339 return -EFAULT;
kernel/exit.c+13−2
@@ -54,6 +54,7 @@ · 53 unmodified lines
5454 #include <linux/writeback.h>
5555 #include <linux/shm.h>
5656 #include <linux/kcov.h>
57+#include <linux/random.h>
5758
5859 #include <asm/uaccess.h>
5960 #include <asm/unistd.h>
@@ -91,11 +92,10 @@ static void __exit_signal(struct task_struct *tsk) · 31 unmodified lines
9192 lockdep_tasklist_lock_is_held());
9293 spin_lock(&sighand->siglock);
9394
95+#ifdef CONFIG_POSIX_TIMERS
9496 posix_cpu_timers_exit(tsk);
9597 if (group_dead) {
9698 posix_cpu_timers_exit_group(tsk);
97− tty = sig->tty;
98− sig->tty = NULL;
9999 } else {
100100 /*
101101 * This can only happen if the caller is de_thread().
@@ -104,7 +104,13 @@ static void __exit_signal(struct task_struct *tsk) · 2 unmodified lines
104104 */
105105 if (unlikely(has_group_leader_pid(tsk)))
106106 posix_cpu_timers_exit_group(tsk);
107+ }
108+#endif
107109
110+ if (group_dead) {
111+ tty = sig->tty;
112+ sig->tty = NULL;
113+ } else {
108114 /*
109115 * If there is any task waiting for the group exit
110116 * then notify it:
@@ -116,6 +122,9 @@ static void __exit_signal(struct task_struct *tsk) · 5 unmodified lines
116122 sig->curr_target = next_thread(tsk);
117123 }
118124
125+ add_device_randomness((const void*) &tsk->se.sum_exec_runtime,
126+ sizeof(unsigned long long));
127+
119128 /*
120129 * Accumulate here the counters for all threads as they die. We could
121130 * skip the group leader because it is the last user of signal_struct,
@@ -799,8 +808,10 @@ void __noreturn do_exit(long code) · 677 unmodified lines
799808 acct_update_integrals(tsk);
800809 group_dead = atomic_dec_and_test(&tsk->signal->live);
801810 if (group_dead) {
811+#ifdef CONFIG_POSIX_TIMERS
802812 hrtimer_cancel(&tsk->signal->real_timer);
803813 exit_itimers(tsk->signal);
814+#endif
804815 if (tsk->mm)
805816 setmax_mm_hiwater_rss(&tsk->signal->maxrss, tsk->mm);
806817 }
kernel/fork.c+2−0
@@ -1347,8 +1347,10 @@ static int copy_signal(unsigned long clone_flags, struct task_struct *tsk) · 1346 unmodified lines
13471347 seqlock_init(&sig->stats_lock);
13481348 prev_cputime_init(&sig->prev_cputime);
13491349
1350+#ifdef CONFIG_POSIX_TIMERS
13501351 hrtimer_init(&sig->real_timer, CLOCK_MONOTONIC, HRTIMER_MODE_REL);
13511352 sig->real_timer.function = it_real_fn;
1353+#endif
13521354
13531355 task_lock(current->group_leader);
13541356 memcpy(sig->rlim, current->signal->rlim, sizeof sig->rlim);
kernel/signal.c+6−0
@@ -427,6 +427,7 @@ void flush_signals(struct task_struct *t) · 426 unmodified lines
427427 spin_unlock_irqrestore(&t->sighand->siglock, flags);
428428 }
429429
430+#ifdef CONFIG_POSIX_TIMERS
430431 static void __flush_itimer_signals(struct sigpending *pending)
431432 {
432433 sigset_t signal, retain;
@@ -460,6 +461,7 @@ void flush_itimer_signals(void) · 27 unmodified lines
460461 __flush_itimer_signals(&tsk->signal->shared_pending);
461462 spin_unlock_irqrestore(&tsk->sighand->siglock, flags);
462463 }
464+#endif
463465
464466 void ignore_signals(struct task_struct *t)
465467 {
@@ -567,6 +569,7 @@ int dequeue_signal(struct task_struct *tsk, sigset_t *mask, siginfo_t *info) · 101 unmodified lines
567569 if (!signr) {
568570 signr = __dequeue_signal(&tsk->signal->shared_pending,
569571 mask, info);
572+#ifdef CONFIG_POSIX_TIMERS
570573 /*
571574 * itimer signal ?
572575 *
@@ -590,6 +593,7 @@ int dequeue_signal(struct task_struct *tsk, sigset_t *mask, siginfo_t *info) · 17 unmodified lines
590593 hrtimer_restart(tmr);
591594 }
592595 }
596+#endif
593597 }
594598
595599 recalc_sigpending();
@@ -611,6 +615,7 @@ int dequeue_signal(struct task_struct *tsk, sigset_t *mask, siginfo_t *info) · 15 unmodified lines
611615 */
612616 current->jobctl |= JOBCTL_STOP_DEQUEUED;
613617 }
618+#ifdef CONFIG_POSIX_TIMERS
614619 if ((info->si_code & __SI_MASK) == __SI_TIMER && info->si_sys_private) {
615620 /*
616621 * Release the siglock to ensure proper locking order
@@ -622,6 +627,7 @@ int dequeue_signal(struct task_struct *tsk, sigset_t *mask, siginfo_t *info) · 5 unmodified lines
622627 do_schedule_next_timer(info);
623628 spin_lock(&tsk->sighand->siglock);
624629 }
630+#endif
625631 return signr;
626632 }
627633
kernel/sys.c+2−1
@@ -1416,7 +1416,8 @@ int do_prlimit(struct task_struct *tsk, unsigned int resource, · 1415 unmodified lines
14161416 * applications, so we live with it
14171417 */
14181418 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))
14201421 update_rlimit_cpu(tsk, new_rlim->rlim_cur);
14211422 out:
14221423 read_unlock(&tasklist_lock);
kernel/time/Makefile+8−2
@@ -1,6 +1,12 @@
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
22 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
410
511 obj-$(CONFIG_GENERIC_CLOCKEVENTS) += clockevents.o tick-common.o
612 ifeq ($(CONFIG_GENERIC_CLOCKEVENTS_BROADCAST),y)
kernel/time/alarmtimer.c+47−12
@@ -26,6 +26,9 @@ · 25 unmodified lines
2626 #include <linux/workqueue.h>
2727 #include <linux/freezer.h>
2828
29+#define CREATE_TRACE_POINTS
30+#include <trace/events/alarmtimer.h>
31+
2932 /**
3033 * struct alarm_base - Alarm timer bases
3134 * @lock: Lock for syncrhonized access to the base
@@ -40,7 +43,9 @@ static struct alarm_base { · 8 unmodified lines
4043 clockid_t base_clockid;
4144 } alarm_bases[ALARM_NUMTYPE];
4245
43−/* freezer delta & lock used to handle clock_nanosleep triggered wakeups */
46+/* freezer information to handle clock_nanosleep triggered wakeups */
47+static enum alarmtimer_type freezer_alarmtype;
48+static ktime_t freezer_expires;
4449 static ktime_t freezer_delta;
4550 static DEFINE_SPINLOCK(freezer_delta_lock);
4651
@@ -194,6 +199,7 @@ static enum hrtimer_restart alarmtimer_fired(struct hrtimer *timer) · 147 unmodified lines
194199 }
195200 spin_unlock_irqrestore(&base->lock, flags);
196201
202+ trace_alarmtimer_fired(alarm, base->gettime());
197203 return ret;
198204
199205 }
@@ -218,15 +224,16 @@ EXPORT_SYMBOL_GPL(alarm_expires_remaining); · 18 unmodified lines
218224 */
219225 static int alarmtimer_suspend(struct device *dev)
220226 {
221− struct rtc_time tm;
222− ktime_t min, now;
223− unsigned long flags;
227+ ktime_t min, now, expires;
228+ int i, ret, type;
224229 struct rtc_device *rtc;
225− int i;
226− int ret;
230+ unsigned long flags;
231+ struct rtc_time tm;
227232
228233 spin_lock_irqsave(&freezer_delta_lock, flags);
229234 min = freezer_delta;
235+ expires = freezer_expires;
236+ type = freezer_alarmtype;
230237 freezer_delta = ktime_set(0, 0);
231238 spin_unlock_irqrestore(&freezer_delta_lock, flags);
232239
@@ -247,8 +254,11 @@ static int alarmtimer_suspend(struct device *dev) · 14 unmodified lines
247254 if (!next)
248255 continue;
249256 delta = ktime_sub(next->expires, base->gettime());
250− if (!min.tv64 || (delta.tv64 < min.tv64))
257+ if (!min.tv64 || (delta.tv64 < min.tv64)) {
258+ expires = next->expires;
251259 min = delta;
260+ type = i;
261+ }
252262 }
253263 if (min.tv64 == 0)
254264 return 0;
@@ -258,6 +268,8 @@ static int alarmtimer_suspend(struct device *dev) · 3 unmodified lines
258268 return -EBUSY;
259269 }
260270
271+ trace_alarmtimer_suspend(expires, type);
272+
261273 /* Setup an rtc timer to fire that far in the future */
262274 rtc_timer_cancel(rtc, &rtctimer);
263275 rtc_read_time(rtc, &tm);
@@ -295,15 +307,32 @@ static int alarmtimer_resume(struct device *dev) · 31 unmodified lines
295307
296308 static void alarmtimer_freezerset(ktime_t absexp, enum alarmtimer_type type)
297309 {
298− ktime_t delta;
310+ struct alarm_base *base;
299311 unsigned long flags;
300− struct alarm_base *base = &alarm_bases[type];
312+ ktime_t delta;
313+
314+ switch(type) {
315+ case ALARM_REALTIME:
316+ base = &alarm_bases[ALARM_REALTIME];
317+ type = ALARM_REALTIME_FREEZER;
318+ break;
319+ case ALARM_BOOTTIME:
320+ base = &alarm_bases[ALARM_BOOTTIME];
321+ type = ALARM_BOOTTIME_FREEZER;
322+ break;
323+ default:
324+ WARN_ONCE(1, "Invalid alarm type: %d\n", type);
325+ return;
326+ }
301327
302328 delta = ktime_sub(absexp, base->gettime());
303329
304330 spin_lock_irqsave(&freezer_delta_lock, flags);
305− if (!freezer_delta.tv64 || (delta.tv64 < freezer_delta.tv64))
331+ if (!freezer_delta.tv64 || (delta.tv64 < freezer_delta.tv64)) {
306332 freezer_delta = delta;
333+ freezer_expires = absexp;
334+ freezer_alarmtype = type;
335+ }
307336 spin_unlock_irqrestore(&freezer_delta_lock, flags);
308337 }
309338
@@ -342,6 +371,8 @@ void alarm_start(struct alarm *alarm, ktime_t start) · 32 unmodified lines
342371 alarmtimer_enqueue(base, alarm);
343372 hrtimer_start(&alarm->timer, alarm->node.expires, HRTIMER_MODE_ABS);
344373 spin_unlock_irqrestore(&base->lock, flags);
374+
375+ trace_alarmtimer_start(alarm, base->gettime());
345376 }
346377 EXPORT_SYMBOL_GPL(alarm_start);
347378
@@ -390,6 +421,8 @@ int alarm_try_to_cancel(struct alarm *alarm) · 42 unmodified lines
390421 if (ret >= 0)
391422 alarmtimer_dequeue(base, alarm);
392423 spin_unlock_irqrestore(&base->lock, flags);
424+
425+ trace_alarmtimer_cancel(alarm, base->gettime());
393426 return ret;
394427 }
395428 EXPORT_SYMBOL_GPL(alarm_try_to_cancel);
@@ -846,8 +879,10 @@ static int __init alarmtimer_init(void) · 450 unmodified lines
846879
847880 alarmtimer_rtc_timer_init();
848881
849− posix_timers_register_clock(CLOCK_REALTIME_ALARM, &alarm_clock);
850− posix_timers_register_clock(CLOCK_BOOTTIME_ALARM, &alarm_clock);
882+ if (IS_ENABLED(CONFIG_POSIX_TIMERS)) {
883+ posix_timers_register_clock(CLOCK_REALTIME_ALARM, &alarm_clock);
884+ posix_timers_register_clock(CLOCK_BOOTTIME_ALARM, &alarm_clock);
885+ }
851886
852887 /* Initialize alarm bases */
853888 alarm_bases[ALARM_REALTIME].base_clockid = CLOCK_REALTIME;
kernel/time/hrtimer.c+14−6
@@ -1742,15 +1742,19 @@ schedule_hrtimeout_range_clock(ktime_t *expires, u64 delta, · 1741 unmodified lines
17421742 * You can set the task state as follows -
17431743 *
17441744 * %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()).
17461747 *
17471748 * %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.
17491751 *
17501752 * The current task state is guaranteed to be TASK_RUNNING when this
17511753 * routine returns.
17521754 *
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.
17541758 */
17551759 int __sched schedule_hrtimeout_range(ktime_t *expires, u64 delta,
17561760 const enum hrtimer_mode mode)
@@ -1772,15 +1776,19 @@ EXPORT_SYMBOL_GPL(schedule_hrtimeout_range); · 15 unmodified lines
17721776 * You can set the task state as follows -
17731777 *
17741778 * %TASK_UNINTERRUPTIBLE - at least @timeout time is guaranteed to
1775− * pass before the routine returns.
1779+ * pass before the routine returns unless the current task is explicitly
1780+ * woken up, (e.g. by wake_up_process()).
17761781 *
17771782 * %TASK_INTERRUPTIBLE - the routine may return early if a signal is
1778− * delivered to the current task.
1783+ * delivered to the current task or the current task is explicitly woken
1784+ * up.
17791785 *
17801786 * The current task state is guaranteed to be TASK_RUNNING when this
17811787 * routine returns.
17821788 *
1783− * Returns 0 when the timer has expired otherwise -EINTR
1789+ * Returns 0 when the timer has expired. If the task was woken before the
1790+ * timer expired by a signal (only possible in state TASK_INTERRUPTIBLE) or
1791+ * by an explicit wakeup, it returns -EINTR.
17841792 */
17851793 int __sched schedule_hrtimeout(ktime_t *expires,
17861794 const enum hrtimer_mode mode)
kernel/time/itimer.c+14−1
@@ -238,6 +238,8 @@ again: · 237 unmodified lines
238238 return 0;
239239 }
240240
241+#ifdef __ARCH_WANT_SYS_ALARM
242+
241243 /**
242244 * alarm_setitimer - set alarm in seconds
243245 *
@@ -250,7 +252,7 @@ again: · 6 unmodified lines
250252 * On 32 bit machines the seconds value is limited to (INT_MAX/2) to avoid
251253 * negative timeval settings which would cause immediate expiry.
252254 */
253−unsigned int alarm_setitimer(unsigned int seconds)
255+static unsigned int alarm_setitimer(unsigned int seconds)
254256 {
255257 struct itimerval it_new, it_old;
256258
@@ -275,6 +277,17 @@ unsigned int alarm_setitimer(unsigned int seconds) · 18 unmodified lines
275277 return it_old.it_value.tv_sec;
276278 }
277279
280+/*
281+ * For backwards compatibility? This can be done in libc so Alpha
282+ * and all newer ports shouldn't need it.
283+ */
284+SYSCALL_DEFINE1(alarm, unsigned int, seconds)
285+{
286+ return alarm_setitimer(seconds);
287+}
288+
289+#endif
290+
278291 SYSCALL_DEFINE3(setitimer, int, which, struct itimerval __user *, value,
279292 struct itimerval __user *, ovalue)
280293 {
kernel/time/posix-cpu-timers.c+0−4
@@ -9,7 +9,6 @@ · 8 unmodified lines
99 #include <asm/uaccess.h>
1010 #include <linux/kernel_stat.h>
1111 #include <trace/events/timer.h>
12−#include <linux/random.h>
1312 #include <linux/tick.h>
1413 #include <linux/workqueue.h>
1514
@@ -447,10 +446,7 @@ static void cleanup_timers(struct list_head *head) · 431 unmodified lines
447446 */
448447 void posix_cpu_timers_exit(struct task_struct *tsk)
449448 {
450− add_device_randomness((const void*) &tsk->se.sum_exec_runtime,
451− sizeof(unsigned long long));
452449 cleanup_timers(tsk->cpu_timers);
453−
454450 }
455451 void posix_cpu_timers_exit_group(struct task_struct *tsk)
456452 {
kernel/time/posix-stubs.c+123−0
@@ -0,0 +1,123 @@
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
kernel/time/timekeeping.c+51−39
@@ -258,10 +258,9 @@ static void tk_setup_internals(struct timekeeper *tk, struct clocksource *clock) · 257 unmodified lines
258258 tk->cycle_interval = interval;
259259
260260 /* Go back from cycles -> shifted ns */
261− tk->xtime_interval = (u64) interval * clock->mult;
261+ tk->xtime_interval = interval * clock->mult;
262262 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;
265264
266265 /* if changing clocks, convert xtime_nsec shift units */
267266 if (old_clock) {
@@ -299,10 +298,10 @@ u32 (*arch_gettimeoffset)(void) = default_arch_gettimeoffset; · 31 unmodified lines
299298 static inline u32 arch_gettimeoffset(void) { return 0; }
300299 #endif
301300
302−static inline s64 timekeeping_delta_to_ns(struct tk_read_base *tkr,
301+static inline u64 timekeeping_delta_to_ns(struct tk_read_base *tkr,
303302 cycle_t delta)
304303 {
305− s64 nsec;
304+ u64 nsec;
306305
307306 nsec = delta * tkr->mult + tkr->xtime_nsec;
308307 nsec >>= tkr->shift;
@@ -311,7 +310,7 @@ static inline s64 timekeeping_delta_to_ns(struct tk_read_base *tkr, · 2 unmodified lines
311310 return nsec + arch_gettimeoffset();
312311 }
313312
314−static inline s64 timekeeping_get_ns(struct tk_read_base *tkr)
313+static inline u64 timekeeping_get_ns(struct tk_read_base *tkr)
315314 {
316315 cycle_t delta;
317316
@@ -319,8 +318,8 @@ static inline s64 timekeeping_get_ns(struct tk_read_base *tkr) · 1 unmodified line
319318 return timekeeping_delta_to_ns(tkr, delta);
320319 }
321320
322−static inline s64 timekeeping_cycles_to_ns(struct tk_read_base *tkr,
323− cycle_t cycles)
321+static inline u64 timekeeping_cycles_to_ns(struct tk_read_base *tkr,
322+ cycle_t cycles)
324323 {
325324 cycle_t delta;
326325
@@ -425,6 +424,35 @@ u64 ktime_get_raw_fast_ns(void) · 98 unmodified lines
425424 }
426425 EXPORT_SYMBOL_GPL(ktime_get_raw_fast_ns);
427426
427+/**
428+ * ktime_get_boot_fast_ns - NMI safe and fast access to boot clock.
429+ *
430+ * To keep it NMI safe since we're accessing from tracing, we're not using a
431+ * separate timekeeper with updates to monotonic clock and boot offset
432+ * protected with seqlocks. This has the following minor side effects:
433+ *
434+ * (1) Its possible that a timestamp be taken after the boot offset is updated
435+ * but before the timekeeper is updated. If this happens, the new boot offset
436+ * is added to the old timekeeping making the clock appear to update slightly
437+ * earlier:
438+ * CPU 0 CPU 1
439+ * timekeeping_inject_sleeptime64()
440+ * __timekeeping_inject_sleeptime(tk, delta);
441+ * timestamp();
442+ * timekeeping_update(tk, TK_CLEAR_NTP...);
443+ *
444+ * (2) On 32-bit systems, the 64-bit boot offset (tk->offs_boot) may be
445+ * partially updated. Since the tk->offs_boot update is a rare event, this
446+ * should be a rare occurrence which postprocessing should be able to handle.
447+ */
448+u64 notrace ktime_get_boot_fast_ns(void)
449+{
450+ struct timekeeper *tk = &tk_core.timekeeper;
451+
452+ return (ktime_get_mono_fast_ns() + ktime_to_ns(tk->offs_boot));
453+}
454+EXPORT_SYMBOL_GPL(ktime_get_boot_fast_ns);
455+
428456 /* Suspend-time cycles value for halted fast timekeeper. */
429457 static cycle_t cycles_at_suspend;
430458
@@ -623,7 +651,7 @@ static void timekeeping_forward_now(struct timekeeper *tk) · 192 unmodified lines
623651 {
624652 struct clocksource *clock = tk->tkr_mono.clock;
625653 cycle_t cycle_now, delta;
626− s64 nsec;
654+ u64 nsec;
627655
628656 cycle_now = tk->tkr_mono.read(clock);
629657 delta = clocksource_delta(cycle_now, tk->tkr_mono.cycle_last, tk->tkr_mono.mask);
@@ -652,7 +680,7 @@ int __getnstimeofday64(struct timespec64 *ts) · 22 unmodified lines
652680 {
653681 struct timekeeper *tk = &tk_core.timekeeper;
654682 unsigned long seq;
655− s64 nsecs = 0;
683+ u64 nsecs;
656684
657685 do {
658686 seq = read_seqcount_begin(&tk_core.seq);
@@ -692,7 +720,7 @@ ktime_t ktime_get(void) · 33 unmodified lines
692720 struct timekeeper *tk = &tk_core.timekeeper;
693721 unsigned int seq;
694722 ktime_t base;
695− s64 nsecs;
723+ u64 nsecs;
696724
697725 WARN_ON(timekeeping_suspended);
698726
@@ -735,7 +763,7 @@ ktime_t ktime_get_with_offset(enum tk_offsets offs) · 36 unmodified lines
735763 struct timekeeper *tk = &tk_core.timekeeper;
736764 unsigned int seq;
737765 ktime_t base, *offset = offsets[offs];
738− s64 nsecs;
766+ u64 nsecs;
739767
740768 WARN_ON(timekeeping_suspended);
741769
@@ -779,7 +807,7 @@ ktime_t ktime_get_raw(void) · 37 unmodified lines
779807 struct timekeeper *tk = &tk_core.timekeeper;
780808 unsigned int seq;
781809 ktime_t base;
782− s64 nsecs;
810+ u64 nsecs;
783811
784812 do {
785813 seq = read_seqcount_begin(&tk_core.seq);
@@ -804,8 +832,8 @@ void ktime_get_ts64(struct timespec64 *ts) · 18 unmodified lines
804832 {
805833 struct timekeeper *tk = &tk_core.timekeeper;
806834 struct timespec64 tomono;
807− s64 nsec;
808835 unsigned int seq;
836+ u64 nsec;
809837
810838 WARN_ON(timekeeping_suspended);
811839
@@ -893,8 +921,8 @@ void ktime_get_snapshot(struct system_time_snapshot *systime_snapshot) · 81 unmodified lines
893921 unsigned long seq;
894922 ktime_t base_raw;
895923 ktime_t base_real;
896− s64 nsec_raw;
897− s64 nsec_real;
924+ u64 nsec_raw;
925+ u64 nsec_real;
898926 cycle_t now;
899927
900928 WARN_ON_ONCE(timekeeping_suspended);
@@ -1052,7 +1080,7 @@ int get_device_system_crosststamp(int (*get_time_fn) · 151 unmodified lines
10521080 cycle_t cycles, now, interval_start;
10531081 unsigned int clock_was_set_seq = 0;
10541082 ktime_t base_real, base_raw;
1055− s64 nsec_real, nsec_raw;
1083+ u64 nsec_real, nsec_raw;
10561084 u8 cs_was_changed_seq;
10571085 unsigned long seq;
10581086 bool do_interp;
@@ -1365,7 +1393,7 @@ void getrawmonotonic64(struct timespec64 *ts) · 306 unmodified lines
13651393 struct timekeeper *tk = &tk_core.timekeeper;
13661394 struct timespec64 ts64;
13671395 unsigned long seq;
1368− s64 nsecs;
1396+ u64 nsecs;
13691397
13701398 do {
13711399 seq = read_seqcount_begin(&tk_core.seq);
@@ -1616,7 +1644,7 @@ void timekeeping_resume(void) · 244 unmodified lines
16161644 struct clocksource *clock = tk->tkr_mono.clock;
16171645 unsigned long flags;
16181646 struct timespec64 ts_new, ts_delta;
1619− cycle_t cycle_now, cycle_delta;
1647+ cycle_t cycle_now;
16201648
16211649 sleeptime_injected = false;
16221650 read_persistent_clock64(&ts_new);
@@ -1642,27 +1670,11 @@ void timekeeping_resume(void) · 19 unmodified lines
16421670 cycle_now = tk->tkr_mono.read(clock);
16431671 if ((clock->flags & CLOCK_SOURCE_SUSPEND_NONSTOP) &&
16441672 cycle_now > tk->tkr_mono.cycle_last) {
1645− u64 num, max = ULLONG_MAX;
1646− u32 mult = clock->mult;
1647− u32 shift = clock->shift;
1648− s64 nsec = 0;
1649−
1650− cycle_delta = clocksource_delta(cycle_now, tk->tkr_mono.cycle_last,
1651− tk->tkr_mono.mask);
1652−
1653− /*
1654− * "cycle_delta * mutl" may cause 64 bits overflow, if the
1655− * suspended time is too long. In that case we need do the
1656− * 64 bits math carefully
1657− */
1658− do_div(max, mult);
1659− if (cycle_delta > max) {
1660− num = div64_u64(cycle_delta, max);
1661− nsec = (((u64) max * mult) >> shift) * num;
1662− cycle_delta -= num * max;
1663− }
1664− nsec += ((u64) cycle_delta * mult) >> shift;
1673+ u64 nsec, cyc_delta;
16651674
1675+ cyc_delta = clocksource_delta(cycle_now, tk->tkr_mono.cycle_last,
1676+ tk->tkr_mono.mask);
1677+ nsec = mul_u64_u32_shr(cyc_delta, clock->mult, clock->shift);
16661678 ts_delta = ns_to_timespec64(nsec);
16671679 sleeptime_injected = true;
16681680 } else if (timespec64_compare(&ts_new, &timekeeping_suspend_time) > 0) {
kernel/time/timer.c+18−30
@@ -1615,7 +1615,8 @@ void update_process_times(int user_tick) · 1614 unmodified lines
16151615 irq_work_tick();
16161616 #endif
16171617 scheduler_tick();
1618− run_posix_cpu_timers(p);
1618+ if (IS_ENABLED(CONFIG_POSIX_TIMERS))
1619+ run_posix_cpu_timers(p);
16191620 }
16201621
16211622 /**
@@ -1676,19 +1677,6 @@ void run_local_timers(void) · 54 unmodified lines
16761677 raise_softirq(TIMER_SOFTIRQ);
16771678 }
16781679
1679−#ifdef __ARCH_WANT_SYS_ALARM
1680−
1681−/*
1682− * For backwards compatibility? This can be done in libc so Alpha
1683− * and all newer ports shouldn't need it.
1684− */
1685−SYSCALL_DEFINE1(alarm, unsigned int, seconds)
1686−{
1687− return alarm_setitimer(seconds);
1688−}
1689−
1690−#endif
1691−
16921680 static void process_timeout(unsigned long __data)
16931681 {
16941682 wake_up_process((struct task_struct *)__data);
@@ -1705,11 +1693,12 @@ static void process_timeout(unsigned long __data) · 10 unmodified lines
17051693 * You can set the task state as follows -
17061694 *
17071695 * %TASK_UNINTERRUPTIBLE - at least @timeout jiffies are guaranteed to
1708− * pass before the routine returns. The routine will return 0
1696+ * pass before the routine returns unless the current task is explicitly
1697+ * woken up, (e.g. by wake_up_process())".
17091698 *
17101699 * %TASK_INTERRUPTIBLE - the routine may return early if a signal is
1711− * delivered to the current task. In this case the remaining time
1712− * in jiffies will be returned, or 0 if the timer expired in time
1700+ * delivered to the current task or the current task is explicitly woken
1701+ * up.
17131702 *
17141703 * The current task state is guaranteed to be TASK_RUNNING when this
17151704 * routine returns.
@@ -1718,7 +1707,9 @@ static void process_timeout(unsigned long __data) · 2 unmodified lines
17181707 * the CPU away without a bound on the timeout. In this case the return
17191708 * value will be %MAX_SCHEDULE_TIMEOUT.
17201709 *
1721− * In all cases the return value is guaranteed to be non-negative.
1710+ * Returns 0 when the timer has expired otherwise the remaining time in
1711+ * jiffies will be returned. In all cases the return value is guaranteed
1712+ * to be non-negative.
17221713 */
17231714 signed long __sched schedule_timeout(signed long timeout)
17241715 {
@@ -1910,16 +1901,6 @@ unsigned long msleep_interruptible(unsigned int msecs) · 185 unmodified lines
19101901
19111902 EXPORT_SYMBOL(msleep_interruptible);
19121903
1913−static void __sched do_usleep_range(unsigned long min, unsigned long max)
1914−{
1915− ktime_t kmin;
1916− u64 delta;
1917−
1918− kmin = ktime_set(0, min * NSEC_PER_USEC);
1919− delta = (u64)(max - min) * NSEC_PER_USEC;
1920− schedule_hrtimeout_range(&kmin, delta, HRTIMER_MODE_REL);
1921−}
1922−
19231904 /**
19241905 * usleep_range - Sleep for an approximate time
19251906 * @min: Minimum time in usecs to sleep
@@ -1933,7 +1914,14 @@ static void __sched do_usleep_range(unsigned long min, unsigned long max) · 7 unmodified lines
19331914 */
19341915 void __sched usleep_range(unsigned long min, unsigned long max)
19351916 {
1936− __set_current_state(TASK_UNINTERRUPTIBLE);
1937− do_usleep_range(min, max);
1917+ ktime_t exp = ktime_add_us(ktime_get(), min);
1918+ u64 delta = (u64)(max - min) * NSEC_PER_USEC;
1919+
1920+ for (;;) {
1921+ __set_current_state(TASK_UNINTERRUPTIBLE);
1922+ /* Do not return before the requested sleep time has elapsed */
1923+ if (!schedule_hrtimeout_range(&exp, delta, HRTIMER_MODE_ABS))
1924+ break;
1925+ }
19381926 }
19391927 EXPORT_SYMBOL(usleep_range);
kernel/trace/trace.c+1−0
@@ -1125,6 +1125,7 @@ static struct { · 1124 unmodified lines
11251125 { trace_clock, "perf", 1 },
11261126 { ktime_get_mono_fast_ns, "mono", 1 },
11271127 { ktime_get_raw_fast_ns, "mono_raw", 1 },
1128+ { ktime_get_boot_fast_ns, "boot", 1 },
11281129 ARCH_TRACE_CLOCKS
11291130 };
11301131
scripts/kconfig/expr.h+2−0
@@ -85,6 +85,7 @@ struct symbol { · 84 unmodified lines
8585 struct property *prop;
8686 struct expr_value dir_dep;
8787 struct expr_value rev_dep;
88+ struct expr_value implied;
8889 };
8990
9091 #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)
@@ -136,6 +137,7 @@ enum prop_type { · 45 unmodified lines
136137 P_DEFAULT, /* default y */
137138 P_CHOICE, /* choice value */
138139 P_SELECT, /* select BAR */
140+ P_IMPLY, /* imply BAR */
139141 P_RANGE, /* range 7..100 (for a symbol) */
140142 P_ENV, /* value from environment variable */
141143 P_SYMBOL, /* where a symbol is defined */
scripts/kconfig/menu.c+39−16
@@ -233,6 +233,8 @@ static void sym_check_prop(struct symbol *sym) · 232 unmodified lines
233233 {
234234 struct property *prop;
235235 struct symbol *sym2;
236+ char *use;
237+
236238 for (prop = sym->prop; prop; prop = prop->next) {
237239 switch (prop->type) {
238240 case P_DEFAULT:
@@ -252,18 +254,20 @@ static void sym_check_prop(struct symbol *sym) · 13 unmodified lines
252254 }
253255 break;
254256 case P_SELECT:
257+ case P_IMPLY:
258+ use = prop->type == P_SELECT ? "select" : "imply";
255259 sym2 = prop_get_symbol(prop);
256260 if (sym->type != S_BOOLEAN && sym->type != S_TRISTATE)
257261 prop_warn(prop,
258− "config symbol '%s' uses select, but is "
259− "not boolean or tristate", sym->name);
262+ "config symbol '%s' uses %s, but is "
263+ "not boolean or tristate", sym->name, use);
260264 else if (sym2->type != S_UNKNOWN &&
261265 sym2->type != S_BOOLEAN &&
262266 sym2->type != S_TRISTATE)
263267 prop_warn(prop,
264− "'%s' has wrong type. 'select' only "
268+ "'%s' has wrong type. '%s' only "
265269 "accept arguments of boolean and "
266− "tristate type", sym2->name);
270+ "tristate type", sym2->name, use);
267271 break;
268272 case P_RANGE:
269273 if (sym->type != S_INT && sym->type != S_HEX)
@@ -333,6 +337,10 @@ void menu_finalize(struct menu *parent) · 63 unmodified lines
333337 struct symbol *es = prop_get_symbol(prop);
334338 es->rev_dep.expr = expr_alloc_or(es->rev_dep.expr,
335339 expr_alloc_and(expr_alloc_symbol(menu->sym), expr_copy(dep)));
340+ } else if (prop->type == P_IMPLY) {
341+ struct symbol *es = prop_get_symbol(prop);
342+ es->implied.expr = expr_alloc_or(es->implied.expr,
343+ expr_alloc_and(expr_alloc_symbol(menu->sym), expr_copy(dep)));
336344 }
337345 }
338346 }
@@ -612,13 +620,30 @@ static struct property *get_symbol_prop(struct symbol *sym) · 273 unmodified lines
612620 return prop;
613621 }
614622
623+static void get_symbol_props_str(struct gstr *r, struct symbol *sym,
624+ enum prop_type tok, const char *prefix)
625+{
626+ bool hit = false;
627+ struct property *prop;
628+
629+ for_all_properties(sym, prop, tok) {
630+ if (!hit) {
631+ str_append(r, prefix);
632+ hit = true;
633+ } else
634+ str_printf(r, " && ");
635+ expr_gstr_print(prop->expr, r);
636+ }
637+ if (hit)
638+ str_append(r, "\n");
639+}
640+
615641 /*
616642 * head is optional and may be NULL
617643 */
618644 static void get_symbol_str(struct gstr *r, struct symbol *sym,
619645 struct list_head *head)
620646 {
621− bool hit;
622647 struct property *prop;
623648
624649 if (sym && sym->name) {
@@ -648,22 +673,20 @@ static void get_symbol_str(struct gstr *r, struct symbol *sym, · 23 unmodified lines
648673 }
649674 }
650675
651− hit = false;
652− for_all_properties(sym, prop, P_SELECT) {
653− if (!hit) {
654− str_append(r, " Selects: ");
655− hit = true;
656− } else
657− str_printf(r, " && ");
658− expr_gstr_print(prop->expr, r);
659− }
660− if (hit)
661− str_append(r, "\n");
676+ get_symbol_props_str(r, sym, P_SELECT, _(" Selects: "));
662677 if (sym->rev_dep.expr) {
663678 str_append(r, _(" Selected by: "));
664679 expr_gstr_print(sym->rev_dep.expr, r);
665680 str_append(r, "\n");
666681 }
682+
683+ get_symbol_props_str(r, sym, P_IMPLY, _(" Implies: "));
684+ if (sym->implied.expr) {
685+ str_append(r, _(" Implied by: "));
686+ expr_gstr_print(sym->implied.expr, r);
687+ str_append(r, "\n");
688+ }
689+
667690 str_append(r, "\n\n");
668691 }
669692
scripts/kconfig/symbol.c+23−1
@@ -258,6 +258,15 @@ static void sym_calc_visibility(struct symbol *sym) · 257 unmodified lines
258258 sym->rev_dep.tri = tri;
259259 sym_set_changed(sym);
260260 }
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+ }
261270 }
262271
263272 /*
@@ -397,6 +406,10 @@ void sym_calc_value(struct symbol *sym) · 133 unmodified lines
397406 newval.tri = EXPR_AND(expr_calc_value(prop->expr),
398407 prop->visible.tri);
399408 }
409+ if (sym->implied.tri != no) {
410+ sym->flags |= SYMBOL_WRITE;
411+ newval.tri = EXPR_OR(newval.tri, sym->implied.tri);
412+ }
400413 }
401414 calc_newval:
402415 if (sym->dir_dep.tri == no && sym->rev_dep.tri != no) {
@@ -413,7 +426,8 @@ void sym_calc_value(struct symbol *sym) · 10 unmodified lines
413426 }
414427 newval.tri = EXPR_OR(newval.tri, sym->rev_dep.tri);
415428 }
416− if (newval.tri == mod && sym_get_type(sym) == S_BOOLEAN)
429+ if (newval.tri == mod &&
430+ (sym_get_type(sym) == S_BOOLEAN || sym->implied.tri == yes))
417431 newval.tri = yes;
418432 break;
419433 case S_STRING:
@@ -498,6 +512,8 @@ bool sym_tristate_within_range(struct symbol *sym, tristate val) · 78 unmodified lines
498512 return false;
499513 if (sym->visible <= sym->rev_dep.tri)
500514 return false;
515+ if (sym->implied.tri == yes && val == mod)
516+ return false;
501517 if (sym_is_choice_value(sym) && sym->visible == yes)
502518 return val == yes;
503519 return val >= sym->rev_dep.tri && val <= sym->visible;
@@ -750,6 +766,10 @@ const char *sym_get_string_default(struct symbol *sym) · 246 unmodified lines
750766 if (sym->type == S_BOOLEAN && val == mod)
751767 val = yes;
752768
769+ /* adjust the default value if this symbol is implied by another */
770+ if (val < sym->implied.tri)
771+ val = sym->implied.tri;
772+
753773 switch (sym->type) {
754774 case S_BOOLEAN:
755775 case S_TRISTATE:
@@ -1352,6 +1372,8 @@ const char *prop_get_type_name(enum prop_type type) · 596 unmodified lines
13521372 return "choice";
13531373 case P_SELECT:
13541374 return "select";
1375+ case P_IMPLY:
1376+ return "imply";
13551377 case P_RANGE:
13561378 return "range";
13571379 case P_SYMBOL:
scripts/kconfig/zconf.gperf+1−0
@@ -38,6 +38,7 @@ int, T_TYPE, TF_COMMAND, S_INT · 37 unmodified lines
3838 hex, T_TYPE, TF_COMMAND, S_HEX
3939 string, T_TYPE, TF_COMMAND, S_STRING
4040 select, T_SELECT, TF_COMMAND
41+imply, T_IMPLY, TF_COMMAND
4142 range, T_RANGE, TF_COMMAND
4243 visible, T_VISIBLE, TF_COMMAND
4344 option, T_OPTION, TF_COMMAND
scripts/kconfig/zconf.hash.c_shipped+17−13
@@ -55,10 +55,10 @@ kconf_id_hash (register const char *str, register unsigned int len) · 54 unmodified lines
5555 73, 73, 73, 73, 73, 73, 73, 73, 73, 73,
5656 73, 73, 73, 73, 73, 73, 73, 73, 73, 73,
5757 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,
5959 0, 0, 0, 5, 0, 0, 73, 73, 5, 0,
6060 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,
6262 73, 73, 73, 73, 73, 73, 73, 73, 73, 73,
6363 73, 73, 73, 73, 73, 73, 73, 73, 73, 73,
6464 73, 73, 73, 73, 73, 73, 73, 73, 73, 73,
@@ -120,6 +120,7 @@ struct kconf_id_strings_t · 55 unmodified lines
120120 char kconf_id_strings_str43[sizeof("hex")];
121121 char kconf_id_strings_str46[sizeof("config")];
122122 char kconf_id_strings_str47[sizeof("boolean")];
123+ char kconf_id_strings_str50[sizeof("imply")];
123124 char kconf_id_strings_str51[sizeof("string")];
124125 char kconf_id_strings_str54[sizeof("help")];
125126 char kconf_id_strings_str56[sizeof("prompt")];
@@ -157,6 +158,7 @@ static const struct kconf_id_strings_t kconf_id_strings_contents = · 31 unmodified lines
157158 "hex",
158159 "config",
159160 "boolean",
161+ "imply",
160162 "string",
161163 "help",
162164 "prompt",
@@ -174,7 +176,7 @@ kconf_id_lookup (register const char *str, register unsigned int len) · 11 unmodified lines
174176 {
175177 enum
176178 {
177− TOTAL_KEYWORDS = 34,
179+ TOTAL_KEYWORDS = 35,
178180 MIN_WORD_LENGTH = 2,
179181 MAX_WORD_LENGTH = 14,
180182 MIN_HASH_VALUE = 2,
@@ -205,15 +207,15 @@ kconf_id_lookup (register const char *str, register unsigned int len) · 24 unmodified lines
205207 {(int)(long)&((struct kconf_id_strings_t *)0)->kconf_id_strings_str12, T_DEFAULT, TF_COMMAND, S_TRISTATE},
206208 #line 36 "scripts/kconfig/zconf.gperf"
207209 {(int)(long)&((struct kconf_id_strings_t *)0)->kconf_id_strings_str13, T_DEFAULT, TF_COMMAND, S_BOOLEAN},
208−#line 46 "scripts/kconfig/zconf.gperf"
210+#line 47 "scripts/kconfig/zconf.gperf"
209211 {(int)(long)&((struct kconf_id_strings_t *)0)->kconf_id_strings_str14, T_OPT_DEFCONFIG_LIST,TF_OPTION},
210212 {-1}, {-1},
211−#line 44 "scripts/kconfig/zconf.gperf"
213+#line 45 "scripts/kconfig/zconf.gperf"
212214 {(int)(long)&((struct kconf_id_strings_t *)0)->kconf_id_strings_str17, T_ON, TF_PARAM},
213215 #line 29 "scripts/kconfig/zconf.gperf"
214216 {(int)(long)&((struct kconf_id_strings_t *)0)->kconf_id_strings_str18, T_OPTIONAL, TF_COMMAND},
215217 {-1}, {-1},
216−#line 43 "scripts/kconfig/zconf.gperf"
218+#line 44 "scripts/kconfig/zconf.gperf"
217219 {(int)(long)&((struct kconf_id_strings_t *)0)->kconf_id_strings_str21, T_OPTION, TF_COMMAND},
218220 #line 17 "scripts/kconfig/zconf.gperf"
219221 {(int)(long)&((struct kconf_id_strings_t *)0)->kconf_id_strings_str22, T_ENDMENU, TF_COMMAND},
@@ -223,9 +225,9 @@ kconf_id_lookup (register const char *str, register unsigned int len) · 3 unmodified lines
223225 #line 23 "scripts/kconfig/zconf.gperf"
224226 {(int)(long)&((struct kconf_id_strings_t *)0)->kconf_id_strings_str25, T_MENUCONFIG, TF_COMMAND},
225227 {-1},
226−#line 45 "scripts/kconfig/zconf.gperf"
228+#line 46 "scripts/kconfig/zconf.gperf"
227229 {(int)(long)&((struct kconf_id_strings_t *)0)->kconf_id_strings_str27, T_OPT_MODULES, TF_OPTION},
228−#line 48 "scripts/kconfig/zconf.gperf"
230+#line 49 "scripts/kconfig/zconf.gperf"
229231 {(int)(long)&((struct kconf_id_strings_t *)0)->kconf_id_strings_str28, T_OPT_ALLNOCONFIG_Y,TF_OPTION},
230232 #line 16 "scripts/kconfig/zconf.gperf"
231233 {(int)(long)&((struct kconf_id_strings_t *)0)->kconf_id_strings_str29, T_MENU, TF_COMMAND},
@@ -234,10 +236,10 @@ kconf_id_lookup (register const char *str, register unsigned int len) · 2 unmodified lines
234236 {(int)(long)&((struct kconf_id_strings_t *)0)->kconf_id_strings_str31, T_SELECT, TF_COMMAND},
235237 #line 21 "scripts/kconfig/zconf.gperf"
236238 {(int)(long)&((struct kconf_id_strings_t *)0)->kconf_id_strings_str32, T_COMMENT, TF_COMMAND},
237−#line 47 "scripts/kconfig/zconf.gperf"
239+#line 48 "scripts/kconfig/zconf.gperf"
238240 {(int)(long)&((struct kconf_id_strings_t *)0)->kconf_id_strings_str33, T_OPT_ENV, TF_OPTION},
239241 {-1},
240−#line 41 "scripts/kconfig/zconf.gperf"
242+#line 42 "scripts/kconfig/zconf.gperf"
241243 {(int)(long)&((struct kconf_id_strings_t *)0)->kconf_id_strings_str35, T_RANGE, TF_COMMAND},
242244 #line 19 "scripts/kconfig/zconf.gperf"
243245 {(int)(long)&((struct kconf_id_strings_t *)0)->kconf_id_strings_str36, T_CHOICE, TF_COMMAND},
@@ -247,7 +249,7 @@ kconf_id_lookup (register const char *str, register unsigned int len) · 3 unmodified lines
247249 {-1},
248250 #line 18 "scripts/kconfig/zconf.gperf"
249251 {(int)(long)&((struct kconf_id_strings_t *)0)->kconf_id_strings_str41, T_SOURCE, TF_COMMAND},
250−#line 42 "scripts/kconfig/zconf.gperf"
252+#line 43 "scripts/kconfig/zconf.gperf"
251253 {(int)(long)&((struct kconf_id_strings_t *)0)->kconf_id_strings_str42, T_VISIBLE, TF_COMMAND},
252254 #line 38 "scripts/kconfig/zconf.gperf"
253255 {(int)(long)&((struct kconf_id_strings_t *)0)->kconf_id_strings_str43, T_TYPE, TF_COMMAND, S_HEX},
@@ -256,7 +258,9 @@ kconf_id_lookup (register const char *str, register unsigned int len) · 2 unmodified lines
256258 {(int)(long)&((struct kconf_id_strings_t *)0)->kconf_id_strings_str46, T_CONFIG, TF_COMMAND},
257259 #line 35 "scripts/kconfig/zconf.gperf"
258260 {(int)(long)&((struct kconf_id_strings_t *)0)->kconf_id_strings_str47, T_TYPE, TF_COMMAND, S_BOOLEAN},
259− {-1}, {-1}, {-1},
261+ {-1}, {-1},
262+#line 41 "scripts/kconfig/zconf.gperf"
263+ {(int)(long)&((struct kconf_id_strings_t *)0)->kconf_id_strings_str50, T_IMPLY, TF_COMMAND},
260264 #line 39 "scripts/kconfig/zconf.gperf"
261265 {(int)(long)&((struct kconf_id_strings_t *)0)->kconf_id_strings_str51, T_TYPE, TF_COMMAND, S_STRING},
262266 {-1}, {-1},
@@ -289,5 +293,5 @@ kconf_id_lookup (register const char *str, register unsigned int len) · 26 unmodified lines
289293 }
290294 return 0;
291295 }
292−#line 49 "scripts/kconfig/zconf.gperf"
296+#line 50 "scripts/kconfig/zconf.gperf"
293297
scripts/kconfig/zconf.tab.c_shipped+736−845
@@ -1,19 +1,19 @@
1−/* A Bison parser, made by GNU Bison 2.5.1. */
1+/* A Bison parser, made by GNU Bison 3.0.4. */
22
33 /* 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+
77 This program is free software: you can redistribute it and/or modify
88 it under the terms of the GNU General Public License as published by
99 the Free Software Foundation, either version 3 of the License, or
1010 (at your option) any later version.
11−
11+
1212 This program is distributed in the hope that it will be useful,
1313 but WITHOUT ANY WARRANTY; without even the implied warranty of
1414 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
1515 GNU General Public License for more details.
16−
16+
1717 You should have received a copy of the GNU General Public License
1818 along with this program. If not, see <http://www.gnu.org/licenses/>. */
1919
@@ -26,7 +26,7 @@ · 6 unmodified lines
2626 special exception, which will cause the skeleton and the resulting
2727 Bison output files to be licensed under the GNU General Public
2828 License without this special exception.
29−
29+
3030 This special exception was added by the Free Software Foundation in
3131 version 2.2 of Bison. */
3232
@@ -44,7 +44,7 @@ · 11 unmodified lines
4444 #define YYBISON 1
4545
4646 /* Bison version. */
47−#define YYBISON_VERSION "2.5.1"
47+#define YYBISON_VERSION "3.0.4"
4848
4949 /* Skeleton name. */
5050 #define YYSKELETON_NAME "yacc.c"
@@ -58,18 +58,16 @@ · 7 unmodified lines
5858 /* Pull parsers. */
5959 #define YYPULL 1
6060
61−/* Using locations. */
62−#define YYLSP_NEEDED 0
6361
6462 /* Substitute the variable and function names. */
6563 #define yyparse zconfparse
6664 #define yylex zconflex
6765 #define yyerror zconferror
68−#define yylval zconflval
69−#define yychar zconfchar
7066 #define yydebug zconfdebug
7167 #define yynerrs zconfnerrs
7268
69+#define yylval zconflval
70+#define yychar zconfchar
7371
7472 /* Copy the first part of user declarations. */
7573
@@ -108,19 +106,14 @@ static struct menu *current_menu, *current_entry; · 32 unmodified lines
108106
109107
110108
111−# ifndef YY_NULL
109+# ifndef YY_NULLPTR
112110 # if defined __cplusplus && 201103L <= __cplusplus
113−# define YY_NULL nullptr
111+# define YY_NULLPTR nullptr
114112 # else
115−# define YY_NULL 0
113+# define YY_NULLPTR 0
116114 # endif
117115 # endif
118116
119−/* Enabling traces. */
120−#ifndef YYDEBUG
121−# define YYDEBUG 1
122−#endif
123−
124117 /* Enabling verbose error messages. */
125118 #ifdef YYERROR_VERBOSE
126119 # undef YYERROR_VERBOSE
@@ -129,62 +122,65 @@ static struct menu *current_menu, *current_entry; · 2 unmodified lines
129122 # define YYERROR_VERBOSE 0
130123 #endif
131124
132−/* Enabling the token table. */
133−#ifndef YYTOKEN_TABLE
134−# define YYTOKEN_TABLE 0
135−#endif
136125
126+/* Debug traces. */
127+#ifndef YYDEBUG
128+# define YYDEBUG 1
129+#endif
130+#if YYDEBUG
131+extern int zconfdebug;
132+#endif
137133
138−/* Tokens. */
134+/* Token type. */
139135 #ifndef YYTOKENTYPE
140136 # define YYTOKENTYPE
141− /* Put the tokens into the symbol table, so that GDB and other debuggers
142− know about them. */
143− enum yytokentype {
144− T_MAINMENU = 258,
145− T_MENU = 259,
146− T_ENDMENU = 260,
147− T_SOURCE = 261,
148− T_CHOICE = 262,
149− T_ENDCHOICE = 263,
150− T_COMMENT = 264,
151− T_CONFIG = 265,
152− T_MENUCONFIG = 266,
153− T_HELP = 267,
154− T_HELPTEXT = 268,
155− T_IF = 269,
156− T_ENDIF = 270,
157− T_DEPENDS = 271,
158− T_OPTIONAL = 272,
159− T_PROMPT = 273,
160− T_TYPE = 274,
161− T_DEFAULT = 275,
162− T_SELECT = 276,
163− T_RANGE = 277,
164− T_VISIBLE = 278,
165− T_OPTION = 279,
166− T_ON = 280,
167− T_WORD = 281,
168− T_WORD_QUOTE = 282,
169− T_UNEQUAL = 283,
170− T_LESS = 284,
171− T_LESS_EQUAL = 285,
172− T_GREATER = 286,
173− T_GREATER_EQUAL = 287,
174− T_CLOSE_PAREN = 288,
175− T_OPEN_PAREN = 289,
176− T_EOL = 290,
177− T_OR = 291,
178− T_AND = 292,
179− T_EQUAL = 293,
180− T_NOT = 294
181− };
137+ enum yytokentype
138+ {
139+ T_MAINMENU = 258,
140+ T_MENU = 259,
141+ T_ENDMENU = 260,
142+ T_SOURCE = 261,
143+ T_CHOICE = 262,
144+ T_ENDCHOICE = 263,
145+ T_COMMENT = 264,
146+ T_CONFIG = 265,
147+ T_MENUCONFIG = 266,
148+ T_HELP = 267,
149+ T_HELPTEXT = 268,
150+ T_IF = 269,
151+ T_ENDIF = 270,
152+ T_DEPENDS = 271,
153+ T_OPTIONAL = 272,
154+ T_PROMPT = 273,
155+ T_TYPE = 274,
156+ T_DEFAULT = 275,
157+ T_SELECT = 276,
158+ T_IMPLY = 277,
159+ T_RANGE = 278,
160+ T_VISIBLE = 279,
161+ T_OPTION = 280,
162+ T_ON = 281,
163+ T_WORD = 282,
164+ T_WORD_QUOTE = 283,
165+ T_UNEQUAL = 284,
166+ T_LESS = 285,
167+ T_LESS_EQUAL = 286,
168+ T_GREATER = 287,
169+ T_GREATER_EQUAL = 288,
170+ T_CLOSE_PAREN = 289,
171+ T_OPEN_PAREN = 290,
172+ T_EOL = 291,
173+ T_OR = 292,
174+ T_AND = 293,
175+ T_EQUAL = 294,
176+ T_NOT = 295
177+ };
182178 #endif
183179
184−
185−
180+/* Value type. */
186181 #if ! defined YYSTYPE && ! defined YYSTYPE_IS_DECLARED
187−typedef union YYSTYPE
182+
183+union YYSTYPE
188184 {
189185
190186
@@ -196,14 +192,20 @@ typedef union YYSTYPE · 5 unmodified lines
196192 const struct kconf_id *id;
197193
198194
195+};
199196
200−} YYSTYPE;
197+typedef union YYSTYPE YYSTYPE;
201198 # define YYSTYPE_IS_TRIVIAL 1
202−# define yystype YYSTYPE /* obsolescent; will be withdrawn */
203199 # define YYSTYPE_IS_DECLARED 1
204200 #endif
205201
206202
203+extern YYSTYPE zconflval;
204+
205+int zconfparse (void);
206+
207+
208+
207209 /* Copy the second part of user declarations. */
208210
209211
@@ -224,11 +226,8 @@ typedef unsigned char yytype_uint8; · 14 unmodified lines
224226
225227 #ifdef YYTYPE_INT8
226228 typedef YYTYPE_INT8 yytype_int8;
227−#elif (defined __STDC__ || defined __C99__FUNC__ \
228− || defined __cplusplus || defined _MSC_VER)
229−typedef signed char yytype_int8;
230229 #else
231−typedef short int yytype_int8;
230+typedef signed char yytype_int8;
232231 #endif
233232
234233 #ifdef YYTYPE_UINT16
@@ -248,8 +247,7 @@ typedef short int yytype_int16; · 13 unmodified lines
248247 # define YYSIZE_T __SIZE_TYPE__
249248 # elif defined size_t
250249 # define YYSIZE_T size_t
251−# elif ! defined YYSIZE_T && (defined __STDC__ || defined __C99__FUNC__ \
252− || defined __cplusplus || defined _MSC_VER)
250+# elif ! defined YYSIZE_T
253251 # include <stddef.h> /* INFRINGES ON USER NAME SPACE */
254252 # define YYSIZE_T size_t
255253 # else
@@ -263,38 +261,67 @@ typedef short int yytype_int16; · 7 unmodified lines
263261 # if defined YYENABLE_NLS && YYENABLE_NLS
264262 # if ENABLE_NLS
265263 # include <libintl.h> /* INFRINGES ON USER NAME SPACE */
266−# define YY_(msgid) dgettext ("bison-runtime", msgid)
264+# define YY_(Msgid) dgettext ("bison-runtime", Msgid)
267265 # endif
268266 # endif
269267 # ifndef YY_
270−# define YY_(msgid) msgid
268+# define YY_(Msgid) Msgid
269+# endif
270+#endif
271+
272+#ifndef YY_ATTRIBUTE
273+# if (defined __GNUC__ \
274+ && (2 < __GNUC__ || (__GNUC__ == 2 && 96 <= __GNUC_MINOR__))) \
275+ || defined __SUNPRO_C && 0x5110 <= __SUNPRO_C
276+# define YY_ATTRIBUTE(Spec) __attribute__(Spec)
277+# else
278+# define YY_ATTRIBUTE(Spec) /* empty */
279+# endif
280+#endif
281+
282+#ifndef YY_ATTRIBUTE_PURE
283+# define YY_ATTRIBUTE_PURE YY_ATTRIBUTE ((__pure__))
284+#endif
285+
286+#ifndef YY_ATTRIBUTE_UNUSED
287+# define YY_ATTRIBUTE_UNUSED YY_ATTRIBUTE ((__unused__))
288+#endif
289+
290+#if !defined _Noreturn \
291+ && (!defined __STDC_VERSION__ || __STDC_VERSION__ < 201112)
292+# if defined _MSC_VER && 1200 <= _MSC_VER
293+# define _Noreturn __declspec (noreturn)
294+# else
295+# define _Noreturn YY_ATTRIBUTE ((__noreturn__))
271296 # endif
272297 #endif
273298
274299 /* Suppress unused-variable warnings by "using" E. */
275300 #if ! defined lint || defined __GNUC__
276−# define YYUSE(e) ((void) (e))
301+# define YYUSE(E) ((void) (E))
277302 #else
278−# define YYUSE(e) /* empty */
303+# define YYUSE(E) /* empty */
279304 #endif
280305
281−/* Identity function, used to suppress warnings about constant conditions. */
282−#ifndef lint
283−# define YYID(n) (n)
284−#else
285−#if (defined __STDC__ || defined __C99__FUNC__ \
286− || defined __cplusplus || defined _MSC_VER)
287−static int
288−YYID (int yyi)
306+#if defined __GNUC__ && 407 <= __GNUC__ * 100 + __GNUC_MINOR__
307+/* Suppress an incorrect diagnostic about yylval being uninitialized. */
308+# define YY_IGNORE_MAYBE_UNINITIALIZED_BEGIN \
309+ _Pragma ("GCC diagnostic push") \
310+ _Pragma ("GCC diagnostic ignored \"-Wuninitialized\"")\
311+ _Pragma ("GCC diagnostic ignored \"-Wmaybe-uninitialized\"")
312+# define YY_IGNORE_MAYBE_UNINITIALIZED_END \
313+ _Pragma ("GCC diagnostic pop")
289314 #else
290−static int
291−YYID (yyi)
292− int yyi;
315+# define YY_INITIAL_VALUE(Value) Value
293316 #endif
294−{
295− return yyi;
296−}
317+#ifndef YY_IGNORE_MAYBE_UNINITIALIZED_BEGIN
318+# define YY_IGNORE_MAYBE_UNINITIALIZED_BEGIN
319+# define YY_IGNORE_MAYBE_UNINITIALIZED_END
297320 #endif
321+#ifndef YY_INITIAL_VALUE
322+# define YY_INITIAL_VALUE(Value) /* Nothing. */
323+#endif
324+
298325
299326 #if ! defined yyoverflow || YYERROR_VERBOSE
300327
@@ -313,8 +340,7 @@ YYID (yyi) · 12 unmodified lines
313340 # define alloca _alloca
314341 # else
315342 # define YYSTACK_ALLOC alloca
316−# if ! defined _ALLOCA_H && ! defined EXIT_SUCCESS && (defined __STDC__ || defined __C99__FUNC__ \
317− || defined __cplusplus || defined _MSC_VER)
343+# if ! defined _ALLOCA_H && ! defined EXIT_SUCCESS
318344 # include <stdlib.h> /* INFRINGES ON USER NAME SPACE */
319345 /* Use EXIT_SUCCESS as a witness for stdlib.h. */
320346 # ifndef EXIT_SUCCESS
@@ -326,8 +352,8 @@ YYID (yyi) · 5 unmodified lines
326352 # endif
327353
328354 # ifdef YYSTACK_ALLOC
329− /* Pacify GCC's `empty if-body' warning. */
330−# define YYSTACK_FREE(Ptr) do { /* empty */; } while (YYID (0))
355+ /* Pacify GCC's 'empty if-body' warning. */
356+# define YYSTACK_FREE(Ptr) do { /* empty */; } while (0)
331357 # ifndef YYSTACK_ALLOC_MAXIMUM
332358 /* The OS might guarantee only one guard page at the bottom of the stack,
333359 and a page size can be as small as 4096 bytes. So we cannot safely
@@ -343,7 +369,7 @@ YYID (yyi) · 9 unmodified lines
343369 # endif
344370 # if (defined __cplusplus && ! defined EXIT_SUCCESS \
345371 && ! ((defined YYMALLOC || defined malloc) \
346− && (defined YYFREE || defined free)))
372+ && (defined YYFREE || defined free)))
347373 # include <stdlib.h> /* INFRINGES ON USER NAME SPACE */
348374 # ifndef EXIT_SUCCESS
349375 # define EXIT_SUCCESS 0
@@ -351,15 +377,13 @@ YYID (yyi) · 1 unmodified line
351377 # endif
352378 # ifndef YYMALLOC
353379 # define YYMALLOC malloc
354−# if ! defined malloc && ! defined EXIT_SUCCESS && (defined __STDC__ || defined __C99__FUNC__ \
355− || defined __cplusplus || defined _MSC_VER)
380+# if ! defined malloc && ! defined EXIT_SUCCESS
356381 void *malloc (YYSIZE_T); /* INFRINGES ON USER NAME SPACE */
357382 # endif
358383 # endif
359384 # ifndef YYFREE
360385 # define YYFREE free
361−# if ! defined free && ! defined EXIT_SUCCESS && (defined __STDC__ || defined __C99__FUNC__ \
362− || defined __cplusplus || defined _MSC_VER)
386+# if ! defined free && ! defined EXIT_SUCCESS
363387 void free (void *); /* INFRINGES ON USER NAME SPACE */
364388 # endif
365389 # endif
@@ -369,7 +393,7 @@ void free (void *); /* INFRINGES ON USER NAME SPACE */ · 3 unmodified lines
369393
370394 #if (! defined yyoverflow \
371395 && (! defined __cplusplus \
372− || (defined YYSTYPE_IS_TRIVIAL && YYSTYPE_IS_TRIVIAL)))
396+ || (defined YYSTYPE_IS_TRIVIAL && YYSTYPE_IS_TRIVIAL)))
373397
374398 /* A type that is properly aligned for any stack member. */
375399 union yyalloc
@@ -394,16 +418,16 @@ union yyalloc · 18 unmodified lines
394418 elements in the stack, and YYPTR gives the new location of the
395419 stack. Advance YYPTR to a properly aligned location for the next
396420 stack. */
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 (YYID (0))
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 (0)
407431
408432 #endif
409433
@@ -422,7 +446,7 @@ union yyalloc · 12 unmodified lines
422446 for (yyi = 0; yyi < (Count); yyi++) \
423447 (Dst)[yyi] = (Src)[yyi]; \
424448 } \
425− while (YYID (0))
449+ while (0)
426450 # endif
427451 # endif
428452 #endif /* !YYCOPY_NEEDED */
@@ -430,25 +454,27 @@ union yyalloc · 1 unmodified line
430454 /* YYFINAL -- State number of the termination state. */
431455 #define YYFINAL 11
432456 /* YYLAST -- Last index in YYTABLE. */
433−#define YYLAST 298
457+#define YYLAST 301
434458
435459 /* YYNTOKENS -- Number of terminals. */
436−#define YYNTOKENS 40
460+#define YYNTOKENS 41
437461 /* YYNNTS -- Number of nonterminals. */
438462 #define YYNNTS 50
439463 /* YYNRULES -- Number of rules. */
440−#define YYNRULES 122
441−/* YYNRULES -- Number of states. */
442−#define YYNSTATES 199
464+#define YYNRULES 124
465+/* YYNSTATES -- Number of states. */
466+#define YYNSTATES 204
443467
444−/* YYTRANSLATE(YYLEX) -- Bison symbol number corresponding to YYLEX. */
468+/* YYTRANSLATE[YYX] -- Symbol number corresponding to YYX as returned
469+ by yylex, with out-of-bounds checking. */
445470 #define YYUNDEFTOK 2
446−#define YYMAXUTOK 294
471+#define YYMAXUTOK 295
447472
448−#define YYTRANSLATE(YYX) \
473+#define YYTRANSLATE(YYX) \
449474 ((unsigned int) (YYX) <= YYMAXUTOK ? yytranslate[YYX] : YYUNDEFTOK)
450475
451−/* YYTRANSLATE[YYLEX] -- Bison symbol number corresponding to YYLEX. */
476+/* YYTRANSLATE[TOKEN-NUM] -- Symbol number corresponding to TOKEN-NUM
477+ as returned by yylex, without out-of-bounds checking. */
452478 static const yytype_uint8 yytranslate[] =
453479 {
454480 0, 2, 2, 2, 2, 2, 2, 2, 2, 2,
@@ -480,90 +506,30 @@ static const yytype_uint8 yytranslate[] = · 25 unmodified lines
480506 5, 6, 7, 8, 9, 10, 11, 12, 13, 14,
481507 15, 16, 17, 18, 19, 20, 21, 22, 23, 24,
482508 25, 26, 27, 28, 29, 30, 31, 32, 33, 34,
483− 35, 36, 37, 38, 39
509+ 35, 36, 37, 38, 39, 40
484510 };
485511
486512 #if YYDEBUG
487−/* YYPRHS[YYN] -- Index of the first RHS symbol of rule number YYN in
488− YYRHS. */
489−static const yytype_uint16 yyprhs[] =
490−{
491− 0, 0, 3, 6, 8, 11, 13, 14, 17, 20,
492− 23, 26, 31, 36, 40, 42, 44, 46, 48, 50,
493− 52, 54, 56, 58, 60, 62, 64, 66, 68, 72,
494− 75, 79, 82, 86, 89, 90, 93, 96, 99, 102,
495− 105, 108, 112, 117, 122, 127, 133, 137, 138, 142,
496− 143, 146, 150, 153, 155, 159, 160, 163, 166, 169,
497− 172, 175, 180, 184, 187, 192, 193, 196, 200, 202,
498− 206, 207, 210, 213, 216, 220, 224, 228, 230, 234,
499− 235, 238, 241, 244, 248, 252, 255, 258, 261, 262,
500− 265, 268, 271, 276, 277, 280, 283, 286, 287, 290,
501− 292, 294, 297, 300, 303, 305, 308, 309, 312, 314,
502− 318, 322, 326, 330, 334, 338, 342, 345, 349, 353,
503− 355, 357, 358
504−};
505−
506−/* YYRHS -- A `-1'-separated list of the rules' RHS. */
507−static const yytype_int8 yyrhs[] =
508−{
509− 41, 0, -1, 85, 42, -1, 42, -1, 67, 43,
510− -1, 43, -1, -1, 43, 45, -1, 43, 59, -1,
511− 43, 71, -1, 43, 84, -1, 43, 26, 1, 35,
512− -1, 43, 44, 1, 35, -1, 43, 1, 35, -1,
513− 16, -1, 18, -1, 19, -1, 21, -1, 17, -1,
514− 22, -1, 20, -1, 23, -1, 35, -1, 65, -1,
515− 75, -1, 48, -1, 50, -1, 73, -1, 26, 1,
516− 35, -1, 1, 35, -1, 10, 26, 35, -1, 47,
517− 51, -1, 11, 26, 35, -1, 49, 51, -1, -1,
518− 51, 52, -1, 51, 53, -1, 51, 79, -1, 51,
519− 77, -1, 51, 46, -1, 51, 35, -1, 19, 82,
520− 35, -1, 18, 83, 86, 35, -1, 20, 87, 86,
521− 35, -1, 21, 26, 86, 35, -1, 22, 88, 88,
522− 86, 35, -1, 24, 54, 35, -1, -1, 54, 26,
523− 55, -1, -1, 38, 83, -1, 7, 89, 35, -1,
524− 56, 60, -1, 84, -1, 57, 62, 58, -1, -1,
525− 60, 61, -1, 60, 79, -1, 60, 77, -1, 60,
526− 35, -1, 60, 46, -1, 18, 83, 86, 35, -1,
527− 19, 82, 35, -1, 17, 35, -1, 20, 26, 86,
528− 35, -1, -1, 62, 45, -1, 14, 87, 85, -1,
529− 84, -1, 63, 66, 64, -1, -1, 66, 45, -1,
530− 66, 71, -1, 66, 59, -1, 3, 83, 85, -1,
531− 4, 83, 35, -1, 68, 80, 78, -1, 84, -1,
532− 69, 72, 70, -1, -1, 72, 45, -1, 72, 71,
533− -1, 72, 59, -1, 6, 83, 35, -1, 9, 83,
534− 35, -1, 74, 78, -1, 12, 35, -1, 76, 13,
535− -1, -1, 78, 79, -1, 78, 35, -1, 78, 46,
536− -1, 16, 25, 87, 35, -1, -1, 80, 81, -1,
537− 80, 35, -1, 23, 86, -1, -1, 83, 86, -1,
538− 26, -1, 27, -1, 5, 35, -1, 8, 35, -1,
539− 15, 35, -1, 35, -1, 85, 35, -1, -1, 14,
540− 87, -1, 88, -1, 88, 29, 88, -1, 88, 30,
541− 88, -1, 88, 31, 88, -1, 88, 32, 88, -1,
542− 88, 38, 88, -1, 88, 28, 88, -1, 34, 87,
543− 33, -1, 39, 87, -1, 87, 36, 87, -1, 87,
544− 37, 87, -1, 26, -1, 27, -1, -1, 26, -1
545−};
546−
547−/* YYRLINE[YYN] -- source line where rule number YYN was defined. */
513+ /* YYRLINE[YYN] -- Source line where rule number YYN was defined. */
548514 static const yytype_uint16 yyrline[] =
549515 {
550− 0, 108, 108, 108, 110, 110, 112, 114, 115, 116,
551− 117, 118, 119, 123, 127, 127, 127, 127, 127, 127,
552− 127, 127, 131, 132, 133, 134, 135, 136, 140, 141,
553− 147, 155, 161, 169, 179, 181, 182, 183, 184, 185,
554− 186, 189, 197, 203, 213, 219, 225, 228, 230, 241,
555− 242, 247, 256, 261, 269, 272, 274, 275, 276, 277,
556− 278, 281, 287, 298, 304, 314, 316, 321, 329, 337,
557− 340, 342, 343, 344, 349, 356, 363, 368, 376, 379,
558− 381, 382, 383, 386, 394, 401, 408, 414, 421, 423,
559− 424, 425, 428, 436, 438, 439, 442, 449, 451, 456,
560− 457, 460, 461, 462, 466, 467, 470, 471, 474, 475,
561− 476, 477, 478, 479, 480, 481, 482, 483, 484, 487,
562− 488, 491, 492
516+ 0, 109, 109, 109, 111, 111, 113, 115, 116, 117,
517+ 118, 119, 120, 124, 128, 128, 128, 128, 128, 128,
518+ 128, 128, 128, 132, 133, 134, 135, 136, 137, 141,
519+ 142, 148, 156, 162, 170, 180, 182, 183, 184, 185,
520+ 186, 187, 190, 198, 204, 214, 220, 226, 232, 235,
521+ 237, 248, 249, 254, 263, 268, 276, 279, 281, 282,
522+ 283, 284, 285, 288, 294, 305, 311, 321, 323, 328,
523+ 336, 344, 347, 349, 350, 351, 356, 363, 370, 375,
524+ 383, 386, 388, 389, 390, 393, 401, 408, 415, 421,
525+ 428, 430, 431, 432, 435, 443, 445, 446, 449, 456,
526+ 458, 463, 464, 467, 468, 469, 473, 474, 477, 478,
527+ 481, 482, 483, 484, 485, 486, 487, 488, 489, 490,
528+ 491, 494, 495, 498, 499
563529 };
564530 #endif
565531
566−#if YYDEBUG || YYERROR_VERBOSE || YYTOKEN_TABLE
532+#if YYDEBUG || YYERROR_VERBOSE || 0
567533 /* YYTNAME[SYMBOL-NUM] -- String name of the symbol SYMBOL-NUM.
568534 First, the terminals, then, starting at YYNTOKENS, nonterminals. */
569535 static const char *const yytname[] =
@@ -571,9 +537,9 @@ static const char *const yytname[] = · 1 unmodified line
571537 "$end", "error", "$undefined", "T_MAINMENU", "T_MENU", "T_ENDMENU",
572538 "T_SOURCE", "T_CHOICE", "T_ENDCHOICE", "T_COMMENT", "T_CONFIG",
573539 "T_MENUCONFIG", "T_HELP", "T_HELPTEXT", "T_IF", "T_ENDIF", "T_DEPENDS",
574− "T_OPTIONAL", "T_PROMPT", "T_TYPE", "T_DEFAULT", "T_SELECT", "T_RANGE",
575− "T_VISIBLE", "T_OPTION", "T_ON", "T_WORD", "T_WORD_QUOTE", "T_UNEQUAL",
576− "T_LESS", "T_LESS_EQUAL", "T_GREATER", "T_GREATER_EQUAL",
540+ "T_OPTIONAL", "T_PROMPT", "T_TYPE", "T_DEFAULT", "T_SELECT", "T_IMPLY",
541+ "T_RANGE", "T_VISIBLE", "T_OPTION", "T_ON", "T_WORD", "T_WORD_QUOTE",
542+ "T_UNEQUAL", "T_LESS", "T_LESS_EQUAL", "T_GREATER", "T_GREATER_EQUAL",
577543 "T_CLOSE_PAREN", "T_OPEN_PAREN", "T_EOL", "T_OR", "T_AND", "T_EQUAL",
578544 "T_NOT", "$accept", "input", "start", "stmt_list", "option_name",
579545 "common_stmt", "option_error", "config_entry_start", "config_stmt",
@@ -585,260 +551,254 @@ static const char *const yytname[] = · 5 unmodified lines
585551 "menu_entry", "menu_end", "menu_stmt", "menu_block", "source_stmt",
586552 "comment", "comment_stmt", "help_start", "help", "depends_list",
587553 "depends", "visibility_list", "visible", "prompt_stmt_opt", "prompt",
588− "end", "nl", "if_expr", "expr", "symbol", "word_opt", YY_NULL
554+ "end", "nl", "if_expr", "expr", "symbol", "word_opt", YY_NULLPTR
589555 };
590556 #endif
591557
592558 # ifdef YYPRINT
593−/* YYTOKNUM[YYLEX-NUM] -- Internal token number corresponding to
594− token YYLEX-NUM. */
559+/* YYTOKNUM[NUM] -- (External) token number corresponding to the
560+ (internal) symbol number NUM (which must be that of a token). */
595561 static const yytype_uint16 yytoknum[] =
596562 {
597563 0, 256, 257, 258, 259, 260, 261, 262, 263, 264,
598564 265, 266, 267, 268, 269, 270, 271, 272, 273, 274,
599565 275, 276, 277, 278, 279, 280, 281, 282, 283, 284,
600− 285, 286, 287, 288, 289, 290, 291, 292, 293, 294
566+ 285, 286, 287, 288, 289, 290, 291, 292, 293, 294,
567+ 295
601568 };
602569 # endif
603570
604−/* YYR1[YYN] -- Symbol number of symbol that rule YYN derives. */
605−static const yytype_uint8 yyr1[] =
571+#define YYPACT_NINF -92
572+
573+#define yypact_value_is_default(Yystate) \
574+ (!!((Yystate) == (-92)))
575+
576+#define YYTABLE_NINF -88
577+
578+#define yytable_value_is_error(Yytable_value) \
579+ 0
580+
581+ /* YYPACT[STATE-NUM] -- Index in YYTABLE of the portion describing
582+ STATE-NUM. */
583+static const yytype_int16 yypact[] =
606584 {
607− 0, 40, 41, 41, 42, 42, 43, 43, 43, 43,
608− 43, 43, 43, 43, 44, 44, 44, 44, 44, 44,
609− 44, 44, 45, 45, 45, 45, 45, 45, 46, 46,
610− 47, 48, 49, 50, 51, 51, 51, 51, 51, 51,
611− 51, 52, 52, 52, 52, 52, 53, 54, 54, 55,
612− 55, 56, 57, 58, 59, 60, 60, 60, 60, 60,
613− 60, 61, 61, 61, 61, 62, 62, 63, 64, 65,
614− 66, 66, 66, 66, 67, 68, 69, 70, 71, 72,
615− 72, 72, 72, 73, 74, 75, 76, 77, 78, 78,
616− 78, 78, 79, 80, 80, 80, 81, 82, 82, 83,
617− 83, 84, 84, 84, 85, 85, 86, 86, 87, 87,
618− 87, 87, 87, 87, 87, 87, 87, 87, 87, 88,
619− 88, 89, 89
585+ 17, 41, -92, 15, -92, 150, -92, 19, -92, -92,
586+ -13, -92, 28, 41, 38, 41, 50, 47, 41, 79,
587+ 82, 44, 76, -92, -92, -92, -92, -92, -92, -92,
588+ -92, -92, 118, -92, 129, -92, -92, -92, -92, -92,
589+ -92, -92, -92, -92, -92, -92, -92, -92, -92, -92,
590+ -92, -92, 184, -92, -92, 107, -92, 111, -92, 113,
591+ -92, 116, -92, 139, 140, 151, -92, -92, 44, 44,
592+ 142, 256, -92, 160, 173, 27, 117, 80, 51, 255,
593+ -15, 255, 217, -92, -92, -92, -92, -92, -92, -8,
594+ -92, 44, 44, 107, 87, 87, 87, 87, 87, 87,
595+ -92, -92, 174, 176, 187, 41, 41, 44, 188, 189,
596+ 87, -92, 213, -92, -92, -92, -92, 206, -92, -92,
597+ 193, 41, 41, 203, -92, -92, -92, -92, -92, -92,
598+ -92, -92, -92, -92, -92, -92, -92, 229, -92, 241,
599+ -92, -92, -92, -92, -92, -92, -92, -92, -92, -92,
600+ 216, -92, -92, -92, -92, -92, -92, -92, -92, -92,
601+ 44, 229, 222, 229, 64, 229, 229, 87, 31, 231,
602+ -92, -92, 229, 236, 229, 44, -92, 145, 242, -92,
603+ -92, 243, 244, 245, 229, 251, -92, -92, 247, -92,
604+ 257, 125, -92, -92, -92, -92, -92, 260, 41, -92,
605+ -92, -92, -92, -92
620606 };
621607
622−/* YYR2[YYN] -- Number of symbols composing right hand side of rule YYN. */
623−static const yytype_uint8 yyr2[] =
608+ /* YYDEFACT[STATE-NUM] -- Default reduction number in state STATE-NUM.
609+ Performed when YYTABLE does not specify something else to do. Zero
610+ means the default is an error. */
611+static const yytype_uint8 yydefact[] =
624612 {
625− 0, 2, 2, 1, 2, 1, 0, 2, 2, 2,
626− 2, 4, 4, 3, 1, 1, 1, 1, 1, 1,
627− 1, 1, 1, 1, 1, 1, 1, 1, 3, 2,
628− 3, 2, 3, 2, 0, 2, 2, 2, 2, 2,
629− 2, 3, 4, 4, 4, 5, 3, 0, 3, 0,
630− 2, 3, 2, 1, 3, 0, 2, 2, 2, 2,
631− 2, 4, 3, 2, 4, 0, 2, 3, 1, 3,
632− 0, 2, 2, 2, 3, 3, 3, 1, 3, 0,
633− 2, 2, 2, 3, 3, 2, 2, 2, 0, 2,
634− 2, 2, 4, 0, 2, 2, 2, 0, 2, 1,
635− 1, 2, 2, 2, 1, 2, 0, 2, 1, 3,
636− 3, 3, 3, 3, 3, 3, 2, 3, 3, 1,
637− 1, 0, 1
613+ 6, 0, 106, 0, 3, 0, 6, 6, 101, 102,
614+ 0, 1, 0, 0, 0, 0, 123, 0, 0, 0,
615+ 0, 0, 0, 14, 19, 15, 16, 21, 17, 18,
616+ 20, 22, 0, 23, 0, 7, 35, 26, 35, 27,
617+ 57, 67, 8, 72, 24, 95, 81, 9, 28, 90,
618+ 25, 10, 0, 107, 2, 76, 13, 0, 103, 0,
619+ 124, 0, 104, 0, 0, 0, 121, 122, 0, 0,
620+ 0, 110, 105, 0, 0, 0, 0, 0, 0, 0,
621+ 90, 0, 0, 77, 85, 53, 86, 31, 33, 0,
622+ 118, 0, 0, 69, 0, 0, 0, 0, 0, 0,
623+ 11, 12, 0, 0, 0, 0, 99, 0, 0, 0,
624+ 0, 49, 0, 41, 40, 36, 37, 0, 39, 38,
625+ 0, 0, 99, 0, 61, 62, 58, 60, 59, 68,
626+ 56, 55, 73, 75, 71, 74, 70, 108, 97, 0,
627+ 96, 82, 84, 80, 83, 79, 92, 93, 91, 117,
628+ 119, 120, 116, 111, 112, 113, 114, 115, 30, 88,
629+ 0, 108, 0, 108, 108, 108, 108, 0, 0, 0,
630+ 89, 65, 108, 0, 108, 0, 98, 0, 0, 42,
631+ 100, 0, 0, 0, 108, 51, 48, 29, 0, 64,
632+ 0, 109, 94, 43, 44, 45, 46, 0, 0, 50,
633+ 63, 66, 47, 52
638634 };
639635
640−/* YYDEFACT[STATE-NAME] -- Default reduction number in state STATE-NUM.
641− Performed when YYTABLE doesn't specify something else to do. Zero
642− means the default is an error. */
643−static const yytype_uint8 yydefact[] =
636+ /* YYPGOTO[NTERM-NUM]. */
637+static const yytype_int16 yypgoto[] =
644638 {
645− 6, 0, 104, 0, 3, 0, 6, 6, 99, 100,
646− 0, 1, 0, 0, 0, 0, 121, 0, 0, 0,
647− 0, 0, 0, 14, 18, 15, 16, 20, 17, 19,
648− 21, 0, 22, 0, 7, 34, 25, 34, 26, 55,
649− 65, 8, 70, 23, 93, 79, 9, 27, 88, 24,
650− 10, 0, 105, 2, 74, 13, 0, 101, 0, 122,
651− 0, 102, 0, 0, 0, 119, 120, 0, 0, 0,
652− 108, 103, 0, 0, 0, 0, 0, 0, 0, 88,
653− 0, 0, 75, 83, 51, 84, 30, 32, 0, 116,
654− 0, 0, 67, 0, 0, 0, 0, 0, 0, 11,
655− 12, 0, 0, 0, 0, 97, 0, 0, 0, 47,
656− 0, 40, 39, 35, 36, 0, 38, 37, 0, 0,
657− 97, 0, 59, 60, 56, 58, 57, 66, 54, 53,
658− 71, 73, 69, 72, 68, 106, 95, 0, 94, 80,
659− 82, 78, 81, 77, 90, 91, 89, 115, 117, 118,
660− 114, 109, 110, 111, 112, 113, 29, 86, 0, 106,
661− 0, 106, 106, 106, 0, 0, 0, 87, 63, 106,
662− 0, 106, 0, 96, 0, 0, 41, 98, 0, 0,
663− 106, 49, 46, 28, 0, 62, 0, 107, 92, 42,
664− 43, 44, 0, 0, 48, 61, 64, 45, 50
639+ -92, -92, 285, 291, -92, 32, -66, -92, -92, -92,
640+ -92, 261, -92, -92, -92, -92, -92, -92, -92, 1,
641+ -92, -92, -92, -92, -92, -92, -92, -92, -92, -92,
642+ -92, 24, -92, -92, -92, -92, -92, 221, 220, -64,
643+ -92, -92, 179, -1, 67, 0, 110, -67, -91, -92
665644 };
666645
667−/* YYDEFGOTO[NTERM-NUM]. */
646+ /* YYDEFGOTO[NTERM-NUM]. */
668647 static const yytype_int16 yydefgoto[] =
669648 {
670− -1, 3, 4, 5, 33, 34, 112, 35, 36, 37,
671− 38, 74, 113, 114, 165, 194, 39, 40, 128, 41,
672− 76, 124, 77, 42, 132, 43, 78, 6, 44, 45,
673− 141, 46, 80, 47, 48, 49, 115, 116, 81, 117,
674− 79, 138, 160, 161, 50, 7, 173, 69, 70, 60
649+ -1, 3, 4, 5, 34, 35, 114, 36, 37, 38,
650+ 39, 75, 115, 116, 168, 199, 40, 41, 130, 42,
651+ 77, 126, 78, 43, 134, 44, 79, 6, 45, 46,
652+ 143, 47, 81, 48, 49, 50, 117, 118, 82, 119,
653+ 80, 140, 162, 163, 51, 7, 176, 70, 71, 61
675654 };
676655
677−/* YYPACT[STATE-NUM] -- Index in YYTABLE of the portion describing
678− STATE-NUM. */
679−#define YYPACT_NINF -91
680−static const yytype_int16 yypact[] =
656+ /* YYTABLE[YYPACT[STATE-NUM]] -- What to do in state STATE-NUM. If
657+ positive, shift that token. If negative, reduce the rule whose
658+ number is the opposite. If YYTABLE_NINF, syntax error. */
659+static const yytype_int16 yytable[] =
681660 {
682− 19, 37, -91, 13, -91, 79, -91, 20, -91, -91,
683− -16, -91, 21, 37, 25, 37, 41, 36, 37, 78,
684− 83, 31, 56, -91, -91, -91, -91, -91, -91, -91,
685− -91, 116, -91, 127, -91, -91, -91, -91, -91, -91,
686− -91, -91, -91, -91, -91, -91, -91, -91, -91, -91,
687− -91, 147, -91, -91, 105, -91, 109, -91, 111, -91,
688− 114, -91, 136, 137, 142, -91, -91, 31, 31, 76,
689− 254, -91, 143, 146, 27, 115, 207, 258, 243, -14,
690− 243, 179, -91, -91, -91, -91, -91, -91, -7, -91,
691− 31, 31, 105, 51, 51, 51, 51, 51, 51, -91,
692− -91, 156, 168, 181, 37, 37, 31, 178, 51, -91,
693− 206, -91, -91, -91, -91, 196, -91, -91, 175, 37,
694− 37, 185, -91, -91, -91, -91, -91, -91, -91, -91,
695− -91, -91, -91, -91, -91, 214, -91, 230, -91, -91,
696− -91, -91, -91, -91, -91, -91, -91, -91, 183, -91,
697− -91, -91, -91, -91, -91, -91, -91, -91, 31, 214,
698− 194, 214, 45, 214, 51, 26, 195, -91, -91, 214,
699− 197, 214, 31, -91, 139, 208, -91, -91, 220, 224,
700− 214, 222, -91, -91, 226, -91, 227, 123, -91, -91,
701− -91, -91, 235, 37, -91, -91, -91, -91, -91
661+ 10, 89, 90, 152, 153, 154, 155, 156, 157, 137,
662+ 55, 125, 57, 128, 59, 11, 147, 63, 148, 167,
663+ 1, 138, 1, 2, 150, 151, 149, -32, 102, 91,
664+ 92, -32, -32, -32, -32, -32, -32, -32, -32, 103,
665+ 164, -32, -32, 104, -32, 105, 106, 107, 108, 109,
666+ 110, -32, 111, 2, 112, 53, 14, 15, 185, 17,
667+ 18, 19, 20, 113, 56, 21, 22, 186, 8, 9,
668+ 93, 66, 67, 147, 58, 148, 184, 60, 175, 68,
669+ 133, 102, 142, 62, 69, -54, -54, 33, -54, -54,
670+ -54, -54, 103, 177, -54, -54, 104, 120, 121, 122,
671+ 123, 91, 92, 135, 161, 144, 64, 112, 191, 65,
672+ 129, 132, 72, 141, 66, 67, 124, -34, 102, 73,
673+ 172, -34, -34, -34, -34, -34, -34, -34, -34, 103,
674+ 74, -34, -34, 104, -34, 105, 106, 107, 108, 109,
675+ 110, -34, 111, 53, 112, 131, 136, 83, 145, 84,
676+ -5, 12, 85, 113, 13, 14, 15, 16, 17, 18,
677+ 19, 20, 91, 92, 21, 22, 23, 24, 25, 26,
678+ 27, 28, 29, 30, 31, 86, 87, 32, 2, 91,
679+ 92, 192, 91, 92, -4, 12, 33, 88, 13, 14,
680+ 15, 16, 17, 18, 19, 20, 100, 203, 21, 22,
681+ 23, 24, 25, 26, 27, 28, 29, 30, 31, 101,
682+ 158, 32, 159, 160, 169, 165, 166, -87, 102, 170,
683+ 33, -87, -87, -87, -87, -87, -87, -87, -87, 171,
684+ 174, -87, -87, 104, -87, -87, -87, -87, -87, -87,
685+ -87, -87, 102, 175, 112, -78, -78, -78, -78, -78,
686+ -78, -78, -78, 146, 92, -78, -78, 104, 179, 13,
687+ 14, 15, 16, 17, 18, 19, 20, 187, 112, 21,
688+ 22, 178, 189, 180, 181, 182, 183, 146, 193, 194,
689+ 195, 196, 188, 200, 190, 94, 95, 96, 97, 98,
690+ 198, 33, 54, 201, 197, 99, 202, 52, 127, 76,
691+ 139, 173
702692 };
703693
704−/* YYPGOTO[NTERM-NUM]. */
705−static const yytype_int16 yypgoto[] =
694+static const yytype_uint8 yycheck[] =
706695 {
707− -91, -91, 264, 268, -91, 30, -65, -91, -91, -91,
708− -91, 238, -91, -91, -91, -91, -91, -91, -91, -12,
709− -91, -91, -91, -91, -91, -91, -91, -91, -91, -91,
710− -91, -5, -91, -91, -91, -91, -91, 200, 209, -61,
711− -91, -91, 170, -1, 65, 0, 118, -66, -90, -91
696+ 1, 68, 69, 94, 95, 96, 97, 98, 99, 24,
697+ 10, 77, 13, 77, 15, 0, 82, 18, 82, 110,
698+ 3, 36, 3, 36, 91, 92, 34, 0, 1, 37,
699+ 38, 4, 5, 6, 7, 8, 9, 10, 11, 12,
700+ 107, 14, 15, 16, 17, 18, 19, 20, 21, 22,
701+ 23, 24, 25, 36, 27, 36, 5, 6, 27, 8,
702+ 9, 10, 11, 36, 36, 14, 15, 36, 27, 28,
703+ 70, 27, 28, 139, 36, 139, 167, 27, 14, 35,
704+ 79, 1, 81, 36, 40, 5, 6, 36, 8, 9,
705+ 10, 11, 12, 160, 14, 15, 16, 17, 18, 19,
706+ 20, 37, 38, 79, 105, 81, 27, 27, 175, 27,
707+ 78, 79, 36, 81, 27, 28, 36, 0, 1, 1,
708+ 121, 4, 5, 6, 7, 8, 9, 10, 11, 12,
709+ 1, 14, 15, 16, 17, 18, 19, 20, 21, 22,
710+ 23, 24, 25, 36, 27, 78, 79, 36, 81, 36,
711+ 0, 1, 36, 36, 4, 5, 6, 7, 8, 9,
712+ 10, 11, 37, 38, 14, 15, 16, 17, 18, 19,
713+ 20, 21, 22, 23, 24, 36, 36, 27, 36, 37,
714+ 38, 36, 37, 38, 0, 1, 36, 36, 4, 5,
715+ 6, 7, 8, 9, 10, 11, 36, 198, 14, 15,
716+ 16, 17, 18, 19, 20, 21, 22, 23, 24, 36,
717+ 36, 27, 36, 26, 1, 27, 27, 0, 1, 13,
718+ 36, 4, 5, 6, 7, 8, 9, 10, 11, 36,
719+ 27, 14, 15, 16, 17, 18, 19, 20, 21, 22,
720+ 23, 24, 1, 14, 27, 4, 5, 6, 7, 8,
721+ 9, 10, 11, 36, 38, 14, 15, 16, 36, 4,
722+ 5, 6, 7, 8, 9, 10, 11, 36, 27, 14,
723+ 15, 161, 36, 163, 164, 165, 166, 36, 36, 36,
724+ 36, 36, 172, 36, 174, 29, 30, 31, 32, 33,
725+ 39, 36, 7, 36, 184, 39, 36, 6, 77, 38,
726+ 80, 122
712727 };
713728
714−/* YYTABLE[YYPACT[STATE-NUM]]. What to do in state STATE-NUM. If
715− positive, shift that token. If negative, reduce the rule which
716− number is the opposite. If YYTABLE_NINF, syntax error. */
717−#define YYTABLE_NINF -86
718−static const yytype_int16 yytable[] =
729+ /* YYSTOS[STATE-NUM] -- The (internal number of the) accessing
730+ symbol of state STATE-NUM. */
731+static const yytype_uint8 yystos[] =
719732 {
720− 10, 88, 89, 150, 151, 152, 153, 154, 155, 135,
721− 54, 123, 56, 11, 58, 126, 145, 62, 164, 2,
722− 146, 136, 1, 1, 148, 149, 147, -31, 101, 90,
723− 91, -31, -31, -31, -31, -31, -31, -31, -31, 102,
724− 162, -31, -31, 103, -31, 104, 105, 106, 107, 108,
725− -31, 109, 181, 110, 2, 52, 55, 65, 66, 172,
726− 57, 182, 111, 8, 9, 67, 131, 59, 140, 92,
727− 68, 61, 145, 133, 180, 142, 146, 65, 66, -5,
728− 12, 90, 91, 13, 14, 15, 16, 17, 18, 19,
729− 20, 71, 174, 21, 22, 23, 24, 25, 26, 27,
730− 28, 29, 30, 159, 63, 31, 187, 127, 130, 64,
731− 139, 2, 90, 91, 32, -33, 101, 72, 169, -33,
732− -33, -33, -33, -33, -33, -33, -33, 102, 73, -33,
733− -33, 103, -33, 104, 105, 106, 107, 108, -33, 109,
734− 52, 110, 129, 134, 82, 143, 83, -4, 12, 84,
735− 111, 13, 14, 15, 16, 17, 18, 19, 20, 90,
736− 91, 21, 22, 23, 24, 25, 26, 27, 28, 29,
737− 30, 85, 86, 31, 188, 90, 91, 87, 99, -85,
738− 101, 100, 32, -85, -85, -85, -85, -85, -85, -85,
739− -85, 156, 198, -85, -85, 103, -85, -85, -85, -85,
740− -85, -85, -85, 157, 163, 110, 158, 166, 101, 167,
741− 168, 171, -52, -52, 144, -52, -52, -52, -52, 102,
742− 91, -52, -52, 103, 118, 119, 120, 121, 172, 176,
743− 183, 101, 185, 110, -76, -76, -76, -76, -76, -76,
744− -76, -76, 122, 189, -76, -76, 103, 13, 14, 15,
745− 16, 17, 18, 19, 20, 190, 110, 21, 22, 191,
746− 193, 195, 196, 14, 15, 144, 17, 18, 19, 20,
747− 197, 53, 21, 22, 51, 75, 125, 175, 32, 177,
748− 178, 179, 93, 94, 95, 96, 97, 184, 137, 186,
749− 170, 0, 98, 32, 0, 0, 0, 0, 192
733+ 0, 3, 36, 42, 43, 44, 68, 86, 27, 28,
734+ 84, 0, 1, 4, 5, 6, 7, 8, 9, 10,
735+ 11, 14, 15, 16, 17, 18, 19, 20, 21, 22,
736+ 23, 24, 27, 36, 45, 46, 48, 49, 50, 51,
737+ 57, 58, 60, 64, 66, 69, 70, 72, 74, 75,
738+ 76, 85, 44, 36, 43, 86, 36, 84, 36, 84,
739+ 27, 90, 36, 84, 27, 27, 27, 28, 35, 40,
740+ 88, 89, 36, 1, 1, 52, 52, 61, 63, 67,
741+ 81, 73, 79, 36, 36, 36, 36, 36, 36, 88,
742+ 88, 37, 38, 86, 29, 30, 31, 32, 33, 39,
743+ 36, 36, 1, 12, 16, 18, 19, 20, 21, 22,
744+ 23, 25, 27, 36, 47, 53, 54, 77, 78, 80,
745+ 17, 18, 19, 20, 36, 47, 62, 78, 80, 46,
746+ 59, 85, 46, 60, 65, 72, 85, 24, 36, 79,
747+ 82, 46, 60, 71, 72, 85, 36, 47, 80, 34,
748+ 88, 88, 89, 89, 89, 89, 89, 89, 36, 36,
749+ 26, 84, 83, 84, 88, 27, 27, 89, 55, 1,
750+ 13, 36, 84, 83, 27, 14, 87, 88, 87, 36,
751+ 87, 87, 87, 87, 89, 27, 36, 36, 87, 36,
752+ 87, 88, 36, 36, 36, 36, 36, 87, 39, 56,
753+ 36, 36, 36, 84
750754 };
751755
752−#define yypact_value_is_default(yystate) \
753− ((yystate) == (-91))
754−
755−#define yytable_value_is_error(yytable_value) \
756− YYID (0)
757−
758−static const yytype_int16 yycheck[] =
756+ /* YYR1[YYN] -- Symbol number of symbol that rule YYN derives. */
757+static const yytype_uint8 yyr1[] =
759758 {
760− 1, 67, 68, 93, 94, 95, 96, 97, 98, 23,
761− 10, 76, 13, 0, 15, 76, 81, 18, 108, 35,
762− 81, 35, 3, 3, 90, 91, 33, 0, 1, 36,
763− 37, 4, 5, 6, 7, 8, 9, 10, 11, 12,
764− 106, 14, 15, 16, 17, 18, 19, 20, 21, 22,
765− 23, 24, 26, 26, 35, 35, 35, 26, 27, 14,
766− 35, 35, 35, 26, 27, 34, 78, 26, 80, 69,
767− 39, 35, 137, 78, 164, 80, 137, 26, 27, 0,
768− 1, 36, 37, 4, 5, 6, 7, 8, 9, 10,
769− 11, 35, 158, 14, 15, 16, 17, 18, 19, 20,
770− 21, 22, 23, 104, 26, 26, 172, 77, 78, 26,
771− 80, 35, 36, 37, 35, 0, 1, 1, 119, 4,
772− 5, 6, 7, 8, 9, 10, 11, 12, 1, 14,
773− 15, 16, 17, 18, 19, 20, 21, 22, 23, 24,
774− 35, 26, 77, 78, 35, 80, 35, 0, 1, 35,
775− 35, 4, 5, 6, 7, 8, 9, 10, 11, 36,
776− 37, 14, 15, 16, 17, 18, 19, 20, 21, 22,
777− 23, 35, 35, 26, 35, 36, 37, 35, 35, 0,
778− 1, 35, 35, 4, 5, 6, 7, 8, 9, 10,
779− 11, 35, 193, 14, 15, 16, 17, 18, 19, 20,
780− 21, 22, 23, 35, 26, 26, 25, 1, 1, 13,
781− 35, 26, 5, 6, 35, 8, 9, 10, 11, 12,
782− 37, 14, 15, 16, 17, 18, 19, 20, 14, 35,
783− 35, 1, 35, 26, 4, 5, 6, 7, 8, 9,
784− 10, 11, 35, 35, 14, 15, 16, 4, 5, 6,
785− 7, 8, 9, 10, 11, 35, 26, 14, 15, 35,
786− 38, 35, 35, 5, 6, 35, 8, 9, 10, 11,
787− 35, 7, 14, 15, 6, 37, 76, 159, 35, 161,
788− 162, 163, 28, 29, 30, 31, 32, 169, 79, 171,
789− 120, -1, 38, 35, -1, -1, -1, -1, 180
759+ 0, 41, 42, 42, 43, 43, 44, 44, 44, 44,
760+ 44, 44, 44, 44, 45, 45, 45, 45, 45, 45,
761+ 45, 45, 45, 46, 46, 46, 46, 46, 46, 47,
762+ 47, 48, 49, 50, 51, 52, 52, 52, 52, 52,
763+ 52, 52, 53, 53, 53, 53, 53, 53, 54, 55,
764+ 55, 56, 56, 57, 58, 59, 60, 61, 61, 61,
765+ 61, 61, 61, 62, 62, 62, 62, 63, 63, 64,
766+ 65, 66, 67, 67, 67, 67, 68, 69, 70, 71,
767+ 72, 73, 73, 73, 73, 74, 75, 76, 77, 78,
768+ 79, 79, 79, 79, 80, 81, 81, 81, 82, 83,
769+ 83, 84, 84, 85, 85, 85, 86, 86, 87, 87,
770+ 88, 88, 88, 88, 88, 88, 88, 88, 88, 88,
771+ 88, 89, 89, 90, 90
790772 };
791773
792−/* YYSTOS[STATE-NUM] -- The (internal number of the) accessing
793− symbol of state STATE-NUM. */
794−static const yytype_uint8 yystos[] =
774+ /* YYR2[YYN] -- Number of symbols on the right hand side of rule YYN. */
775+static const yytype_uint8 yyr2[] =
795776 {
796− 0, 3, 35, 41, 42, 43, 67, 85, 26, 27,
797− 83, 0, 1, 4, 5, 6, 7, 8, 9, 10,
798− 11, 14, 15, 16, 17, 18, 19, 20, 21, 22,
799− 23, 26, 35, 44, 45, 47, 48, 49, 50, 56,
800− 57, 59, 63, 65, 68, 69, 71, 73, 74, 75,
801− 84, 43, 35, 42, 85, 35, 83, 35, 83, 26,
802− 89, 35, 83, 26, 26, 26, 27, 34, 39, 87,
803− 88, 35, 1, 1, 51, 51, 60, 62, 66, 80,
804− 72, 78, 35, 35, 35, 35, 35, 35, 87, 87,
805− 36, 37, 85, 28, 29, 30, 31, 32, 38, 35,
806− 35, 1, 12, 16, 18, 19, 20, 21, 22, 24,
807− 26, 35, 46, 52, 53, 76, 77, 79, 17, 18,
808− 19, 20, 35, 46, 61, 77, 79, 45, 58, 84,
809− 45, 59, 64, 71, 84, 23, 35, 78, 81, 45,
810− 59, 70, 71, 84, 35, 46, 79, 33, 87, 87,
811− 88, 88, 88, 88, 88, 88, 35, 35, 25, 83,
812− 82, 83, 87, 26, 88, 54, 1, 13, 35, 83,
813− 82, 26, 14, 86, 87, 86, 35, 86, 86, 86,
814− 88, 26, 35, 35, 86, 35, 86, 87, 35, 35,
815− 35, 35, 86, 38, 55, 35, 35, 35, 83
777+ 0, 2, 2, 1, 2, 1, 0, 2, 2, 2,
778+ 2, 4, 4, 3, 1, 1, 1, 1, 1, 1,
779+ 1, 1, 1, 1, 1, 1, 1, 1, 1, 3,
780+ 2, 3, 2, 3, 2, 0, 2, 2, 2, 2,
781+ 2, 2, 3, 4, 4, 4, 4, 5, 3, 0,
782+ 3, 0, 2, 3, 2, 1, 3, 0, 2, 2,
783+ 2, 2, 2, 4, 3, 2, 4, 0, 2, 3,
784+ 1, 3, 0, 2, 2, 2, 3, 3, 3, 1,
785+ 3, 0, 2, 2, 2, 3, 3, 2, 2, 2,
786+ 0, 2, 2, 2, 4, 0, 2, 2, 2, 0,
787+ 2, 1, 1, 2, 2, 2, 1, 2, 0, 2,
788+ 1, 3, 3, 3, 3, 3, 3, 3, 2, 3,
789+ 3, 1, 1, 0, 1
816790 };
817791
818−#define yyerrok (yyerrstatus = 0)
819−#define yyclearin (yychar = YYEMPTY)
820−#define YYEMPTY (-2)
821−#define YYEOF 0
822−
823−#define YYACCEPT goto yyacceptlab
824−#define YYABORT goto yyabortlab
825−#define YYERROR goto yyerrorlab
826−
827−
828−/* Like YYERROR except do call yyerror. This remains here temporarily
829− to ease the transition to the new meaning of YYERROR, for GCC.
830− Once GCC version 2 has supplanted version 1, this can go. However,
831− YYFAIL appears to be in use. Nevertheless, it is formally deprecated
832− in Bison 2.4.2's NEWS entry, where a plan to phase it out is
833− discussed. */
834−
835−#define YYFAIL goto yyerrlab
836−#if defined YYFAIL
837− /* This is here to suppress warnings from the GCC cpp's
838− -Wunused-macros. Normally we don't worry about that warning, but
839− some users do, and we want to make it easy for users to remove
840− YYFAIL uses, which will produce warnings from Bison 2.5. */
841−#endif
792+
793+#define yyerrok (yyerrstatus = 0)
794+#define yyclearin (yychar = YYEMPTY)
795+#define YYEMPTY (-2)
796+#define YYEOF 0
797+
798+#define YYACCEPT goto yyacceptlab
799+#define YYABORT goto yyabortlab
800+#define YYERROR goto yyerrorlab
801+
842802
843803 #define YYRECOVERING() (!!yyerrstatus)
844804
@@ -855,55 +815,15 @@ do \ · 10 unmodified lines
855815 else \
856816 { \
857817 yyerror (YY_("syntax error: cannot back up")); \
858− YYERROR; \
859− } \
860−while (YYID (0))
861−
862−
863−#define YYTERROR 1
864−#define YYERRCODE 256
865−
866−
867−/* YYLLOC_DEFAULT -- Set CURRENT to span from RHS[1] to RHS[N].
868− If N is 0, then set CURRENT to the empty location which ends
869− the previous symbol: RHS[0] (always defined). */
870−
871−#define YYRHSLOC(Rhs, K) ((Rhs)[K])
872−#ifndef YYLLOC_DEFAULT
873−# define YYLLOC_DEFAULT(Current, Rhs, N) \
874− do \
875− if (YYID (N)) \
876− { \
877− (Current).first_line = YYRHSLOC (Rhs, 1).first_line; \
878− (Current).first_column = YYRHSLOC (Rhs, 1).first_column; \
879− (Current).last_line = YYRHSLOC (Rhs, N).last_line; \
880− (Current).last_column = YYRHSLOC (Rhs, N).last_column; \
881− } \
882− else \
883− { \
884− (Current).first_line = (Current).last_line = \
885− YYRHSLOC (Rhs, 0).last_line; \
886− (Current).first_column = (Current).last_column = \
887− YYRHSLOC (Rhs, 0).last_column; \
888− } \
889− while (YYID (0))
890−#endif
891−
892−
893−/* This macro is provided for backward compatibility. */
894−
895−#ifndef YY_LOCATION_PRINT
896−# define YY_LOCATION_PRINT(File, Loc) ((void) 0)
897−#endif
818+ YYERROR; \
819+ } \
820+while (0)
898821
822+/* Error token number */
823+#define YYTERROR 1
824+#define YYERRCODE 256
899825
900−/* YYLEX -- calling `yylex' with the right arguments. */
901826
902−#ifdef YYLEX_PARAM
903−# define YYLEX yylex (YYLEX_PARAM)
904−#else
905−# define YYLEX yylex ()
906−#endif
907827
908828 /* Enable debugging if requested. */
909829 #if YYDEBUG
@@ -913,40 +833,36 @@ while (YYID (0)) · 3 unmodified lines
913833 # define YYFPRINTF fprintf
914834 # endif
915835
916−# define YYDPRINTF(Args) \
917−do { \
918− if (yydebug) \
919− YYFPRINTF Args; \
920−} while (YYID (0))
836+# define YYDPRINTF(Args) \
837+do { \
838+ if (yydebug) \
839+ YYFPRINTF Args; \
840+} while (0)
841+
842+/* This macro is provided for backward compatibility. */
843+#ifndef YY_LOCATION_PRINT
844+# define YY_LOCATION_PRINT(File, Loc) ((void) 0)
845+#endif
846+
921847
922−# define YY_SYMBOL_PRINT(Title, Type, Value, Location) \
923−do { \
924− if (yydebug) \
925− { \
926− YYFPRINTF (stderr, "%s ", Title); \
927− yy_symbol_print (stderr, \
928− Type, Value); \
929− YYFPRINTF (stderr, "\n"); \
930− } \
931−} while (YYID (0))
848+# define YY_SYMBOL_PRINT(Title, Type, Value, Location) \
849+do { \
850+ if (yydebug) \
851+ { \
852+ YYFPRINTF (stderr, "%s ", Title); \
853+ yy_symbol_print (stderr, \
854+ Type, Value); \
855+ YYFPRINTF (stderr, "\n"); \
856+ } \
857+} while (0)
932858
933859
934−/*--------------------------------.
935−| Print this symbol on YYOUTPUT. |
936−`--------------------------------*/
860+/*----------------------------------------.
861+| Print this symbol's value on YYOUTPUT. |
862+`----------------------------------------*/
937863
938−/*ARGSUSED*/
939−#if (defined __STDC__ || defined __C99__FUNC__ \
940− || defined __cplusplus || defined _MSC_VER)
941864 static void
942865 yy_symbol_value_print (FILE *yyoutput, int yytype, YYSTYPE const * const yyvaluep)
943−#else
944−static void
945−yy_symbol_value_print (yyoutput, yytype, yyvaluep)
946− FILE *yyoutput;
947− int yytype;
948− YYSTYPE const * const yyvaluep;
949−#endif
950866 {
951867 FILE *yyo = yyoutput;
952868 YYUSE (yyo);
@@ -955,14 +871,8 @@ yy_symbol_value_print (yyoutput, yytype, yyvaluep) · 2 unmodified lines
955871 # ifdef YYPRINT
956872 if (yytype < YYNTOKENS)
957873 YYPRINT (yyoutput, yytoknum[yytype], *yyvaluep);
958−# else
959− YYUSE (yyoutput);
960874 # endif
961− switch (yytype)
962− {
963− default:
964− break;
965− }
875+ YYUSE (yytype);
966876 }
967877
968878
@@ -970,22 +880,11 @@ yy_symbol_value_print (yyoutput, yytype, yyvaluep) · 1 unmodified line
970880 | Print this symbol on YYOUTPUT. |
971881 `--------------------------------*/
972882
973−#if (defined __STDC__ || defined __C99__FUNC__ \
974− || defined __cplusplus || defined _MSC_VER)
975883 static void
976884 yy_symbol_print (FILE *yyoutput, int yytype, YYSTYPE const * const yyvaluep)
977−#else
978−static void
979−yy_symbol_print (yyoutput, yytype, yyvaluep)
980− FILE *yyoutput;
981− int yytype;
982− YYSTYPE const * const yyvaluep;
983−#endif
984885 {
985− if (yytype < YYNTOKENS)
986− YYFPRINTF (yyoutput, "token %s (", yytname[yytype]);
987− else
988− YYFPRINTF (yyoutput, "nterm %s (", yytname[yytype]);
886+ YYFPRINTF (yyoutput, "%s %s (",
887+ yytype < YYNTOKENS ? "token" : "nterm", yytname[yytype]);
989888
990889 yy_symbol_value_print (yyoutput, yytype, yyvaluep);
991890 YYFPRINTF (yyoutput, ")");
@@ -996,16 +895,8 @@ yy_symbol_print (yyoutput, yytype, yyvaluep) · 4 unmodified lines
996895 | TOP (included). |
997896 `------------------------------------------------------------------*/
998897
999−#if (defined __STDC__ || defined __C99__FUNC__ \
1000− || defined __cplusplus || defined _MSC_VER)
1001898 static void
1002899 yy_stack_print (yytype_int16 *yybottom, yytype_int16 *yytop)
1003−#else
1004−static void
1005−yy_stack_print (yybottom, yytop)
1006− yytype_int16 *yybottom;
1007− yytype_int16 *yytop;
1008−#endif
1009900 {
1010901 YYFPRINTF (stderr, "Stack now");
1011902 for (; yybottom <= yytop; yybottom++)
@@ -1016,49 +907,42 @@ yy_stack_print (yybottom, yytop) · 4 unmodified lines
1016907 YYFPRINTF (stderr, "\n");
1017908 }
1018909
1019−# define YY_STACK_PRINT(Bottom, Top) \
1020−do { \
1021− if (yydebug) \
1022− yy_stack_print ((Bottom), (Top)); \
1023−} while (YYID (0))
910+# define YY_STACK_PRINT(Bottom, Top) \
911+do { \
912+ if (yydebug) \
913+ yy_stack_print ((Bottom), (Top)); \
914+} while (0)
1024915
1025916
1026917 /*------------------------------------------------.
1027918 | Report that the YYRULE is going to be reduced. |
1028919 `------------------------------------------------*/
1029920
1030−#if (defined __STDC__ || defined __C99__FUNC__ \
1031− || defined __cplusplus || defined _MSC_VER)
1032921 static void
1033−yy_reduce_print (YYSTYPE *yyvsp, int yyrule)
1034−#else
1035−static void
1036−yy_reduce_print (yyvsp, yyrule)
1037− YYSTYPE *yyvsp;
1038− int yyrule;
1039−#endif
922+yy_reduce_print (yytype_int16 *yyssp, YYSTYPE *yyvsp, int yyrule)
1040923 {
924+ unsigned long int yylno = yyrline[yyrule];
1041925 int yynrhs = yyr2[yyrule];
1042926 int yyi;
1043− unsigned long int yylno = yyrline[yyrule];
1044927 YYFPRINTF (stderr, "Reducing stack by rule %d (line %lu):\n",
1045− yyrule - 1, yylno);
928+ yyrule - 1, yylno);
1046929 /* The symbols being reduced. */
1047930 for (yyi = 0; yyi < yynrhs; yyi++)
1048931 {
1049932 YYFPRINTF (stderr, " $%d = ", yyi + 1);
1050− yy_symbol_print (stderr, yyrhs[yyprhs[yyrule] + yyi],
1051− &(yyvsp[(yyi + 1) - (yynrhs)])
1052− );
933+ yy_symbol_print (stderr,
934+ yystos[yyssp[yyi + 1 - yynrhs]],
935+ &(yyvsp[(yyi + 1) - (yynrhs)])
936+ );
1053937 YYFPRINTF (stderr, "\n");
1054938 }
1055939 }
1056940
1057−# define YY_REDUCE_PRINT(Rule) \
1058−do { \
1059− if (yydebug) \
1060− yy_reduce_print (yyvsp, Rule); \
1061−} while (YYID (0))
941+# define YY_REDUCE_PRINT(Rule) \
942+do { \
943+ if (yydebug) \
944+ yy_reduce_print (yyssp, yyvsp, Rule); \
945+} while (0)
1062946
1063947 /* Nonzero means print parse trace. It is left uninitialized so that
1064948 multiple parsers can coexist. */
@@ -1072,7 +956,7 @@ int yydebug; · 7 unmodified lines
1072956
1073957
1074958 /* YYINITDEPTH -- initial size of the parser's stacks. */
1075−#ifndef YYINITDEPTH
959+#ifndef YYINITDEPTH
1076960 # define YYINITDEPTH 200
1077961 #endif
1078962
@@ -1095,15 +979,8 @@ int yydebug; · 16 unmodified lines
1095979 # define yystrlen strlen
1096980 # else
1097981 /* Return the length of YYSTR. */
1098−#if (defined __STDC__ || defined __C99__FUNC__ \
1099− || defined __cplusplus || defined _MSC_VER)
1100982 static YYSIZE_T
1101983 yystrlen (const char *yystr)
1102−#else
1103−static YYSIZE_T
1104−yystrlen (yystr)
1105− const char *yystr;
1106−#endif
1107984 {
1108985 YYSIZE_T yylen;
1109986 for (yylen = 0; yystr[yylen]; yylen++)
@@ -1119,16 +996,8 @@ yystrlen (yystr) · 9 unmodified lines
1119996 # else
1120997 /* Copy YYSRC to YYDEST, returning the address of the terminating '\0' in
1121998 YYDEST. */
1122−#if (defined __STDC__ || defined __C99__FUNC__ \
1123− || defined __cplusplus || defined _MSC_VER)
1124999 static char *
11251000 yystpcpy (char *yydest, const char *yysrc)
1126−#else
1127−static char *
1128−yystpcpy (yydest, yysrc)
1129− char *yydest;
1130− const char *yysrc;
1131−#endif
11321001 {
11331002 char *yyd = yydest;
11341003 const char *yys = yysrc;
@@ -1158,27 +1027,27 @@ yytnamerr (char *yyres, const char *yystr) · 23 unmodified lines
11581027 char const *yyp = yystr;
11591028
11601029 for (;;)
1161− switch (*++yyp)
1162− {
1163− case '\'':
1164− case ',':
1165− goto do_not_strip_quotes;
1166−
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;
1176−
1177− case '"':
1178− if (yyres)
1179− yyres[yyn] = '\0';
1180− return yyn;
1181− }
1030+ switch (*++yyp)
1031+ {
1032+ case '\'':
1033+ case ',':
1034+ goto do_not_strip_quotes;
1035+
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;
1045+
1046+ case '"':
1047+ if (yyres)
1048+ yyres[yyn] = '\0';
1049+ return yyn;
1050+ }
11821051 do_not_strip_quotes: ;
11831052 }
11841053
@@ -1201,12 +1070,11 @@ static int · 16 unmodified lines
12011070 yysyntax_error (YYSIZE_T *yymsg_alloc, char **yymsg,
12021071 yytype_int16 *yyssp, int yytoken)
12031072 {
1204− YYSIZE_T yysize0 = yytnamerr (YY_NULL, yytname[yytoken]);
1073+ YYSIZE_T yysize0 = yytnamerr (YY_NULLPTR, yytname[yytoken]);
12051074 YYSIZE_T yysize = yysize0;
1206− YYSIZE_T yysize1;
12071075 enum { YYERROR_VERBOSE_ARGS_MAXIMUM = 5 };
12081076 /* Internationalized format string. */
1209− const char *yyformat = YY_NULL;
1077+ const char *yyformat = YY_NULLPTR;
12101078 /* Arguments of yyformat. */
12111079 char const *yyarg[YYERROR_VERBOSE_ARGS_MAXIMUM];
12121080 /* Number of reported tokens (one for the "unexpected", one per
@@ -1214,10 +1082,6 @@ yysyntax_error (YYSIZE_T *yymsg_alloc, char **yymsg, · 1 unmodified line
12141082 int yycount = 0;
12151083
12161084 /* There are many possibilities here to consider:
1217− - Assume YYFAIL is not used. It's too flawed to consider. See
1218− <http://lists.gnu.org/archive/html/bison-patches/2009-12/msg00024.html>
1219− for details. YYERROR is fine as it does not invoke this
1220− function.
12211085 - If this state is a consistent state with a default action, then
12221086 the only way this function was invoked is if the default action
12231087 is an error action. In that case, don't check for expected
@@ -1266,11 +1130,13 @@ yysyntax_error (YYSIZE_T *yymsg_alloc, char **yymsg, · 42 unmodified lines
12661130 break;
12671131 }
12681132 yyarg[yycount++] = yytname[yyx];
1269− yysize1 = yysize + yytnamerr (YY_NULL, yytname[yyx]);
1270− if (! (yysize <= yysize1
1271− && yysize1 <= YYSTACK_ALLOC_MAXIMUM))
1272− return 2;
1273− yysize = yysize1;
1133+ {
1134+ YYSIZE_T yysize1 = yysize + yytnamerr (YY_NULLPTR, yytname[yyx]);
1135+ if (! (yysize <= yysize1
1136+ && yysize1 <= YYSTACK_ALLOC_MAXIMUM))
1137+ return 2;
1138+ yysize = yysize1;
1139+ }
12741140 }
12751141 }
12761142 }
@@ -1290,10 +1156,12 @@ yysyntax_error (YYSIZE_T *yymsg_alloc, char **yymsg, · 13 unmodified lines
12901156 # undef YYCASE_
12911157 }
12921158
1293− yysize1 = yysize + yystrlen (yyformat);
1294− if (! (yysize <= yysize1 && yysize1 <= YYSTACK_ALLOC_MAXIMUM))
1295− return 2;
1296− yysize = yysize1;
1159+ {
1160+ YYSIZE_T yysize1 = yysize + yystrlen (yyformat);
1161+ if (! (yysize <= yysize1 && yysize1 <= YYSTACK_ALLOC_MAXIMUM))
1162+ return 2;
1163+ yysize = yysize1;
1164+ }
12971165
12981166 if (*yymsg_alloc < yysize)
12991167 {
@@ -1330,78 +1198,58 @@ yysyntax_error (YYSIZE_T *yymsg_alloc, char **yymsg, · 30 unmodified lines
13301198 | Release the memory associated to this symbol. |
13311199 `-----------------------------------------------*/
13321200
1333−/*ARGSUSED*/
1334−#if (defined __STDC__ || defined __C99__FUNC__ \
1335− || defined __cplusplus || defined _MSC_VER)
13361201 static void
13371202 yydestruct (const char *yymsg, int yytype, YYSTYPE *yyvaluep)
1338−#else
1339−static void
1340−yydestruct (yymsg, yytype, yyvaluep)
1341− const char *yymsg;
1342− int yytype;
1343− YYSTYPE *yyvaluep;
1344−#endif
13451203 {
13461204 YYUSE (yyvaluep);
1347−
13481205 if (!yymsg)
13491206 yymsg = "Deleting";
13501207 YY_SYMBOL_PRINT (yymsg, yytype, yyvaluep, yylocationp);
13511208
1209+ YY_IGNORE_MAYBE_UNINITIALIZED_BEGIN
13521210 switch (yytype)
13531211 {
1354− case 57: /* "choice_entry" */
1212+ case 58: /* choice_entry */
13551213
1356− {
1214+ {
13571215 fprintf(stderr, "%s:%d: missing end statement for this entry\n",
1358− (yyvaluep->menu)->file->name, (yyvaluep->menu)->lineno);
1359− if (current_menu == (yyvaluep->menu))
1216+ ((*yyvaluep).menu)->file->name, ((*yyvaluep).menu)->lineno);
1217+ if (current_menu == ((*yyvaluep).menu))
13601218 menu_end_menu();
1361−};
1219+}
1220+
1221+ break;
13621222
1363− break;
1364− case 63: /* "if_entry" */
1223+ case 64: /* if_entry */
13651224
1366− {
1225+ {
13671226 fprintf(stderr, "%s:%d: missing end statement for this entry\n",
1368− (yyvaluep->menu)->file->name, (yyvaluep->menu)->lineno);
1369− if (current_menu == (yyvaluep->menu))
1227+ ((*yyvaluep).menu)->file->name, ((*yyvaluep).menu)->lineno);
1228+ if (current_menu == ((*yyvaluep).menu))
13701229 menu_end_menu();
1371−};
1230+}
13721231
1373− break;
1374− case 69: /* "menu_entry" */
1232+ break;
13751233
1376− {
1234+ case 70: /* menu_entry */
1235+
1236+ {
13771237 fprintf(stderr, "%s:%d: missing end statement for this entry\n",
1378− (yyvaluep->menu)->file->name, (yyvaluep->menu)->lineno);
1379− if (current_menu == (yyvaluep->menu))
1238+ ((*yyvaluep).menu)->file->name, ((*yyvaluep).menu)->lineno);
1239+ if (current_menu == ((*yyvaluep).menu))
13801240 menu_end_menu();
1381−};
1241+}
1242+
1243+ break;
13821244
1383− break;
13841245
13851246 default:
1386− break;
1247+ break;
13871248 }
1249+ YY_IGNORE_MAYBE_UNINITIALIZED_END
13881250 }
13891251
13901252
1391−/* Prevent warnings from -Wmissing-prototypes. */
1392−#ifdef YYPARSE_PARAM
1393−#if defined __STDC__ || defined __cplusplus
1394−int yyparse (void *YYPARSE_PARAM);
1395−#else
1396−int yyparse ();
1397−#endif
1398−#else /* ! YYPARSE_PARAM */
1399−#if defined __STDC__ || defined __cplusplus
1400−int yyparse (void);
1401−#else
1402−int yyparse ();
1403−#endif
1404−#endif /* ! YYPARSE_PARAM */
14051253
14061254
14071255 /* The lookahead symbol. */
@@ -1409,7 +1257,6 @@ int yychar; · 1 unmodified line
14091257
14101258 /* The semantic value of the lookahead symbol. */
14111259 YYSTYPE yylval;
1412−
14131260 /* Number of syntax errors so far. */
14141261 int yynerrs;
14151262
@@ -1418,35 +1265,16 @@ int yynerrs; · 2 unmodified lines
14181265 | yyparse. |
14191266 `----------*/
14201267
1421−#ifdef YYPARSE_PARAM
1422−#if (defined __STDC__ || defined __C99__FUNC__ \
1423− || defined __cplusplus || defined _MSC_VER)
1424−int
1425−yyparse (void *YYPARSE_PARAM)
1426−#else
1427−int
1428−yyparse (YYPARSE_PARAM)
1429− void *YYPARSE_PARAM;
1430−#endif
1431−#else /* ! YYPARSE_PARAM */
1432−#if (defined __STDC__ || defined __C99__FUNC__ \
1433− || defined __cplusplus || defined _MSC_VER)
14341268 int
14351269 yyparse (void)
1436−#else
1437−int
1438−yyparse ()
1439−
1440−#endif
1441−#endif
14421270 {
14431271 int yystate;
14441272 /* Number of tokens to shift before error messages enabled. */
14451273 int yyerrstatus;
14461274
14471275 /* The stacks and their tools:
1448− `yyss': related to states.
1449− `yyvs': related to semantic values.
1276+ 'yyss': related to states.
1277+ 'yyvs': related to semantic values.
14501278
14511279 Refer to the stacks through separate pointers, to allow yyoverflow
14521280 to reallocate them elsewhere. */
@@ -1466,7 +1294,7 @@ yyparse () · 13 unmodified lines
14661294 int yyn;
14671295 int yyresult;
14681296 /* Lookahead token as an internal (translated) token number. */
1469− int yytoken;
1297+ int yytoken = 0;
14701298 /* The variables used to return semantic value and location from the
14711299 action routines. */
14721300 YYSTYPE yyval;
@@ -1484,9 +1312,8 @@ yyparse () · 11 unmodified lines
14841312 Keep to zero when no symbol should be popped. */
14851313 int yylen = 0;
14861314
1487− yytoken = 0;
1488− yyss = yyssa;
1489− yyvs = yyvsa;
1315+ yyssp = yyss = yyssa;
1316+ yyvsp = yyvs = yyvsa;
14901317 yystacksize = YYINITDEPTH;
14911318
14921319 YYDPRINTF ((stderr, "Starting parse\n"));
@@ -1495,14 +1322,6 @@ yyparse () · 2 unmodified lines
14951322 yyerrstatus = 0;
14961323 yynerrs = 0;
14971324 yychar = YYEMPTY; /* Cause a token to be read. */
1498−
1499− /* Initialize stack pointers.
1500− Waste one element of value and location stack
1501− so that they stay on the same level as the state stack.
1502− The wasted elements are never initialized. */
1503− yyssp = yyss;
1504− yyvsp = yyvs;
1505−
15061325 goto yysetstate;
15071326
15081327 /*------------------------------------------------------------.
@@ -1523,23 +1342,23 @@ yyparse () · 14 unmodified lines
15231342
15241343 #ifdef yyoverflow
15251344 {
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;
1531−
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);
1540−
1541− yyss = yyss1;
1542− yyvs = yyvs1;
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;
1350+
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);
1359+
1360+ yyss = yyss1;
1361+ yyvs = yyvs1;
15431362 }
15441363 #else /* no yyoverflow */
15451364 # ifndef YYSTACK_RELOCATE
@@ -1547,22 +1366,22 @@ yyparse () · 1 unmodified line
15471366 # else
15481367 /* Extend the stack our own way. */
15491368 if (YYMAXDEPTH <= yystacksize)
1550− goto yyexhaustedlab;
1369+ goto yyexhaustedlab;
15511370 yystacksize *= 2;
15521371 if (YYMAXDEPTH < yystacksize)
1553− yystacksize = YYMAXDEPTH;
1372+ yystacksize = YYMAXDEPTH;
15541373
15551374 {
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);
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);
15631382 # undef YYSTACK_RELOCATE
1564− if (yyss1 != yyssa)
1565− YYSTACK_FREE (yyss1);
1383+ if (yyss1 != yyssa)
1384+ YYSTACK_FREE (yyss1);
15661385 }
15671386 # endif
15681387 #endif /* no yyoverflow */
@@ -1571,10 +1390,10 @@ yyparse () · 2 unmodified lines
15711390 yyvsp = yyvs + yysize - 1;
15721391
15731392 YYDPRINTF ((stderr, "Stack size increased to %lu\n",
1574− (unsigned long int) yystacksize));
1393+ (unsigned long int) yystacksize));
15751394
15761395 if (yyss + yystacksize - 1 <= yyssp)
1577− YYABORT;
1396+ YYABORT;
15781397 }
15791398
15801399 YYDPRINTF ((stderr, "Entering state %d\n", yystate));
@@ -1603,7 +1422,7 @@ yybackup: · 22 unmodified lines
16031422 if (yychar == YYEMPTY)
16041423 {
16051424 YYDPRINTF ((stderr, "Reading a token: "));
1606− yychar = YYLEX;
1425+ yychar = yylex ();
16071426 }
16081427
16091428 if (yychar <= YYEOF)
@@ -1643,7 +1462,9 @@ yybackup: · 33 unmodified lines
16431462 yychar = YYEMPTY;
16441463
16451464 yystate = yyn;
1465+ YY_IGNORE_MAYBE_UNINITIALIZED_BEGIN
16461466 *++yyvsp = yylval;
1467+ YY_IGNORE_MAYBE_UNINITIALIZED_END
16471468
16481469 goto yynewstate;
16491470
@@ -1666,7 +1487,7 @@ yyreduce: · 16 unmodified lines
16661487 yylen = yyr2[yyn];
16671488
16681489 /* If YYLEN is nonzero, implement the default value of the action:
1669− `$$ = $1'.
1490+ '$$ = $1'.
16701491
16711492 Otherwise, the following line sets YYVAL to garbage.
16721493 This behavior is undocumented and Bison
@@ -1682,64 +1503,73 @@ yyreduce: · 9 unmodified lines
16821503 case 10:
16831504
16841505 { zconf_error("unexpected end statement"); }
1506+
16851507 break;
16861508
16871509 case 11:
16881510
1689− { zconf_error("unknown statement \"%s\"", (yyvsp[(2) - (4)].string)); }
1511+ { zconf_error("unknown statement \"%s\"", (yyvsp[-2].string)); }
1512+
16901513 break;
16911514
16921515 case 12:
16931516
16941517 {
1695− zconf_error("unexpected option \"%s\"", kconf_id_strings + (yyvsp[(2) - (4)].id)->name);
1518+ zconf_error("unexpected option \"%s\"", kconf_id_strings + (yyvsp[-2].id)->name);
16961519 }
1520+
16971521 break;
16981522
16991523 case 13:
17001524
17011525 { zconf_error("invalid statement"); }
1526+
17021527 break;
17031528
1704− case 28:
1529+ case 29:
1530+
1531+ { zconf_error("unknown option \"%s\"", (yyvsp[-2].string)); }
17051532
1706− { zconf_error("unknown option \"%s\"", (yyvsp[(1) - (3)].string)); }
17071533 break;
17081534
1709− case 29:
1535+ case 30:
17101536
17111537 { zconf_error("invalid option"); }
1538+
17121539 break;
17131540
1714− case 30:
1541+ case 31:
17151542
17161543 {
1717− struct symbol *sym = sym_lookup((yyvsp[(2) - (3)].string), 0);
1544+ struct symbol *sym = sym_lookup((yyvsp[-1].string), 0);
17181545 sym->flags |= SYMBOL_OPTIONAL;
17191546 menu_add_entry(sym);
1720− printd(DEBUG_PARSE, "%s:%d:config %s\n", zconf_curname(), zconf_lineno(), (yyvsp[(2) - (3)].string));
1547+ printd(DEBUG_PARSE, "%s:%d:config %s\n", zconf_curname(), zconf_lineno(), (yyvsp[-1].string));
17211548 }
1549+
17221550 break;
17231551
1724− case 31:
1552+ case 32:
17251553
17261554 {
17271555 menu_end_entry();
17281556 printd(DEBUG_PARSE, "%s:%d:endconfig\n", zconf_curname(), zconf_lineno());
17291557 }
1558+
17301559 break;
17311560
1732− case 32:
1561+ case 33:
17331562
17341563 {
1735− struct symbol *sym = sym_lookup((yyvsp[(2) - (3)].string), 0);
1564+ struct symbol *sym = sym_lookup((yyvsp[-1].string), 0);
17361565 sym->flags |= SYMBOL_OPTIONAL;
17371566 menu_add_entry(sym);
1738− printd(DEBUG_PARSE, "%s:%d:menuconfig %s\n", zconf_curname(), zconf_lineno(), (yyvsp[(2) - (3)].string));
1567+ printd(DEBUG_PARSE, "%s:%d:menuconfig %s\n", zconf_curname(), zconf_lineno(), (yyvsp[-1].string));
17391568 }
1569+
17401570 break;
17411571
1742− case 33:
1572+ case 34:
17431573
17441574 {
17451575 if (current_entry->prompt)
@@ -1749,352 +1579,410 @@ yyreduce: · 3 unmodified lines
17491579 menu_end_entry();
17501580 printd(DEBUG_PARSE, "%s:%d:endconfig\n", zconf_curname(), zconf_lineno());
17511581 }
1582+
17521583 break;
17531584
1754− case 41:
1585+ case 42:
17551586
17561587 {
1757− menu_set_type((yyvsp[(1) - (3)].id)->stype);
1588+ menu_set_type((yyvsp[-2].id)->stype);
17581589 printd(DEBUG_PARSE, "%s:%d:type(%u)\n",
17591590 zconf_curname(), zconf_lineno(),
1760− (yyvsp[(1) - (3)].id)->stype);
1591+ (yyvsp[-2].id)->stype);
17611592 }
1593+
17621594 break;
17631595
1764− case 42:
1596+ case 43:
17651597
17661598 {
1767− menu_add_prompt(P_PROMPT, (yyvsp[(2) - (4)].string), (yyvsp[(3) - (4)].expr));
1599+ menu_add_prompt(P_PROMPT, (yyvsp[-2].string), (yyvsp[-1].expr));
17681600 printd(DEBUG_PARSE, "%s:%d:prompt\n", zconf_curname(), zconf_lineno());
17691601 }
1602+
17701603 break;
17711604
1772− case 43:
1605+ case 44:
17731606
17741607 {
1775− menu_add_expr(P_DEFAULT, (yyvsp[(2) - (4)].expr), (yyvsp[(3) - (4)].expr));
1776− if ((yyvsp[(1) - (4)].id)->stype != S_UNKNOWN)
1777− menu_set_type((yyvsp[(1) - (4)].id)->stype);
1608+ menu_add_expr(P_DEFAULT, (yyvsp[-2].expr), (yyvsp[-1].expr));
1609+ if ((yyvsp[-3].id)->stype != S_UNKNOWN)
1610+ menu_set_type((yyvsp[-3].id)->stype);
17781611 printd(DEBUG_PARSE, "%s:%d:default(%u)\n",
17791612 zconf_curname(), zconf_lineno(),
1780− (yyvsp[(1) - (4)].id)->stype);
1613+ (yyvsp[-3].id)->stype);
17811614 }
1615+
17821616 break;
17831617
1784− case 44:
1618+ case 45:
17851619
17861620 {
1787− menu_add_symbol(P_SELECT, sym_lookup((yyvsp[(2) - (4)].string), 0), (yyvsp[(3) - (4)].expr));
1621+ menu_add_symbol(P_SELECT, sym_lookup((yyvsp[-2].string), 0), (yyvsp[-1].expr));
17881622 printd(DEBUG_PARSE, "%s:%d:select\n", zconf_curname(), zconf_lineno());
17891623 }
1624+
17901625 break;
17911626
1792− case 45:
1627+ case 46:
17931628
17941629 {
1795− menu_add_expr(P_RANGE, expr_alloc_comp(E_RANGE,(yyvsp[(2) - (5)].symbol), (yyvsp[(3) - (5)].symbol)), (yyvsp[(4) - (5)].expr));
1630+ menu_add_symbol(P_IMPLY, sym_lookup((yyvsp[-2].string), 0), (yyvsp[-1].expr));
1631+ printd(DEBUG_PARSE, "%s:%d:imply\n", zconf_curname(), zconf_lineno());
1632+}
1633+
1634+ break;
1635+
1636+ case 47:
1637+
1638+ {
1639+ menu_add_expr(P_RANGE, expr_alloc_comp(E_RANGE,(yyvsp[-3].symbol), (yyvsp[-2].symbol)), (yyvsp[-1].expr));
17961640 printd(DEBUG_PARSE, "%s:%d:range\n", zconf_curname(), zconf_lineno());
17971641 }
1642+
17981643 break;
17991644
1800− case 48:
1645+ case 50:
18011646
18021647 {
1803− const struct kconf_id *id = kconf_id_lookup((yyvsp[(2) - (3)].string), strlen((yyvsp[(2) - (3)].string)));
1648+ const struct kconf_id *id = kconf_id_lookup((yyvsp[-1].string), strlen((yyvsp[-1].string)));
18041649 if (id && id->flags & TF_OPTION)
1805− menu_add_option(id->token, (yyvsp[(3) - (3)].string));
1650+ menu_add_option(id->token, (yyvsp[0].string));
18061651 else
1807− zconfprint("warning: ignoring unknown option %s", (yyvsp[(2) - (3)].string));
1808− free((yyvsp[(2) - (3)].string));
1652+ zconfprint("warning: ignoring unknown option %s", (yyvsp[-1].string));
1653+ free((yyvsp[-1].string));
18091654 }
1655+
18101656 break;
18111657
1812− case 49:
1658+ case 51:
18131659
18141660 { (yyval.string) = NULL; }
1661+
18151662 break;
18161663
1817− case 50:
1664+ case 52:
1665+
1666+ { (yyval.string) = (yyvsp[0].string); }
18181667
1819− { (yyval.string) = (yyvsp[(2) - (2)].string); }
18201668 break;
18211669
1822− case 51:
1670+ case 53:
18231671
18241672 {
1825− struct symbol *sym = sym_lookup((yyvsp[(2) - (3)].string), SYMBOL_CHOICE);
1673+ struct symbol *sym = sym_lookup((yyvsp[-1].string), SYMBOL_CHOICE);
18261674 sym->flags |= SYMBOL_AUTO;
18271675 menu_add_entry(sym);
18281676 menu_add_expr(P_CHOICE, NULL, NULL);
18291677 printd(DEBUG_PARSE, "%s:%d:choice\n", zconf_curname(), zconf_lineno());
18301678 }
1679+
18311680 break;
18321681
1833− case 52:
1682+ case 54:
18341683
18351684 {
18361685 (yyval.menu) = menu_add_menu();
18371686 }
1687+
18381688 break;
18391689
1840− case 53:
1690+ case 55:
18411691
18421692 {
1843− if (zconf_endtoken((yyvsp[(1) - (1)].id), T_CHOICE, T_ENDCHOICE)) {
1693+ if (zconf_endtoken((yyvsp[0].id), T_CHOICE, T_ENDCHOICE)) {
18441694 menu_end_menu();
18451695 printd(DEBUG_PARSE, "%s:%d:endchoice\n", zconf_curname(), zconf_lineno());
18461696 }
18471697 }
1698+
18481699 break;
18491700
1850− case 61:
1701+ case 63:
18511702
18521703 {
1853− menu_add_prompt(P_PROMPT, (yyvsp[(2) - (4)].string), (yyvsp[(3) - (4)].expr));
1704+ menu_add_prompt(P_PROMPT, (yyvsp[-2].string), (yyvsp[-1].expr));
18541705 printd(DEBUG_PARSE, "%s:%d:prompt\n", zconf_curname(), zconf_lineno());
18551706 }
1707+
18561708 break;
18571709
1858− case 62:
1710+ case 64:
18591711
18601712 {
1861− if ((yyvsp[(1) - (3)].id)->stype == S_BOOLEAN || (yyvsp[(1) - (3)].id)->stype == S_TRISTATE) {
1862− menu_set_type((yyvsp[(1) - (3)].id)->stype);
1713+ if ((yyvsp[-2].id)->stype == S_BOOLEAN || (yyvsp[-2].id)->stype == S_TRISTATE) {
1714+ menu_set_type((yyvsp[-2].id)->stype);
18631715 printd(DEBUG_PARSE, "%s:%d:type(%u)\n",
18641716 zconf_curname(), zconf_lineno(),
1865− (yyvsp[(1) - (3)].id)->stype);
1717+ (yyvsp[-2].id)->stype);
18661718 } else
18671719 YYERROR;
18681720 }
1721+
18691722 break;
18701723
1871− case 63:
1724+ case 65:
18721725
18731726 {
18741727 current_entry->sym->flags |= SYMBOL_OPTIONAL;
18751728 printd(DEBUG_PARSE, "%s:%d:optional\n", zconf_curname(), zconf_lineno());
18761729 }
1730+
18771731 break;
18781732
1879− case 64:
1733+ case 66:
18801734
18811735 {
1882− if ((yyvsp[(1) - (4)].id)->stype == S_UNKNOWN) {
1883− menu_add_symbol(P_DEFAULT, sym_lookup((yyvsp[(2) - (4)].string), 0), (yyvsp[(3) - (4)].expr));
1736+ if ((yyvsp[-3].id)->stype == S_UNKNOWN) {
1737+ menu_add_symbol(P_DEFAULT, sym_lookup((yyvsp[-2].string), 0), (yyvsp[-1].expr));
18841738 printd(DEBUG_PARSE, "%s:%d:default\n",
18851739 zconf_curname(), zconf_lineno());
18861740 } else
18871741 YYERROR;
18881742 }
1743+
18891744 break;
18901745
1891− case 67:
1746+ case 69:
18921747
18931748 {
18941749 printd(DEBUG_PARSE, "%s:%d:if\n", zconf_curname(), zconf_lineno());
18951750 menu_add_entry(NULL);
1896− menu_add_dep((yyvsp[(2) - (3)].expr));
1751+ menu_add_dep((yyvsp[-1].expr));
18971752 (yyval.menu) = menu_add_menu();
18981753 }
1754+
18991755 break;
19001756
1901− case 68:
1757+ case 70:
19021758
19031759 {
1904− if (zconf_endtoken((yyvsp[(1) - (1)].id), T_IF, T_ENDIF)) {
1760+ if (zconf_endtoken((yyvsp[0].id), T_IF, T_ENDIF)) {
19051761 menu_end_menu();
19061762 printd(DEBUG_PARSE, "%s:%d:endif\n", zconf_curname(), zconf_lineno());
19071763 }
19081764 }
1765+
19091766 break;
19101767
1911− case 74:
1768+ case 76:
19121769
19131770 {
1914− menu_add_prompt(P_MENU, (yyvsp[(2) - (3)].string), NULL);
1771+ menu_add_prompt(P_MENU, (yyvsp[-1].string), NULL);
19151772 }
1773+
19161774 break;
19171775
1918− case 75:
1776+ case 77:
19191777
19201778 {
19211779 menu_add_entry(NULL);
1922− menu_add_prompt(P_MENU, (yyvsp[(2) - (3)].string), NULL);
1780+ menu_add_prompt(P_MENU, (yyvsp[-1].string), NULL);
19231781 printd(DEBUG_PARSE, "%s:%d:menu\n", zconf_curname(), zconf_lineno());
19241782 }
1783+
19251784 break;
19261785
1927− case 76:
1786+ case 78:
19281787
19291788 {
19301789 (yyval.menu) = menu_add_menu();
19311790 }
1791+
19321792 break;
19331793
1934− case 77:
1794+ case 79:
19351795
19361796 {
1937− if (zconf_endtoken((yyvsp[(1) - (1)].id), T_MENU, T_ENDMENU)) {
1797+ if (zconf_endtoken((yyvsp[0].id), T_MENU, T_ENDMENU)) {
19381798 menu_end_menu();
19391799 printd(DEBUG_PARSE, "%s:%d:endmenu\n", zconf_curname(), zconf_lineno());
19401800 }
19411801 }
1802+
19421803 break;
19431804
1944− case 83:
1805+ case 85:
19451806
19461807 {
1947− printd(DEBUG_PARSE, "%s:%d:source %s\n", zconf_curname(), zconf_lineno(), (yyvsp[(2) - (3)].string));
1948− zconf_nextfile((yyvsp[(2) - (3)].string));
1808+ printd(DEBUG_PARSE, "%s:%d:source %s\n", zconf_curname(), zconf_lineno(), (yyvsp[-1].string));
1809+ zconf_nextfile((yyvsp[-1].string));
19491810 }
1811+
19501812 break;
19511813
1952− case 84:
1814+ case 86:
19531815
19541816 {
19551817 menu_add_entry(NULL);
1956− menu_add_prompt(P_COMMENT, (yyvsp[(2) - (3)].string), NULL);
1818+ menu_add_prompt(P_COMMENT, (yyvsp[-1].string), NULL);
19571819 printd(DEBUG_PARSE, "%s:%d:comment\n", zconf_curname(), zconf_lineno());
19581820 }
1821+
19591822 break;
19601823
1961− case 85:
1824+ case 87:
19621825
19631826 {
19641827 menu_end_entry();
19651828 }
1829+
19661830 break;
19671831
1968− case 86:
1832+ case 88:
19691833
19701834 {
19711835 printd(DEBUG_PARSE, "%s:%d:help\n", zconf_curname(), zconf_lineno());
19721836 zconf_starthelp();
19731837 }
1838+
19741839 break;
19751840
1976− case 87:
1841+ case 89:
19771842
19781843 {
1979− current_entry->help = (yyvsp[(2) - (2)].string);
1844+ current_entry->help = (yyvsp[0].string);
19801845 }
1846+
19811847 break;
19821848
1983− case 92:
1849+ case 94:
19841850
19851851 {
1986− menu_add_dep((yyvsp[(3) - (4)].expr));
1852+ menu_add_dep((yyvsp[-1].expr));
19871853 printd(DEBUG_PARSE, "%s:%d:depends on\n", zconf_curname(), zconf_lineno());
19881854 }
1989− break;
1990−
1991− case 96:
19921855
1993− {
1994− menu_add_visibility((yyvsp[(2) - (2)].expr));
1995−}
19961856 break;
19971857
19981858 case 98:
19991859
20001860 {
2001− menu_add_prompt(P_PROMPT, (yyvsp[(1) - (2)].string), (yyvsp[(2) - (2)].expr));
1861+ menu_add_visibility((yyvsp[0].expr));
20021862 }
2003− break;
20041863
2005− case 101:
2006−
2007− { (yyval.id) = (yyvsp[(1) - (2)].id); }
20081864 break;
20091865
2010− case 102:
1866+ case 100:
1867+
1868+ {
1869+ menu_add_prompt(P_PROMPT, (yyvsp[-1].string), (yyvsp[0].expr));
1870+}
20111871
2012− { (yyval.id) = (yyvsp[(1) - (2)].id); }
20131872 break;
20141873
20151874 case 103:
20161875
2017− { (yyval.id) = (yyvsp[(1) - (2)].id); }
1876+ { (yyval.id) = (yyvsp[-1].id); }
1877+
20181878 break;
20191879
2020− case 106:
1880+ case 104:
1881+
1882+ { (yyval.id) = (yyvsp[-1].id); }
20211883
2022− { (yyval.expr) = NULL; }
20231884 break;
20241885
2025− case 107:
1886+ case 105:
1887+
1888+ { (yyval.id) = (yyvsp[-1].id); }
20261889
2027− { (yyval.expr) = (yyvsp[(2) - (2)].expr); }
20281890 break;
20291891
20301892 case 108:
20311893
2032− { (yyval.expr) = expr_alloc_symbol((yyvsp[(1) - (1)].symbol)); }
1894+ { (yyval.expr) = NULL; }
1895+
20331896 break;
20341897
20351898 case 109:
20361899
2037− { (yyval.expr) = expr_alloc_comp(E_LTH, (yyvsp[(1) - (3)].symbol), (yyvsp[(3) - (3)].symbol)); }
1900+ { (yyval.expr) = (yyvsp[0].expr); }
1901+
20381902 break;
20391903
20401904 case 110:
20411905
2042− { (yyval.expr) = expr_alloc_comp(E_LEQ, (yyvsp[(1) - (3)].symbol), (yyvsp[(3) - (3)].symbol)); }
1906+ { (yyval.expr) = expr_alloc_symbol((yyvsp[0].symbol)); }
1907+
20431908 break;
20441909
20451910 case 111:
20461911
2047− { (yyval.expr) = expr_alloc_comp(E_GTH, (yyvsp[(1) - (3)].symbol), (yyvsp[(3) - (3)].symbol)); }
1912+ { (yyval.expr) = expr_alloc_comp(E_LTH, (yyvsp[-2].symbol), (yyvsp[0].symbol)); }
1913+
20481914 break;
20491915
20501916 case 112:
20511917
2052− { (yyval.expr) = expr_alloc_comp(E_GEQ, (yyvsp[(1) - (3)].symbol), (yyvsp[(3) - (3)].symbol)); }
1918+ { (yyval.expr) = expr_alloc_comp(E_LEQ, (yyvsp[-2].symbol), (yyvsp[0].symbol)); }
1919+
20531920 break;
20541921
20551922 case 113:
20561923
2057− { (yyval.expr) = expr_alloc_comp(E_EQUAL, (yyvsp[(1) - (3)].symbol), (yyvsp[(3) - (3)].symbol)); }
1924+ { (yyval.expr) = expr_alloc_comp(E_GTH, (yyvsp[-2].symbol), (yyvsp[0].symbol)); }
1925+
20581926 break;
20591927
20601928 case 114:
20611929
2062− { (yyval.expr) = expr_alloc_comp(E_UNEQUAL, (yyvsp[(1) - (3)].symbol), (yyvsp[(3) - (3)].symbol)); }
1930+ { (yyval.expr) = expr_alloc_comp(E_GEQ, (yyvsp[-2].symbol), (yyvsp[0].symbol)); }
1931+
20631932 break;
20641933
20651934 case 115:
20661935
2067− { (yyval.expr) = (yyvsp[(2) - (3)].expr); }
1936+ { (yyval.expr) = expr_alloc_comp(E_EQUAL, (yyvsp[-2].symbol), (yyvsp[0].symbol)); }
1937+
20681938 break;
20691939
20701940 case 116:
20711941
2072− { (yyval.expr) = expr_alloc_one(E_NOT, (yyvsp[(2) - (2)].expr)); }
1942+ { (yyval.expr) = expr_alloc_comp(E_UNEQUAL, (yyvsp[-2].symbol), (yyvsp[0].symbol)); }
1943+
20731944 break;
20741945
20751946 case 117:
20761947
2077− { (yyval.expr) = expr_alloc_two(E_OR, (yyvsp[(1) - (3)].expr), (yyvsp[(3) - (3)].expr)); }
1948+ { (yyval.expr) = (yyvsp[-1].expr); }
1949+
20781950 break;
20791951
20801952 case 118:
20811953
2082− { (yyval.expr) = expr_alloc_two(E_AND, (yyvsp[(1) - (3)].expr), (yyvsp[(3) - (3)].expr)); }
1954+ { (yyval.expr) = expr_alloc_one(E_NOT, (yyvsp[0].expr)); }
1955+
20831956 break;
20841957
20851958 case 119:
20861959
2087− { (yyval.symbol) = sym_lookup((yyvsp[(1) - (1)].string), 0); free((yyvsp[(1) - (1)].string)); }
1960+ { (yyval.expr) = expr_alloc_two(E_OR, (yyvsp[-2].expr), (yyvsp[0].expr)); }
1961+
20881962 break;
20891963
20901964 case 120:
20911965
2092− { (yyval.symbol) = sym_lookup((yyvsp[(1) - (1)].string), SYMBOL_CONST); free((yyvsp[(1) - (1)].string)); }
1966+ { (yyval.expr) = expr_alloc_two(E_AND, (yyvsp[-2].expr), (yyvsp[0].expr)); }
1967+
20931968 break;
20941969
20951970 case 121:
20961971
1972+ { (yyval.symbol) = sym_lookup((yyvsp[0].string), 0); free((yyvsp[0].string)); }
1973+
1974+ break;
1975+
1976+ case 122:
1977+
1978+ { (yyval.symbol) = sym_lookup((yyvsp[0].string), SYMBOL_CONST); free((yyvsp[0].string)); }
1979+
1980+ break;
1981+
1982+ case 123:
1983+
20971984 { (yyval.string) = NULL; }
1985+
20981986 break;
20991987
21001988
@@ -2120,7 +2008,7 @@ yyreduce: · 19 unmodified lines
21202008
21212009 *++yyvsp = yyval;
21222010
2123− /* Now `shift' the result of the reduction. Determine what state
2011+ /* Now 'shift' the result of the reduction. Determine what state
21242012 that goes to, based on the state we popped back to and the rule
21252013 number reduced by. */
21262014
@@ -2135,9 +2023,9 @@ yyreduce: · 8 unmodified lines
21352023 goto yynewstate;
21362024
21372025
2138−/*------------------------------------.
2139−| yyerrlab -- here on detecting error |
2140−`------------------------------------*/
2026+/*--------------------------------------.
2027+| yyerrlab -- here on detecting error. |
2028+`--------------------------------------*/
21412029 yyerrlab:
21422030 /* Make sure we have latest lookahead translation. See comments at
21432031 user semantic actions for why this is necessary. */
@@ -2188,20 +2076,20 @@ yyerrlab: · 44 unmodified lines
21882076 if (yyerrstatus == 3)
21892077 {
21902078 /* If just tried and failed to reuse lookahead token after an
2191− error, discard it. */
2079+ error, discard it. */
21922080
21932081 if (yychar <= YYEOF)
2194− {
2195− /* Return failure if at end of input. */
2196− if (yychar == YYEOF)
2197− YYABORT;
2198− }
2082+ {
2083+ /* Return failure if at end of input. */
2084+ if (yychar == YYEOF)
2085+ YYABORT;
2086+ }
21992087 else
2200− {
2201− yydestruct ("Error: discarding",
2202− yytoken, &yylval);
2203− yychar = YYEMPTY;
2204− }
2088+ {
2089+ yydestruct ("Error: discarding",
2090+ yytoken, &yylval);
2091+ yychar = YYEMPTY;
2092+ }
22052093 }
22062094
22072095 /* Else will try to reuse lookahead token after shifting the error
@@ -2220,7 +2108,7 @@ yyerrorlab: · 12 unmodified lines
22202108 if (/*CONSTCOND*/ 0)
22212109 goto yyerrorlab;
22222110
2223− /* Do not reclaim the symbols of the rule which action triggered
2111+ /* Do not reclaim the symbols of the rule whose action triggered
22242112 this YYERROR. */
22252113 YYPOPSTACK (yylen);
22262114 yylen = 0;
@@ -2233,35 +2121,37 @@ yyerrorlab: · 6 unmodified lines
22332121 | yyerrlab1 -- common code for both syntax error and YYERROR. |
22342122 `-------------------------------------------------------------*/
22352123 yyerrlab1:
2236− yyerrstatus = 3; /* Each real token shifted decrements this. */
2124+ yyerrstatus = 3; /* Each real token shifted decrements this. */
22372125
22382126 for (;;)
22392127 {
22402128 yyn = yypact[yystate];
22412129 if (!yypact_value_is_default (yyn))
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− }
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+ }
22512139
22522140 /* Pop the current state because it cannot handle the error token. */
22532141 if (yyssp == yyss)
2254− YYABORT;
2142+ YYABORT;
22552143
22562144
22572145 yydestruct ("Error: popping",
2258− yystos[yystate], yyvsp);
2146+ yystos[yystate], yyvsp);
22592147 YYPOPSTACK (1);
22602148 yystate = *yyssp;
22612149 YY_STACK_PRINT (yyss, yyssp);
22622150 }
22632151
2152+ YY_IGNORE_MAYBE_UNINITIALIZED_BEGIN
22642153 *++yyvsp = yylval;
2154+ YY_IGNORE_MAYBE_UNINITIALIZED_END
22652155
22662156
22672157 /* Shift the error token. */
@@ -2304,14 +2194,14 @@ yyreturn: · 36 unmodified lines
23042194 yydestruct ("Cleanup: discarding lookahead",
23052195 yytoken, &yylval);
23062196 }
2307− /* Do not reclaim the symbols of the rule which action triggered
2197+ /* Do not reclaim the symbols of the rule whose action triggered
23082198 this YYABORT or YYACCEPT. */
23092199 YYPOPSTACK (yylen);
23102200 YY_STACK_PRINT (yyss, yyssp);
23112201 while (yyssp != yyss)
23122202 {
23132203 yydestruct ("Cleanup: popping",
2314− yystos[*yyssp], yyvsp);
2204+ yystos[*yyssp], yyvsp);
23152205 YYPOPSTACK (1);
23162206 }
23172207 #ifndef yyoverflow
@@ -2322,14 +2212,11 @@ yyreturn: · 4 unmodified lines
23222212 if (yymsg != yymsgbuf)
23232213 YYSTACK_FREE (yymsg);
23242214 #endif
2325− /* Make sure YYID is used. */
2326− return YYID (yyresult);
2215+ return yyresult;
23272216 }
23282217
23292218
23302219
2331−
2332−
23332220 void conf_parse(const char *name)
23342221 {
23352222 struct symbol *sym;
@@ -2501,6 +2388,11 @@ static void print_symbol(FILE *out, struct menu *menu) · 165 unmodified lines
25012388 expr_fprint(prop->expr, out);
25022389 fputc('\n', out);
25032390 break;
2391+ case P_IMPLY:
2392+ fputs( " imply ", out);
2393+ expr_fprint(prop->expr, out);
2394+ fputc('\n', out);
2395+ break;
25042396 case P_RANGE:
25052397 fputs( " range ", out);
25062398 expr_fprint(prop->expr, out);
@@ -2577,4 +2469,3 @@ void zconfdump(FILE *out) · 70 unmodified lines
25772469 #include "expr.c"
25782470 #include "symbol.c"
25792471 #include "menu.c"
2580−
scripts/kconfig/zconf.y+14−2
@@ -31,7 +31,7 @@ struct symbol *symbol_hash[SYMBOL_HASHSIZE]; · 30 unmodified lines
3131 static struct menu *current_menu, *current_entry;
3232
3333 %}
34−%expect 30
34+%expect 32
3535
3636 %union
3737 {
@@ -62,6 +62,7 @@ static struct menu *current_menu, *current_entry; · 24 unmodified lines
6262 %token <id>T_TYPE
6363 %token <id>T_DEFAULT
6464 %token <id>T_SELECT
65+%token <id>T_IMPLY
6566 %token <id>T_RANGE
6667 %token <id>T_VISIBLE
6768 %token <id>T_OPTION
@@ -124,7 +125,7 @@ stmt_list: · 56 unmodified lines
124125 ;
125126
126127 option_name:
127− T_DEPENDS | T_PROMPT | T_TYPE | T_SELECT | T_OPTIONAL | T_RANGE | T_DEFAULT | T_VISIBLE
128+ T_DEPENDS | T_PROMPT | T_TYPE | T_SELECT | T_IMPLY | T_OPTIONAL | T_RANGE | T_DEFAULT | T_VISIBLE
128129 ;
129130
130131 common_stmt:
@@ -216,6 +217,12 @@ config_option: T_SELECT T_WORD if_expr T_EOL · 85 unmodified lines
216217 printd(DEBUG_PARSE, "%s:%d:select\n", zconf_curname(), zconf_lineno());
217218 };
218219
220+config_option: T_IMPLY T_WORD if_expr T_EOL
221+{
222+ menu_add_symbol(P_IMPLY, sym_lookup($2, 0), $3);
223+ printd(DEBUG_PARSE, "%s:%d:imply\n", zconf_curname(), zconf_lineno());
224+};
225+
219226 config_option: T_RANGE symbol symbol if_expr T_EOL
220227 {
221228 menu_add_expr(P_RANGE, expr_alloc_comp(E_RANGE,$2, $3), $4);
@@ -664,6 +671,11 @@ static void print_symbol(FILE *out, struct menu *menu) · 442 unmodified lines
664671 expr_fprint(prop->expr, out);
665672 fputc('\n', out);
666673 break;
674+ case P_IMPLY:
675+ fputs( " imply ", out);
676+ expr_fprint(prop->expr, out);
677+ fputc('\n', out);
678+ break;
667679 case P_RANGE:
668680 fputs( " range ", out);
669681 expr_fprint(prop->expr, out);
security/selinux/hooks.c+7−4
@@ -2525,7 +2525,8 @@ static void selinux_bprm_committing_creds(struct linux_binprm *bprm) · 2524 unmodified lines
25252525 rlim->rlim_cur = min(rlim->rlim_max, initrlim->rlim_cur);
25262526 }
25272527 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));
25292530 }
25302531 }
25312532
@@ -2555,9 +2556,11 @@ static void selinux_bprm_committed_creds(struct linux_binprm *bprm) · 23 unmodified lines
25552556 */
25562557 rc = avc_has_perm(osid, sid, SECCLASS_PROCESS, PROCESS__SIGINH, NULL);
25572558 if (rc) {
2558− memset(&itimer, 0, sizeof itimer);
2559− for (i = 0; i < 3; i++)
2560− do_setitimer(i, &itimer, NULL);
2559+ if (IS_ENABLED(CONFIG_POSIX_TIMERS)) {
2560+ memset(&itimer, 0, sizeof itimer);
2561+ for (i = 0; i < 3; i++)
2562+ do_setitimer(i, &itimer, NULL);
2563+ }
25612564 spin_lock_irq(&current->sighand->siglock);
25622565 if (!fatal_signal_pending(current)) {
25632566 flush_sigqueue(&current->pending);
tools/testing/selftests/timers/skew_consistency.c+1−1
@@ -57,7 +57,7 @@ int main(int argv, char **argc) · 56 unmodified lines
5757 pid_t pid;
5858
5959
60− printf("Running Asyncrhonous Frequency Changing Tests...\n");
60+ printf("Running Asynchronous Frequency Changing Tests...\n");
6161
6262 pid = fork();
6363 if (!pid)