summaryrefslogtreecommitdiff
path: root/misc/pascal/insn16
diff options
context:
space:
mode:
Diffstat (limited to 'misc/pascal/insn16')
-rw-r--r--misc/pascal/insn16/include/pexec.h38
-rw-r--r--misc/pascal/insn16/popt/pjopt.h2
-rw-r--r--misc/pascal/insn16/popt/plopt.h2
-rw-r--r--misc/pascal/insn16/prun/pdbg.c26
-rw-r--r--misc/pascal/insn16/prun/pexec.c12
-rw-r--r--misc/pascal/insn16/prun/pload.c2
-rw-r--r--misc/pascal/insn16/prun/prun.c1
7 files changed, 41 insertions, 42 deletions
diff --git a/misc/pascal/insn16/include/pexec.h b/misc/pascal/insn16/include/pexec.h
index e3717ca73..d593232c3 100644
--- a/misc/pascal/insn16/include/pexec.h
+++ b/misc/pascal/insn16/include/pexec.h
@@ -54,8 +54,8 @@
****************************************************************************/
typedef uint16_t ustack_t; /* Stack values are 16-bits in length */
-typedef int16_t sstack_t;
-typedef uint16_t addr_t; /* Addresses are 16-bits in length */
+typedef int16_t sstack_t;
+typedef uint16_t paddr_t; /* Addresses are 16-bits in length */
typedef uint16_t level_t; /* Limits to MAXUINT16 levels */
union stack_u
@@ -74,18 +74,18 @@ struct pexec_attr_s
/* Instruction space (I-Space) */
FAR uint8_t *ispace; /* Allocated I-Space containing p-code data */
- addr_t entry; /* Entry point */
- addr_t maxpc; /* Last valid p-code address */
+ paddr_t entry; /* Entry point */
+ paddr_t maxpc; /* Last valid p-code address */
/* Read-only data block */
FAR uint8_t *rodata; /* Address of read-only data block */
- addr_t rosize; /* Size of read-only data block */
+ paddr_t rosize; /* Size of read-only data block */
/* Allocate for variable storage */
- addr_t varsize; /* Variable storage size */
- addr_t strsize; /* String storage size */
+ paddr_t varsize; /* Variable storage size */
+ paddr_t strsize; /* String storage size */
};
/* This structure defines the current state of the p-code interpreter */
@@ -102,7 +102,7 @@ struct pexec_s
/* Address of last valid P-Code */
- addr_t maxpc;
+ paddr_t maxpc;
/* These are the emulated P-Machine registers:
*
@@ -116,19 +116,19 @@ struct pexec_s
* pc: Holds the current p-code location
*/
- addr_t spb; /* Pascal stack base */
- addr_t sp; /* Pascal stack pointer */
- addr_t csp; /* Character stack pointer */
- addr_t fp; /* Base of the current frame */
- addr_t rop; /* Read-only data pointer */
- addr_t pc; /* Program counter */
+ paddr_t spb; /* Pascal stack base */
+ paddr_t sp; /* Pascal stack pointer */
+ paddr_t csp; /* Character stack pointer */
+ paddr_t fp; /* Base of the current frame */
+ paddr_t rop; /* Read-only data pointer */
+ paddr_t pc; /* Program counter */
/* Info needed to perform a simulated reset */
- addr_t strsize; /* String stack size */
- addr_t rosize; /* Read-only stack size */
- addr_t entry; /* Entry point */
- addr_t stacksize; /* (debug only) */
+ paddr_t strsize; /* String stack size */
+ paddr_t rosize; /* Read-only stack size */
+ paddr_t entry; /* Entry point */
+ paddr_t stacksize; /* (debug only) */
};
/****************************************************************************
@@ -142,7 +142,7 @@ extern "C" {
#define EXTERN extern
#endif
-EXTERN FAR struct pexec_s *pload(const char *filename, addr_t varsize, addr_t strsize);
+EXTERN FAR struct pexec_s *pload(const char *filename, paddr_t varsize, paddr_t strsize);
EXTERN FAR struct pexec_s *pexec_init(struct pexec_attr_s *attr);
EXTERN int pexec(FAR struct pexec_s *st);
EXTERN void pexec_reset(struct pexec_s *st);
diff --git a/misc/pascal/insn16/popt/pjopt.h b/misc/pascal/insn16/popt/pjopt.h
index 4c083e0e3..892ac3385 100644
--- a/misc/pascal/insn16/popt/pjopt.h
+++ b/misc/pascal/insn16/popt/pjopt.h
@@ -49,4 +49,4 @@
int16_t BranchOptimize(void);
-#endif /* __PJOPT_H */ \ No newline at end of file
+#endif /* __PJOPT_H */
diff --git a/misc/pascal/insn16/popt/plopt.h b/misc/pascal/insn16/popt/plopt.h
index eab655930..e38a726e7 100644
--- a/misc/pascal/insn16/popt/plopt.h
+++ b/misc/pascal/insn16/popt/plopt.h
@@ -50,5 +50,5 @@
extern int16_t LoadOptimize ( void );
extern int16_t StoreOptimize ( void );
-#endif __PLOPT_H
+#endif /* __PLOPT_H */
diff --git a/misc/pascal/insn16/prun/pdbg.c b/misc/pascal/insn16/prun/pdbg.c
index 9b7c4f5d2..4f9dc35d3 100644
--- a/misc/pascal/insn16/prun/pdbg.c
+++ b/misc/pascal/insn16/prun/pdbg.c
@@ -91,8 +91,8 @@ enum command_e
struct trace_s
{
- addr_t pc;
- addr_t sp;
+ paddr_t pc;
+ paddr_t sp;
ustack_t tos;
};
typedef struct trace_s trace_t;
@@ -117,11 +117,11 @@ static void pdbg_execcommand(struct pexec_s *st, enum command_e cmd, uint32_t
static int32_t pdbg_readdecimal(char *ptr);
static int32_t pdbg_readhex(char *ptr, int32_t defaultvalue);
static void pdbg_programstatus(struct pexec_s *st);
-static addr_t pdbg_printpcode(struct pexec_s *st, addr_t pc, int16_t nitems);
-static addr_t pdbg_printstack(struct pexec_s *st, addr_t sp, int16_t nitems);
+static paddr_t pdbg_printpcode(struct pexec_s *st, paddr_t pc, int16_t nitems);
+static paddr_t pdbg_printstack(struct pexec_s *st, paddr_t sp, int16_t nitems);
static void pdbg_printregisters(struct pexec_s *st);
static void pdbg_printtracearray(struct pexec_s *st);
-static void pdbg_addbreakpoint(addr_t pc);
+static void pdbg_addbreakpoint(paddr_t pc);
static void pdbg_deletebreakpoint(int16_t bpno);
static void pdbg_printbreakpoints(struct pexec_s *st);
static void pdbg_checkbreakpoint(struct pexec_s *st);
@@ -144,14 +144,14 @@ static uint16_t g_tracendx;
/* This is the index into the circular g_tracearray */
static uint16_t g_ntracepoints;
/* This is the number of valid enties in g_tracearray */
-static addr_t g_breakpoint[MAX_BREAK_POINTS];
+static paddr_t g_breakpoint[MAX_BREAK_POINTS];
/* Contains address associated with all active */
/* break points. */
-static addr_t g_untilpoint;
+static paddr_t g_untilpoint;
/* The 'g_untilpoint' is a temporary breakpoint */
static uint16_t g_nbreakpoints;
/* Number of items in breakPoints[] */
-static addr_t g_displayloc;
+static paddr_t g_displayloc;
/* P-code display location display */
static bool g_bstopexecution;
/* true means to stop program execution */
@@ -167,7 +167,7 @@ static char g_inline[LINE_SIZE+1];
void dbg_run(struct pexec_s *st)
{
- addr_t pc;
+ paddr_t pc;
int i;
pdbg_showcommands();
@@ -473,10 +473,10 @@ static void pdbg_programstatus(struct pexec_s *st)
/***********************************************************************/
/* Print the disassembled P-Code at PC */
-static addr_t pdbg_printpcode(struct pexec_s *st, addr_t pc, int16_t nitems)
+static paddr_t pdbg_printpcode(struct pexec_s *st, paddr_t pc, int16_t nitems)
{
OPTYPE op;
- addr_t opsize;
+ paddr_t opsize;
uint8_t *address;
for (; ((pc < st->maxpc) && (nitems > 0)); nitems--)
@@ -526,7 +526,7 @@ static addr_t pdbg_printpcode(struct pexec_s *st, addr_t pc, int16_t nitems)
/***********************************************************************/
/* Print the stack value at SP */
-static addr_t pdbg_printstack(struct pexec_s *st, addr_t sp, int16_t nitems)
+static paddr_t pdbg_printstack(struct pexec_s *st, paddr_t sp, int16_t nitems)
{
int32_t isp;
@@ -591,7 +591,7 @@ static void pdbg_printtracearray(struct pexec_s *st)
/***********************************************************************/
/* Add a breakpoint to the breakpoint array */
-static void pdbg_addbreakpoint(addr_t pc)
+static void pdbg_addbreakpoint(paddr_t pc)
{
int i;
diff --git a/misc/pascal/insn16/prun/pexec.c b/misc/pascal/insn16/prun/pexec.c
index d73a22077..be3c044ec 100644
--- a/misc/pascal/insn16/prun/pexec.c
+++ b/misc/pascal/insn16/prun/pexec.c
@@ -302,8 +302,8 @@ static uint16_t pexec_libcall(struct pexec_s *st, uint16_t subfunc)
{
ustack_t uparm1;
ustack_t uparm2;
- addr_t addr1;
- addr_t addr2;
+ paddr_t addr1;
+ paddr_t addr2;
uint16_t *tmp;
uint16_t *ref;
uint8_t *src;
@@ -1981,7 +1981,7 @@ static inline int pexec24(FAR struct pexec_s *st, uint8_t opcode, uint16_t imm16
return ret;
branch_out:
- st->pc = (addr_t)imm16;
+ st->pc = (paddr_t)imm16;
return ret;
}
@@ -2174,7 +2174,7 @@ static int pexec32(FAR struct pexec_s *st, uint8_t opcode, uint8_t imm8, uint16_
uparm1 = st->sp;
PUSH(st, st->pc + 4);
st->fp = uparm1;
- st->pc = (addr_t)imm16;
+ st->pc = (paddr_t)imm16;
return eNOERROR;
/* System Functions:
@@ -2210,8 +2210,8 @@ static int pexec32(FAR struct pexec_s *st, uint8_t opcode, uint8_t imm8, uint16_
FAR struct pexec_s *pexec_init(struct pexec_attr_s *attr)
{
struct pexec_s *st;
- addr_t stacksize;
- addr_t adjusted_rosize;
+ paddr_t stacksize;
+ paddr_t adjusted_rosize;
/* Allocate the p-machine state stucture */
diff --git a/misc/pascal/insn16/prun/pload.c b/misc/pascal/insn16/prun/pload.c
index 8d5576019..0ffd633d4 100644
--- a/misc/pascal/insn16/prun/pload.c
+++ b/misc/pascal/insn16/prun/pload.c
@@ -76,7 +76,7 @@
* Public Functions
****************************************************************************/
-FAR struct pexec_s *pload(const char *filename, addr_t varsize, addr_t strsize)
+FAR struct pexec_s *pload(const char *filename, paddr_t varsize, paddr_t strsize)
{
struct pexec_attr_s attr;
struct pexec_s *st;
diff --git a/misc/pascal/insn16/prun/prun.c b/misc/pascal/insn16/prun/prun.c
index 5a92ef43c..a9fa92778 100644
--- a/misc/pascal/insn16/prun/prun.c
+++ b/misc/pascal/insn16/prun/prun.c
@@ -38,7 +38,6 @@
****************************************************************************/
#include <stdint.h>
-#include <stddefs.h>
#include <stdio.h>
#include <stdlib.h>
#include <getopt.h>