NJU-ProjectN/abstract-machine ics2023 initialized
NJU-ProjectN/abstract-machine 3348db971fd860be5cb28e21c18f9d0e65d0c96a Merge pull request #8 from Jasonyanyusong/master
This commit is contained in:
parent
2824efad33
commit
8e4feb4010
129 changed files with 9017 additions and 0 deletions
19
abstract-machine/am/src/platform/dummy/cte.c
Normal file
19
abstract-machine/am/src/platform/dummy/cte.c
Normal file
|
@ -0,0 +1,19 @@
|
|||
#include <am.h>
|
||||
|
||||
bool cte_init(Context*(*handler)(Event, Context*)) {
|
||||
return false;
|
||||
}
|
||||
|
||||
Context *kcontext(Area kstack, void (*entry)(void *), void *arg) {
|
||||
return NULL;
|
||||
}
|
||||
|
||||
void yield() {
|
||||
}
|
||||
|
||||
bool ienabled() {
|
||||
return false;
|
||||
}
|
||||
|
||||
void iset(bool enable) {
|
||||
}
|
11
abstract-machine/am/src/platform/dummy/ioe.c
Normal file
11
abstract-machine/am/src/platform/dummy/ioe.c
Normal file
|
@ -0,0 +1,11 @@
|
|||
#include <am.h>
|
||||
#include <klib-macros.h>
|
||||
|
||||
static void fail(void *buf) { panic("access nonexist register"); }
|
||||
|
||||
bool ioe_init() {
|
||||
return false;
|
||||
}
|
||||
|
||||
void ioe_read (int reg, void *buf) { fail(buf); }
|
||||
void ioe_write(int reg, void *buf) { fail(buf); }
|
17
abstract-machine/am/src/platform/dummy/mpe.c
Normal file
17
abstract-machine/am/src/platform/dummy/mpe.c
Normal file
|
@ -0,0 +1,17 @@
|
|||
#include <am.h>
|
||||
|
||||
bool mpe_init(void (*entry)()) {
|
||||
return false;
|
||||
}
|
||||
|
||||
int cpu_count() {
|
||||
return 1;
|
||||
}
|
||||
|
||||
int cpu_current() {
|
||||
return 0;
|
||||
}
|
||||
|
||||
int atomic_xchg(int *addr, int newval) {
|
||||
return 0;
|
||||
}
|
10
abstract-machine/am/src/platform/dummy/trm.c
Normal file
10
abstract-machine/am/src/platform/dummy/trm.c
Normal file
|
@ -0,0 +1,10 @@
|
|||
#include <am.h>
|
||||
|
||||
Area heap = RANGE(NULL, NULL);
|
||||
|
||||
void putch(char ch) {
|
||||
}
|
||||
|
||||
void halt(int code) {
|
||||
while (1);
|
||||
}
|
18
abstract-machine/am/src/platform/dummy/vme.c
Normal file
18
abstract-machine/am/src/platform/dummy/vme.c
Normal file
|
@ -0,0 +1,18 @@
|
|||
#include <am.h>
|
||||
|
||||
bool vme_init(void* (*pgalloc_f)(int), void (*pgfree_f)(void*)) {
|
||||
return false;
|
||||
}
|
||||
|
||||
void protect(AddrSpace *as) {
|
||||
}
|
||||
|
||||
void unprotect(AddrSpace *as) {
|
||||
}
|
||||
|
||||
void map(AddrSpace *as, void *va, void *pa, int prot) {
|
||||
}
|
||||
|
||||
Context *ucontext(AddrSpace *as, Area kstack, void *entry) {
|
||||
return NULL;
|
||||
}
|
Loading…
Add table
Add a link
Reference in a new issue