diff options
author | Luke T. Shumaker <lukeshu@lukeshu.com> | 2024-10-04 17:39:24 -0600 |
---|---|---|
committer | Luke T. Shumaker <lukeshu@lukeshu.com> | 2024-10-04 17:39:24 -0600 |
commit | 860a9e995b8e7076ce4e5c231e844184bef9b95e (patch) | |
tree | 8e106b091ec1c4ad423407ae8a6c386b5260772e | |
parent | 2fe787ba4db420f5b08573d77e35cfaa0d7a0793 (diff) |
wip
-rw-r--r-- | cmd/sbc_harness/config/config.h | 2 | ||||
-rw-r--r-- | lib9p/include/lib9p/srv.h | 2 | ||||
-rw-r--r-- | lib9p/srv.c | 11 | ||||
-rw-r--r-- | libcr/coroutine.c | 2 |
4 files changed, 13 insertions, 4 deletions
diff --git a/cmd/sbc_harness/config/config.h b/cmd/sbc_harness/config/config.h index 0e8f43b..82aea34 100644 --- a/cmd/sbc_harness/config/config.h +++ b/cmd/sbc_harness/config/config.h @@ -15,7 +15,7 @@ #if defined(USE_CONFIG_COROUTINE) && !defined(_CONFIG_H_COROUTINE_) #define _CONFIG_H_COROUTINE_ -# define CONFIG_COROUTINE_DEFAULT_STACK_SIZE (16*1024) +# define CONFIG_COROUTINE_DEFAULT_STACK_SIZE (32*1024) # define CONFIG_COROUTINE_MEASURE_STACK 1 /* bool */ # define CONFIG_COROUTINE_PROTECT_STACK 1 /* bool */ # define CONFIG_COROUTINE_DEBUG 0 /* bool */ diff --git a/lib9p/include/lib9p/srv.h b/lib9p/include/lib9p/srv.h index 769b562..0211260 100644 --- a/lib9p/include/lib9p/srv.h +++ b/lib9p/include/lib9p/srv.h @@ -18,7 +18,7 @@ struct lib9p_srv_file_vtable { /* all */ struct lib9p_srv_io (*io )(struct lib9p_srv_reqctx *ctx, void *impldata, lib9p_o_t flags); - struct lib9p_stat (*stat )(struct lib9p_srv_reqcggtx *ctx, void *impldata); + struct lib9p_stat (*stat )(struct lib9p_srv_reqctx *ctx, void *impldata); void (*wstat )(struct lib9p_srv_reqctx *ctx, void *impldata, struct lib9p_stat new); void (*remove )(struct lib9p_srv_reqctx *ctx, void *impldata); diff --git a/lib9p/srv.c b/lib9p/srv.c index 0f9466c..534d70a 100644 --- a/lib9p/srv.c +++ b/lib9p/srv.c @@ -375,7 +375,7 @@ static void handle_Tauth(struct lib9p_req *ctx, struct lib9p_msg_Tauth *req, str return; } -static void handle_Tattach(struct lib9p_req *ctx, struct lib9p_msg_Tattach *req, struct lib9p_msg_Rattach *UNUSED(resp)) { +static void handle_Tattach(struct lib9p_req *ctx, struct lib9p_msg_Tattach *req, struct lib9p_msg_Rattach *resp) { struct lib9p_srv_reqctx subctx = { .base = &ctx->ctx, .uid = req->n_uname, @@ -418,6 +418,13 @@ static void handle_Tattach(struct lib9p_req *ctx, struct lib9p_msg_Tattach *req, if (lib9p_ctx_has_error(&ctx->ctx)) return; + struct lib9p_stat stat = rootdir.vtable.stat(&subctx, rootdir.impldata); + if (lib9p_ctx_has_error(&ctx->ctx)) { + if (rootdir.vtable.free) + rootdir.vtable.free(&subctx, rootdir.impldata); + return; + } + struct lib9p_srv_file *rootdir_ptr = fidmap_store(&ctx->parent_sess->fids, req->fid, rootdir); if (!rootdir_ptr) { lib9p_error(&ctx->ctx, LINUX_EMFILE, "too many open files"); @@ -426,7 +433,7 @@ static void handle_Tattach(struct lib9p_req *ctx, struct lib9p_msg_Tattach *req, return; } - //resp->qid = rootdir.qid; + resp->qid = stat.file_qid; return; } diff --git a/libcr/coroutine.c b/libcr/coroutine.c index fac0cd7..13ee932 100644 --- a/libcr/coroutine.c +++ b/libcr/coroutine.c @@ -502,7 +502,9 @@ static inline void _cr_transition(enum coroutine_state state) { } /* No coroutines are runnable, wait for an interrupt * to change that. */ + cr_enable_interrupts(); cr_plat_wait_for_interrupt(); + cr_disable_interrupts(); } coroutine_table[coroutine_running-1].sp = cr_plat_get_sp(); |