Book a Demo!
CoCalc Logo Icon
StoreFeaturesDocsShareSupportNewsAboutPoliciesSign UpSign In
freebsd
GitHub Repository: freebsd/freebsd-src
Path: blob/main/sys/cddl/dev/kinst/amd64/kinst_isa.h
48375 views
1
/*
2
* SPDX-License-Identifier: CDDL 1.0
3
*
4
* Copyright (c) 2022 Christos Margiolis <[email protected]>
5
* Copyright (c) 2022 Mark Johnston <[email protected]>
6
* Copyright (c) 2023 The FreeBSD Foundation
7
*
8
* Portions of this software were developed by Christos Margiolis
9
* <[email protected]> under sponsorship from the FreeBSD Foundation.
10
*/
11
12
#ifndef _KINST_ISA_H_
13
#define _KINST_ISA_H_
14
15
#include <sys/types.h>
16
17
#define KINST_PATCHVAL 0xcc
18
19
/*
20
* Each trampoline is 32 bytes long and contains [instruction, jmp]. Since we
21
* have 2 instructions stored in the trampoline, and each of them can take up
22
* to 16 bytes, 32 bytes is enough to cover even the worst case scenario.
23
*/
24
#define KINST_TRAMP_SIZE 32
25
26
typedef uint8_t kinst_patchval_t;
27
28
struct kinst_probe_md {
29
int flags;
30
int instlen; /* original instr len */
31
int tinstlen; /* trampoline instr len */
32
uint8_t template[16]; /* copied into thread tramps */
33
int dispoff; /* offset of rip displacement */
34
35
/* operands to "call" instruction branch target */
36
int reg1;
37
int reg2;
38
int scale;
39
int64_t disp;
40
};
41
42
#endif /* _KINST_ISA_H_ */
43
44