/[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.11 by ram, Mon Oct 31 04:11:27 1994 UTC revision 1.12 by dtc, Sat Feb 15 17:10:44 1997 UTC
# Line 64  Line 64 
64  (defun sap+ (sap offset)  (defun sap+ (sap offset)
65    "Return a new sap OFFSET bytes from SAP."    "Return a new sap OFFSET bytes from SAP."
66    (declare (type system-area-pointer sap)    (declare (type system-area-pointer sap)
67             (fixnum offset))             #+x86 (fixnum offset) #-x86 (type index offset))
68    (sap+ sap offset))    (sap+ sap offset))
69    
70  (defun sap- (sap1 sap2)  (defun sap- (sap1 sap2)
# Line 85  Line 85 
85  (defun sap-ref-8 (sap offset)  (defun sap-ref-8 (sap offset)
86    "Returns the 8-bit byte at OFFSET bytes from SAP."    "Returns the 8-bit byte at OFFSET bytes from SAP."
87    (declare (type system-area-pointer sap)    (declare (type system-area-pointer sap)
88             (type index offset))             #+x86 (fixnum offset) #-x86 (type index offset))
89    (sap-ref-8 sap offset))    (sap-ref-8 sap offset))
90    
91  (defun sap-ref-16 (sap offset)  (defun sap-ref-16 (sap offset)
92    "Returns the 16-bit word at OFFSET bytes from SAP."    "Returns the 16-bit word at OFFSET bytes from SAP."
93    (declare (type system-area-pointer sap)    (declare (type system-area-pointer sap)
94             (type index offset))             #+x86 (fixnum offset) #-x86 (type index offset))
95    (sap-ref-16 sap offset))    (sap-ref-16 sap offset))
96    
97  (defun sap-ref-32 (sap offset)  (defun sap-ref-32 (sap offset)
98    "Returns the 32-bit dualword at OFFSET bytes from SAP."    "Returns the 32-bit dualword at OFFSET bytes from SAP."
99    (declare (type system-area-pointer sap)    (declare (type system-area-pointer sap)
100             (type index offset))             #+x86 (fixnum offset) #-x86 (type index offset))
101    (sap-ref-32 sap offset))    (sap-ref-32 sap offset))
102    
103  #+alpha  #+alpha
104  (defun sap-ref-64 (sap offset)  (defun sap-ref-64 (sap offset)
105    "Returns the 64-bit quadword at OFFSET bytes from SAP."    "Returns the 64-bit quadword at OFFSET bytes from SAP."
106    (declare (type system-area-pointer sap)    (declare (type system-area-pointer sap)
107             (type index offset))             #+x86 (fixnum offset) #-x86 (type index offset))
108    (sap-ref-64 sap offset))    (sap-ref-64 sap offset))
109    
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             (type index offset))             #+x86 (fixnum offset) #-x86 (type index 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)
117    "Returns the 32-bit single-float at OFFSET bytes from SAP."    "Returns the 32-bit single-float at OFFSET bytes from SAP."
118    (declare (type system-area-pointer sap)    (declare (type system-area-pointer sap)
119             (type index offset))             #+x86 (fixnum offset) #-x86 (type index offset))
120    (sap-ref-single sap offset))    (sap-ref-single sap offset))
121    
122  (defun sap-ref-double (sap offset)  (defun sap-ref-double (sap offset)
123    "Returns the 64-bit double-float at OFFSET bytes from SAP."    "Returns the 64-bit double-float at OFFSET bytes from SAP."
124    (declare (type system-area-pointer sap)    (declare (type system-area-pointer sap)
125             (type index offset))             #+x86 (fixnum offset) #-x86 (type index offset))
126    (sap-ref-double sap offset))    (sap-ref-double sap offset))
127    
128  (defun signed-sap-ref-8 (sap offset)  (defun signed-sap-ref-8 (sap offset)
129    "Returns the signed 8-bit byte at OFFSET bytes from SAP."    "Returns the signed 8-bit byte at OFFSET bytes from SAP."
130    (declare (type system-area-pointer sap)    (declare (type system-area-pointer sap)
131             (type index offset))             #+x86 (fixnum offset) #-x86 (type index offset))
132    (signed-sap-ref-8 sap offset))    (signed-sap-ref-8 sap offset))
133    
134  (defun signed-sap-ref-16 (sap offset)  (defun signed-sap-ref-16 (sap offset)
135    "Returns the signed 16-bit word at OFFSET bytes from SAP."    "Returns the signed 16-bit word at OFFSET bytes from SAP."
136    (declare (type system-area-pointer sap)    (declare (type system-area-pointer sap)
137             (type index offset))             #+x86 (fixnum offset) #-x86 (type index offset))
138    (signed-sap-ref-16 sap offset))    (signed-sap-ref-16 sap offset))
139    
140  (defun signed-sap-ref-32 (sap offset)  (defun signed-sap-ref-32 (sap offset)
141    "Returns the signed 32-bit dualword at OFFSET bytes from SAP."    "Returns the signed 32-bit dualword at OFFSET bytes from SAP."
142    (declare (type system-area-pointer sap)    (declare (type system-area-pointer sap)
143             (type index offset))             #+x86 (fixnum offset) #-x86 (type index offset))
144    (signed-sap-ref-32 sap offset))    (signed-sap-ref-32 sap offset))
145    
146  #+alpha  #+alpha
147  (defun signed-sap-ref-64 (sap offset)  (defun signed-sap-ref-64 (sap offset)
148    "Returns the signed 64-bit quadword at OFFSET bytes from SAP."    "Returns the signed 64-bit quadword at OFFSET bytes from SAP."
149    (declare (type system-area-pointer sap)    (declare (type system-area-pointer sap)
150             (type index offset))             #+x86 (fixnum offset) #-x86 (type index offset))
151    (signed-sap-ref-64 sap offset))    (signed-sap-ref-64 sap offset))
152    
153  (defun %set-sap-ref-8 (sap offset new-value)  (defun %set-sap-ref-8 (sap offset new-value)
154    (declare (type system-area-pointer sap)    (declare (type system-area-pointer sap)
155             (type index offset)             #+x86 (fixnum offset) #-x86 (type index offset)
156             (type (unsigned-byte 8) new-value))             (type (unsigned-byte 8) new-value))
157    (setf (sap-ref-8 sap offset) new-value))    (setf (sap-ref-8 sap offset) new-value))
158    
159  (defun %set-sap-ref-16 (sap offset new-value)  (defun %set-sap-ref-16 (sap offset new-value)
160    (declare (type system-area-pointer sap)    (declare (type system-area-pointer sap)
161             (type index offset)             #+x86 (fixnum offset) #-x86 (type index offset)
162             (type (unsigned-byte 16) new-value))             (type (unsigned-byte 16) new-value))
163    (setf (sap-ref-16 sap offset) new-value))    (setf (sap-ref-16 sap offset) new-value))
164    
165  (defun %set-sap-ref-32 (sap offset new-value)  (defun %set-sap-ref-32 (sap offset new-value)
166    (declare (type system-area-pointer sap)    (declare (type system-area-pointer sap)
167             (type index offset)             #+x86 (fixnum offset) #-x86 (type index offset)
168             (type (unsigned-byte 32) new-value))             (type (unsigned-byte 32) new-value))
169    (setf (sap-ref-32 sap offset) new-value))    (setf (sap-ref-32 sap offset) new-value))
170    
171  #+alpha  #+alpha
172  (defun %set-sap-ref-64 (sap offset new-value)  (defun %set-sap-ref-64 (sap offset new-value)
173    (declare (type system-area-pointer sap)    (declare (type system-area-pointer sap)
174             (type index offset)             #+x86 (fixnum offset) #-x86 (type index offset)
175             (type (unsigned-byte 64) new-value))             (type (unsigned-byte 64) new-value))
176    (setf (sap-ref-64 sap offset) new-value))    (setf (sap-ref-64 sap offset) new-value))
177    
178  (defun %set-signed-sap-ref-8 (sap offset new-value)  (defun %set-signed-sap-ref-8 (sap offset new-value)
179    (declare (type system-area-pointer sap)    (declare (type system-area-pointer sap)
180             (type index offset)             #+x86 (fixnum offset) #-x86 (type index offset)
181             (type (signed-byte 8) new-value))             (type (signed-byte 8) new-value))
182    (setf (signed-sap-ref-8 sap offset) new-value))    (setf (signed-sap-ref-8 sap offset) new-value))
183    
184  (defun %set-signed-sap-ref-16 (sap offset new-value)  (defun %set-signed-sap-ref-16 (sap offset new-value)
185    (declare (type system-area-pointer sap)    (declare (type system-area-pointer sap)
186             (type index offset)             #+x86 (fixnum offset) #-x86 (type index offset)
187             (type (signed-byte 16) new-value))             (type (signed-byte 16) new-value))
188    (setf (signed-sap-ref-16 sap offset) new-value))    (setf (signed-sap-ref-16 sap offset) new-value))
189    
190  (defun %set-signed-sap-ref-32 (sap offset new-value)  (defun %set-signed-sap-ref-32 (sap offset new-value)
191    (declare (type system-area-pointer sap)    (declare (type system-area-pointer sap)
192             (type index offset)             #+x86 (fixnum offset) #-x86 (type index offset)
193             (type (signed-byte 32) new-value))             (type (signed-byte 32) new-value))
194    (setf (signed-sap-ref-32 sap offset) new-value))    (setf (signed-sap-ref-32 sap offset) new-value))
195    
196  #+alpha  #+alpha
197  (defun %set-signed-sap-ref-64 (sap offset new-value)  (defun %set-signed-sap-ref-64 (sap offset new-value)
198    (declare (type system-area-pointer sap)    (declare (type system-area-pointer sap)
199             (type index offset)             #+x86 (fixnum offset) #-x86 (type index offset)
200             (type (signed-byte 64) new-value))             (type (signed-byte 64) new-value))
201    (setf (signed-sap-ref-64 sap offset) new-value))    (setf (signed-sap-ref-64 sap offset) new-value))
202    
203  (defun %set-sap-ref-sap (sap offset new-value)  (defun %set-sap-ref-sap (sap offset new-value)
204    (declare (type system-area-pointer sap new-value)    (declare (type system-area-pointer sap new-value)
205             (type index offset))             #+x86 (fixnum offset) #-x86 (type index offset))
206    (setf (sap-ref-sap sap offset) new-value))    (setf (sap-ref-sap sap offset) new-value))
207    
208  (defun %set-sap-ref-single (sap offset new-value)  (defun %set-sap-ref-single (sap offset new-value)
209    (declare (type system-area-pointer sap)    (declare (type system-area-pointer sap)
210             (type index offset)             #+x86 (fixnum offset) #-x86 (type index offset)
211             (type single-float new-value))             (type single-float new-value))
212    (setf (sap-ref-single sap offset) new-value))    (setf (sap-ref-single sap offset) new-value))
213    
214  (defun %set-sap-ref-double (sap offset new-value)  (defun %set-sap-ref-double (sap offset new-value)
215    (declare (type system-area-pointer sap)    (declare (type system-area-pointer sap)
216             (type index offset)             #+x86 (fixnum offset) #-x86 (type index offset)
217             (type double-float new-value))             (type double-float new-value))
218    (setf (sap-ref-double sap offset) new-value))    (setf (sap-ref-double sap offset) new-value))
219    

Legend:
Removed from v.1.11  
changed lines
  Added in v.1.12

  ViewVC Help
Powered by ViewVC 1.1.5