/[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 by dtc, Fri Apr 25 20:49:42 1997 UTC revision 1.13.2.2 by pw, Tue May 23 16:36:49 2000 UTC
# Line 15  Line 15 
15    
16  (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
17            signed-sap-ref-8 signed-sap-ref-16 signed-sap-ref-32            signed-sap-ref-8 signed-sap-ref-16 signed-sap-ref-32
18            #+alpha sap-ref-64 #+alpha signed-sap-ref-64            sap-ref-64 signed-sap-ref-64
19            sap+ sap- sap< sap<= sap= sap>= sap>            sap+ sap- sap< sap<= sap= sap>= sap>
20            allocate-system-memory allocate-system-memory-at            allocate-system-memory allocate-system-memory-at
21            reallocate-system-memory deallocate-system-memory))            reallocate-system-memory deallocate-system-memory))
# Line 25  Line 25 
25            %set-sap-ref-8 %set-signed-sap-ref-8            %set-sap-ref-8 %set-signed-sap-ref-8
26            %set-sap-ref-16 %set-signed-sap-ref-16            %set-sap-ref-16 %set-signed-sap-ref-16
27            %set-sap-ref-32 %set-signed-sap-ref-32            %set-sap-ref-32 %set-signed-sap-ref-32
28            #+alpha %set-sap-ref-64 #+alpha %set-signed-sap-ref-64))            %set-sap-ref-64 %set-signed-sap-ref-64))
29  (in-package "SYSTEM")  (in-package "SYSTEM")
30    
31  (use-package "KERNEL")  (use-package "KERNEL")
# 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             #+(or x86 sparc) (fixnum offset) #-(or x86 sparc) (type index offset))             (fixnum 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             #+(or x86 sparc) (fixnum offset) #-(or x86 sparc) (type index offset))             (fixnum 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             #+(or x86 sparc) (fixnum offset) #-(or x86 sparc) (type index offset))             (fixnum 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             #+(or x86 sparc) (fixnum offset) #-(or x86 sparc) (type index offset))             (fixnum offset))
101    (sap-ref-32 sap offset))    (sap-ref-32 sap offset))
102    
 #+alpha  
