Changeset 15147


Ignore:
Timestamp:
Dec 21, 2011, 6:15:31 PM (7 years ago)
Author:
gb
Message:

At least for x86: move some platform-specific constants (register indices)
from x86-constants*.h to platform-*.h. What a concept.

Location:
trunk/source/lisp-kernel
Files:
9 edited

Legend:

Unmodified
Added
Removed
  • trunk/source/lisp-kernel/platform-darwinx8632.h

    r14295 r15147  
    3737#include "x86-constants32.h"
    3838
     39/* offsets into uc_mcontext.ss */
     40
     41#define REG_EAX 0
     42#define REG_EBX 1
     43#define REG_ECX 2
     44#define REG_EDX 3
     45#define REG_EDI 4
     46#define REG_ESI 5
     47#define REG_EBP 6
     48#define REG_ESP 7
     49#define REG_EFL 9
     50#define REG_EIP 10
     51
    3952
    4053/* xp accessors, sigreturn stuff */
  • trunk/source/lisp-kernel/platform-darwinx8664.h

    r14295 r15147  
    3838#include "x86-constants64.h"
    3939
     40#define REG_RAX 0
     41#define REG_RBX 1
     42#define REG_RCX 2
     43#define REG_RDX 3
     44#define REG_RDI 4
     45#define REG_RSI 5
     46#define REG_RBP 6
     47#define REG_RSP 7
     48#define REG_R8 8
     49#define REG_R9 9
     50#define REG_R10 10
     51#define REG_R11 11
     52#define REG_R12 12
     53#define REG_R13 13
     54#define REG_R14 14
     55#define REG_R15 15
     56#define REG_RIP 16
     57#define REG_RFL 17
     58
    4059/* xp accessors, sigreturn stuff */
    4160#define DARWIN_USE_PSEUDO_SIGRETURN 1
  • trunk/source/lisp-kernel/platform-freebsdx8632.h

    r13952 r15147  
    3232#include "x86-constants32.h"
    3333
     34#define REG_EDI 5
     35#define REG_ESI 6
     36#define REG_EBP 7
     37#define REG_ISP 8
     38#define REG_EBX 9
     39#define REG_EDX 10
     40#define REG_ECX 11
     41#define REG_EAX 12
     42#define REG_EIP 15
     43#define REG_EFL 17
     44#define REG_ESP 18
     45
     46
    3447#include "freebsdx8632/fpu.h"
    3548#define xpGPRvector(x) ((natural *)(&((x)->uc_mcontext)))
  • trunk/source/lisp-kernel/platform-freebsdx8664.h

    r14123 r15147  
    3030#include "lisptypes.h"
    3131#include "x86-constants64.h"
     32#define REG_RDI 1
     33#define REG_RSI 2
     34#define REG_RDX 3
     35#define REG_RCX 4
     36#define REG_R8 5
     37#define REG_R9 6
     38#define REG_RAX 7
     39#define REG_RBX 8
     40#define REG_RBP 9
     41#define REG_R10 10
     42#define REG_R11 11
     43#define REG_R12 12
     44#define REG_R13 13
     45#define REG_R14 14
     46#define REG_R15 15
     47#define REG_RIP 20
     48#define REG_RFL 22
     49#define REG_RSP 23
    3250
    3351#include <machine/fpu.h>
  • trunk/source/lisp-kernel/platform-solarisx86.h

    r13960 r15147  
    3131#include "x86-constants32.h"
    3232
     33#include <sys/regset.h>
     34#include <limits.h>
     35#define REG_EAX EAX
     36#define REG_EBX EBX
     37#define REG_ECX ECX
     38#define REG_EDX EDX
     39#define REG_ESI ESI
     40#define REG_EDI EDI
     41#define REG_EBP EBP
     42#define REG_ESP UESP    /* Maybe ... ESP is often 0, but who knows why ? */
     43#define REG_EFL EFL
     44#define REG_EIP EIP
     45
    3346#define xpGPRvector(x) ((x)->uc_mcontext.gregs)
    3447#define xpGPR(x,gprno) (xpGPRvector(x)[gprno])
  • trunk/source/lisp-kernel/platform-win32.h

    r13952 r15147  
    3333#include "x86-constants32.h"
    3434
     35/* Offsets relative to _CONTEXT.Edi */
     36#define REG_EDI 0
     37#define REG_ESI 1
     38#define REG_EBX 2
     39#define REG_EDX 3
     40#define REG_ECX 4
     41#define REG_EAX 5
     42#define REG_EBP 6
     43#define REG_EIP 7
     44#define REG_EFL 9
     45#define REG_ESP 10
     46
    3547#define xpGPRvector(x) ((DWORD *)(&(x)->Edi))
    3648#define xpGPR(x,gprno) (xpGPRvector(x)[gprno])
  • trunk/source/lisp-kernel/platform-win64.h

    r13952 r15147  
    3434#include "x86-constants64.h"
    3535
     36/* DWORD64 indices in &(CONTEXT->Rax) */
     37#define REG_RAX     0
     38#define REG_RCX     1
     39#define REG_RDX     2
     40#define REG_RBX     3
     41#define REG_RSP     4
     42#define REG_RBP     5
     43#define REG_RSI     6
     44#define REG_RDI     7
     45#define REG_R8      8
     46#define REG_R9      9
     47#define REG_R10     10
     48#define REG_R11     11
     49#define REG_R12     12
     50#define REG_R13     13
     51#define REG_R14     14
     52#define REG_R15     15
     53#define REG_RIP     16
     54
    3655#define xpGPRvector(x) ((DWORD64 *)(&(x)->Rax))
    3756#define xpGPR(x,gprno) (xpGPRvector(x)[gprno])
  • trunk/source/lisp-kernel/x86-constants32.h

    r15093 r15147  
    1717
    1818#include "x86-constants.h"
    19 
    20 /* offsets into uc_mcontext.ss */
    21 #ifdef DARWIN
    22 #define REG_EAX 0
    23 #define REG_EBX 1
    24 #define REG_ECX 2
    25 #define REG_EDX 3
    26 #define REG_EDI 4
    27 #define REG_ESI 5
    28 #define REG_EBP 6
    29 #define REG_ESP 7
    30 #define REG_EFL 9
    31 #define REG_EIP 10
    32 #endif
    33 
    34 #ifdef WINDOWS
    35 /* Offsets relative to _CONTEXT.Edi */
    36 #define REG_EDI 0
    37 #define REG_ESI 1
    38 #define REG_EBX 2
    39 #define REG_EDX 3
    40 #define REG_ECX 4
    41 #define REG_EAX 5
    42 #define REG_EBP 6
    43 #define REG_EIP 7
    44 #define REG_EFL 9
    45 #define REG_ESP 10
    46 #endif
    47 
    48 #ifdef FREEBSD
    49 #define REG_EDI 5
    50 #define REG_ESI 6
    51 #define REG_EBP 7
    52 #define REG_ISP 8
    53 #define REG_EBX 9
    54 #define REG_EDX 10
    55 #define REG_ECX 11
    56 #define REG_EAX 12
    57 #define REG_EIP 15
    58 #define REG_EFL 17
    59 #define REG_ESP 18
    60 #endif
    61 
    62 #ifdef SOLARIS
    63 #include <sys/regset.h>
    64 #include <limits.h>
    65 #define REG_EAX EAX
    66 #define REG_EBX EBX
    67 #define REG_ECX ECX
    68 #define REG_EDX EDX
    69 #define REG_ESI ESI
    70 #define REG_EDI EDI
    71 #define REG_EBP EBP
    72 #define REG_ESP UESP    /* Maybe ... ESP is often 0, but who knows why ? */
    73 #define REG_EFL EFL
    74 #define REG_EIP EIP
    75 #endif
    7619
    7720/* Indicies of GPRs in the mcontext component of a ucontext */
  • trunk/source/lisp-kernel/x86-constants64.h

    r15093 r15147  
    1717#include "x86-constants.h"
    1818
    19 #ifdef DARWIN
    20 #define REG_RAX 0
    21 #define REG_RBX 1
    22 #define REG_RCX 2
    23 #define REG_RDX 3
    24 #define REG_RDI 4
    25 #define REG_RSI 5
    26 #define REG_RBP 6
    27 #define REG_RSP 7
    28 #define REG_R8 8
    29 #define REG_R9 9
    30 #define REG_R10 10
    31 #define REG_R11 11
    32 #define REG_R12 12
    33 #define REG_R13 13
    34 #define REG_R14 14
    35 #define REG_R15 15
    36 #define REG_RIP 16
    37 #define REG_RFL 17
    38 #endif
    39 
    40 #ifdef FREEBSD
    41 #define REG_RDI 1
    42 #define REG_RSI 2
    43 #define REG_RDX 3
    44 #define REG_RCX 4
    45 #define REG_R8 5
    46 #define REG_R9 6
    47 #define REG_RAX 7
    48 #define REG_RBX 8
    49 #define REG_RBP 9
    50 #define REG_R10 10
    51 #define REG_R11 11
    52 #define REG_R12 12
    53 #define REG_R13 13
    54 #define REG_R14 14
    55 #define REG_R15 15
    56 #define REG_RIP 20
    57 #define REG_RFL 22
    58 #define REG_RSP 23
    59 #endif
    60 
    61 #ifdef WIN_64
    62 /* DWORD64 indices in &(CONTEXT->Rax) */
    63 #define REG_RAX     0
    64 #define REG_RCX     1
    65 #define REG_RDX     2
    66 #define REG_RBX     3
    67 #define REG_RSP     4
    68 #define REG_RBP     5
    69 #define REG_RSI     6
    70 #define REG_RDI     7
    71 #define REG_R8      8
    72 #define REG_R9      9
    73 #define REG_R10     10
    74 #define REG_R11     11
    75 #define REG_R12     12
    76 #define REG_R13     13
    77 #define REG_R14     14
    78 #define REG_R15     15
    79 #define REG_RIP     16
    80 #endif
    8119
    8220/* Define indices of the GPRs in the mcontext component of a ucontext */
     
    8927#define Isave1      REG_R14
    9028#define Isave0      REG_R15
    91 #define Itemp2        REG_R10
     29#define Itemp2      REG_R10
    9230#define Ifn         REG_R13
    9331#define Irbp        REG_RBP
Note: See TracChangeset for help on using the changeset viewer.