Back to home page

OSCL-LXR

 
 

    


0001 /* SPDX-License-Identifier: GPL-2.0-or-later */
0002 #ifndef _ASM_UPROBES_H
0003 #define _ASM_UPROBES_H
0004 /*
0005  * User-space Probes (UProbes) for x86
0006  *
0007  * Copyright (C) IBM Corporation, 2008-2011
0008  * Authors:
0009  *  Srikar Dronamraju
0010  *  Jim Keniston
0011  */
0012 
0013 #include <linux/notifier.h>
0014 
0015 typedef u8 uprobe_opcode_t;
0016 
0017 #define MAX_UINSN_BYTES           16
0018 #define UPROBE_XOL_SLOT_BYTES        128    /* to keep it cache aligned */
0019 
0020 #define UPROBE_SWBP_INSN        0xcc
0021 #define UPROBE_SWBP_INSN_SIZE          1
0022 
0023 struct uprobe_xol_ops;
0024 
0025 struct arch_uprobe {
0026     union {
0027         u8          insn[MAX_UINSN_BYTES];
0028         u8          ixol[MAX_UINSN_BYTES];
0029     };
0030 
0031     const struct uprobe_xol_ops *ops;
0032 
0033     union {
0034         struct {
0035             s32 offs;
0036             u8  ilen;
0037             u8  opc1;
0038         }           branch;
0039         struct {
0040             u8  fixups;
0041             u8  ilen;
0042         }           defparam;
0043         struct {
0044             u8  reg_offset; /* to the start of pt_regs */
0045             u8  ilen;
0046         }           push;
0047     };
0048 };
0049 
0050 struct arch_uprobe_task {
0051 #ifdef CONFIG_X86_64
0052     unsigned long           saved_scratch_register;
0053 #endif
0054     unsigned int            saved_trap_nr;
0055     unsigned int            saved_tf;
0056 };
0057 
0058 #endif  /* _ASM_UPROBES_H */