Get rid of vm-support-routines indirection.
[sbcl.git] / src / compiler / mips / c-call.lisp
index eae4850..fcaecfb 100644 (file)
                 (invoke-alien-type-method :result-tn type state))
             values)))
 
-(!def-vm-support-routine make-call-out-tns (type)
+(defun make-call-out-tns (type)
   (let ((arg-state (make-arg-state)))
     (collect ((arg-tns))
       (dolist (arg-type (alien-fun-type-arg-types type))
@@ -452,7 +452,15 @@ and a pointer to the arguments."
       (finalize-segment segment)
       ;; Now that the segment is done, convert it to a static
       ;; vector we can point foreign code to.
-      (let ((buffer (sb!assem::segment-buffer segment)))
-        (make-static-vector (length buffer)
-                            :element-type '(unsigned-byte 8)
-                            :initial-contents buffer)))))
+      (let* ((buffer (sb!assem::segment-buffer segment))
+             (vector (make-static-vector (length buffer)
+                                         :element-type '(unsigned-byte 8)
+                                         :initial-contents buffer))
+             (sap (sb!sys:vector-sap vector)))
+        (sb!alien:alien-funcall
+         (sb!alien:extern-alien "os_flush_icache"
+                                (function void
+                                          system-area-pointer
+                                          unsigned-long))
+         sap (length buffer))
+        vector))))