mirror of
https://github.com/Leonmmcoset/cleonos.git
synced 2026-04-27 05:34:00 +00:00
style: auto-format C/C++ sources with clang-format
This commit is contained in:
committed by
github-actions[bot]
parent
2aca4b9e94
commit
c65a92897b
@@ -32,11 +32,11 @@ static int ush_cmd_help(void) {
|
|||||||
ush_writeln(" diskinfo");
|
ush_writeln(" diskinfo");
|
||||||
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(" 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]");
|
||||||
ush_writeln(" kill <pid> [signal]");
|
ush_writeln(" kill <pid> [signal]");
|
||||||
|
|||||||
@@ -194,8 +194,8 @@ static int ush_dns_parse_response(const u8 *resp, u64 resp_len, u16 expected_id)
|
|||||||
}
|
}
|
||||||
|
|
||||||
if (type == 1U && klass == 1U && rdlen == 4U) {
|
if (type == 1U && klass == 1U && rdlen == 4U) {
|
||||||
u64 ip = ((u64)resp[off] << 24ULL) | ((u64)resp[off + 1ULL] << 16ULL) |
|
u64 ip = ((u64)resp[off] << 24ULL) | ((u64)resp[off + 1ULL] << 16ULL) | ((u64)resp[off + 2ULL] << 8ULL) |
|
||||||
((u64)resp[off + 2ULL] << 8ULL) | (u64)resp[off + 3ULL];
|
(u64)resp[off + 3ULL];
|
||||||
ush_dns_print_ipv4_be(ip);
|
ush_dns_print_ipv4_be(ip);
|
||||||
(void)putchar('\n');
|
(void)putchar('\n');
|
||||||
found++;
|
found++;
|
||||||
|
|||||||
@@ -172,13 +172,13 @@ typedef struct cleonos_net_udp_recv_req {
|
|||||||
#define CLEONOS_SYSCALL_DISK_READ_SECTOR 93ULL
|
#define CLEONOS_SYSCALL_DISK_READ_SECTOR 93ULL
|
||||||
#define CLEONOS_SYSCALL_DISK_WRITE_SECTOR 94ULL
|
#define CLEONOS_SYSCALL_DISK_WRITE_SECTOR 94ULL
|
||||||
#define CLEONOS_SYSCALL_NET_AVAILABLE 95ULL
|
#define CLEONOS_SYSCALL_NET_AVAILABLE 95ULL
|
||||||
#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
|
||||||
|
|
||||||
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);
|
||||||
@@ -276,13 +276,13 @@ u64 cleonos_sys_disk_mounted(void);
|
|||||||
u64 cleonos_sys_disk_mount_path(char *out_path, u64 out_size);
|
u64 cleonos_sys_disk_mount_path(char *out_path, u64 out_size);
|
||||||
u64 cleonos_sys_disk_read_sector(u64 lba, void *out_sector);
|
u64 cleonos_sys_disk_read_sector(u64 lba, void *out_sector);
|
||||||
u64 cleonos_sys_disk_write_sector(u64 lba, const void *sector_data);
|
u64 cleonos_sys_disk_write_sector(u64 lba, const void *sector_data);
|
||||||
u64 cleonos_sys_net_available(void);
|
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);
|
||||||
|
|
||||||
#endif
|
#endif
|
||||||
|
|||||||
@@ -416,25 +416,25 @@ u64 cleonos_sys_net_available(void) {
|
|||||||
return cleonos_syscall(CLEONOS_SYSCALL_NET_AVAILABLE, 0ULL, 0ULL, 0ULL);
|
return cleonos_syscall(CLEONOS_SYSCALL_NET_AVAILABLE, 0ULL, 0ULL, 0ULL);
|
||||||
}
|
}
|
||||||
|
|
||||||
u64 cleonos_sys_net_ipv4_addr(void) {
|
u64 cleonos_sys_net_ipv4_addr(void) {
|
||||||
return cleonos_syscall(CLEONOS_SYSCALL_NET_IPV4_ADDR, 0ULL, 0ULL, 0ULL);
|
return cleonos_syscall(CLEONOS_SYSCALL_NET_IPV4_ADDR, 0ULL, 0ULL, 0ULL);
|
||||||
}
|
}
|
||||||
|
|
||||||
u64 cleonos_sys_net_netmask(void) {
|
u64 cleonos_sys_net_netmask(void) {
|
||||||
return cleonos_syscall(CLEONOS_SYSCALL_NET_NETMASK, 0ULL, 0ULL, 0ULL);
|
return cleonos_syscall(CLEONOS_SYSCALL_NET_NETMASK, 0ULL, 0ULL, 0ULL);
|
||||||
}
|
}
|
||||||
|
|
||||||
u64 cleonos_sys_net_gateway(void) {
|
u64 cleonos_sys_net_gateway(void) {
|
||||||
return cleonos_syscall(CLEONOS_SYSCALL_NET_GATEWAY, 0ULL, 0ULL, 0ULL);
|
return cleonos_syscall(CLEONOS_SYSCALL_NET_GATEWAY, 0ULL, 0ULL, 0ULL);
|
||||||
}
|
}
|
||||||
|
|
||||||
u64 cleonos_sys_net_dns_server(void) {
|
u64 cleonos_sys_net_dns_server(void) {
|
||||||
return cleonos_syscall(CLEONOS_SYSCALL_NET_DNS_SERVER, 0ULL, 0ULL, 0ULL);
|
return cleonos_syscall(CLEONOS_SYSCALL_NET_DNS_SERVER, 0ULL, 0ULL, 0ULL);
|
||||||
}
|
}
|
||||||
|
|
||||||
u64 cleonos_sys_net_ping(u64 dst_ipv4_be, u64 poll_budget) {
|
u64 cleonos_sys_net_ping(u64 dst_ipv4_be, u64 poll_budget) {
|
||||||
return cleonos_syscall(CLEONOS_SYSCALL_NET_PING, dst_ipv4_be, poll_budget, 0ULL);
|
return cleonos_syscall(CLEONOS_SYSCALL_NET_PING, dst_ipv4_be, poll_budget, 0ULL);
|
||||||
}
|
}
|
||||||
|
|
||||||
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) {
|
||||||
return cleonos_syscall(CLEONOS_SYSCALL_NET_UDP_SEND, (u64)req, 0ULL, 0ULL);
|
return cleonos_syscall(CLEONOS_SYSCALL_NET_UDP_SEND, (u64)req, 0ULL, 0ULL);
|
||||||
|
|||||||
Reference in New Issue
Block a user