103  (defun sap-ref-64 (sap offset)  (defun sap-ref-64 (sap offset)
104    "Returns the 64-bit quadword at OFFSET bytes from SAP."    "Returns the 64-bit quadword at OFFSET bytes from SAP."
105    (declare (type system-area-pointer sap)    (declare (type system-area-pointer sap)
106             #+(or x86 sparc) (fixnum offset) #-(or x86 sparc) (type index offset))             (fixnum offset))
107    (sap-ref-64 sap offset))    (sap-ref-64 sap offset))
108    
109  (defun sap-ref-sap (sap offset)  (defun sap-ref-sap (sap offset)
110    "Returns the 32-bit system-area-pointer at OFFSET bytes from SAP."    "Returns the 32-bit system-area-pointer at OFFSET bytes from SAP."
111    (declare (type system-area-pointer sap)    (declare (type system-area-pointer sap)
112             #+(or x86 sparc) (fixnum offset) #-(or x86 sparc) (type index offset))             (fixnum offset))
113    (sap-ref-sap sap offset))    (sap-ref-sap sap offset))
114    
115  (defun sap-ref-single (sap offset)  (defun sap-ref-single (sap offset)
116    "Returns the 32-bit single-float at OFFSET bytes from SAP."    "Returns the 32-bit single-float at OFFSET bytes from SAP."
117    (declare (type system-area-pointer sap)    (declare (type system-area-pointer sap)
118             #+(or x86 sparc) (fixnum offset) #-(or x86 sparc) (type index offset))             (fixnum offset))
119    (sap-ref-single sap offset))    (sap-ref-single sap offset))
120    
121  (defun sap-ref-double (sap offset)  (defun sap-ref-double (sap offset)
122    "Returns the 64-bit double-float at OFFSET bytes from SAP."    "Returns the 64-bit double-float at OFFSET bytes from SAP."
123    (declare (type system-area-pointer sap)    (declare (type system-area-pointer sap)
124             #+(or x86 sparc) (fixnum offset) #-(or x86 sparc) (type index offset))             (fixnum offset))
125    (sap-ref-double sap offset))    (sap-ref-double sap offset))
126    
127    #+(or x86 long-float)
128    (defun sap-ref-long (sap offset)
129      "Returns the long-float at OFFSET bytes from SAP."
130      (declare (type system-area-pointer sap)
131               (fixnum offset))
132      (sap-ref-long sap offset))
133    
134  (defun signed-sap-ref-8 (sap offset)  (defun signed-sap-ref-8 (sap offset)
135    "Returns the signed 8-bit byte at OFFSET bytes from SAP."    "Returns the signed 8-bit byte at OFFSET bytes from SAP."
136    (declare (type system-area-pointer sap)    (declare (type system-area-pointer sap)
137             #+(or x86 sparc) (fixnum offset) #-(or x86 sparc) (type index offset))             (fixnum offset))
138    (signed-sap-ref-8 sap offset))    (signed-sap-ref-8 sap offset))
139    
140  (defun signed-sap-ref-16 (sap offset)  (defun signed-sap-ref-16 (sap offset)
141    "Returns the signed 16-bit word at OFFSET bytes from SAP."    "Returns the signed 16-bit word at OFFSET bytes from SAP."
142    (declare (type system-area-pointer sap)    (declare (type system-area-pointer sap)
143             #+(or x86 sparc) (fixnum offset) #-(or x86 sparc) (type index offset))             (fixnum offset))
144    (signed-sap-ref-16 sap offset))    (signed-sap-ref-16 sap offset))
145    
146  (defun signed-sap-ref-32 (sap offset)  (defun signed-sap-ref-32 (sap offset)
147    "Returns the signed 32-bit dualword at OFFSET bytes from SAP."    "Returns the signed 32-bit dualword at OFFSET bytes from SAP."
148    (declare (type system-area-pointer sap)    (declare (type system-area-pointer sap)
149             #+(or x86 sparc) (fixnum offset) #-(or x86 sparc) (type index offset))             (fixnum offset))
150    (signed-sap-ref-32 sap offset))    (signed-sap-ref-32 sap offset))
151    
 #+alpha  
152  (defun signed-sap-ref-64 (sap offset)  (defun signed-sap-ref-64 (sap offset)
153    "Returns the signed 64-bit quadword at OFFSET bytes from SAP."    "Returns the signed 64-bit quadword at OFFSET bytes from SAP."
154    (declare (type system-area-pointer sap)    (declare (type system-area-pointer sap)
155             #+(or x86 sparc) (fixnum offset) #-(or x86 sparc) (type index offset))             (fixnum offset))
156    (signed-sap-ref-64 sap offset))    (signed-sap-ref-64 sap offset))
157    
158  (defun %set-sap-ref-8 (sap offset new-value)  (defun %set-sap-ref-8 (sap offset new-value)
159    (declare (type system-area-pointer sap)    (declare (type system-area-pointer sap)
160             #+(or x86 sparc) (fixnum offset) #-(or x86 sparc) (type index offset)             (fixnum offset)
161             (type (unsigned-byte 8) new-value))             (type (unsigned-byte 8) new-value))
162    (setf (sap-ref-8 sap offset) new-value))    (setf (sap-ref-8 sap offset) new-value))
163    
164  (defun %set-sap-ref-16 (sap offset new-value)  (defun %set-sap-ref-16 (sap offset new-value)
165    (declare (type system-area-pointer sap)    (declare (type system-area-pointer sap)
166             #+(or x86 sparc) (fixnum offset) #-(or x86 sparc) (type index offset)             (fixnum offset)
167             (type (unsigned-byte 16) new-value))             (type (unsigned-byte 16) new-value))
168    (setf (sap-ref-16 sap offset) new-value))    (setf (sap-ref-16 sap offset) new-value))
169    
170  (defun %set-sap-ref-32 (sap offset new-value)  (defun %set-sap-ref-32 (sap offset new-value)
171    (declare (type system-area-pointer sap)    (declare (type system-area-pointer sap)
172             #+(or x86 sparc) (fixnum offset) #-(or x86 sparc) (type index offset)             (fixnum offset)
173             (type (unsigned-byte 32) new-value))             (type (unsigned-byte 32) new-value))
174    (setf (sap-ref-32 sap offset) new-value))    (setf (sap-ref-32 sap offset) new-value))
175    
 #+alpha  
176  (defun %set-sap-ref-64 (sap offset new-value)  (defun %set-sap-ref-64 (sap offset new-value)
177    (declare (type system-area-pointer sap)    (declare (type system-area-pointer sap)
178             #+(or x86 sparc) (fixnum offset) #-(or x86 sparc) (type index offset)             (fixnum offset)
179             (type (unsigned-byte 64) new-value))             (type (unsigned-byte 64) new-value))
180    (setf (sap-ref-64 sap offset) new-value))    (setf (sap-ref-64 sap offset) new-value))
181    
182  (defun %set-signed-sap-ref-8 (sap offset new-value)  (defun %set-signed-sap-ref-8 (sap offset new-value)
183    (declare (type system-area-pointer sap)    (declare (type system-area-pointer sap)
184             #+(or x86 sparc) (fixnum offset) #-(or x86 sparc) (type index offset)             (fixnum offset)
185             (type (signed-byte 8) new-value))             (type (signed-byte 8) new-value))
186    (setf (signed-sap-ref-8 sap offset) new-value))    (setf (signed-sap-ref-8 sap offset) new-value))
187    
188  (defun %set-signed-sap-ref-16 (sap offset new-value)  (defun %set-signed-sap-ref-16 (sap offset new-value)
189    (declare (type system-area-pointer sap)    (declare (type system-area-pointer sap)
190             #+(or x86 sparc) (fixnum offset) #-(or x86 sparc) (type index offset)             (fixnum offset)
191             (type (signed-byte 16) new-value))             (type (signed-byte 16) new-value))
192    (setf (signed-sap-ref-16 sap offset) new-value))    (setf (signed-sap-ref-16 sap offset) new-value))
193    
194  (defun %set-signed-sap-ref-32 (sap offset new-value)  (defun %set-signed-sap-ref-32 (sap offset new-value)
195    (declare (type system-area-pointer sap)    (declare (type system-area-pointer sap)
196             #+(or x86 sparc) (fixnum offset) #-(or x86 sparc) (type index offset)             (fixnum offset)
197             (type (signed-byte 32) new-value))             (type (signed-byte 32) new-value))
198    (setf (signed-sap-ref-32 sap offset) new-value))    (setf (signed-sap-ref-32 sap offset) new-value))
199    
 #+alpha  
200  (defun %set-signed-sap-ref-64 (sap offset new-value)  (defun %set-signed-sap-ref-64 (sap offset new-value)
201    (declare (type system-area-pointer sap)    (declare (type system-area-pointer sap)
202             #+(or x86 sparc) (fixnum offset) #-(or x86 sparc) (type index offset)             (fixnum offset)
203             (type (signed-byte 64) new-value))             (type (signed-byte 64) new-value))
204    (setf (signed-sap-ref-64 sap offset) new-value))    (setf (signed-sap-ref-64 sap offset) new-value))
205    
206  (defun %set-sap-ref-sap (sap offset new-value)  (defun %set-sap-ref-sap (sap offset new-value)
207    (declare (type system-area-pointer sap new-value)    (declare (type system-area-pointer sap new-value)
208             #+(or x86 sparc) (fixnum offset) #-(or x86 sparc) (type index offset))             (fixnum offset))
209    (setf (sap-ref-sap sap offset) new-value))    (setf (sap-ref-sap sap offset) new-value))
210    
211  (defun %set-sap-ref-single (sap offset new-value)  (defun %set-sap-ref-single (sap offset new-value)
212    (declare (type system-area-pointer sap)    (declare (type system-area-pointer sap)
213             #+(or x86 sparc) (fixnum offset) #-(or x86 sparc) (type index offset)             (fixnum offset)
214             (type single-float new-value))             (type single-float new-value))
215    (setf (sap-ref-single sap offset) new-value))    (setf (sap-ref-single sap offset) new-value))
216    
217  (defun %set-sap-ref-double (sap offset new-value)  (defun %set-sap-ref-double (sap offset new-value)
218    (declare (type system-area-pointer sap)    (declare (type system-area-pointer sap)
219             #+(or x86 sparc) (fixnum offset) #-(or x86 sparc) (type index offset)             (fixnum offset)
220             (type double-float new-value))             (type double-float new-value))
221    (setf (sap-ref-double sap offset) new-value))    (setf (sap-ref-double sap offset) new-value))
222    
223    #+long-float
224    (defun %set-sap-ref-long (sap offset new-value)
225      (declare (type system-area-pointer sap)
226               (fixnum offset)
227               (type long-float new-value))
228      (setf (sap-ref-long sap offset) new-value))
229    
230    
231    
232  ;;;; System memory allocation.  ;;;; System memory allocation.

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

  ViewVC Help
Powered by ViewVC 1.1.5