Changeset 5828
- Timestamp:
- Jan 30, 2007, 4:43:40 PM (18 years ago)
- File:
-
- 1 edited
-
trunk/ccl/lib/ffi-linuxppc32.lisp (modified) (4 diffs)
Legend:
- Unmodified
- Added
- Removed
-
trunk/ccl/lib/ffi-linuxppc32.lisp
r5803 r5828 20 20 ;;; Structures are never actually passed by value; the caller 21 21 ;;; instead passes a pointer to the structure or a copy of it. 22 ;;; Structures whose size is 8 bytes or less are returned in r3/r4; 23 ;;; this happens rarely enough that we can probably get away with 24 ;;; boxing an :UNSIGNED-DOUBLEWORD and storing it in the structure-return 25 ;;; argument. 26 22 ;;; In the EABI (which Linux uses, as opposed to the SVR4 ABI) 23 ;;; structures are always "returned" by passing a pointer to 24 ;;; a caller-allocated structure in the first argument. 27 25 (defun linux32::record-type-returns-structure-as-first-arg (rtype) 28 26 (when (and rtype … … 33 31 rtype 34 32 (parse-foreign-type rtype)))) 35 (and (typep ftype 'foreign-record-type) 36 (> (ensure-foreign-type-bits ftype) 64))))) 33 (typep ftype 'foreign-record-type)))) 37 34 38 35 … … 50 47 (argforms (pop args))) 51 48 (when (typep result-type 'foreign-record-type) 49 (setq result-form (pop args)) 52 50 (if (linux32::record-type-returns-structure-as-first-arg result-type) 53 51 (progn … … 56 54 (argforms :address) 57 55 (argforms result-form)) 56 ;; This only happens in the SVR4 ABI. 58 57 (progn 59 58 (setq result-type (parse-foreign-type :unsigned-doubleword) 60 59 result-type-spec :unsigned-doubleword 61 enclosing-form `(setf (%%get-unsigned-longlong ,result-form ))))))60 enclosing-form `(setf (%%get-unsigned-longlong ,result-form 0)))))) 62 61 (unless (evenp (length args)) 63 62 (error "~s should be an even-length list of alternating foreign types and values" args))
Note:
See TracChangeset
for help on using the changeset viewer.
