diff --git a/cleonos/c/apps/help_main.c b/cleonos/c/apps/help_main.c index a7863e8..bd9c10f 100644 --- a/cleonos/c/apps/help_main.c +++ b/cleonos/c/apps/help_main.c @@ -33,10 +33,10 @@ static int ush_cmd_help(void) { ush_writeln(" mkfsfat32 [label]"); ush_writeln(" mount [path] (default suggested: /temp/disk)"); ush_writeln(" partctl (mbr partition control: list/init-mbr/create/delete/set-boot)"); - ush_writeln(" ping [count]"); - ush_writeln(" ifconfig"); - ush_writeln(" nslookup "); - ush_writeln(" httpget "); + ush_writeln(" ping [count]"); + ush_writeln(" ifconfig"); + ush_writeln(" nslookup "); + ush_writeln(" httpget "); ush_writeln(" pid"); ush_writeln(" spawn [args...] / bg [args...]"); ush_writeln(" wait / fg [pid]"); diff --git a/cleonos/c/apps/httpget_main.c b/cleonos/c/apps/httpget_main.c index 7f6a17f..0d7688a 100644 --- a/cleonos/c/apps/httpget_main.c +++ b/cleonos/c/apps/httpget_main.c @@ -606,4 +606,4 @@ int cleonos_app_main(void) { } return (success != 0) ? 0 : 1; -} +} diff --git a/cleonos/c/include/cleonos_syscall.h b/cleonos/c/include/cleonos_syscall.h index d61b8bf..4c33d98 100644 --- a/cleonos/c/include/cleonos_syscall.h +++ b/cleonos/c/include/cleonos_syscall.h @@ -68,32 +68,32 @@ typedef struct cleonos_net_udp_send_req { u64 payload_len; } cleonos_net_udp_send_req; -typedef struct cleonos_net_udp_recv_req { - u64 out_payload_ptr; - u64 payload_capacity; - u64 out_src_ipv4_ptr; - u64 out_src_port_ptr; - u64 out_dst_port_ptr; -} cleonos_net_udp_recv_req; - -typedef struct cleonos_net_tcp_connect_req { - u64 dst_ipv4_be; - u64 dst_port; - u64 src_port; - u64 poll_budget; -} cleonos_net_tcp_connect_req; - -typedef struct cleonos_net_tcp_send_req { - u64 payload_ptr; - u64 payload_len; - u64 poll_budget; -} cleonos_net_tcp_send_req; - -typedef struct cleonos_net_tcp_recv_req { - u64 out_payload_ptr; - u64 payload_capacity; - u64 poll_budget; -} cleonos_net_tcp_recv_req; +typedef struct cleonos_net_udp_recv_req { + u64 out_payload_ptr; + u64 payload_capacity; + u64 out_src_ipv4_ptr; + u64 out_src_port_ptr; + u64 out_dst_port_ptr; +} cleonos_net_udp_recv_req; + +typedef struct cleonos_net_tcp_connect_req { + u64 dst_ipv4_be; + u64 dst_port; + u64 src_port; + u64 poll_budget; +} cleonos_net_tcp_connect_req; + +typedef struct cleonos_net_tcp_send_req { + u64 payload_ptr; + u64 payload_len; + u64 poll_budget; +} cleonos_net_tcp_send_req; + +typedef struct cleonos_net_tcp_recv_req { + u64 out_payload_ptr; + u64 payload_capacity; + u64 poll_budget; +} cleonos_net_tcp_recv_req; #define CLEONOS_SYSCALL_LOG_WRITE 0ULL #define CLEONOS_SYSCALL_TIMER_TICKS 1ULL @@ -194,14 +194,14 @@ typedef struct cleonos_net_tcp_recv_req { #define CLEONOS_SYSCALL_NET_IPV4_ADDR 96ULL #define CLEONOS_SYSCALL_NET_PING 97ULL #define CLEONOS_SYSCALL_NET_UDP_SEND 98ULL -#define CLEONOS_SYSCALL_NET_UDP_RECV 99ULL -#define CLEONOS_SYSCALL_NET_NETMASK 100ULL -#define CLEONOS_SYSCALL_NET_GATEWAY 101ULL -#define CLEONOS_SYSCALL_NET_DNS_SERVER 102ULL -#define CLEONOS_SYSCALL_NET_TCP_CONNECT 103ULL -#define CLEONOS_SYSCALL_NET_TCP_SEND 104ULL -#define CLEONOS_SYSCALL_NET_TCP_RECV 105ULL -#define CLEONOS_SYSCALL_NET_TCP_CLOSE 106ULL +#define CLEONOS_SYSCALL_NET_UDP_RECV 99ULL +#define CLEONOS_SYSCALL_NET_NETMASK 100ULL +#define CLEONOS_SYSCALL_NET_GATEWAY 101ULL +#define CLEONOS_SYSCALL_NET_DNS_SERVER 102ULL +#define CLEONOS_SYSCALL_NET_TCP_CONNECT 103ULL +#define CLEONOS_SYSCALL_NET_TCP_SEND 104ULL +#define CLEONOS_SYSCALL_NET_TCP_RECV 105ULL +#define CLEONOS_SYSCALL_NET_TCP_CLOSE 106ULL u64 cleonos_syscall(u64 id, u64 arg0, u64 arg1, u64 arg2); u64 cleonos_sys_log_write(const char *message, u64 length); @@ -303,13 +303,13 @@ u64 cleonos_sys_net_available(void); u64 cleonos_sys_net_ipv4_addr(void); u64 cleonos_sys_net_netmask(void); u64 cleonos_sys_net_gateway(void); -u64 cleonos_sys_net_dns_server(void); -u64 cleonos_sys_net_ping(u64 dst_ipv4_be, u64 poll_budget); -u64 cleonos_sys_net_udp_send(const cleonos_net_udp_send_req *req); -u64 cleonos_sys_net_udp_recv(cleonos_net_udp_recv_req *req); -u64 cleonos_sys_net_tcp_connect(const cleonos_net_tcp_connect_req *req); -u64 cleonos_sys_net_tcp_send(const cleonos_net_tcp_send_req *req); -u64 cleonos_sys_net_tcp_recv(cleonos_net_tcp_recv_req *req); -u64 cleonos_sys_net_tcp_close(u64 poll_budget); - -#endif +u64 cleonos_sys_net_dns_server(void); +u64 cleonos_sys_net_ping(u64 dst_ipv4_be, u64 poll_budget); +u64 cleonos_sys_net_udp_send(const cleonos_net_udp_send_req *req); +u64 cleonos_sys_net_udp_recv(cleonos_net_udp_recv_req *req); +u64 cleonos_sys_net_tcp_connect(const cleonos_net_tcp_connect_req *req); +u64 cleonos_sys_net_tcp_send(const cleonos_net_tcp_send_req *req); +u64 cleonos_sys_net_tcp_recv(cleonos_net_tcp_recv_req *req); +u64 cleonos_sys_net_tcp_close(u64 poll_budget); + +#endif diff --git a/cleonos/c/src/syscall.c b/cleonos/c/src/syscall.c index e7fb13b..a714cb6 100644 --- a/cleonos/c/src/syscall.c +++ b/cleonos/c/src/syscall.c @@ -440,22 +440,22 @@ u64 cleonos_sys_net_udp_send(const cleonos_net_udp_send_req *req) { return cleonos_syscall(CLEONOS_SYSCALL_NET_UDP_SEND, (u64)req, 0ULL, 0ULL); } -u64 cleonos_sys_net_udp_recv(cleonos_net_udp_recv_req *req) { - return cleonos_syscall(CLEONOS_SYSCALL_NET_UDP_RECV, (u64)req, 0ULL, 0ULL); -} - -u64 cleonos_sys_net_tcp_connect(const cleonos_net_tcp_connect_req *req) { - return cleonos_syscall(CLEONOS_SYSCALL_NET_TCP_CONNECT, (u64)req, 0ULL, 0ULL); -} - -u64 cleonos_sys_net_tcp_send(const cleonos_net_tcp_send_req *req) { - return cleonos_syscall(CLEONOS_SYSCALL_NET_TCP_SEND, (u64)req, 0ULL, 0ULL); -} - -u64 cleonos_sys_net_tcp_recv(cleonos_net_tcp_recv_req *req) { - return cleonos_syscall(CLEONOS_SYSCALL_NET_TCP_RECV, (u64)req, 0ULL, 0ULL); -} - -u64 cleonos_sys_net_tcp_close(u64 poll_budget) { - return cleonos_syscall(CLEONOS_SYSCALL_NET_TCP_CLOSE, poll_budget, 0ULL, 0ULL); -} +u64 cleonos_sys_net_udp_recv(cleonos_net_udp_recv_req *req) { + return cleonos_syscall(CLEONOS_SYSCALL_NET_UDP_RECV, (u64)req, 0ULL, 0ULL); +} + +u64 cleonos_sys_net_tcp_connect(const cleonos_net_tcp_connect_req *req) { + return cleonos_syscall(CLEONOS_SYSCALL_NET_TCP_CONNECT, (u64)req, 0ULL, 0ULL); +} + +u64 cleonos_sys_net_tcp_send(const cleonos_net_tcp_send_req *req) { + return cleonos_syscall(CLEONOS_SYSCALL_NET_TCP_SEND, (u64)req, 0ULL, 0ULL); +} + +u64 cleonos_sys_net_tcp_recv(cleonos_net_tcp_recv_req *req) { + return cleonos_syscall(CLEONOS_SYSCALL_NET_TCP_RECV, (u64)req, 0ULL, 0ULL); +} + +u64 cleonos_sys_net_tcp_close(u64 poll_budget) { + return cleonos_syscall(CLEONOS_SYSCALL_NET_TCP_CLOSE, poll_budget, 0ULL, 0ULL); +}