summaryrefslogtreecommitdiff
path: root/cmd
diff options
context:
space:
mode:
authorLuke T. Shumaker <lukeshu@lukeshu.com>2024-11-13 15:23:42 -0700
committerLuke T. Shumaker <lukeshu@lukeshu.com>2024-11-19 20:15:12 -0700
commit0360ef3a038c8c3f6f252fdc8f1b91e4cbdd4e39 (patch)
tree387fde8b794f059484e300bef5fc1051fb30095c /cmd
parent363e741feba2268db9c72215460c627bcc4f33ac (diff)
libcr: Start to add coroutine names
Diffstat (limited to 'cmd')
-rw-r--r--cmd/sbc_harness/main.c8
-rw-r--r--cmd/srv9p/main.c14
2 files changed, 14 insertions, 8 deletions
diff --git a/cmd/sbc_harness/main.c b/cmd/sbc_harness/main.c
index d015259..85dfdfb 100644
--- a/cmd/sbc_harness/main.c
+++ b/cmd/sbc_harness/main.c
@@ -86,11 +86,11 @@ int main() {
usb_common_lateinit();
/* set up coroutines **************************************************/
- coroutine_add(usb_common_cr, NULL);
+ coroutine_add("usb_common", usb_common_cr, NULL);
usb_keyboard_rpc_t keyboard_chan = {0};
- coroutine_add(usb_keyboard_cr, &keyboard_chan);
- //coroutine_add(hello_world_cr, &keyboard_chan);
- coroutine_add_with_stack_size(4*1024, dhcp_cr, &dev_w5500);
+ coroutine_add("usb_keyboard", usb_keyboard_cr, &keyboard_chan);
+ //coroutine_add("hello_world", hello_world_cr, &keyboard_chan);
+ coroutine_add_with_stack_size(4*1024, "dhcp", dhcp_cr, &dev_w5500);
/* event loop *********************************************************/
coroutine_main();
diff --git a/cmd/srv9p/main.c b/cmd/srv9p/main.c
index c5a3367..076d756 100644
--- a/cmd/srv9p/main.c
+++ b/cmd/srv9p/main.c
@@ -99,17 +99,23 @@ static COROUTINE read_cr(void *_srv) {
cr_end();
}
+const char *hexdig = "0123456789abcdef";
+
int main() {
struct lib9p_srv srv = {
.rootdir = get_root,
};
- for (int i = 0; i < CONFIG_SRV9P_NUM_CONNS; i++)
- if (!coroutine_add(read_cr, &srv))
+ for (int i = 0; i < CONFIG_SRV9P_NUM_CONNS; i++) {
+ char name[] = {'r', 'e', 'a', 'd', '-', hexdig[i], '\0'};
+ if (!coroutine_add(name, read_cr, &srv))
error(1, 0, "coroutine_add(read_cr, &srv)");
- for (int i = 0; i < 2*CONFIG_SRV9P_NUM_CONNS; i++)
- if (!coroutine_add(lib9p_srv_write_cr, &srv))
+ }
+ for (int i = 0; i < 2*CONFIG_SRV9P_NUM_CONNS; i++) {
+ char name[] = {'w', 'r', 'i', 't', 'e', '-', hexdig[i], '\0'};
+ if (!coroutine_add(name, lib9p_srv_write_cr, &srv))
error(1, 0, "coroutine_add(lib9p_srv_write_cr, &srv)");
+ }
coroutine_main();
return 1;