Mon 16 Mar 11:09:06 CET 2026
This commit is contained in:
parent
a3e7de22a5
commit
7b44d17215
34
src/context.h
Normal file
34
src/context.h
Normal file
|
|
@ -0,0 +1,34 @@
|
||||||
|
#ifndef _CONTEXT_H
|
||||||
|
#define _CONTEXT_H
|
||||||
|
|
||||||
|
#include "types.h"
|
||||||
|
#include "reg.h"
|
||||||
|
#include "stack.h"
|
||||||
|
#include "mem.h"
|
||||||
|
|
||||||
|
/*
|
||||||
|
Task/VM context
|
||||||
|
*/
|
||||||
|
typedef struct context {
|
||||||
|
index_t index;
|
||||||
|
stack_t *DS;
|
||||||
|
stack_t *FS;
|
||||||
|
reg_t *R;
|
||||||
|
mem_t *M;
|
||||||
|
segment_t *S;
|
||||||
|
index_t task; // task number
|
||||||
|
int32_t evmask; // events of this task
|
||||||
|
struct context *next; // task context chaining
|
||||||
|
} context_t;
|
||||||
|
|
||||||
|
extern context_t *Context[MAXTASKS];
|
||||||
|
extern int ContextTop;
|
||||||
|
|
||||||
|
context_t *ContextAllocate();
|
||||||
|
context_t* ContextInit(context_t* C, mem_t *M,stack_t *DS, stack_t *FS, reg_t *R);
|
||||||
|
int ContextReset(context_t *c);
|
||||||
|
void ContextResetAll(context_t *c0);
|
||||||
|
|
||||||
|
#define CONTEXTID(C) (C->index)
|
||||||
|
|
||||||
|
#endif
|
||||||
Loading…
Reference in New Issue
Block a user