{nemu,npc}: inject mainargs to the bin file

* this removes the dependency of trm.c to keep the mainargs up-to-date
This commit is contained in:
Zihao Yu 2024-05-12 21:34:43 +08:00
parent c3ffbc97c3
commit c52a41181f
5 changed files with 52 additions and 15 deletions

View file

@ -5,10 +5,7 @@ extern char _heap_start;
int main(const char *args);
Area heap = RANGE(&_heap_start, PMEM_END);
#ifndef MAINARGS
#define MAINARGS ""
#endif
static const char mainargs[] = MAINARGS;
static const char mainargs[MAINARGS_MAX_LEN] = MAINARGS_PLACEHOLDER; // defined in CFLAGS
void putch(char ch) {
outb(SERIAL_PORT, ch);

View file

@ -9,10 +9,7 @@ extern char _pmem_start;
#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;
static const char mainargs[MAINARGS_MAX_LEN] = MAINARGS_PLACEHOLDER; // defined in CFLAGS
void putch(char ch) {
}