Changeset 14179


Ignore:
Timestamp:
Aug 13, 2010, 10:13:07 AM (9 years ago)
Author:
gb
Message:

Darwin/ARM abi changes (signal context accessors.)

File:
1 edited

Legend:

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

    r14119 r14179  
    3434)
    3535
     36#+darwinarm-target
     37(progn
     38(defmacro with-xp-registers-and-gpr-offset ((xp register-number)
     39                                            (registers offset) &body body)
     40  (let* ((regform `(pref ,xp :ucontext_t.uc_mcontext.__ss)))
     41    `(with-macptrs ((,registers ,regform))
     42      (let ((,offset (xp-gpr-offset ,register-number)))
     43        ,@body))))
     44(defun xp-gpr-offset (register-number)
     45  (unless (and (fixnump register-number)
     46               (<= 0 (the fixnum register-number))
     47               (< (the fixnum register-number) 17))
     48    (setq register-number (require-type register-number '(integer 0 (17)))))
     49  (the fixnum (* (the fixnum register-number) arm::node-size)))
     50(defconstant xp-cpsr-regno 16)
     51)
     52
    3653(defun xp-gpr-lisp (xp register-number)
    3754  (with-xp-registers-and-gpr-offset (xp register-number) (registers offset)
     
    5673
    5774(defun return-address-offset (xp fn machine-state-offset)
    58   (with-macptrs ((regs (pref xp #+linuxarm-target :ucontext.uc_mcontext)))
     75  (with-macptrs ((regs (pref xp #+linuxarm-target :ucontext.uc_mcontext
     76                                #+darwinarm-target :ucontext_t.uc_mcontext.__ss)))
    5977    (if (functionp fn)
    6078      (or (%code-vector-pc (uvref fn 0) (%inc-ptr regs machine-state-offset))
     
    6381
    6482(defconstant lr-offset-in-register-context
    65   #+linuxarm-target (get-field-offset :sigcontext.arm_lr))
     83  #+linuxarm-target (get-field-offset :sigcontext.arm_lr)
     84  #+darwinarm-target (get-field-offset :__darwin_arm_thread_state.__lr))
    6685
    6786(defconstant pc-offset-in-register-context
    68   #+linuxarm-target (get-field-offset :sigcontext.arm_pc))
     87  #+linuxarm-target (get-field-offset :sigcontext.arm_pc)
     88  #+darwinarm-target (get-field-offset :__darwin_arm_thread_state.__pc))
    6989
    7090(defun funcall-with-xp-stack-frames (xp trap-function thunk)
Note: See TracChangeset for help on using the changeset viewer.