| 1 | /* Copyright (C) 2001-2020 Free Software Foundation, Inc. | 
|---|
| 2 | This file is part of the GNU C Library. | 
|---|
| 3 |  | 
|---|
| 4 | The GNU C Library is free software; you can redistribute it and/or | 
|---|
| 5 | modify it under the terms of the GNU Lesser General Public | 
|---|
| 6 | License as published by the Free Software Foundation; either | 
|---|
| 7 | version 2.1 of the License, or (at your option) any later version. | 
|---|
| 8 |  | 
|---|
| 9 | The GNU C Library is distributed in the hope that it will be useful, | 
|---|
| 10 | but WITHOUT ANY WARRANTY; without even the implied warranty of | 
|---|
| 11 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU | 
|---|
| 12 | Lesser General Public License for more details. | 
|---|
| 13 |  | 
|---|
| 14 | You should have received a copy of the GNU Lesser General Public | 
|---|
| 15 | License along with the GNU C Library; if not, see | 
|---|
| 16 | <https://www.gnu.org/licenses/>.  */ | 
|---|
| 17 |  | 
|---|
| 18 | #ifndef _SYS_REG_H | 
|---|
| 19 | #define _SYS_REG_H	1 | 
|---|
| 20 |  | 
|---|
| 21 |  | 
|---|
| 22 | #ifdef __x86_64__ | 
|---|
| 23 | /* Index into an array of 8 byte longs returned from ptrace for | 
|---|
| 24 | location of the users' stored general purpose registers.  */ | 
|---|
| 25 |  | 
|---|
| 26 | # define R15	0 | 
|---|
| 27 | # define R14	1 | 
|---|
| 28 | # define R13	2 | 
|---|
| 29 | # define R12	3 | 
|---|
| 30 | # define RBP	4 | 
|---|
| 31 | # define RBX	5 | 
|---|
| 32 | # define R11	6 | 
|---|
| 33 | # define R10	7 | 
|---|
| 34 | # define R9	8 | 
|---|
| 35 | # define R8	9 | 
|---|
| 36 | # define RAX	10 | 
|---|
| 37 | # define RCX	11 | 
|---|
| 38 | # define RDX	12 | 
|---|
| 39 | # define RSI	13 | 
|---|
| 40 | # define RDI	14 | 
|---|
| 41 | # define ORIG_RAX 15 | 
|---|
| 42 | # define RIP	16 | 
|---|
| 43 | # define CS	17 | 
|---|
| 44 | # define EFLAGS	18 | 
|---|
| 45 | # define RSP	19 | 
|---|
| 46 | # define SS	20 | 
|---|
| 47 | # define FS_BASE 21 | 
|---|
| 48 | # define GS_BASE 22 | 
|---|
| 49 | # define DS	23 | 
|---|
| 50 | # define ES	24 | 
|---|
| 51 | # define FS	25 | 
|---|
| 52 | # define GS	26 | 
|---|
| 53 | #else | 
|---|
| 54 |  | 
|---|
| 55 | /* Index into an array of 4 byte integers returned from ptrace for | 
|---|
| 56 | * location of the users' stored general purpose registers. */ | 
|---|
| 57 |  | 
|---|
| 58 | # define EBX 0 | 
|---|
| 59 | # define ECX 1 | 
|---|
| 60 | # define EDX 2 | 
|---|
| 61 | # define ESI 3 | 
|---|
| 62 | # define EDI 4 | 
|---|
| 63 | # define EBP 5 | 
|---|
| 64 | # define EAX 6 | 
|---|
| 65 | # define DS 7 | 
|---|
| 66 | # define ES 8 | 
|---|
| 67 | # define FS 9 | 
|---|
| 68 | # define GS 10 | 
|---|
| 69 | # define ORIG_EAX 11 | 
|---|
| 70 | # define EIP 12 | 
|---|
| 71 | # define CS  13 | 
|---|
| 72 | # define EFL 14 | 
|---|
| 73 | # define UESP 15 | 
|---|
| 74 | # define SS   16 | 
|---|
| 75 | #endif | 
|---|
| 76 |  | 
|---|
| 77 | #endif | 
|---|
| 78 |  | 
|---|