constants.py.in 1.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960
  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 <kieran.bingham@linaro.org>
  10. *
  11. * This work is licensed under the terms of the GNU GPL version 2.
  12. *
  13. */
  14. #include <linux/fs.h>
  15. #include <linux/mount.h>
  16. #include <linux/of_fdt.h>
  17. /* We need to stringify expanded macros so that they can be parsed */
  18. #define STRING(x) #x
  19. #define XSTRING(x) STRING(x)
  20. #define LX_VALUE(x) LX_##x = x
  21. #define LX_GDBPARSED(x) LX_##x = gdb.parse_and_eval(XSTRING(x))
  22. /*
  23. * IS_ENABLED generates (a || b) which is not compatible with python
  24. * We can only switch on configuration items we know are available
  25. * Therefore - IS_BUILTIN() is more appropriate
  26. */
  27. #define LX_CONFIG(x) LX_##x = IS_BUILTIN(x)
  28. /* The build system will take care of deleting everything above this marker */
  29. <!-- end-c-headers -->
  30. import gdb
  31. /* linux/fs.h */
  32. LX_VALUE(MS_RDONLY)
  33. LX_VALUE(MS_SYNCHRONOUS)
  34. LX_VALUE(MS_MANDLOCK)
  35. LX_VALUE(MS_DIRSYNC)
  36. LX_VALUE(MS_NOATIME)
  37. LX_VALUE(MS_NODIRATIME)
  38. /* linux/mount.h */
  39. LX_VALUE(MNT_NOSUID)
  40. LX_VALUE(MNT_NODEV)
  41. LX_VALUE(MNT_NOEXEC)
  42. LX_VALUE(MNT_NOATIME)
  43. LX_VALUE(MNT_NODIRATIME)
  44. LX_VALUE(MNT_RELATIME)
  45. /* linux/of_fdt.h> */
  46. LX_VALUE(OF_DT_HEADER)
  47. /* Kernel Configs */
  48. LX_CONFIG(CONFIG_OF)