Apply a number of fixes for the Alpha platform.

This commit is contained in:
Daniel C. Sobral 2000-06-02 20:07:56 +00:00
parent 60ed92ddd3
commit 11b96475f7
Notes: svn2git 2020-12-20 02:59:44 +00:00
svn path=/head/; revision=61182
7 changed files with 21 additions and 57 deletions

View File

@ -14,9 +14,6 @@
#include <stdlib.h>
#else
#include <stand.h>
#ifdef __i386__
#include <machine/cpufunc.h>
#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

View File

@ -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

View File

@ -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;

View File

@ -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

View File

@ -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;
}

View File

@ -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];
}

View File

@ -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;
}