Skip to content

Commit

Permalink
Cleanup library
Browse files Browse the repository at this point in the history
  • Loading branch information
yhzhang0128 committed Dec 26, 2022
1 parent 050d45f commit c1adcdf
Show file tree
Hide file tree
Showing 3 changed files with 12 additions and 10 deletions.
19 changes: 10 additions & 9 deletions library/egos.h
Original file line number Diff line number Diff line change
Expand Up @@ -53,14 +53,6 @@ struct grass {
extern struct earth *earth;
extern struct grass *grass;

#ifndef LIBC_STDIO
#define printf earth->tty_printf
#define INFO earth->tty_info
#define FATAL earth->tty_fatal
#define SUCCESS earth->tty_success
#define CRITICAL earth->tty_critical
#endif

/* Memory layout */
#define PAGE_SIZE 4096
#define FRAME_CACHE_END 0x80020000
Expand All @@ -70,7 +62,6 @@ extern struct grass *grass;
#define SYSCALL_ARG 0x80002400 /* 1KB system call args */
/* 1KB grass interface */
#define APPS_STACK_TOP 0x80002000 /* 6KB app stack */
#define EXCP_STACK_OFFSET 0x00000400 /* 1KB saved exception stack */
#define APPS_ARG 0x80000000 /* 1KB app main() argc, argv */
#define APPS_SIZE 0x00003000
#define APPS_ENTRY 0x08005000 /* 12KB app code+data */
Expand All @@ -79,6 +70,16 @@ extern struct grass *grass;
/* 12KB earth data */
/* earth code is in QSPI flash */


#ifndef LIBC_STDIO
/* Only earth/dev_tty.c uses LIBC_STDIO and does not need these macros */
#define printf earth->tty_printf
#define INFO earth->tty_info
#define FATAL earth->tty_fatal
#define SUCCESS earth->tty_success
#define CRITICAL earth->tty_critical
#endif

/* Memory-mapped I/O register access macros */
#define ACCESS(x) (*(__typeof__(*x) volatile *)(x))
#define REGW(base, offset) (ACCESS((unsigned int*)(base + offset)))
Expand Down
1 change: 1 addition & 0 deletions library/elf/elf.c
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,7 @@ static void load_app(int pid, elf_reader reader,
int argc, void** argv,
struct elf32_program_header* pheader) {

/* Debug printing during bootup */
if (pid < GPID_USER_START) {
INFO("App file size: 0x%.8x bytes", pheader->p_filesz);
INFO("App memory size: 0x%.8x bytes", pheader->p_memsz);
Expand Down
2 changes: 1 addition & 1 deletion library/file/disk.c
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
*/

/* Author: Yunhao Zhang
* Description: the inode_store for accessing the physical disk
* Description: the inode_store structure for accessing the physical disk
*/

#include "egos.h"
Expand Down

0 comments on commit c1adcdf

Please sign in to comment.