From 11b96475f782bd7581dcdcdaece1df282856a8ff Mon Sep 17 00:00:00 2001 From: "Daniel C. Sobral" Date: Fri, 2 Jun 2000 20:07:56 +0000 Subject: [PATCH] Apply a number of fixes for the Alpha platform. --- sys/boot/ficl/alpha/sysdep.c | 36 ------------------------------------ sys/boot/ficl/alpha/sysdep.h | 12 ++++++------ sys/boot/ficl/dict.c | 6 +++--- sys/boot/ficl/ficl.h | 16 ++++++++-------- sys/boot/ficl/testmain.c | 2 +- sys/boot/ficl/vm.c | 4 ++-- sys/boot/ficl/words.c | 2 +- 7 files changed, 21 insertions(+), 57 deletions(-) diff --git a/sys/boot/ficl/alpha/sysdep.c b/sys/boot/ficl/alpha/sysdep.c index 2a5346aa7b43..00b0d4acf0e3 100644 --- a/sys/boot/ficl/alpha/sysdep.c +++ b/sys/boot/ficl/alpha/sysdep.c @@ -14,9 +14,6 @@ #include #else #include -#ifdef __i386__ -#include -#endif #endif #include "ficl.h" @@ -80,39 +77,6 @@ void ficlFree (void *p) free(p); } -#ifndef TESTMAIN -#ifdef __i386__ -/* - * outb ( port# c -- ) - * Store a byte to I/O port number port# - */ -void -ficlOutb(FICL_VM *pVM) -{ - u_char c; - u_int32_t port; - - port=stackPopUNS(pVM->pStack); - c=(u_char)stackPopINT(pVM->pStack); - outb(port,c); -} - -/* - * inb ( port# -- c ) - * Fetch a byte from I/O port number port# - */ -void -ficlInb(FICL_VM *pVM) -{ - u_char c; - u_int32_t port; - - port=stackPopUNS(pVM->pStack); - c=inb(port); - stackPushINT(pVM->pStack,c); -} -#endif -#endif /* ** Stub function for dictionary access control - does nothing diff --git a/sys/boot/ficl/alpha/sysdep.h b/sys/boot/ficl/alpha/sysdep.h index 661a49642102..1803352b0a76 100644 --- a/sys/boot/ficl/alpha/sysdep.h +++ b/sys/boot/ficl/alpha/sysdep.h @@ -66,11 +66,11 @@ ** System dependent data type declarations... */ #if !defined INT32 -#define INT32 long +#define INT32 int #endif #if !defined UNS32 -#define UNS32 unsigned long +#define UNS32 unsigned int #endif #if !defined UNS16 @@ -91,18 +91,18 @@ ** FICL_INT. */ #if !defined FICL_INT -#define FICL_INT INT32 +#define FICL_INT long #endif #if !defined FICL_UNS -#define FICL_UNS UNS32 +#define FICL_UNS unsigned long #endif /* ** Ficl presently supports values of 32 and 64 for BITS_PER_CELL */ #if !defined BITS_PER_CELL -#define BITS_PER_CELL 32 +#define BITS_PER_CELL 64 #endif #if ((BITS_PER_CELL != 32) && (BITS_PER_CELL != 64)) @@ -248,7 +248,7 @@ typedef struct ** machine. 3 would be appropriate for a 64 bit machine. */ #if !defined FICL_ALIGN -#define FICL_ALIGN 4 +#define FICL_ALIGN 3 #define FICL_ALIGN_ADD ((1 << FICL_ALIGN) - 1) #endif diff --git a/sys/boot/ficl/dict.c b/sys/boot/ficl/dict.c index 5f75a25ed899..d12428c98458 100644 --- a/sys/boot/ficl/dict.c +++ b/sys/boot/ficl/dict.c @@ -235,10 +235,10 @@ FICL_WORD *dictAppendWord2(FICL_DICT *pDict, /************************************************************************** - d i c t A p p e n d U N S 3 2 -** Append the specified UNS32 to the dictionary + d i c t A p p e n d U N S +** Append the specified FICL_UNS to the dictionary **************************************************************************/ -void dictAppendUNS(FICL_DICT *pDict, UNS32 u) +void dictAppendUNS(FICL_DICT *pDict, FICL_UNS u) { *pDict->here++ = LVALUEtoCELL(u); return; diff --git a/sys/boot/ficl/ficl.h b/sys/boot/ficl/ficl.h index 176d9478390f..1b5f0bda2247 100644 --- a/sys/boot/ficl/ficl.h +++ b/sys/boot/ficl/ficl.h @@ -281,13 +281,13 @@ typedef struct _ficl_string typedef struct { - UNS32 count; + FICL_UNS count; char *cp; } STRINGINFO; #define SI_COUNT(si) (si.count) #define SI_PTR(si) (si.cp) -#define SI_SETLEN(si, len) (si.count = (UNS32)(len)) +#define SI_SETLEN(si, len) (si.count = (FICL_UNS)(len)) #define SI_SETPTR(si, ptr) (si.cp = (char *)(ptr)) /* ** Init a STRINGINFO from a pointer to NULL-terminated string @@ -425,8 +425,8 @@ typedef struct vm IPTYPE ip; /* instruction pointer */ struct ficl_word *runningWord;/* address of currently running word (often just *(ip-1) ) */ - UNS32 state; /* compiling or interpreting */ - UNS32 base; /* number conversion base */ + FICL_UNS state; /* compiling or interpreting */ + FICL_UNS base; /* number conversion base */ FICL_STACK *pStack; /* param stack */ FICL_STACK *rStack; /* return stack */ CELL sourceID; /* -1 if string, 0 if normal input */ @@ -572,7 +572,7 @@ void vmCheckStack(FICL_VM *pVM, int popCells, int pushCells); ** PopTib restores the TIB state given a saved TIB from PushTib ** GetInBuf returns a pointer to the next unused char of the TIB */ -void vmPushTib(FICL_VM *pVM, char *text, INT32 nChars, TIB *pSaveTib); +void vmPushTib(FICL_VM *pVM, char *text, FICL_INT nChars, TIB *pSaveTib); void vmPopTib(FICL_VM *pVM, TIB *pTib); #define vmGetInBuf(pVM) ((pVM)->tib.cp + (pVM)->tib.index) #define vmGetInBufLen(pVM) ((pVM)->tib.end - (pVM)->tib.cp) @@ -758,7 +758,7 @@ void ficlTermSystem(void); ** Successful creation and init of the VM by ficlNewVM (or equiv) */ int ficlExec (FICL_VM *pVM, char *pText); -int ficlExecC(FICL_VM *pVM, char *pText, INT32 nChars); +int ficlExecC(FICL_VM *pVM, char *pText, FICL_INT nChars); int ficlExecXT(FICL_VM *pVM, FICL_WORD *pWord); /* @@ -807,8 +807,8 @@ FICL_WORD *ficlLookup(char *name); */ FICL_DICT *ficlGetDict(void); FICL_DICT *ficlGetEnv(void); -void ficlSetEnv(char *name, UNS32 value); -void ficlSetEnvD(char *name, UNS32 hi, UNS32 lo); +void ficlSetEnv(char *name, FICL_UNS value); +void ficlSetEnvD(char *name, FICL_UNS hi, FICL_UNS lo); #if FICL_WANT_LOCALS FICL_DICT *ficlGetLoc(void); #endif diff --git a/sys/boot/ficl/testmain.c b/sys/boot/ficl/testmain.c index 8871ca90819b..75e1d888c3c9 100644 --- a/sys/boot/ficl/testmain.c +++ b/sys/boot/ficl/testmain.c @@ -227,7 +227,7 @@ static void ficlBreak(FICL_VM *pVM) static void ficlClock(FICL_VM *pVM) { clock_t now = clock(); - stackPushUNS(pVM->pStack, (UNS32)now); + stackPushUNS(pVM->pStack, (FICL_UNS)now); return; } diff --git a/sys/boot/ficl/vm.c b/sys/boot/ficl/vm.c index 0676cdb982f0..3608d29bbe7a 100644 --- a/sys/boot/ficl/vm.c +++ b/sys/boot/ficl/vm.c @@ -176,7 +176,7 @@ STRINGINFO vmGetWord0(FICL_VM *pVM) char *pSrc = vmGetInBuf(pVM); char *pEnd = vmGetInBufEnd(pVM); STRINGINFO si; - UNS32 count = 0; + FICL_UNS count = 0; char ch; pSrc = skipSpace(pSrc, pEnd); @@ -595,7 +595,7 @@ char *ultoa(FICL_UNS value, char *string, int radix ) while (ud.lo) { - result = ficlLongDiv(ud, (UNS32)radix); + result = ficlLongDiv(ud, (FICL_UNS)radix); ud.lo = result.quot; *cp++ = digits[result.rem]; } diff --git a/sys/boot/ficl/words.c b/sys/boot/ficl/words.c index 3e0fc18f508a..3f9219f9cddc 100644 --- a/sys/boot/ficl/words.c +++ b/sys/boot/ficl/words.c @@ -1024,7 +1024,7 @@ static void iFetch(FICL_VM *pVM) #if FICL_ROBUST > 1 vmCheckStack(pVM, 1, 1); #endif - pw = (UNS32)stackPopPtr(pVM->pStack); + pw = (UNS32 *)stackPopPtr(pVM->pStack); stackPushUNS(pVM->pStack, (FICL_UNS)*pw); return; }