constants.py.in 1.8 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879
  1. /*
  2. * gdb helper commands and functions for Linux kernel debugging
  3. *
  4. * Kernel constants derived from include files.
  5. *
  6. * Copyright (c) 2016 Linaro Ltd
  7. *
  8. * Authors:
  9. * Kieran Bingham <[email protected]>
  10. *
  11. * This work is licensed under the terms of the GNU GPL version 2.
  12. *
  13. */
  14. #include <linux/clk-provider.h>
  15. #include <linux/fs.h>
  16. #include <linux/hrtimer.h>
  17. #include <linux/mount.h>
  18. #include <linux/of_fdt.h>
  19. #include <linux/threads.h>
  20. /* We need to stringify expanded macros so that they can be parsed */
  21. #define STRING(x) #x
  22. #define XSTRING(x) STRING(x)
  23. #define LX_VALUE(x) LX_##x = x
  24. #define LX_GDBPARSED(x) LX_##x = gdb.parse_and_eval(XSTRING(x))
  25. /*
  26. * IS_ENABLED generates (a || b) which is not compatible with python
  27. * We can only switch on configuration items we know are available
  28. * Therefore - IS_BUILTIN() is more appropriate
  29. */
  30. #define LX_CONFIG(x) LX_##x = IS_BUILTIN(x)
  31. /* The build system will take care of deleting everything above this marker */
  32. <!-- end-c-headers -->
  33. import gdb
  34. LX_CONFIG(CONFIG_DEBUG_INFO_REDUCED)
  35. /* linux/clk-provider.h */
  36. if IS_BUILTIN(CONFIG_COMMON_CLK):
  37. LX_GDBPARSED(CLK_GET_RATE_NOCACHE)
  38. /* linux/fs.h */
  39. LX_VALUE(SB_RDONLY)
  40. LX_VALUE(SB_SYNCHRONOUS)
  41. LX_VALUE(SB_MANDLOCK)
  42. LX_VALUE(SB_DIRSYNC)
  43. LX_VALUE(SB_NOATIME)
  44. LX_VALUE(SB_NODIRATIME)
  45. /* linux/htimer.h */
  46. LX_GDBPARSED(hrtimer_resolution)
  47. /* linux/mount.h */
  48. LX_VALUE(MNT_NOSUID)
  49. LX_VALUE(MNT_NODEV)
  50. LX_VALUE(MNT_NOEXEC)
  51. LX_VALUE(MNT_NOATIME)
  52. LX_VALUE(MNT_NODIRATIME)
  53. LX_VALUE(MNT_RELATIME)
  54. /* linux/threads.h */
  55. LX_VALUE(NR_CPUS)
  56. /* linux/of_fdt.h> */
  57. LX_VALUE(OF_DT_HEADER)
  58. /* Kernel Configs */
  59. LX_CONFIG(CONFIG_GENERIC_CLOCKEVENTS)
  60. LX_CONFIG(CONFIG_GENERIC_CLOCKEVENTS_BROADCAST)
  61. LX_CONFIG(CONFIG_HIGH_RES_TIMERS)
  62. LX_CONFIG(CONFIG_NR_CPUS)
  63. LX_CONFIG(CONFIG_OF)
  64. LX_CONFIG(CONFIG_TICK_ONESHOT)