~ [ source navigation ] ~ [ diff markup ] ~ [ identifier search ] ~

TOMOYO Linux Cross Reference
Linux/arch/x86/um/user-offsets.c

Version: ~ [ linux-6.11.5 ] ~ [ linux-6.10.14 ] ~ [ linux-6.9.12 ] ~ [ linux-6.8.12 ] ~ [ linux-6.7.12 ] ~ [ linux-6.6.58 ] ~ [ linux-6.5.13 ] ~ [ linux-6.4.16 ] ~ [ linux-6.3.13 ] ~ [ linux-6.2.16 ] ~ [ linux-6.1.114 ] ~ [ linux-6.0.19 ] ~ [ linux-5.19.17 ] ~ [ linux-5.18.19 ] ~ [ linux-5.17.15 ] ~ [ linux-5.16.20 ] ~ [ linux-5.15.169 ] ~ [ linux-5.14.21 ] ~ [ linux-5.13.19 ] ~ [ linux-5.12.19 ] ~ [ linux-5.11.22 ] ~ [ linux-5.10.228 ] ~ [ linux-5.9.16 ] ~ [ linux-5.8.18 ] ~ [ linux-5.7.19 ] ~ [ linux-5.6.19 ] ~ [ linux-5.5.19 ] ~ [ linux-5.4.284 ] ~ [ linux-5.3.18 ] ~ [ linux-5.2.21 ] ~ [ linux-5.1.21 ] ~ [ linux-5.0.21 ] ~ [ linux-4.20.17 ] ~ [ linux-4.19.322 ] ~ [ linux-4.18.20 ] ~ [ linux-4.17.19 ] ~ [ linux-4.16.18 ] ~ [ linux-4.15.18 ] ~ [ linux-4.14.336 ] ~ [ linux-4.13.16 ] ~ [ linux-4.12.14 ] ~ [ linux-4.11.12 ] ~ [ linux-4.10.17 ] ~ [ linux-4.9.337 ] ~ [ linux-4.4.302 ] ~ [ linux-3.10.108 ] ~ [ linux-2.6.32.71 ] ~ [ linux-2.6.0 ] ~ [ linux-2.4.37.11 ] ~ [ unix-v6-master ] ~ [ ccs-tools-1.8.9 ] ~ [ policy-sample ] ~
Architecture: ~ [ i386 ] ~ [ alpha ] ~ [ m68k ] ~ [ mips ] ~ [ ppc ] ~ [ sparc ] ~ [ sparc64 ] ~

  1 // SPDX-License-Identifier: GPL-2.0
  2 #include <stdio.h>
  3 #include <stddef.h>
  4 #include <signal.h>
  5 #include <poll.h>
  6 #include <sys/mman.h>
  7 #include <sys/user.h>
  8 #define __FRAME_OFFSETS
  9 #include <linux/ptrace.h>
 10 #include <asm/types.h>
 11 #include <linux/kbuild.h>
 12 
 13 #define DEFINE_LONGS(sym, val)  \
 14         COMMENT(#val " / sizeof(unsigned long)");       \
 15         DEFINE(sym, val / sizeof(unsigned long))
 16 
 17 /* workaround for a warning with -Wmissing-prototypes */
 18 void foo(void);
 19 
 20 void foo(void)
 21 {
 22 #ifdef __i386__
 23         DEFINE_LONGS(HOST_FP_SIZE, sizeof(struct user_fpregs_struct));
 24         DEFINE_LONGS(HOST_FPX_SIZE, sizeof(struct user_fpxregs_struct));
 25 
 26         DEFINE(HOST_IP, EIP);
 27         DEFINE(HOST_SP, UESP);
 28         DEFINE(HOST_EFLAGS, EFL);
 29         DEFINE(HOST_AX, EAX);
 30         DEFINE(HOST_BX, EBX);
 31         DEFINE(HOST_CX, ECX);
 32         DEFINE(HOST_DX, EDX);
 33         DEFINE(HOST_SI, ESI);
 34         DEFINE(HOST_DI, EDI);
 35         DEFINE(HOST_BP, EBP);
 36         DEFINE(HOST_CS, CS);
 37         DEFINE(HOST_SS, SS);
 38         DEFINE(HOST_DS, DS);
 39         DEFINE(HOST_FS, FS);
 40         DEFINE(HOST_ES, ES);
 41         DEFINE(HOST_GS, GS);
 42         DEFINE(HOST_ORIG_AX, ORIG_EAX);
 43 #else
 44 #ifdef FP_XSTATE_MAGIC1
 45         DEFINE_LONGS(HOST_FP_SIZE, 2696);
 46 #else
 47         DEFINE(HOST_FP_SIZE, sizeof(struct _fpstate) / sizeof(unsigned long));
 48 #endif
 49         DEFINE_LONGS(HOST_BX, RBX);
 50         DEFINE_LONGS(HOST_CX, RCX);
 51         DEFINE_LONGS(HOST_DI, RDI);
 52         DEFINE_LONGS(HOST_SI, RSI);
 53         DEFINE_LONGS(HOST_DX, RDX);
 54         DEFINE_LONGS(HOST_BP, RBP);
 55         DEFINE_LONGS(HOST_AX, RAX);
 56         DEFINE_LONGS(HOST_R8, R8);
 57         DEFINE_LONGS(HOST_R9, R9);
 58         DEFINE_LONGS(HOST_R10, R10);
 59         DEFINE_LONGS(HOST_R11, R11);
 60         DEFINE_LONGS(HOST_R12, R12);
 61         DEFINE_LONGS(HOST_R13, R13);
 62         DEFINE_LONGS(HOST_R14, R14);
 63         DEFINE_LONGS(HOST_R15, R15);
 64         DEFINE_LONGS(HOST_ORIG_AX, ORIG_RAX);
 65         DEFINE_LONGS(HOST_CS, CS);
 66         DEFINE_LONGS(HOST_SS, SS);
 67         DEFINE_LONGS(HOST_EFLAGS, EFLAGS);
 68 #if 0
 69         DEFINE_LONGS(HOST_FS, FS);
 70         DEFINE_LONGS(HOST_GS, GS);
 71         DEFINE_LONGS(HOST_DS, DS);
 72         DEFINE_LONGS(HOST_ES, ES);
 73 #endif
 74 
 75         DEFINE_LONGS(HOST_IP, RIP);
 76         DEFINE_LONGS(HOST_SP, RSP);
 77 #endif
 78 
 79         DEFINE(UM_FRAME_SIZE, sizeof(struct user_regs_struct));
 80         DEFINE(UM_POLLIN, POLLIN);
 81         DEFINE(UM_POLLPRI, POLLPRI);
 82         DEFINE(UM_POLLOUT, POLLOUT);
 83 
 84         DEFINE(UM_PROT_READ, PROT_READ);
 85         DEFINE(UM_PROT_WRITE, PROT_WRITE);
 86         DEFINE(UM_PROT_EXEC, PROT_EXEC);
 87 }
 88 

~ [ source navigation ] ~ [ diff markup ] ~ [ identifier search ] ~

kernel.org | git.kernel.org | LWN.net | Project Home | SVN repository | Mail admin

Linux® is a registered trademark of Linus Torvalds in the United States and other countries.
TOMOYO® is a registered trademark of NTT DATA CORPORATION.

sflogo.php