Skip to content

Commit

Permalink
Add flag of OS_LINUX.
Browse files Browse the repository at this point in the history
This is not supported for windows.
  • Loading branch information
mitsut committed Feb 26, 2022
1 parent b54da09 commit 24fb034
Show file tree
Hide file tree
Showing 3 changed files with 10 additions and 0 deletions.
4 changes: 4 additions & 0 deletions apl/include/athrill_syscall.h
Original file line number Diff line number Diff line change
Expand Up @@ -310,9 +310,11 @@ static inline int athrill_newlib_open_r_flag(int org_flags)
ATHRILL_OPEN_R_FLAG_TARGET2INF(flags, org_flags, O_APPEND);
ATHRILL_OPEN_R_FLAG_TARGET2INF(flags, org_flags, O_CREAT);
ATHRILL_OPEN_R_FLAG_TARGET2INF(flags, org_flags, O_EXCL);
#if OS_LINUX /* Windows not support */
ATHRILL_OPEN_R_FLAG_TARGET2INF(flags, org_flags, O_NOCTTY);
ATHRILL_OPEN_R_FLAG_TARGET2INF(flags, org_flags, O_NONBLOCK);
ATHRILL_OPEN_R_FLAG_TARGET2INF(flags, org_flags, O_SYNC);
#endif /* OS_LINUX */
ATHRILL_OPEN_R_FLAG_TARGET2INF(flags, org_flags, O_TRUNC);
ATHRILL_OPEN_R_FLAG_TARGET2INF(flags, org_flags, O_RDONLY);
ATHRILL_OPEN_R_FLAG_TARGET2INF(flags, org_flags, O_WRONLY);
Expand All @@ -326,9 +328,11 @@ static inline int athrill_syscall_open_r_flag(int inf_flags)
ATHRILL_OPEN_R_FLAG_INF2TARGET(flags, inf_flags, O_APPEND);
ATHRILL_OPEN_R_FLAG_INF2TARGET(flags, inf_flags, O_CREAT);
ATHRILL_OPEN_R_FLAG_INF2TARGET(flags, inf_flags, O_EXCL);
#if OS_LINUX
ATHRILL_OPEN_R_FLAG_INF2TARGET(flags, inf_flags, O_NOCTTY);
ATHRILL_OPEN_R_FLAG_INF2TARGET(flags, inf_flags, O_NONBLOCK);
ATHRILL_OPEN_R_FLAG_INF2TARGET(flags, inf_flags, O_SYNC);
#endif /* OS_LINUX */
ATHRILL_OPEN_R_FLAG_INF2TARGET(flags, inf_flags, O_TRUNC);
ATHRILL_OPEN_R_FLAG_INF2TARGET(flags, inf_flags, O_RDONLY);
ATHRILL_OPEN_R_FLAG_INF2TARGET(flags, inf_flags, O_WRONLY);
Expand Down
2 changes: 2 additions & 0 deletions src/device/mpu/loader/loader.c
Original file line number Diff line number Diff line change
Expand Up @@ -191,13 +191,15 @@ static Std_ReturnType Elf_LoadProgram(const Elf32_Ehdr *elf_image, MemoryAddress
set_malloc_region(memap, i);
}
}
#ifdef OS_LINUX /* Windows not support */
for (i = 0; i < memap->dev_num; i++) {
ptr = mpu_address_set_dev(memap->dev[i].start, memap->dev[i].size, memap->dev[i].extdev_handle);
if (ptr == NULL) {
printf("Invalid dev file: can not load dev addr=0x%x\n", memap->dev[i].start);
return STD_E_INVALID;
}
}
#endif /* OS_LINUX */
/*
* set cache from elf file.
*/
Expand Down
4 changes: 4 additions & 0 deletions src/main/main.c
Original file line number Diff line number Diff line change
Expand Up @@ -43,6 +43,7 @@ static FILE *save_operation_fp = NULL;

static void load_cui_operation(void)
{
#ifdef OS_LINUX /* Windows not support */
DbgCmdExecutorType *res;
char *filename;
size_t buffer_size = 1024;
Expand Down Expand Up @@ -71,6 +72,7 @@ static void load_cui_operation(void)
res->run(res);
}
}
#endif /* OS_LINUX */
return;
}
static void save_cui_operation(const char* op)
Expand Down Expand Up @@ -116,6 +118,7 @@ static void do_cui(void)
}
}

#ifdef OS_LINUX
static void athrill_sigterm_handler(int arg)
{
athrill_device_cleanup();
Expand All @@ -127,6 +130,7 @@ static void athrill_sigterm_handler(int arg)
exit(0);
return;
}
#endif


/*
Expand Down

0 comments on commit 24fb034

Please sign in to comment.