Move poorly-named NWORDS function near its call site
[sbcl.git] / src / code / arm-vm.lisp
blob0f3df7978204abd84254d810fcbea84d5d2d1b69
1 ;;; This file contains the ARM specific runtime stuff.
2 ;;;
3 (in-package "SB!VM")
5 #-sb-xc-host
6 (defun machine-type ()
7 "Return a string describing the type of the local machine."
8 "ARM")
9 \f
10 ;;;; FIXUP-CODE-OBJECT
12 (!with-bigvec-or-sap
13 (defun fixup-code-object (code offset fixup kind)
14 (declare (type index offset))
15 (unless (zerop (rem offset n-word-bytes))
16 (error "Unaligned instruction? offset=#x~X." offset))
17 (without-gcing
18 (let ((sap (code-instructions code)))
19 (ecase kind
20 (:absolute
21 (setf (sap-ref-32 sap offset) fixup)))))))
23 ;;;; "Sigcontext" access functions, cut & pasted from sparc-vm.lisp,
24 ;;;; then modified for ARM.
25 ;;;;
26 ;;;; See also x86-vm for commentary on signed vs unsigned.
28 #-sb-xc-host (progn
29 (defun context-float-register (context index format)
30 (declare (ignorable context index))
31 (warn "stub CONTEXT-FLOAT-REGISTER")
32 (coerce 0 format))
34 (defun %set-context-float-register (context index format new-value)
35 (declare (ignore context index))
36 (warn "stub %SET-CONTEXT-FLOAT-REGISTER")
37 (coerce new-value format))
39 ;;;; INTERNAL-ERROR-ARGS.
41 ;;; Given a (POSIX) signal context, extract the internal error
42 ;;; arguments from the instruction stream.
43 (defun internal-error-args (context)
44 (declare (type (alien (* os-context-t)) context))
45 (let* ((pc (context-pc context))
46 (error-number (sap-ref-8 pc 5)))
47 (declare (type system-area-pointer pc))
48 (values error-number
49 (sb!kernel::decode-internal-error-args (sap+ pc 6) error-number))))
50 ) ; end PROGN