Path: blob/main/sys/cddl/dev/kinst/amd64/kinst_isa.h
48375 views
/*1* SPDX-License-Identifier: CDDL 1.02*3* Copyright (c) 2022 Christos Margiolis <[email protected]>4* Copyright (c) 2022 Mark Johnston <[email protected]>5* Copyright (c) 2023 The FreeBSD Foundation6*7* Portions of this software were developed by Christos Margiolis8* <[email protected]> under sponsorship from the FreeBSD Foundation.9*/1011#ifndef _KINST_ISA_H_12#define _KINST_ISA_H_1314#include <sys/types.h>1516#define KINST_PATCHVAL 0xcc1718/*19* Each trampoline is 32 bytes long and contains [instruction, jmp]. Since we20* have 2 instructions stored in the trampoline, and each of them can take up21* to 16 bytes, 32 bytes is enough to cover even the worst case scenario.22*/23#define KINST_TRAMP_SIZE 322425typedef uint8_t kinst_patchval_t;2627struct kinst_probe_md {28int flags;29int instlen; /* original instr len */30int tinstlen; /* trampoline instr len */31uint8_t template[16]; /* copied into thread tramps */32int dispoff; /* offset of rip displacement */3334/* operands to "call" instruction branch target */35int reg1;36int reg2;37int scale;38int64_t disp;39};4041#endif /* _KINST_ISA_H_ */424344