dtrace: Address KMSAN warnings in dtrace_disx86
[freebsd/src.git] / stand / ficl / i386 / sysdep.c
blob41a5c679e9b38c99f1034860be68cccded473ba0
1 /*******************************************************************
2 ** s y s d e p . c
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...
7 **
8 *******************************************************************/
11 #ifdef TESTMAIN
12 #include <stdio.h>
13 #include <stdlib.h>
14 #else
15 #include <stand.h>
16 #endif
17 #include "ficl.h"
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)
28 DPUNS q;
29 uint64_t qx;
31 qx = (uint64_t)x * (uint64_t) y;
33 q.hi = (uint32_t)( qx >> 32 );
34 q.lo = (uint32_t)( qx & 0xFFFFFFFFL);
36 return q;
39 UNSQR ficlLongDiv(DPUNS q, FICL_UNS y)
41 UNSQR result;
42 uint64_t qx, qh;
44 qh = q.hi;
45 qx = (qh << 32) | q.lo;
47 result.quot = qx / y;
48 result.rem = qx % y;
50 return result;
52 #endif
54 void ficlTextOut(FICL_VM *pVM, char *msg, int fNewline)
56 IGNORE(pVM);
58 while(*msg != 0)
59 putchar((unsigned char)*(msg++));
60 if (fNewline)
61 putchar('\n');
63 return;
66 void *ficlMalloc (size_t size)
68 return malloc(size);
71 void *ficlRealloc (void *p, size_t size)
73 return realloc(p, size);
76 void ficlFree (void *p)
78 free(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)
94 #if FICL_MULTITHREAD
95 int ficlLockDictionary(short fLock)
97 IGNORE(fLock);
98 return 0;
100 #endif /* FICL_MULTITHREAD */