NJU-ProjectN/abstract-machine 3348db971fd860be5cb28e21c18f9d0e65d0c96a Merge pull request #8 from Jasonyanyusong/master
27 lines
470 B
C
27 lines
470 B
C
#include <am.h>
|
|
#include <klib-macros.h>
|
|
|
|
extern char _heap_start;
|
|
int main(const char *args);
|
|
|
|
extern char _pmem_start;
|
|
#define PMEM_SIZE (128 * 1024 * 1024)
|
|
#define PMEM_END ((uintptr_t)&_pmem_start + PMEM_SIZE)
|
|
|
|
Area heap = RANGE(&_heap_start, PMEM_END);
|
|
#ifndef MAINARGS
|
|
#define MAINARGS ""
|
|
#endif
|
|
static const char mainargs[] = MAINARGS;
|
|
|
|
void putch(char ch) {
|
|
}
|
|
|
|
void halt(int code) {
|
|
while (1);
|
|
}
|
|
|
|
void _trm_init() {
|
|
int ret = main(mainargs);
|
|
halt(ret);
|
|
}
|