X-Git-Url: http://repo.macrolet.net/gitweb/?a=blobdiff_plain;f=src%2Fcode%2Ftarget-sap.lisp;h=b63c33d37a1f1a7ce0fa21b26f3bd4dbc2c59160;hb=4fc9d21ae1d8a6a2f8ff70f589d5da103203de13;hp=56f07891037b84df4932afa4cfae851a6bf87a8d;hpb=39e38e4c91fdfc368c60220a1b38ffefb86ff403;p=sbcl.git diff --git a/src/code/target-sap.lisp b/src/code/target-sap.lisp index 56f0789..b63c33d 100644 --- a/src/code/target-sap.lisp +++ b/src/code/target-sap.lisp @@ -9,152 +9,129 @@ ;;;; provided with absolutely no warranty. See the COPYING and CREDITS ;;;; files for more information. -(in-package "SB!SYS") -;;; FIXME: Shouldn't these be IN-PACKAGE SB!KERNEL instead? (They're -;;; not dependent on the OS, only on the CPU architecture.) +(in-package "SB!KERNEL") ;;;; primitive SAP operations +;;; Return T iff the SAP X points to a smaller address then the SAP Y. (defun sap< (x y) - #!+sb-doc - "Return T iff the SAP X points to a smaller address then the SAP Y." (declare (type system-area-pointer x y)) (sap< x y)) +;;; Return T iff the SAP X points to a smaller or the same address as +;;; the SAP Y. (defun sap<= (x y) - #!+sb-doc - "Return T iff the SAP X points to a smaller or the same address as - the SAP Y." (declare (type system-area-pointer x y)) (sap<= x y)) +;;; Return T iff the SAP X points to the same address as the SAP Y. (defun sap= (x y) - #!+sb-doc - "Return T iff the SAP X points to the same address as the SAP Y." (declare (type system-area-pointer x y)) (sap= x y)) +;;; Return T iff the SAP X points to a larger or the same address as +;;; the SAP Y. (defun sap>= (x y) - #!+sb-doc - "Return T iff the SAP X points to a larger or the same address as - the SAP Y." (declare (type system-area-pointer x y)) (sap>= x y)) +;;; Return T iff the SAP X points to a larger address then the SAP Y. (defun sap> (x y) - #!+sb-doc - "Return T iff the SAP X points to a larger address then the SAP Y." (declare (type system-area-pointer x y)) (sap> x y)) +;;; Return a new SAP, OFFSET bytes from SAP. (defun sap+ (sap offset) - #!+sb-doc - "Return a new sap OFFSET bytes from SAP." (declare (type system-area-pointer sap) (fixnum offset)) (sap+ sap offset)) +;;; Return the byte offset between SAP1 and SAP2. (defun sap- (sap1 sap2) - #!+sb-doc - "Return the byte offset between SAP1 and SAP2." (declare (type system-area-pointer sap1 sap2)) (sap- sap1 sap2)) +;;; Convert SAP into an integer. (defun sap-int (sap) - #!+sb-doc - "Converts a System Area Pointer into an integer." (declare (type system-area-pointer sap)) (sap-int sap)) +;;; Convert an integer into a SAP. (defun int-sap (int) - #!+sb-doc - "Converts an integer into a System Area Pointer." (declare (type sap-int-type int)) (int-sap int)) +;;; Return the 8-bit byte at OFFSET bytes from SAP. (defun sap-ref-8 (sap offset) - #!+sb-doc - "Returns the 8-bit byte at OFFSET bytes from SAP." (declare (type system-area-pointer sap) (fixnum offset)) (sap-ref-8 sap offset)) +;;; Return the 16-bit word at OFFSET bytes from SAP. (defun sap-ref-16 (sap offset) - #!+sb-doc - "Returns the 16-bit word at OFFSET bytes from SAP." (declare (type system-area-pointer sap) (fixnum offset)) (sap-ref-16 sap offset)) +;;; Returns the 32-bit dualword at OFFSET bytes from SAP. (defun sap-ref-32 (sap offset) - #!+sb-doc - "Returns the 32-bit dualword at OFFSET bytes from SAP." (declare (type system-area-pointer sap) (fixnum offset)) (sap-ref-32 sap offset)) +;;; Return the 64-bit quadword at OFFSET bytes from SAP. #!+alpha (defun sap-ref-64 (sap offset) - #!+sb-doc - "Returns the 64-bit quadword at OFFSET bytes from SAP." (declare (type system-area-pointer sap) (fixnum offset)) (sap-ref-64 sap offset)) +;;; Return the 32-bit SAP at OFFSET bytes from SAP. (defun sap-ref-sap (sap offset) - #!+sb-doc - "Returns the 32-bit system-area-pointer at OFFSET bytes from SAP." (declare (type system-area-pointer sap) (fixnum offset)) (sap-ref-sap sap offset)) +;;; Return the 32-bit SINGLE-FLOAT at OFFSET bytes from SAP. (defun sap-ref-single (sap offset) - #!+sb-doc - "Returns the 32-bit single-float at OFFSET bytes from SAP." (declare (type system-area-pointer sap) (fixnum offset)) (sap-ref-single sap offset)) +;;; Return the 64-bit DOUBLE-FLOAT at OFFSET bytes from SAP. (defun sap-ref-double (sap offset) - #!+sb-doc - "Returns the 64-bit double-float at OFFSET bytes from SAP." (declare (type system-area-pointer sap) (fixnum offset)) (sap-ref-double sap offset)) +;;; Return the LONG-FLOAT at OFFSET bytes from SAP. #!+(or x86 long-float) (defun sap-ref-long (sap offset) - #!+sb-doc - "Returns the long-float at OFFSET bytes from SAP." (declare (type system-area-pointer sap) (fixnum offset)) (sap-ref-long sap offset)) +;;; Return the signed 8-bit byte at OFFSET bytes from SAP. (defun signed-sap-ref-8 (sap offset) - #!+sb-doc - "Returns the signed 8-bit byte at OFFSET bytes from SAP." (declare (type system-area-pointer sap) (fixnum offset)) (signed-sap-ref-8 sap offset)) +;;; Return the signed 16-bit word at OFFSET bytes from SAP. (defun signed-sap-ref-16 (sap offset) - #!+sb-doc - "Returns the signed 16-bit word at OFFSET bytes from SAP." (declare (type system-area-pointer sap) (fixnum offset)) (signed-sap-ref-16 sap offset)) +;;; Return the signed 32-bit dualword at OFFSET bytes from SAP. (defun signed-sap-ref-32 (sap offset) - #!+sb-doc - "Returns the signed 32-bit dualword at OFFSET bytes from SAP." (declare (type system-area-pointer sap) (fixnum offset)) (signed-sap-ref-32 sap offset)) +;;; Return the signed 64-bit quadword at OFFSET bytes from SAP. #!+alpha (defun signed-sap-ref-64 (sap offset) - #!+sb-doc - "Returns the signed 64-bit quadword at OFFSET bytes from SAP." (declare (type system-area-pointer sap) (fixnum offset)) (signed-sap-ref-64 sap offset))