mirror of
https://github.com/Leonmmcoset/cleonos.git
synced 2026-04-27 05:34:00 +00:00
Merge pull request #9 from CLeonOS/codex/style-autofix-24922748865-1
style: auto-format C/C++ sources with clang-format
This commit is contained in:
@@ -33,10 +33,10 @@ static int ush_cmd_help(void) {
|
|||||||
ush_writeln(" mkfsfat32 [label]");
|
ush_writeln(" mkfsfat32 [label]");
|
||||||
ush_writeln(" mount [path] (default suggested: /temp/disk)");
|
ush_writeln(" mount [path] (default suggested: /temp/disk)");
|
||||||
ush_writeln(" partctl <subcommand> (mbr partition control: list/init-mbr/create/delete/set-boot)");
|
ush_writeln(" partctl <subcommand> (mbr partition control: list/init-mbr/create/delete/set-boot)");
|
||||||
ush_writeln(" ping <a.b.c.d> [count]");
|
ush_writeln(" ping <a.b.c.d> [count]");
|
||||||
ush_writeln(" ifconfig");
|
ush_writeln(" ifconfig");
|
||||||
ush_writeln(" nslookup <domain>");
|
ush_writeln(" nslookup <domain>");
|
||||||
ush_writeln(" httpget <http://host[:port]/path>");
|
ush_writeln(" httpget <http://host[:port]/path>");
|
||||||
ush_writeln(" pid");
|
ush_writeln(" pid");
|
||||||
ush_writeln(" spawn <path|name> [args...] / bg <path|name> [args...]");
|
ush_writeln(" spawn <path|name> [args...] / bg <path|name> [args...]");
|
||||||
ush_writeln(" wait <pid> / fg [pid]");
|
ush_writeln(" wait <pid> / fg [pid]");
|
||||||
|
|||||||
@@ -606,4 +606,4 @@ int cleonos_app_main(void) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
return (success != 0) ? 0 : 1;
|
return (success != 0) ? 0 : 1;
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -68,32 +68,32 @@ typedef struct cleonos_net_udp_send_req {
|
|||||||
u64 payload_len;
|
u64 payload_len;
|
||||||
} cleonos_net_udp_send_req;
|
} cleonos_net_udp_send_req;
|
||||||
|
|
||||||
typedef struct cleonos_net_udp_recv_req {
|
typedef struct cleonos_net_udp_recv_req {
|
||||||
u64 out_payload_ptr;
|
u64 out_payload_ptr;
|
||||||
u64 payload_capacity;
|
u64 payload_capacity;
|
||||||
u64 out_src_ipv4_ptr;
|
u64 out_src_ipv4_ptr;
|
||||||
u64 out_src_port_ptr;
|
u64 out_src_port_ptr;
|
||||||
u64 out_dst_port_ptr;
|
u64 out_dst_port_ptr;
|
||||||
} cleonos_net_udp_recv_req;
|
} cleonos_net_udp_recv_req;
|
||||||
|
|
||||||
typedef struct cleonos_net_tcp_connect_req {
|
typedef struct cleonos_net_tcp_connect_req {
|
||||||
u64 dst_ipv4_be;
|
u64 dst_ipv4_be;
|
||||||
u64 dst_port;
|
u64 dst_port;
|
||||||
u64 src_port;
|
u64 src_port;
|
||||||
u64 poll_budget;
|
u64 poll_budget;
|
||||||
} cleonos_net_tcp_connect_req;
|
} cleonos_net_tcp_connect_req;
|
||||||
|
|
||||||
typedef struct cleonos_net_tcp_send_req {
|
typedef struct cleonos_net_tcp_send_req {
|
||||||
u64 payload_ptr;
|
u64 payload_ptr;
|
||||||
u64 payload_len;
|
u64 payload_len;
|
||||||
u64 poll_budget;
|
u64 poll_budget;
|
||||||
} cleonos_net_tcp_send_req;
|
} cleonos_net_tcp_send_req;
|
||||||
|
|
||||||
typedef struct cleonos_net_tcp_recv_req {
|
typedef struct cleonos_net_tcp_recv_req {
|
||||||
u64 out_payload_ptr;
|
u64 out_payload_ptr;
|
||||||
u64 payload_capacity;
|
u64 payload_capacity;
|
||||||
u64 poll_budget;
|
u64 poll_budget;
|
||||||
} cleonos_net_tcp_recv_req;
|
} cleonos_net_tcp_recv_req;
|
||||||
|
|
||||||
#define CLEONOS_SYSCALL_LOG_WRITE 0ULL
|
#define CLEONOS_SYSCALL_LOG_WRITE 0ULL
|
||||||
#define CLEONOS_SYSCALL_TIMER_TICKS 1ULL
|
#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_IPV4_ADDR 96ULL
|
||||||
#define CLEONOS_SYSCALL_NET_PING 97ULL
|
#define CLEONOS_SYSCALL_NET_PING 97ULL
|
||||||
#define CLEONOS_SYSCALL_NET_UDP_SEND 98ULL
|
#define CLEONOS_SYSCALL_NET_UDP_SEND 98ULL
|
||||||
#define CLEONOS_SYSCALL_NET_UDP_RECV 99ULL
|
#define CLEONOS_SYSCALL_NET_UDP_RECV 99ULL
|
||||||
#define CLEONOS_SYSCALL_NET_NETMASK 100ULL
|
#define CLEONOS_SYSCALL_NET_NETMASK 100ULL
|
||||||
#define CLEONOS_SYSCALL_NET_GATEWAY 101ULL
|
#define CLEONOS_SYSCALL_NET_GATEWAY 101ULL
|
||||||
#define CLEONOS_SYSCALL_NET_DNS_SERVER 102ULL
|
#define CLEONOS_SYSCALL_NET_DNS_SERVER 102ULL
|
||||||
#define CLEONOS_SYSCALL_NET_TCP_CONNECT 103ULL
|
#define CLEONOS_SYSCALL_NET_TCP_CONNECT 103ULL
|
||||||
#define CLEONOS_SYSCALL_NET_TCP_SEND 104ULL
|
#define CLEONOS_SYSCALL_NET_TCP_SEND 104ULL
|
||||||
#define CLEONOS_SYSCALL_NET_TCP_RECV 105ULL
|
#define CLEONOS_SYSCALL_NET_TCP_RECV 105ULL
|
||||||
#define CLEONOS_SYSCALL_NET_TCP_CLOSE 106ULL
|
#define CLEONOS_SYSCALL_NET_TCP_CLOSE 106ULL
|
||||||
|
|
||||||
u64 cleonos_syscall(u64 id, u64 arg0, u64 arg1, u64 arg2);
|
u64 cleonos_syscall(u64 id, u64 arg0, u64 arg1, u64 arg2);
|
||||||
u64 cleonos_sys_log_write(const char *message, u64 length);
|
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_ipv4_addr(void);
|
||||||
u64 cleonos_sys_net_netmask(void);
|
u64 cleonos_sys_net_netmask(void);
|
||||||
u64 cleonos_sys_net_gateway(void);
|
u64 cleonos_sys_net_gateway(void);
|
||||||
u64 cleonos_sys_net_dns_server(void);
|
u64 cleonos_sys_net_dns_server(void);
|
||||||
u64 cleonos_sys_net_ping(u64 dst_ipv4_be, u64 poll_budget);
|
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_send(const cleonos_net_udp_send_req *req);
|
||||||
u64 cleonos_sys_net_udp_recv(cleonos_net_udp_recv_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_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_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_recv(cleonos_net_tcp_recv_req *req);
|
||||||
u64 cleonos_sys_net_tcp_close(u64 poll_budget);
|
u64 cleonos_sys_net_tcp_close(u64 poll_budget);
|
||||||
|
|
||||||
#endif
|
#endif
|
||||||
|
|||||||
@@ -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);
|
return cleonos_syscall(CLEONOS_SYSCALL_NET_UDP_SEND, (u64)req, 0ULL, 0ULL);
|
||||||
}
|
}
|
||||||
|
|
||||||
u64 cleonos_sys_net_udp_recv(cleonos_net_udp_recv_req *req) {
|
u64 cleonos_sys_net_udp_recv(cleonos_net_udp_recv_req *req) {
|
||||||
return cleonos_syscall(CLEONOS_SYSCALL_NET_UDP_RECV, (u64)req, 0ULL, 0ULL);
|
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) {
|
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);
|
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) {
|
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);
|
return cleonos_syscall(CLEONOS_SYSCALL_NET_TCP_SEND, (u64)req, 0ULL, 0ULL);
|
||||||
}
|
}
|
||||||
|
|
||||||
u64 cleonos_sys_net_tcp_recv(cleonos_net_tcp_recv_req *req) {
|
u64 cleonos_sys_net_tcp_recv(cleonos_net_tcp_recv_req *req) {
|
||||||
return cleonos_syscall(CLEONOS_SYSCALL_NET_TCP_RECV, (u64)req, 0ULL, 0ULL);
|
return cleonos_syscall(CLEONOS_SYSCALL_NET_TCP_RECV, (u64)req, 0ULL, 0ULL);
|
||||||
}
|
}
|
||||||
|
|
||||||
u64 cleonos_sys_net_tcp_close(u64 poll_budget) {
|
u64 cleonos_sys_net_tcp_close(u64 poll_budget) {
|
||||||
return cleonos_syscall(CLEONOS_SYSCALL_NET_TCP_CLOSE, poll_budget, 0ULL, 0ULL);
|
return cleonos_syscall(CLEONOS_SYSCALL_NET_TCP_CLOSE, poll_budget, 0ULL, 0ULL);
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user