forked from yystopf/xiuos
Fix userland exit() type
This commit is contained in:
parent
56ec6edbe5
commit
0b858de120
|
@ -28,7 +28,7 @@ int main(int argc, char* argv[])
|
|||
char* shell_task_param[2] = { "/shell", 0 };
|
||||
if ((fd = open(&session, shell_task_param[0])) < 0) {
|
||||
printf("Open %s failed\n", shell_task_param[0]);
|
||||
exit();
|
||||
exit(1);
|
||||
}
|
||||
|
||||
if (spawn(&session, fd, read, fsize, shell_task_param[0], shell_task_param) < 0) {
|
||||
|
@ -37,6 +37,6 @@ int main(int argc, char* argv[])
|
|||
|
||||
close(&session, fd);
|
||||
|
||||
exit();
|
||||
exit(0);
|
||||
return 0;
|
||||
}
|
||||
|
|
|
@ -12,6 +12,7 @@
|
|||
#include <assert.h>
|
||||
#include <stdbool.h>
|
||||
#include <stdint.h>
|
||||
#include <stdlib.h>
|
||||
|
||||
#include "libfs_to_client.h"
|
||||
#include "libserial.h"
|
||||
|
@ -90,7 +91,7 @@ int main(int argc, char** argv)
|
|||
struct Session session_nowait;
|
||||
if (connect_session(&session_wait, "SimpleServer", 4096) < 0 || connect_session(&session_nowait, "SimpleServer", 4096) < 0) {
|
||||
printf("connect session failed\n");
|
||||
exit();
|
||||
exit(1);
|
||||
}
|
||||
|
||||
char *buf1 = NULL, *buf2 = NULL;
|
||||
|
@ -138,5 +139,5 @@ int main(int argc, char** argv)
|
|||
free_session(&session_wait);
|
||||
free_session(&session_nowait);
|
||||
|
||||
exit();
|
||||
exit(0);
|
||||
}
|
||||
|
|
|
@ -38,10 +38,10 @@ int main(int argc, char* argv[])
|
|||
{
|
||||
if (register_server("SimpleServer") < 0) {
|
||||
printf("register server name: %s failed.\n", "SimpleServer");
|
||||
exit();
|
||||
exit(1);
|
||||
}
|
||||
ipc_server_loop(&IpcSimpleServer);
|
||||
|
||||
// never reached
|
||||
exit();
|
||||
exit(0);
|
||||
}
|
||||
|
|
|
@ -48,6 +48,6 @@ int main(int argc, char* argv[])
|
|||
printf("Test memry error %s.\n", 0x50000000);
|
||||
printf("After error computing.\n");
|
||||
|
||||
exit();
|
||||
exit(0);
|
||||
return 0;
|
||||
}
|
||||
|
|
|
@ -24,12 +24,12 @@ int main(int argc, char* argv[])
|
|||
struct Session session;
|
||||
if (connect_session(&session, "TestIRQ", 4096) < 0) {
|
||||
printf("connect session failed\n");
|
||||
exit();
|
||||
exit(1);
|
||||
}
|
||||
|
||||
printf("%s start waiting for IRQ.\n", prog_name);
|
||||
wait_intr(&session);
|
||||
printf("%s return from waiting for IRQ.\n", prog_name);
|
||||
|
||||
exit();
|
||||
exit(0);
|
||||
}
|
|
@ -40,16 +40,16 @@ int main()
|
|||
{
|
||||
if (register_irq(SW_INTERRUPT_3, Ipc_intr_3) < 0) {
|
||||
printf("TEST_SW_HDLR: bind failed");
|
||||
exit();
|
||||
exit(1);
|
||||
}
|
||||
|
||||
static char prog_name[] = "TestIRQ";
|
||||
if (register_server("TestIRQ") < 0) {
|
||||
printf("register server name: %s failed.\n", prog_name);
|
||||
exit();
|
||||
exit(1);
|
||||
}
|
||||
|
||||
ipc_server_loop(&IpcSwIntrHandler);
|
||||
|
||||
exit();
|
||||
exit(0);
|
||||
}
|
|
@ -39,6 +39,6 @@ int main(int argc, char* argv[])
|
|||
// test function
|
||||
count_down();
|
||||
|
||||
exit();
|
||||
exit(0);
|
||||
return 0;
|
||||
}
|
||||
|
|
|
@ -96,5 +96,5 @@ int main()
|
|||
printf("%s: Soft interrupt send 1 time\n", prog_name);
|
||||
}
|
||||
printf("%s: Soft interrupt send done\n", prog_name);
|
||||
exit();
|
||||
exit(0);
|
||||
}
|
|
@ -178,7 +178,7 @@ int main(int argc, char** argv)
|
|||
static char server_name[] = "TimerServer";
|
||||
if (register_server(server_name) < 0) {
|
||||
printf("register server name %s failed\n", server_name);
|
||||
exit();
|
||||
exit(1);
|
||||
}
|
||||
|
||||
static uint32_t epit_instance = HW_EPIT2;
|
||||
|
@ -188,7 +188,7 @@ int main(int argc, char** argv)
|
|||
|
||||
ipc_server_loop(&IpcSabreliteTimer);
|
||||
|
||||
exit();
|
||||
exit(0);
|
||||
}
|
||||
|
||||
////////////////////////////////////////////////////////////////////////////////
|
||||
|
|
|
@ -250,23 +250,23 @@ int main(int argc, char** argv)
|
|||
{
|
||||
if (connect_session(&timer_session, timer_server_name, 4096) < 0) {
|
||||
printf("%s connect server: %s failed\n", enet_server_name, timer_server_name);
|
||||
exit();
|
||||
exit(1);
|
||||
}
|
||||
|
||||
printf("%s: Mapping %08x(size: %x) to %08x\n", enet_server_name, AIPS1_ARB_PHY_BASE_ADDR, AIPS1_ARB_END_ADDR - AIPS1_ARB_BASE_ADDR, AIPS1_ARB_BASE_ADDR);
|
||||
if (!mmap(AIPS1_ARB_BASE_ADDR, AIPS1_ARB_PHY_BASE_ADDR, AIPS1_ARB_END_ADDR - AIPS1_ARB_BASE_ADDR, true)) {
|
||||
printf("%s: mmap AIPS1 ARB(%8x) failed\n", enet_server_name, AIPS1_ARB_PHY_BASE_ADDR);
|
||||
exit();
|
||||
exit(1);
|
||||
}
|
||||
|
||||
printf("%s: Mapping %08x(size: %x) to %8x\n", enet_server_name, AIPS2_ARB_PHY_BASE_ADDR, AIPS2_ARB_END_ADDR - AIPS2_ARB_BASE_ADDR, AIPS2_ARB_BASE_ADDR);
|
||||
if (!mmap(AIPS2_ARB_BASE_ADDR, AIPS2_ARB_PHY_BASE_ADDR, AIPS2_ARB_END_ADDR - AIPS2_ARB_BASE_ADDR, true)) {
|
||||
printf("%s: mmap AIPS1 ARB(%08x) failed\n", enet_server_name, AIPS2_ARB_PHY_BASE_ADDR);
|
||||
exit();
|
||||
exit(1);
|
||||
}
|
||||
|
||||
enet_test();
|
||||
|
||||
exit();
|
||||
exit(0);
|
||||
return 0;
|
||||
}
|
|
@ -358,10 +358,10 @@ int main(int argc, char* argv[])
|
|||
|
||||
if (register_server("MemFS") < 0) {
|
||||
printf("register server name: %s failed.\n", "MemFs");
|
||||
exit();
|
||||
exit(1);
|
||||
}
|
||||
ipc_server_loop(&IpcFsServer);
|
||||
|
||||
// never reached
|
||||
exit();
|
||||
exit(0);
|
||||
}
|
||||
|
|
|
@ -26,9 +26,9 @@ int spawn(struct Session* session, int fd, ipc_read_fn ipc_read, ipc_fsize_fn ip
|
|||
return ret;
|
||||
}
|
||||
|
||||
int exit()
|
||||
void exit(int status)
|
||||
{
|
||||
return syscall(SYSCALL_EXIT, 0, 0, 0, 0);
|
||||
syscall(SYSCALL_EXIT, (uintptr_t)status, 0, 0, 0);
|
||||
}
|
||||
|
||||
int yield(task_yield_reason reason)
|
||||
|
|
|
@ -65,7 +65,7 @@ typedef int (*ipc_write_fn)(struct Session* session, int fd, char* src, int offs
|
|||
int syscall(int sys_num, intptr_t a1, intptr_t a2, intptr_t a3, intptr_t a4);
|
||||
|
||||
int spawn(struct Session* session, int fd, ipc_read_fn ipc_read, ipc_fsize_fn ipc_fsize, char* name, char** argv);
|
||||
int exit();
|
||||
void exit(int status);
|
||||
int yield(task_yield_reason reason);
|
||||
int kill(int pid);
|
||||
int register_server(char* name);
|
||||
|
|
Loading…
Reference in New Issue