]>
Commit | Line | Data |
---|---|---|
f197d75f KB |
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 | ||
c1a15399 KB |
15 | #include <linux/fs.h> |
16 | #include <linux/mount.h> | |
e127a73d | 17 | #include <linux/radix-tree.h> |
c1a15399 | 18 | |
f197d75f | 19 | /* We need to stringify expanded macros so that they can be parsed */ |
c1a15399 | 20 | |
f197d75f KB |
21 | #define STRING(x) #x |
22 | #define XSTRING(x) STRING(x) | |
23 | ||
24 | #define LX_VALUE(x) LX_##x = x | |
25 | #define LX_GDBPARSED(x) LX_##x = gdb.parse_and_eval(XSTRING(x)) | |
26 | ||
27 | /* | |
28 | * IS_ENABLED generates (a || b) which is not compatible with python | |
29 | * We can only switch on configuration items we know are available | |
30 | * Therefore - IS_BUILTIN() is more appropriate | |
31 | */ | |
32 | #define LX_CONFIG(x) LX_##x = IS_BUILTIN(x) | |
33 | ||
34 | /* The build system will take care of deleting everything above this marker */ | |
35 | <!-- end-c-headers --> | |
36 | ||
37 | import gdb | |
c1a15399 KB |
38 | |
39 | /* linux/fs.h */ | |
40 | LX_VALUE(MS_RDONLY) | |
41 | LX_VALUE(MS_SYNCHRONOUS) | |
42 | LX_VALUE(MS_MANDLOCK) | |
43 | LX_VALUE(MS_DIRSYNC) | |
44 | LX_VALUE(MS_NOATIME) | |
45 | LX_VALUE(MS_NODIRATIME) | |
46 | ||
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) | |
e127a73d KB |
54 | |
55 | /* linux/radix-tree.h */ | |
56 | LX_VALUE(RADIX_TREE_INDIRECT_PTR) | |
57 | LX_GDBPARSED(RADIX_TREE_HEIGHT_MASK) | |
58 | LX_GDBPARSED(RADIX_TREE_MAP_SHIFT) | |
59 | LX_GDBPARSED(RADIX_TREE_MAP_MASK) |