version 1.17, 2008/03/25 10:41:30
|
version 1.21, 2008/06/01 12:18:56
|
Line 23
|
Line 23
|
|
|
require libcc.fs |
require libcc.fs |
|
|
|
clear-libs s" ffi" add-lib |
|
|
\c #include <ffi.h> |
\c #include <ffi.h> |
\c static Cell *gforth_RP; |
\c static Cell *gforth_RP; |
\c static char *gforth_LP; |
\c static unsigned char *gforth_LP; |
\c static void **gforth_clist; |
\c static void **gforth_clist; |
\c static void *gforth_ritem; |
\c static void *gforth_ritem; |
\c typedef void *Label; |
\c typedef void *Label; |
\c typedef Label *Xt; |
\c typedef Label *Xt; |
|
\c Label *gforth_engine(Xt *ip, Cell *sp, Cell *rp0, Float *fp, unsigned char *lp); |
\c static void gforth_callback_ffi(ffi_cif * cif, void * resp, void ** args, void * ip) |
\c static void gforth_callback_ffi(ffi_cif * cif, void * resp, void ** args, void * ip) |
\c { |
\c { |
\c Cell *rp1 = gforth_RP; |
\c Cell *rp1 = gforth_RP; |
\c Cell *sp = gforth_SP; |
\c Cell *sp = gforth_SP; |
\c Float *fp = gforth_FP; |
\c Float *fp = gforth_FP; |
\c char *lp = gforth_LP; |
\c unsigned char *lp = gforth_LP; |
\c void ** clist = gforth_clist; |
\c void ** clist = gforth_clist; |
\c void * ritem = gforth_ritem; |
\c void * ritem = gforth_ritem; |
\c |
\c |
Line 80 c-function ffi-call ffi_call1 a a a a --
|
Line 83 c-function ffi-call ffi_call1 a a a a --
|
|
|
\c #define ffi_prep_closure1(a_ip, a_cif, a_closure) \ |
\c #define ffi_prep_closure1(a_ip, a_cif, a_closure) \ |
\c ffi_prep_closure((ffi_closure *)a_closure, (ffi_cif *)a_cif, gforth_callback_ffi, (void *)a_ip) |
\c ffi_prep_closure((ffi_closure *)a_closure, (ffi_cif *)a_cif, gforth_callback_ffi, (void *)a_ip) |
c-function ffi-prep-closure a a a -- n |
c-function ffi-prep-closure ffi_prep_closure1 a a a -- n |
|
|
\ !! use ud? |
\ !! use ud? |
\c #define ffi_2fetch(a_addr) (*(long long *)a_addr) |
\c #define ffi_2fetch(a_addr) (*(long long *)a_addr) |