OpenOCD
linux_header.h
Go to the documentation of this file.
1 /* SPDX-License-Identifier: GPL-2.0-or-later */
2 
3 #ifndef OPENOCD_RTOS_LINUX_HEADER_H
4 #define OPENOCD_RTOS_LINUX_HEADER_H
5 
6 /* gdb script to update the header file
7  according to kernel version and build option
8  before executing function awareness
9  kernel symbol must be loaded : symbol vmlinux
10 
11 define awareness
12  set logging off
13  set logging file linux_header.h
14  set logging on
15 
16  printf "#define QAT %p\n",&((struct task_struct *)(0))->stack
17  set $a=&((struct list_head *)(0))->next
18  set $a=(int)$a+(int)&((struct task_struct *)(0))->tasks
19  printf "#define NEXT %p\n",$a
20  printf "#define COMM %p\n",&((struct task_struct *)(0))->comm
21  printf "#define MEM %p\n",&((struct task_struct *)(0))->mm
22  printf "#define ONCPU %p\n",&((struct task_struct *)(0))->on_cpu
23  printf "#define PID %p\n",&((struct task_struct *)(0))->pid
24  printf "#define CPU_CONT %p\n",&((struct thread_info *)(0))->cpu_context
25  printf "#define PREEMPT %p\n",&((struct thread_info *)(0))->preempt_count
26  printf "#define MM_CTX %p\n",&((struct mm_struct *)(0))->context
27  end
28 */
29 #define QAT 0x4
30 #define NEXT 0x1b0
31 #define COMM 0x2d4
32 #define MEM 0x1cc
33 #define ONCPU 0x18
34 #define PID 0x1f4
35 #define CPU_CONT 0x1c
36 #define PREEMPT 0x4
37 #define MM_CTX 0x160
38 
39 #endif /* OPENOCD_RTOS_LINUX_HEADER_H */