The Design and Implementation of the FreeBSD Operating System, Second Edition
Now available: The Design and Implementation of the FreeBSD Operating System (Second Edition)


[ source navigation ] [ diff markup ] [ identifier search ] [ freetext search ] [ file search ] [ list types ] [ track identifier ]

FreeBSD/Linux Kernel Cross Reference
sys/cddl/dev/kinst/amd64/kinst_isa.h

Version: -  FREEBSD  -  FREEBSD-13-STABLE  -  FREEBSD-13-0  -  FREEBSD-12-STABLE  -  FREEBSD-12-0  -  FREEBSD-11-STABLE  -  FREEBSD-11-0  -  FREEBSD-10-STABLE  -  FREEBSD-10-0  -  FREEBSD-9-STABLE  -  FREEBSD-9-0  -  FREEBSD-8-STABLE  -  FREEBSD-8-0  -  FREEBSD-7-STABLE  -  FREEBSD-7-0  -  FREEBSD-6-STABLE  -  FREEBSD-6-0  -  FREEBSD-5-STABLE  -  FREEBSD-5-0  -  FREEBSD-4-STABLE  -  FREEBSD-3-STABLE  -  FREEBSD22  -  l41  -  OPENBSD  -  linux-2.6  -  MK84  -  PLAN9  -  xnu-8792 
SearchContext: -  none  -  3  -  10 

    1 /*
    2  * SPDX-License-Identifier: CDDL 1.0
    3  *
    4  * Copyright 2022 Christos Margiolis <christos@FreeBSD.org>
    5  * Copyright 2022 Mark Johnston <markj@FreeBSD.org>
    6  */
    7 
    8 #ifndef _KINST_ISA_H_
    9 #define _KINST_ISA_H_
   10 
   11 #include <sys/types.h>
   12 
   13 #define KINST_PATCHVAL          0xcc
   14 
   15 /*
   16  * Each trampoline is 32 bytes long and contains [instruction, jmp]. Since we
   17  * have 2 instructions stored in the trampoline, and each of them can take up
   18  * to 16 bytes, 32 bytes is enough to cover even the worst case scenario.
   19  */
   20 #define KINST_TRAMP_SIZE        32
   21 #define KINST_TRAMPCHUNK_SIZE   PAGE_SIZE
   22 
   23 /*
   24  * Fill the trampolines with breakpoint instructions so that the kernel will
   25  * crash cleanly if things somehow go wrong.
   26  */
   27 #define KINST_TRAMP_INIT(t, s)  memset((t), KINST_PATCHVAL, (s))
   28 
   29 typedef uint8_t kinst_patchval_t;
   30 
   31 struct kinst_probe_md {
   32         int                     flags;
   33         int                     instlen;        /* original instr len */
   34         int                     tinstlen;       /* trampoline instr len */
   35         uint8_t                 template[16];   /* copied into thread tramps */
   36         int                     dispoff;        /* offset of rip displacement */
   37 
   38         /* operands to "call" instruction branch target */
   39         int                     reg1;
   40         int                     reg2;
   41         int                     scale;
   42         int64_t                 disp;
   43 };
   44 
   45 #endif /* _KINST_ISA_H_ */

Cache object: a3731c9cf4e2e3349abf70ddaf660a70


[ source navigation ] [ diff markup ] [ identifier search ] [ freetext search ] [ file search ] [ list types ] [ track identifier ]


This page is part of the FreeBSD/Linux Linux Kernel Cross-Reference, and was automatically generated using a modified version of the LXR engine.