Home | History | Annotate | Download | only in sys
      1 /*
      2  * Copyright (C) 2014 The Android Open Source Project
      3  * All rights reserved.
      4  *
      5  * Redistribution and use in source and binary forms, with or without
      6  * modification, are permitted provided that the following conditions
      7  * are met:
      8  *  * Redistributions of source code must retain the above copyright
      9  *    notice, this list of conditions and the following disclaimer.
     10  *  * Redistributions in binary form must reproduce the above copyright
     11  *    notice, this list of conditions and the following disclaimer in
     12  *    the documentation and/or other materials provided with the
     13  *    distribution.
     14  *
     15  * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
     16  * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
     17  * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS
     18  * FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE
     19  * COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT,
     20  * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING,
     21  * BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS
     22  * OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED
     23  * AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
     24  * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT
     25  * OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
     26  * SUCH DAMAGE.
     27  */
     28 
     29 #ifndef _SYS_REG_H_
     30 #define _SYS_REG_H_
     31 
     32 #include <sys/cdefs.h>
     33 
     34 #if defined(__i386__)
     35 
     36 #define EBX 0
     37 #define ECX 1
     38 #define EDX 2
     39 #define ESI 3
     40 #define EDI 4
     41 #define EBP 5
     42 #define EAX 6
     43 #define DS 7
     44 #define ES 8
     45 #define FS 9
     46 #define GS 10
     47 #define ORIG_EAX 11
     48 #define EIP 12
     49 #define CS 13
     50 #define EFL 14
     51 #define UESP 15
     52 #define SS 16
     53 
     54 #elif defined(__x86_64__)
     55 
     56 #define R15 0
     57 #define R14 1
     58 #define R13 2
     59 #define R12 3
     60 #define RBP 4
     61 #define RBX 5
     62 #define R11 6
     63 #define R10 7
     64 #define R9 8
     65 #define R8 9
     66 #define RAX 10
     67 #define RCX 11
     68 #define RDX 12
     69 #define RSI 13
     70 #define RDI 14
     71 #define ORIG_RAX 15
     72 #define RIP 16
     73 #define CS 17
     74 #define EFLAGS 18
     75 #define RSP 19
     76 #define SS 20
     77 #define FS_BASE 21
     78 #define GS_BASE 22
     79 #define DS 23
     80 #define ES 24
     81 #define FS 25
     82 #define GS 26
     83 
     84 #endif
     85 
     86 #endif
     87