1 /*******************************************************************
3 ** Forth Inspired Command Language
4 ** Author: John Sadler (john_sadler@alum.mit.edu)
5 ** Created: 16 Oct 1997
6 ** Implementations of FICL external interface functions...
8 *******************************************************************/
19 #include "../x86/sysdep.c"
22 ******************* FreeBSD P O R T B E G I N S H E R E ******************** Michael Smith
25 #if PORTABLE_LONGMULDIV == 0
26 DPUNS
ficlLongMul(FICL_UNS x
, FICL_UNS y
)
31 qx
= (uint64_t)x
* (uint64_t) y
;
33 q
.hi
= (uint32_t)( qx
>> 32 );
34 q
.lo
= (uint32_t)( qx
& 0xFFFFFFFFL
);
39 UNSQR
ficlLongDiv(DPUNS q
, FICL_UNS y
)
45 qx
= (qh
<< 32) | q
.lo
;
54 void ficlTextOut(FICL_VM
*pVM
, char *msg
, int fNewline
)
59 putchar((unsigned char)*(msg
++));
66 void *ficlMalloc (size_t size
)
71 void *ficlRealloc (void *p
, size_t size
)
73 return realloc(p
, size
);
76 void ficlFree (void *p
)
83 ** Stub function for dictionary access control - does nothing
84 ** by default, user can redefine to guarantee exclusive dict
85 ** access to a single thread for updates. All dict update code
86 ** is guaranteed to be bracketed as follows:
87 ** ficlLockDictionary(TRUE);
88 ** <code that updates dictionary>
89 ** ficlLockDictionary(FALSE);
91 ** Returns zero if successful, nonzero if unable to acquire lock
92 ** befor timeout (optional - could also block forever)
95 int ficlLockDictionary(short fLock
)
100 #endif /* FICL_MULTITHREAD */