1 ;;;; ARM compiler support for the debugger
3 ;;;; This software is part of the SBCL system. See the README file for
6 ;;;; This software is derived from the CMU CL system, which was
7 ;;;; written at Carnegie Mellon University and released into the
8 ;;;; public domain. The software is in the public domain and is
9 ;;;; provided with absolutely no warranty. See the COPYING and CREDITS
10 ;;;; files for more information.
14 (define-vop (debug-cur-sp)
15 (:translate sb
!di
::current-sp
)
17 (:results
(res :scs
(sap-reg)))
18 (:result-types system-area-pointer
)
22 (define-vop (debug-cur-fp)
23 (:translate sb
!di
::current-fp
)
25 (:results
(res :scs
(sap-reg)))
26 (:result-types system-area-pointer
)
30 (define-vop (read-control-stack)
31 (:translate sb
!kernel
:stack-ref
)
33 (:args
(sap :scs
(sap-reg))
34 (offset :scs
(any-reg)))
35 (:arg-types system-area-pointer positive-fixnum
)
36 (:results
(result :scs
(descriptor-reg)))
39 (inst ldr result
(@ sap offset
))))
41 (define-vop (write-control-stack)
42 (:translate sb
!kernel
:%set-stack-ref
)
44 (:args
(sap :scs
(sap-reg))
45 (offset :scs
(any-reg))
46 (value :scs
(descriptor-reg) :target result
))
47 (:arg-types system-area-pointer positive-fixnum
*)
48 (:results
(result :scs
(descriptor-reg)))
51 (inst str value
(@ sap offset
))
54 (define-vop (code-from-mumble)
56 (:args
(thing :scs
(descriptor-reg)))
57 (:results
(code :scs
(descriptor-reg)))
58 (:temporary
(:scs
(non-descriptor-reg)) temp
)
59 (:variant-vars lowtag
)
61 (loadw temp thing
0 lowtag
)
62 (inst mov temp
(lsr temp
(- n-widetag-bits word-shift
)))
64 (unless (= lowtag other-pointer-lowtag
)
65 (inst sub
:ne temp temp
(- other-pointer-lowtag lowtag
)))
66 (inst sub
:ne code thing temp
)
67 (inst mov
:eq code null-tn
)))
69 (define-vop (code-from-lra code-from-mumble
)
70 (:translate sb
!di
::lra-code-header
)
71 (:variant other-pointer-lowtag
))
73 (define-vop (code-from-fun code-from-mumble
)
74 (:translate sb
!di
::fun-code-header
)
75 (:variant fun-pointer-lowtag
))
77 (define-vop (%make-lisp-obj
)
79 (:translate %make-lisp-obj
)
80 (:args
(value :scs
(unsigned-reg) :target result
))
81 (:arg-types unsigned-num
)
82 (:results
(result :scs
(descriptor-reg)))
86 (define-vop (get-lisp-obj-address)
88 (:translate sb
!di
::get-lisp-obj-address
)
89 (:args
(thing :scs
(descriptor-reg) :target result
))
90 (:results
(result :scs
(unsigned-reg)))
91 (:result-types unsigned-num
)
96 (define-vop (fun-word-offset)
98 (:translate sb
!di
::fun-word-offset
)
99 (:args
(fun :scs
(descriptor-reg)))
100 (:results
(res :scs
(unsigned-reg)))
101 (:result-types positive-fixnum
)
103 (loadw res fun
0 fun-pointer-lowtag
)
104 (inst mov res
(lsr res n-widetag-bits
))))