Foreign Function Interface, as released 2009-03-18.
authorMatt Birkholz <matt@birkholz.chandler.az.us>
Fri, 15 May 2009 06:31:31 +0000 (23:31 -0700)
committerMatt Birkholz <matt@birkholz.chandler.az.us>
Mon, 18 May 2009 17:33:14 +0000 (10:33 -0700)
commitfad32e1a80cdc3e99cfec93af5f6becd9d99ff64
tree60436e8f45614ec4677ca9a7cb6acf7304d1d290
parent645587e343ef1f3961fa6f2f0ba08af0bdeddb64
Foreign Function Interface, as released 2009-03-18.

* doc/Makefile.in:

Include ffi in SUBDIRS.  Fixed a command that halted `make install`
whenever $(DESTDIR)$(infodir)/dir existed.

* doc/configure.ac:

Include ffi/Makefile.

* doc/ffi/Makefile.in:

Build the Users' Manual for the FFI.

* doc/ffi/ffi.texinfo:

The Users' Manual for the FFI.

* doc/index.html:

Include mit-scheme-ffi/index.html, and an $Id:$ stamp.

* src/Makefile.in:

Optimistically included ffi in LIARC_BUNDLES.  Use --batch-mode more.

* src/README.txt:

Punted mention of bchscheme.  Describe ffi as part of the core.

* src/Setup.sh:

Include ffi in INSTALLED_SUBDIRS.  Create lib/mit-scheme.h and
lib/ffi.

* src/configure.ac:

Include ffi/Makefile.  Include ffi in liarc BUNDLEs.

* src/etc/compile.scm:

Include ffi in list for compile-dir.

* src/etc/create-makefiles.sh:

Include ffi in BUNDLES.  Use --batch-mode.

* src/etc/optiondb.scm:

Define loadable option 'FFI.

* src/ffi/Makefile-fragment:

Install the FFI.  Show how to build the example.

* src/ffi/: cdecls.scm, compile.scm, ctypes.scm, ed-ffi.scm, ffi.pkg,
generator.scm, load.scm, syntax.scm:

The FFI .cdecl file reader, syntax expanders and trampoline generator.

* src/ffi/prhello.cdecl, src/ffi/prhello.scm:

The example, Gtk 2.0, primitive "Hello, World!" program.

* src/microcode/boot.c:

Initialize the C data stack (ffi_obstack) alongside scratch_obstack.
Give Interpret() a pop_return_p argument.

* src/microcode/configure.ac:

Include pruxffi whenever pruxdld is available.

* src/microcode/const.h:

Declare PRIM_RETURN_TO_C and PRIM_ABORT_TO_C -- two new ways to exit
the interpreter that leave it ready for re-entry via Interpret(1).

* src/microcode/extern.h:

Declare ffi_obstack, find_primitive_cname, and a pop_return_p
parameter to Interpret().

* src/microcode/fixobj.h, src/microcode/utabmd.scm:

Include a CALLBACK-HANDLER slot in the fixed objects vector.

* src/microcode/interp.c:

Added a pop_return_p parameter to Interpret().  Implemented the new
PRIM_RETURN_TO_C and PRIM_ABORT_TO_C aborts.

* src/microcode/makegen/Makefile.in.in:

Install mit-scheme.h.

* src/microcode/makegen/files-optional.scm:

Include pruxffi in the list.

* src/microcode/primutl.c:

Needed a find_primitive_cname function taking a C string.  A similar
function, find_primitive, already takes a Scheme string.  Modified it
into find_primitive_cname, in terms of which find_primitive was easily
re-implemented.

* src/microcode/pruxdld.c:

Failed function is "dlsym", not "dlopen", in dld_lookup.

* src/microcode/pruxffi.c, src/microcode/pruxffi.h:

The FFI's C/Unix primitives.

* src/runtime/ed-ffi.scm, src/runtime/ffi.scm:

Runtime support for the FFI: aliens, alien-functions, malloc/free, a
callback-handler...

* src/runtime/make.scm:

Include (runtime ffi) in the package-initialization-sequence.

* src/runtime/runtime.pkg:

Declare a (runtime ffi) package, with a link to without-preemption in
(runtime thread).

* src/runtime/thread.scm:

Added the without-timer-interrupts procedure for use by the call-alien
procedure in (runtime ffi).  This halts thread switching during the
callout, forcing all chains of callouts interrupted by callbacks who
make callouts that are interrupted by callbacks... to run in one
thread, preserving the order imposed by one C stack.  If two
callbacks, "Newer" nested inside "Older" on the C stack, are running
in two Scheme threads, Scheme could proceed with Older before Newer,
returning a value for Older to a callback trampoline expecting the
value of Newer.  Blam!
41 files changed:
doc/Makefile.in
doc/configure.ac
doc/ffi/Makefile.in [new file with mode: 0644]
doc/ffi/ffi.texinfo [new file with mode: 0644]
doc/index.html
src/Makefile.in
src/README.txt
src/Setup.sh
src/configure.ac
src/etc/compile.scm
src/etc/create-makefiles.sh
src/etc/optiondb.scm
src/ffi/Makefile-fragment [new file with mode: 0644]
src/ffi/cdecls.scm [new file with mode: 0644]
src/ffi/compile.scm [new file with mode: 0644]
src/ffi/ctypes.scm [new file with mode: 0644]
src/ffi/ed-ffi.scm [new file with mode: 0644]
src/ffi/ffi.pkg [new file with mode: 0644]
src/ffi/generator.scm [new file with mode: 0644]
src/ffi/load.scm [new file with mode: 0644]
src/ffi/prhello.cdecl [new file with mode: 0644]
src/ffi/prhello.scm [new file with mode: 0644]
src/ffi/syntax.scm [new file with mode: 0644]
src/microcode/boot.c
src/microcode/configure.ac
src/microcode/const.h
src/microcode/extern.h
src/microcode/fixobj.h
src/microcode/interp.c
src/microcode/makegen/Makefile.in.in
src/microcode/makegen/files-optional.scm
src/microcode/primutl.c
src/microcode/pruxdld.c
src/microcode/pruxffi.c [new file with mode: 0644]
src/microcode/pruxffi.h [new file with mode: 0644]
src/microcode/utabmd.scm
src/runtime/ed-ffi.scm
src/runtime/ffi.scm [new file with mode: 0644]
src/runtime/make.scm
src/runtime/runtime.pkg
src/runtime/thread.scm