Ignore:
Timestamp:
Jul 19, 2008, 5:10:17 AM (11 years ago)
Author:
rme
Message:

x8632 and Darwin/x8632 support.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/source/level-1/x86-trap-support.lisp

    r10053 r10139  
    158158      )))
    159159
     160#+darwinx8632-target
     161(progn
     162  (defconstant gp-regs-offset 0)
     163  (defmacro xp-gp-regs (xp)
     164    `(pref (pref ,xp :ucontext.uc_mcontext) :mcontext.ss))
     165  (defun xp-mxcsr (xp)
     166    (%get-unsigned-long (pref (pref xp :ucontext.uc_mcontext) :mcontext.fs) 32))
     167  (defconstant flags-register-offset 9)
     168  (defconstant eip-register-offset 10)
     169  (defparameter *encoded-gpr-to-indexed-gpr*
     170    #(0                                 ;eax
     171      2                                 ;ecx
     172      3                                 ;edx
     173      1                                 ;ebx
     174      7                                 ;esp
     175      6                                 ;ebp
     176      5                                 ;esi
     177      4                                 ;edi
     178      )))
     179
    160180(defun indexed-gpr-lisp (xp igpr)
    161   (%get-object (xp-gp-regs xp) (+ gp-regs-offset (ash igpr x8664::word-shift))))
     181  (%get-object (xp-gp-regs xp) (+ gp-regs-offset (ash igpr target::word-shift))))
    162182(defun (setf indexed-gpr-lisp) (new xp igpr)
    163   (%set-object (xp-gp-regs xp) (+ gp-regs-offset (ash igpr x8664::word-shift)) new))
     183  (%set-object (xp-gp-regs xp) (+ gp-regs-offset (ash igpr target::word-shift)) new))
    164184(defun encoded-gpr-lisp (xp gpr)
    165185  (indexed-gpr-lisp xp (aref *encoded-gpr-to-indexed-gpr* gpr)))
     
    167187  (setf (indexed-gpr-lisp xp (aref *encoded-gpr-to-indexed-gpr* gpr)) new))
    168188(defun indexed-gpr-integer (xp igpr)
    169   (%get-signed-long-long (xp-gp-regs xp) (+ gp-regs-offset (ash igpr x8664::word-shift))))
     189  #+x8664-target
     190  (%get-signed-long-long (xp-gp-regs xp) (+ gp-regs-offset (ash igpr x8664::word-shift)))
     191  #+x8632-target
     192  (%get-signed-long (xp-gp-regs xp) (+ gp-regs-offset (ash igpr x8632::word-shift))))
    170193(defun (setf indexed-gpr-integer) (new xp igpr)
    171194  (setf
     195   #+x8664-target
    172196   (%get-signed-long-long (xp-gp-regs xp) (+ gp-regs-offset (ash igpr x8664::word-shift)))
     197   #+x8632-target
     198   (%get-signed-long (xp-gp-regs xp) (+ gp-regs-offset (ash igpr x8632::word-shift)))
    173199   new))
    174200(defun encoded-gpr-integer (xp gpr)
     
    177203  (setf (indexed-gpr-integer xp (aref *encoded-gpr-to-indexed-gpr* gpr)) new))
    178204(defun indexed-gpr-macptr (xp igpr)
    179   (%get-ptr (xp-gp-regs xp) (+ gp-regs-offset (ash igpr x8664::word-shift))))
     205  (%get-ptr (xp-gp-regs xp) (+ gp-regs-offset (ash igpr target::word-shift))))
    180206(defun (setf indexed-gpr-macptr) (new xp igpr)
    181   (setf (%get-ptr (xp-gp-regs xp) (+ gp-regs-offset (ash igpr x8664::word-shift))) new))
     207  (setf (%get-ptr (xp-gp-regs xp) (+ gp-regs-offset (ash igpr target::word-shift))) new))
    182208(defun indexed-gpr-macptr (xp igpr)
    183   (%get-ptr (xp-gp-regs xp) (+ gp-regs-offset (ash igpr x8664::word-shift))))
     209  (%get-ptr (xp-gp-regs xp) (+ gp-regs-offset (ash igpr target::word-shift))))
    184210(defun encoded-gpr-macptr (xp gpr)
    185211  (indexed-gpr-macptr xp (aref *encoded-gpr-to-indexed-gpr* gpr)))
     
    187213  (setf (indexed-gpr-macptr xp (aref *encoded-gpr-to-indexed-gpr* gpr)) new))
    188214(defun xp-flags-register (xp)
    189   (%get-signed-long-long (xp-gp-regs xp) (+ gp-regs-offset (ash flags-register-offset x8664::fixnumshift))))
     215  #+x8664-target
     216  (%get-signed-long-long (xp-gp-regs xp) (+ gp-regs-offset (ash flags-register-offset x8664::fixnumshift)))
     217  #+x8632-target
     218  (%get-signed-long (xp-gp-regs xp) (+ gp-regs-offset (ash flags-register-offset x8632::fixnumshift))))
    190219 
    191220
    192221
    193222(defun %get-xcf-byte (xcf-ptr delta)
    194   (let* ((containing-object (%get-object xcf-ptr x8664::xcf.containing-object))
    195          (byte-offset (%get-object xcf-ptr x8664::xcf.relative-pc)))
     223  (let* ((containing-object (%get-object xcf-ptr target::xcf.containing-object))
     224         (byte-offset (%get-object xcf-ptr target::xcf.relative-pc)))
    196225    (if containing-object
    197226      (locally (declare (optimize (speed 3) (safety 0))
Note: See TracChangeset for help on using the changeset viewer.