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 #if defined(__i386__)
     33 
     34 #define EBX 0
     35 #define ECX 1
     36 #define EDX 2
     37 #define ESI 3
     38 #define EDI 4
     39 #define EBP 5
     40 #define EAX 6
     41 #define DS 7
     42 #define ES 8
     43 #define FS 9
     44 #define GS 10
     45 #define ORIG_EAX 11
     46 #define EIP 12
     47 #define CS 13
     48 #define EFL 14
     49 #define UESP 15
     50 #define SS 16
     51 
     52 #elif defined(__x86_64__)
     53 
     54 #define R15 0
     55 #define R14 1
     56 #define R13 2
     57 #define R12 3
     58 #define RBP 4
     59 #define RBX 5
     60 #define R11 6
     61 #define R10 7
     62 #define R9 8
     63 #define R8 9
     64 #define RAX 10
     65 #define RCX 11
     66 #define RDX 12
     67 #define RSI 13
     68 #define RDI 14
     69 #define ORIG_RAX 15
     70 #define RIP 16
     71 #define CS 17
     72 #define EFLAGS 18
     73 #define RSP 19
     74 #define SS 20
     75 #define FS_BASE 21
     76 #define GS_BASE 22
     77 #define DS 23
     78 #define ES 24
     79 #define FS 25
     80 #define GS 26
     81 
     82 #endif
     83 
     84 #endif /* _SYS_REG_H_ */
     85