19 #ifndef __TARGET_OS_LINUX_GENERIC_H__
20 #define __TARGET_OS_LINUX_GENERIC_H__
23 #define PAGE_SIZE 0x1000
25 #define THREAD_SIZE 8192
27 #define KERNEL_STACK_OFFSET (5*8)
29 #define THREAD_INFO_GET_CPL(tid) (((tid) & (0x3 << 62)) >> 62)
30 #define THREAD_INFO_GET_TID(tid) ((tid) & 0xffffffff)
31 #define THREAD_INFO_SET_CPL(tid,cpl) (tid) |= (((cpl) & 0x3) << 62)
32 #define THREAD_INFO_SET_TID(tid,pid) (tid) |= (0xffffffff & (pid))
34 #define TIF_32_SYSCALL_TRACE 0
35 #define TIF_32_NOTIFY_RESUME 1
36 #define TIF_32_SIGPENDING 2
37 #define TIF_32_NEED_RESCHED 3
38 #define TIF_32_SINGLESTEP 4
40 #define TIF_32_SYSCALL_EMU 6
41 #define TIF_32_SYSCALL_AUDIT 7
42 #define TIF_32_SECCOMP 8
43 #define TIF_32_RESTORE_SIGMASK 9
44 #define TIF_32_MEMDIE 16
45 #define TIF_32_DEBUG 17
46 #define TIF_32_IO_BITMAP 18
48 #define _TIF_32_SYSCALL_TRACE (1<<TIF_32_SYSCALL_TRACE)
49 #define _TIF_32_NOTIFY_RESUME (1<<TIF_32_NOTIFY_RESUME)
50 #define _TIF_32_SIGPENDING (1<<TIF_32_SIGPENDING)
51 #define _TIF_32_NEED_RESCHED (1<<TIF_32_NEED_RESCHED)
52 #define _TIF_32_SINGLESTEP (1<<TIF_32_SINGLESTEP)
53 #define _TIF_32_IRET (1<<TIF_32_IRET)
54 #define _TIF_32_SYSCALL_EMU (1<<TIF_32_SYSCALL_EMU)
55 #define _TIF_32_SYSCALL_AUDIT (1<<TIF_32_SYSCALL_AUDIT)
56 #define _TIF_32_SECCOMP (1<<TIF_32_SECCOMP)
57 #define _TIF_32_RESTORE_SIGMASK (1<<TIF_32_RESTORE_SIGMASK)
58 #define _TIF_32_DEBUG (1<<TIF_32_DEBUG)
59 #define _TIF_32_IO_BITMAP (1<<TIF_32_IO_BITMAP)
62 #define TIF_64_SYSCALL_TRACE 0
63 #define TIF_64_NOTIFY_RESUME 1
64 #define TIF_64_SIGPENDING 2
65 #define TIF_64_NEED_RESCHED 3
66 #define TIF_64_SINGLESTEP 4
68 #define TIF_64_SYSCALL_AUDIT 7
69 #define TIF_64_SECCOMP 8
71 #define TIF_64_IA32 17
72 #define TIF_64_FORK 18
73 #define TIF_64_ABI_PENDING 19
74 #define TIF_64_MEMDIE 20
76 #define _TIF_64_SYSCALL_TRACE (1<<TIF_64_SYSCALL_TRACE)
77 #define _TIF_64_NOTIFY_RESUME (1<<TIF_64_NOTIFY_RESUME)
78 #define _TIF_64_SIGPENDING (1<<TIF_64_SIGPENDING)
79 #define _TIF_64_SINGLESTEP (1<<TIF_64_SINGLESTEP)
80 #define _TIF_64_NEED_RESCHED (1<<TIF_64_NEED_RESCHED)
81 #define _TIF_64_IRET (1<<TIF_64_IRET)
82 #define _TIF_64_SYSCALL_AUDIT (1<<TIF_64_SYSCALL_AUDIT)
83 #define _TIF_64_SECCOMP (1<<TIF_64_SECCOMP)
84 #define _TIF_64_IA32 (1<<TIF_64_IA32)
85 #define _TIF_64_FORK (1<<TIF_64_FORK)
86 #define _TIF_64_ABI_PENDING (1<<TIF_64_ABI_PENDING)
318 struct value *file,
char *
buf,
int buflen);
320 #define PREEMPT_MASK 0x000000ff
321 #define SOFTIRQ_MASK 0x0000ff00
322 #define HARDIRQ_MASK 0x0fff0000
323 #define PREEMPT_ACTIVE 0x10000000
324 #define PREEMPT_NEED_RESCHED 0x80000000
325 #define PREEMPT_BITSHIFT 0
326 #define SOFTIRQ_BITSHIFT 8
327 #define HARDIRQ_BITSHIFT 16
332 #define PREEMPT_COUNT(p) (((p) & PREEMPT_MASK) >> PREEMPT_BITSHIFT)
333 #define SOFTIRQ_COUNT(p) (((p) & SOFTIRQ_MASK) >> SOFTIRQ_BITSHIFT)
334 #define HARDIRQ_COUNT(p) (((p) & HARDIRQ_MASK) >> HARDIRQ_BITSHIFT)
346 char *list_head_member_name,
int nofree,
351 char *list_head_member_name,
int nofree,
unsigned int thread_struct_has_debugreg
struct bsymbol * module_type
struct symbol * task_struct_type
struct value * os_linux_get_task(struct target *target, tid_t tid)
int os_linux_list_for_each_entry(struct target *t, struct bsymbol *btype, struct bsymbol *list_head, char *list_head_member_name, int nofree, os_linux_list_iterator_t iterator, void *data)
struct symbol * mm_struct_type
unsigned int thread_struct_has_fs
struct symbol * os_linux_get_task_struct_type_ptr(struct target *target)
struct symbol * os_linux_get_task_struct_type(struct target *target)
int os_linux_get_task_pid(struct target *target, struct value *task)
struct probe * active_memory_probe_mremap
struct probe * int3_probe
unsigned int hypervisor_ignores_userspace_exceptions
GHashTable * task_struct_addr_to_thread
struct symbol * pt_regs_type
const char * task_uid_member_name
char * kernel_sysmap_filename
struct bsymbol * thread_entry_f_symbol
const char * thread_sp0_member_name
struct value * os_linux_load_current_task_as_type(struct target *target, struct symbol *datatype, REGVAL kernel_esp)
struct probe * active_thread_entry_probe
struct probe * active_memory_probe_madvise
struct probe * active_memory_probe_mmap_pgoff
struct bsymbol * module_free_symbol
struct probe * active_thread_exit_probe
struct symbol * task_struct_type_ptr
OFFSET irq_count_percpu_offset
struct value * os_linux_load_current_thread_as_type(struct target *target, struct symbol *datatype, REGVAL kernel_esp)
unsigned int thread_struct_has_ds_es
struct bsymbol * thread_exit_f_symbol
GHashTable * mm_addr_to_mm_cache
unsigned int thread_struct_has_debugreg0
num_t os_linux_get_preempt_count(struct target *target)
struct value * task_struct
struct symbol * thread_struct_type
struct bsymbol * thread_entry_v_symbol
int(* os_linux_list_iterator_t)(struct target *t, struct value *value, void *data)
unsigned int thread_struct_has_perf_debugreg
struct probe * active_memory_probe
char * kernel_elf_filename
struct probe * active_memory_probe_mmap
num_t thread_info_preempt_count
const char * task_gid_member_name
struct probe * active_memory_probe_uselib
struct os_linux_vma * vma_cache
struct probe * debug_probe
struct value * os_linux_load_current_task(struct target *target, REGVAL kernel_esp)
OFFSET kernel_stack_percpu_offset
struct value * thread_info
struct bsymbol * thread_exit_v_symbol
unsigned int task_struct_has_thread_info
unsigned int last_thread_count
char * os_linux_file_get_path(struct target *target, struct value *task, struct value *file, char *buf, int buflen)
const char * thread_sp_member_name
struct probe * active_memory_probe_munmap
unsigned int pt_regs_has_fs_gs
unsigned int task_struct_has_stack
const char * thread_info_preempt_count_name
struct bsymbol * module_free_mod_symbol
unsigned int pt_regs_has_ds_es
struct symbol * thread_info_type
struct os_linux_vma * next
struct bsymbol * init_task
struct value * thread_struct
struct probe * active_memory_probe_mprotect
uint8_t thread_auto_gc_counter
struct symbol * os_linux_get_thread_info_type(struct target *target)
ADDR schedule_swap_new_rsp_addr
const char * thread_ip_member_name
int os_linux_get_task_tid(struct target *target, struct value *task)
int os_linux_list_for_each_struct(struct target *t, struct bsymbol *bsymbol, char *list_head_member_name, int nofree, os_linux_list_iterator_t iterator, void *data)