Ignore:
Timestamp:
Jan 6, 2009, 6:00:06 PM (12 years ago)
Author:
rme
Message:

Additional x8632 FFI details involving structure return and callbacks.

DEFINE-CALLBACK: add hair to recognize when a hidden first argument
will need to be discarded on return. Try to deal with interactions
with the win32 _stdcall case, too. Pass info argument to
DEFINE-CALLBACK-FUNCTION that encodes the arg discard information.

DEFINE-CALLBACK-FUNCTION: pass said info argument to
MAKE-CALLBACK-TRAMPOLINE.

MAKE-CALLBACK-TRAMPOLINE: pack arg discarding information and the
callback index into the value that gets passed to .SPcallback via
the %eax register.

.SPcallback: decode this information, and handle discarding the
appropriate number of args on return.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/source/level-1/l1-callbacks.lisp

    r11186 r11590  
    2323
    2424;;; (defcallback ...) expands into a call to this function.
    25 (defun define-callback-function (lisp-function  &optional doc-string (without-interrupts t) (info 0) &aux name trampoline)
     25(defun define-callback-function (lisp-function  &optional doc-string (without-interrupts t) info &aux name trampoline)
    2626  (unless (functionp lisp-function)
    2727    (setq lisp-function (require-type lisp-function 'function)))
     
    5858                       (unless (%svref %pascal-functions% i)
    5959                         (return i)))))
    60           (setq trampoline (make-callback-trampoline index (or info 0)))
     60          (setq trampoline (make-callback-trampoline index info))
    6161          (setf (%svref %pascal-functions% index)
    6262                (%cons-pfe trampoline info lisp-function name without-interrupts)))))
Note: See TracChangeset for help on using the changeset viewer.