X-Git-Url: http://repo.macrolet.net/gitweb/?a=blobdiff_plain;f=src%2Fcompiler%2Falpha%2Fc-call.lisp;h=6b3ead794307952a3752b77351b2b10b8431bb22;hb=ffa9a31f62e3e2abab8ebcbb3bfdab9725feaf7f;hp=1624938b85931131b9eabda1bef8519a672c9e97;hpb=dfa55a883f94470267b626dae77ce7e7dfac3df6;p=sbcl.git diff --git a/src/compiler/alpha/c-call.lisp b/src/compiler/alpha/c-call.lisp index 1624938..6b3ead7 100644 --- a/src/compiler/alpha/c-call.lisp +++ b/src/compiler/alpha/c-call.lisp @@ -1,23 +1,15 @@ -;;; -*- Package: ALPHA -*- -;;; -;;; ********************************************************************** -;;; This code was written as part of the CMU Common Lisp project at -;;; Carnegie Mellon University, and has been placed in the public domain. -;;; - -;;; -;;; ********************************************************************** -;;; -;;; This file contains the VOPs and other necessary machine specific support -;;; routines for call-out to C. -;;; -;;; Written by William Lott. -;;; Converted by Sean Hallgren. -;;; -(in-package "SB!VM") +;;;; VOPs and other machine-specific support routines for call-out to C + +;;;; This software is part of the SBCL system. See the README file for +;;;; more information. +;;;; +;;;; This software is derived from the CMU CL system, which was +;;;; written at Carnegie Mellon University and released into the +;;;; public domain. The software is in the public domain and is +;;;; provided with absolutely no warranty. See the COPYING and CREDITS +;;;; files for more information. -(use-package "SB!ALIEN") -(use-package "SB!ALIEN-INTERNALS") +(in-package "SB!VM") (defun my-make-wired-tn (prim-type-name sc-name offset) (make-wired-tn (primitive-type-or-lose prim-type-name ) @@ -27,7 +19,7 @@ (defstruct arg-state (stack-frame-size 0)) -(def-alien-type-method (integer :arg-tn) (type state) +(define-alien-type-method (integer :arg-tn) (type state) (let ((stack-frame-size (arg-state-stack-frame-size state))) (setf (arg-state-stack-frame-size state) (1+ stack-frame-size)) (multiple-value-bind @@ -39,7 +31,7 @@ (my-make-wired-tn ptype reg-sc (+ stack-frame-size nl0-offset)) (my-make-wired-tn ptype stack-sc (* 2 (- stack-frame-size 4))))))) -(def-alien-type-method (system-area-pointer :arg-tn) (type state) +(define-alien-type-method (system-area-pointer :arg-tn) (type state) (declare (ignore type)) (let ((stack-frame-size (arg-state-stack-frame-size state))) (setf (arg-state-stack-frame-size state) (1+ stack-frame-size)) @@ -51,7 +43,7 @@ 'sap-stack (* 2 (- stack-frame-size 4)))))) -(def-alien-type-method (double-float :arg-tn) (type state) +(define-alien-type-method (double-float :arg-tn) (type state) (declare (ignore type)) (let ((stack-frame-size (arg-state-stack-frame-size state))) (setf (arg-state-stack-frame-size state) (1+ stack-frame-size)) @@ -63,7 +55,7 @@ 'double-stack (* 2 (- stack-frame-size 6)))))) -(def-alien-type-method (single-float :arg-tn) (type state) +(define-alien-type-method (single-float :arg-tn) (type state) (declare (ignore type)) (let ((stack-frame-size (arg-state-stack-frame-size state))) (setf (arg-state-stack-frame-size state) (1+ stack-frame-size)) @@ -75,9 +67,7 @@ 'single-stack (* 2 (- stack-frame-size 6)))))) - - -(def-alien-type-method (integer :result-tn) (type state) +(define-alien-type-method (integer :result-tn) (type state) (declare (ignore state)) (multiple-value-bind (ptype reg-sc) @@ -86,19 +76,19 @@ (values 'unsigned-byte-64 'unsigned-reg)) (my-make-wired-tn ptype reg-sc lip-offset))) -(def-alien-type-method (system-area-pointer :result-tn) (type state) +(define-alien-type-method (system-area-pointer :result-tn) (type state) (declare (ignore type state)) (my-make-wired-tn 'system-area-pointer 'sap-reg lip-offset)) -(def-alien-type-method (double-float :result-tn) (type state) +(define-alien-type-method (double-float :result-tn) (type state) (declare (ignore type state)) (my-make-wired-tn 'double-float 'double-reg lip-offset)) -(def-alien-type-method (single-float :result-tn) (type state) +(define-alien-type-method (single-float :result-tn) (type state) (declare (ignore type state)) (my-make-wired-tn 'single-float 'single-reg lip-offset)) -(def-alien-type-method (values :result-tn) (type state) +(define-alien-type-method (values :result-tn) (type state) (let ((values (alien-values-type-values type))) (when (cdr values) (error "Too many result values from c-call.")) @@ -108,16 +98,15 @@ (!def-vm-support-routine make-call-out-tns (type) (let ((arg-state (make-arg-state))) (collect ((arg-tns)) - (dolist (arg-type (alien-function-type-arg-types type)) + (dolist (arg-type (alien-fun-type-arg-types type)) (arg-tns (invoke-alien-type-method :arg-tn arg-type arg-state))) (values (my-make-wired-tn 'positive-fixnum 'any-reg nsp-offset) - (* (max (arg-state-stack-frame-size arg-state) 4) word-bytes) + (* (max (arg-state-stack-frame-size arg-state) 4) n-word-bytes) (arg-tns) (invoke-alien-type-method :result-tn - (alien-function-type-result-type type) + (alien-fun-type-result-type type) nil))))) - (define-vop (foreign-symbol-address) (:translate foreign-symbol-address) (:policy :fast-safe)