Skip to content

Commit

Permalink
cleanup
Browse files Browse the repository at this point in the history
  • Loading branch information
yhzhang0128 committed Apr 6, 2022
1 parent 118fe05 commit c78359b
Showing 1 changed file with 19 additions and 20 deletions.
39 changes: 19 additions & 20 deletions library/egos.h
Original file line number Diff line number Diff line change
@@ -1,5 +1,24 @@
#pragma once

#define PAGE_SIZE 4096

/* memory layout */
#define FRAME_CACHE_END 0x80020000
#define FRAME_CACHE_START 0x80004000 /* 112KB frame cache */
/* earth interface */
#define GRASS_STACK_TOP 0x80003f80 /* ~8KB grass stack */
/* grass interface */
#define APPS_STACK_TOP 0x80002000 /* ~6KB app stack */
#define SYSCALL_ARG 0x80000400 /* ~1KB syscall args */
#define APPS_ARG 0x80000000 /* ~1KB argc, argv */

#define APPS_SIZE 0x00003000
#define APPS_ENTRY 0x08005000 /* 12KB app code+data */
#define GRASS_SIZE 0x00002000
#define GRASS_ENTRY 0x08003000 /* 8KB grass code+data */
/* 12KB earth data+stack */
/* earth code is in QSPI flash */

struct earth {
/* CPU interface */
int (*intr_enable)();
Expand Down Expand Up @@ -36,26 +55,6 @@ struct grass {
char work_dir_name[32];
};

#define PAGE_SIZE 4096

/* memory layout */
#define FRAME_CACHE_END 0x80020000
#define FRAME_CACHE_START 0x80004000 /* 112KB frame cache */
/* earth interface */
#define GRASS_STACK_TOP 0x80003f80 /* ~8KB grass stack */
/* grass interface */
#define APPS_STACK_TOP 0x80002000 /* ~6KB app stack */
#define SYSCALL_ARG 0x80000400 /* ~1KB syscall args */
#define APPS_ARG 0x80000000 /* ~1KB argc, argv */

#define APPS_SIZE 0x00003000
#define APPS_ENTRY 0x08005000 /* 12KB app code+data */
#define GRASS_SIZE 0x00002000
#define GRASS_ENTRY 0x08003000 /* 8KB grass code+data */
/* 12KB earth data+stack */
/* earth code is in QSPI flash */

/* C library interface */
extern struct earth *earth;

#define printf earth->tty_printf
Expand Down

0 comments on commit c78359b

Please sign in to comment.