2 * gdb helper commands and functions for Linux kernel debugging
4 * Kernel constants derived from include files.
6 * Copyright (c) 2016 Linaro Ltd
9 * Kieran Bingham <kieran.bingham@linaro.org>
11 * This work is licensed under the terms of the GNU GPL version 2.
15 #include <linux/clk-provider.h>
17 #include <linux/hrtimer.h>
18 #include <linux/irq.h>
19 #include <linux/mount.h>
20 #include <linux/of_fdt.h>
21 #include <linux/radix-tree.h>
22 #include <linux/threads.h>
24 /* We need to stringify expanded macros so that they can be parsed */
27 #define XSTRING(x) STRING(x)
29 #define LX_VALUE(x) LX_##x = x
30 #define LX_GDBPARSED(x) LX_##x = gdb.parse_and_eval(XSTRING(x))
33 * IS_ENABLED generates (a || b) which is not compatible with python
34 * We can only switch on configuration items we know are available
35 * Therefore - IS_BUILTIN() is more appropriate
37 #define LX_CONFIG(x) LX_##x = IS_BUILTIN(x)
39 /* The build system will take care of deleting everything above this marker */
40 <!-- end-c-headers -->
44 LX_CONFIG(CONFIG_DEBUG_INFO_REDUCED)
46 /* linux/clk-provider.h */
47 if IS_BUILTIN(CONFIG_COMMON_CLK):
48 LX_GDBPARSED(CLK_GET_RATE_NOCACHE)
52 LX_VALUE(SB_SYNCHRONOUS)
56 LX_VALUE(SB_NODIRATIME)
59 LX_GDBPARSED(hrtimer_resolution)
62 LX_GDBPARSED(IRQD_LEVEL)
63 LX_GDBPARSED(IRQ_HIDDEN)
66 LX_GDBPARSED(MOD_TEXT)
73 LX_VALUE(MNT_NODIRATIME)
74 LX_VALUE(MNT_RELATIME)
80 LX_VALUE(OF_DT_HEADER)
82 /* linux/radix-tree.h */
83 LX_GDBPARSED(RADIX_TREE_ENTRY_MASK)
84 LX_GDBPARSED(RADIX_TREE_INTERNAL_NODE)
85 LX_GDBPARSED(RADIX_TREE_MAP_SIZE)
86 LX_GDBPARSED(RADIX_TREE_MAP_SHIFT)
87 LX_GDBPARSED(RADIX_TREE_MAP_MASK)
90 LX_CONFIG(CONFIG_GENERIC_CLOCKEVENTS)
91 LX_CONFIG(CONFIG_GENERIC_CLOCKEVENTS_BROADCAST)
92 LX_CONFIG(CONFIG_HIGH_RES_TIMERS)
93 LX_CONFIG(CONFIG_NR_CPUS)
95 LX_CONFIG(CONFIG_TICK_ONESHOT)
96 LX_CONFIG(CONFIG_GENERIC_IRQ_SHOW_LEVEL)
97 LX_CONFIG(CONFIG_X86_LOCAL_APIC)
99 LX_CONFIG(CONFIG_X86_THERMAL_VECTOR)
100 LX_CONFIG(CONFIG_X86_MCE_THRESHOLD)
101 LX_CONFIG(CONFIG_X86_MCE_AMD)
102 LX_CONFIG(CONFIG_X86_MCE)
103 LX_CONFIG(CONFIG_X86_IO_APIC)
104 LX_CONFIG(CONFIG_HAVE_KVM)