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 *******************************************************************/
11 * $FreeBSD: src/sys/boot/ficl/sparc64/sysdep.c,v 1.1 2002/05/19 23:20:56 jake Exp $
12 * $DragonFly: src/sys/boot/ficl/sparc64/sysdep.c,v 1.1 2003/11/10 06:08:34 dillon Exp $
24 ******************* FreeBSD P O R T B E G I N S H E R E ******************** Michael Smith
27 #if PORTABLE_LONGMULDIV == 0
28 DPUNS
ficlLongMul(FICL_UNS x
, FICL_UNS y
)
33 qx
= (u_int64_t
)x
* (u_int64_t
) y
;
35 q
.hi
= (u_int32_t
)( qx
>> 32 );
36 q
.lo
= (u_int32_t
)( qx
& 0xFFFFFFFFL
);
41 UNSQR
ficlLongDiv(DPUNS q
, FICL_UNS y
)
47 qx
= (qh
<< 32) | q
.lo
;
56 void ficlTextOut(FICL_VM
*pVM
, char *msg
, int fNewline
)
68 void *ficlMalloc (size_t size
)
73 void *ficlRealloc (void *p
, size_t size
)
75 return realloc(p
, size
);
78 void ficlFree (void *p
)
85 ** Stub function for dictionary access control - does nothing
86 ** by default, user can redefine to guarantee exclusive dict
87 ** access to a single thread for updates. All dict update code
88 ** is guaranteed to be bracketed as follows:
89 ** ficlLockDictionary(TRUE);
90 ** <code that updates dictionary>
91 ** ficlLockDictionary(FALSE);
93 ** Returns zero if successful, nonzero if unable to acquire lock
94 ** befor timeout (optional - could also block forever)
97 int ficlLockDictionary(short fLock
)
102 #endif /* FICL_MULTITHREAD */