constants.py.in 1.2 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152
  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. /* We need to stringify expanded macros so that they can be parsed */
  17. #define STRING(x) #x
  18. #define XSTRING(x) STRING(x)
  19. #define LX_VALUE(x) LX_##x = x
  20. #define LX_GDBPARSED(x) LX_##x = gdb.parse_and_eval(XSTRING(x))
  21. /*
  22. * IS_ENABLED generates (a || b) which is not compatible with python
  23. * We can only switch on configuration items we know are available
  24. * Therefore - IS_BUILTIN() is more appropriate
  25. */
  26. #define LX_CONFIG(x) LX_##x = IS_BUILTIN(x)
  27. /* The build system will take care of deleting everything above this marker */
  28. <!-- end-c-headers -->
  29. import gdb
  30. /* linux/fs.h */
  31. LX_VALUE(MS_RDONLY)
  32. LX_VALUE(MS_SYNCHRONOUS)
  33. LX_VALUE(MS_MANDLOCK)
  34. LX_VALUE(MS_DIRSYNC)
  35. LX_VALUE(MS_NOATIME)
  36. LX_VALUE(MS_NODIRATIME)
  37. /* linux/mount.h */
  38. LX_VALUE(MNT_NOSUID)
  39. LX_VALUE(MNT_NODEV)
  40. LX_VALUE(MNT_NOEXEC)
  41. LX_VALUE(MNT_NOATIME)
  42. LX_VALUE(MNT_NODIRATIME)
  43. LX_VALUE(MNT_RELATIME)