/[cmucl]/src/code/sap.lisp
ViewVC logotype

Diff of /src/code/sap.lisp

Parent Directory Parent Directory | Revision Log Revision Log | View Patch Patch

revision 1.13.2.2 by pw, Tue May 23 16:36:49 2000 UTC revision 1.23 by rtoy, Mon Apr 19 02:18:04 2010 UTC
# Line 12  Line 12 
12  ;;; This file holds the support for System Area Pointers (saps).  ;;; This file holds the support for System Area Pointers (saps).
13  ;;;  ;;;
14  (in-package "SYSTEM")  (in-package "SYSTEM")
15    (intl:textdomain "cmucl")
16    
17  (export '(system-area-pointer sap-ref-8 sap-ref-16 sap-ref-32 sap-ref-sap  (export '(system-area-pointer sap-ref-8 sap-ref-16 sap-ref-32 sap-ref-sap
18            signed-sap-ref-8 signed-sap-ref-16 signed-sap-ref-32            signed-sap-ref-8 signed-sap-ref-16 signed-sap-ref-32
# Line 64  Line 65 
65  (defun sap+ (sap offset)  (defun sap+ (sap offset)
66    "Return a new sap OFFSET bytes from SAP."    "Return a new sap OFFSET bytes from SAP."
67    (declare (type system-area-pointer sap)    (declare (type system-area-pointer sap)
68             (fixnum offset))             (type (signed-byte #-alpha #.vm:word-bits #+alpha 64) offset))
69    (sap+ sap offset))    (sap+ sap offset))
70    
71  (defun sap- (sap1 sap2)  (defun sap- (sap1 sap2)
# Line 85  Line 86 
86  (defun sap-ref-8 (sap offset)  (defun sap-ref-8 (sap offset)
87    "Returns the 8-bit byte at OFFSET bytes from SAP."    "Returns the 8-bit byte at OFFSET bytes from SAP."
88    (declare (type system-area-pointer sap)    (declare (type system-area-pointer sap)
89             (fixnum offset))             (type (signed-byte #-alpha #.vm:word-bits #+alpha 64) offset))
90    (sap-ref-8 sap offset))    (sap-ref-8 sap offset))
91    
92  (defun sap-ref-16 (sap offset)  (defun sap-ref-16 (sap offset)
93    "Returns the 16-bit word at OFFSET bytes from SAP."    "Returns the 16-bit word at OFFSET bytes from SAP."
94    (declare (type system-area-pointer sap)    (declare (type system-area-pointer sap)
95             (fixnum offset))             (type (signed-byte #-alpha #.(1- vm:word-bits) #+alpha 63) offset))
96    (sap-ref-16 sap offset))    (sap-ref-16 sap offset))
97    
98  (defun sap-ref-32 (sap offset)  (defun sap-ref-32 (sap offset)
# Line 109  Line 110 
110  (defun sap-ref-sap (sap offset)  (defun sap-ref-sap (sap offset)
111    "Returns the 32-bit system-area-pointer at OFFSET bytes from SAP."    "Returns the 32-bit system-area-pointer at OFFSET bytes from SAP."
112    (declare (type system-area-pointer sap)    (declare (type system-area-pointer sap)
113             (fixnum offset))             (type (signed-byte #-alpha #.vm:word-bits #+alpha 64) offset))
114    (sap-ref-sap sap offset))    (sap-ref-sap sap offset))
115    
116  (defun sap-ref-single (sap offset)  (defun sap-ref-single (sap offset)
# Line 126  Line 127 
127    
128  #+(or x86 long-float)  #+(or x86 long-float)
129  (defun sap-ref-long (sap offset)  (defun sap-ref-long (sap offset)
130    "Returns the long-float at OFFSET bytes from SAP."    _N"Returns the long-float at OFFSET bytes from SAP."
131    (declare (type system-area-pointer sap)    (declare (type system-area-pointer sap)
132             (fixnum offset))             (fixnum offset))
133    (sap-ref-long sap offset))    (sap-ref-long sap offset))
# Line 134  Line 135 
135  (defun signed-sap-ref-8 (sap offset)  (defun signed-sap-ref-8 (sap offset)
136    "Returns the signed 8-bit byte at OFFSET bytes from SAP."    "Returns the signed 8-bit byte at OFFSET bytes from SAP."
137    (declare (type system-area-pointer sap)    (declare (type system-area-pointer sap)
138             (fixnum offset))             (type (signed-byte #-alpha #.vm:word-bits #+alpha 64) offset))
139    (signed-sap-ref-8 sap offset))    (signed-sap-ref-8 sap offset))
140    
141  (defun signed-sap-ref-16 (sap offset)  (defun signed-sap-ref-16 (sap offset)
142    "Returns the signed 16-bit word at OFFSET bytes from SAP."    "Returns the signed 16-bit word at OFFSET bytes from SAP."
143    (declare (type system-area-pointer sap)    (declare (type system-area-pointer sap)
144             (fixnum offset))             (type (signed-byte #-alpha #.(1- vm:word-bits) #+alpha 63) offset))
145    (signed-sap-ref-16 sap offset))    (signed-sap-ref-16 sap offset))
146    
147  (defun signed-sap-ref-32 (sap offset)  (defun signed-sap-ref-32 (sap offset)
# Line 157  Line 158 
158    
159  (defun %set-sap-ref-8 (sap offset new-value)  (defun %set-sap-ref-8 (sap offset new-value)
160    (declare (type system-area-pointer sap)    (declare (type system-area-pointer sap)
161             (fixnum offset)             (type (signed-byte #-alpha #.vm:word-bits #+alpha 64) offset)
162             (type (unsigned-byte 8) new-value))             (type (unsigned-byte 8) new-value))
163    (setf (sap-ref-8 sap offset) new-value))    (setf (sap-ref-8 sap offset) new-value))
164    
165  (defun %set-sap-ref-16 (sap offset new-value)  (defun %set-sap-ref-16 (sap offset new-value)
166    (declare (type system-area-pointer sap)    (declare (type system-area-pointer sap)
167             (fixnum offset)             (type (signed-byte #-alpha #.(1- vm:word-bits) #+alpha 63) offset)
168             (type (unsigned-byte 16) new-value))             (type (unsigned-byte 16) new-value))
169    (setf (sap-ref-16 sap offset) new-value))    (setf (sap-ref-16 sap offset) new-value))
170    
# Line 181  Line 182 
182    
183  (defun %set-signed-sap-ref-8 (sap offset new-value)  (defun %set-signed-sap-ref-8 (sap offset new-value)
184    (declare (type system-area-pointer sap)    (declare (type system-area-pointer sap)
185             (fixnum offset)             (type (signed-byte #-alpha #.vm:word-bits #+alpha 64) offset)
186             (type (signed-byte 8) new-value))             (type (signed-byte 8) new-value))
187    (setf (signed-sap-ref-8 sap offset) new-value))    (setf (signed-sap-ref-8 sap offset) new-value))
188    
189  (defun %set-signed-sap-ref-16 (sap offset new-value)  (defun %set-signed-sap-ref-16 (sap offset new-value)
190    (declare (type system-area-pointer sap)    (declare (type system-area-pointer sap)
191             (fixnum offset)             (type (signed-byte #-alpha #.(1- vm:word-bits) #+alpha 63) offset)
192             (type (signed-byte 16) new-value))             (type (signed-byte 16) new-value))
193    (setf (signed-sap-ref-16 sap offset) new-value))    (setf (signed-sap-ref-16 sap offset) new-value))
194    
# Line 205  Line 206 
206    
207  (defun %set-sap-ref-sap (sap offset new-value)  (defun %set-sap-ref-sap (sap offset new-value)
208    (declare (type system-area-pointer sap new-value)    (declare (type system-area-pointer sap new-value)
209             (fixnum offset))             (type (signed-byte #-alpha #.vm:word-bits #+alpha 64) offset))
210    (setf (sap-ref-sap sap offset) new-value))    (setf (sap-ref-sap sap offset) new-value))
211    
212  (defun %set-sap-ref-single (sap offset new-value)  (defun %set-sap-ref-single (sap offset new-value)
# Line 220  Line 221 
221             (type double-float new-value))             (type double-float new-value))
222    (setf (sap-ref-double sap offset) new-value))    (setf (sap-ref-double sap offset) new-value))
223    
224  #+long-float  #+(or x86 long-float)
225  (defun %set-sap-ref-long (sap offset new-value)  (defun %set-sap-ref-long (sap offset new-value)
226    (declare (type system-area-pointer sap)    (declare (type system-area-pointer sap)
227             (fixnum offset)             (fixnum offset)

Legend:
Removed from v.1.13.2.2  
changed lines
  Added in v.1.23

  ViewVC Help
Powered by ViewVC 1.1.5