File: dt_pt_regs.h

package info (click to toggle)
dtrace 2.0.5-1
  • links: PTS
  • area: main
  • in suites: sid
  • size: 24,408 kB
  • sloc: ansic: 61,247; sh: 17,997; asm: 1,717; lex: 947; awk: 754; yacc: 695; perl: 37; sed: 17; makefile: 15
file content (56 lines) | stat: -rw-r--r-- 1,710 bytes parent folder | download
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
/*
 * Oracle Linux DTrace.
 * Copyright (c) 2019, 2022, Oracle and/or its affiliates. All rights reserved.
 * Licensed under the Universal Permissive License v 1.0 as shown at
 * http://oss.oracle.com/licenses/upl.
 */

#ifndef	_DT_PR_REGS_H
#define	_DT_PR_REGS_H

#ifndef __BPF__
# include <sys/ptrace.h>
#endif
#include <asm/ptrace.h>

#ifdef	__cplusplus
extern "C" {
#endif

#if defined(__amd64)
typedef struct pt_regs		dt_pt_regs;
# define PT_REGS_RET		offsetof(dt_pt_regs, rax)
# define PT_REGS_ARG0		offsetof(dt_pt_regs, rdi)
# define PT_REGS_ARG1		offsetof(dt_pt_regs, rsi)
# define PT_REGS_ARG2		offsetof(dt_pt_regs, rdx)
# define PT_REGS_ARG3		offsetof(dt_pt_regs, rcx)
# define PT_REGS_ARG4		offsetof(dt_pt_regs, r8)
# define PT_REGS_ARG5		offsetof(dt_pt_regs, r9)
# define PT_REGS_ARGC		6
# define PT_REGS_ARGSTKBASE	1
# define PT_REGS_IP		offsetof(dt_pt_regs, rip)
# define PT_REGS_SP		offsetof(dt_pt_regs, rsp)
#elif defined(__aarch64__)
typedef struct user_pt_regs	dt_pt_regs;
# define PT_REGS_RET		offsetof(dt_pt_regs, regs[0])
# define PT_REGS_ARG0		offsetof(dt_pt_regs, regs[0])
# define PT_REGS_ARG1		offsetof(dt_pt_regs, regs[1])
# define PT_REGS_ARG2		offsetof(dt_pt_regs, regs[2])
# define PT_REGS_ARG3		offsetof(dt_pt_regs, regs[3])
# define PT_REGS_ARG4		offsetof(dt_pt_regs, regs[4])
# define PT_REGS_ARG5		offsetof(dt_pt_regs, regs[5])
# define PT_REGS_ARG6		offsetof(dt_pt_regs, regs[6])
# define PT_REGS_ARG7		offsetof(dt_pt_regs, regs[7])
# define PT_REGS_ARGC		8
# define PT_REGS_ARGSTKBASE	0
# define PT_REGS_IP		offsetof(dt_pt_regs, pc)
# define PT_REGS_SP		offsetof(dt_pt_regs, sp)
#else
# error ISA not supported
#endif

#ifdef	__cplusplus
}
#endif

#endif	/* _DT_PR_REGS_H */