1#ifndef BORON_INTERNAL_H
2#define BORON_INTERNAL_H
16#define OPT_BITS(c) (c)->id._pad0
18#define PORT_DEVICE(dev,pbuf) \
19 UPortDevice* dev = (pbuf->form == UR_PORT_SIMPLE) ? \
20 (UPortDevice*) pbuf->ptr.v : \
21 (pbuf->ptr.v ? *((UPortDevice**) pbuf->ptr.v) : 0)
23#define PORT_SITE(dev,pbuf,portC) \
24 UBuffer* pbuf = ur_buffer(portC->port.buf); \
33 uint16_t argStackSize;
34 uint16_t evalStackSize;
35 UAtom compileAtoms[5];
40#define BENV ((BoronEnv*) ut->env)
62#define MASK_EOP_DO (1<<EOP_DO_BLOCK | 1<<EOP_DO_BLOCK1 | 1<<EOP_FUNC_BODY | 1<<EOP_REDUCE)
63#define MASK_EOP_CATCH (1<<EOP_CATCH | 1<<EOP_INVOKE_LOOP)
64#define MASK_EOP_FFLAGS (1<<EOP_DO_BLOCK | 1<<EOP_FUNC_BODY)
67struct EvalFrameBlock {
77struct EvalFrameReduce {
87typedef union EvalFrame EvalFrame;
89typedef struct EvalFrameInvoke EvalFrameInvoke;
91struct EvalFrameInvoke {
96 UStatus (*func)(UThread*, EvalFrameInvoke*);
98 UStatus (*catchf)(UThread*, EvalFrame*);
111struct EvalFrameCall {
129struct EvalFrameData {
142 struct EvalFrameBlock block;
143 struct EvalFrameReduce reduce;
144 struct EvalFrameInvoke invoke;
145 struct EvalFrameCall call;
146 struct EvalFrameSet set;
147 struct EvalFrameData data;
151typedef struct BoronFibre BoronThread;
157 int (*requestAccess)( UThread*,
const char* );
163 BoronThread* nextFibre;
171#ifdef CONFIG_ASSEMBLE
173 UAtomEntry* insTable;
177#define BT ((BoronThread*) ut)
178#define RESULT (BT->evalData + BT_RESULT)
180extern EvalFrame* boron_reuseFrame(
UThread*,
int extraFrames,
int* keepStack);
181extern EvalFrame* boron_pushEvalFrame(
UThread*);
182extern EvalFrame* boron_findEvalFrame(
UThread*,
int op);
183extern int boron_resetEvalFrame(
UThread*,
const EvalFrame*);
184extern void boron_initEvalCatch(EvalFrame* ef,
186 int origStack,
UCell* result);
191extern int boron_breakDoBlock1(
UThread*, EvalFrameInvoke*);
The UBuffer struct holds information about a resource, usually a chunk of memory.
Definition urlan.h:266
The UThread struct stores the data specific to a thread of execution.
Definition urlan.h:309
A cell holds a single value of a simple type or a reference (often to a UBuffer) for a complex type.
Definition urlan.h:248
UStatus
Definition urlan.h:116
int32_t UIndex
This is an index into an array.
Definition urlan.h:150