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 *******************************************************************/
20 #include "../x86/sysdep.c"
23 ******************* FreeBSD P O R T B E G I N S H E R E ******************** Michael Smith
26 #if PORTABLE_LONGMULDIV == 0
27 DPUNS ficlLongMul(FICL_UNS x, FICL_UNS y)
32 qx = (uint64_t)x * (uint64_t) y;
34 q.hi = (uint32_t)( qx >> 32 );
35 q.lo = (uint32_t)( qx & 0xFFFFFFFFL);
40 UNSQR ficlLongDiv(DPUNS q, FICL_UNS y)
46 qx = (qh << 32) | q.lo;
55 void ficlTextOut(FICL_VM *pVM, char *msg, int fNewline)
60 putchar((unsigned char)*(msg++));
67 void *ficlMalloc (size_t size)
72 void *ficlRealloc (void *p, size_t size)
74 return realloc(p, size);
77 void ficlFree (void *p)
84 ** Stub function for dictionary access control - does nothing
85 ** by default, user can redefine to guarantee exclusive dict
86 ** access to a single thread for updates. All dict update code
87 ** is guaranteed to be bracketed as follows:
88 ** ficlLockDictionary(TRUE);
89 ** <code that updates dictionary>
90 ** ficlLockDictionary(FALSE);
92 ** Returns zero if successful, nonzero if unable to acquire lock
93 ** befor timeout (optional - could also block forever)
96 int ficlLockDictionary(short fLock)
101 #endif /* FICL_MULTITHREAD */