diff options
author | Luke T. Shumaker <lukeshu@lukeshu.com> | 2025-06-10 00:47:32 -0600 |
---|---|---|
committer | Luke T. Shumaker <lukeshu@lukeshu.com> | 2025-06-10 16:47:14 -0600 |
commit | 6eafa9fd3a49289d34007a018b6d1fba8e4b7e24 (patch) | |
tree | 61dddfb0735fe841a0e1c56ea331a360a2d2dad0 /cmd/sbc_harness/fs_harness_flash_bin.c | |
parent | db43b1ae4456367d9909ce3ccc00be7dede651fc (diff) |
libmisc: obj.h: Rework the LO_INTERFACE_* API to expose method funcs
Diffstat (limited to 'cmd/sbc_harness/fs_harness_flash_bin.c')
-rw-r--r-- | cmd/sbc_harness/fs_harness_flash_bin.c | 26 |
1 files changed, 13 insertions, 13 deletions
diff --git a/cmd/sbc_harness/fs_harness_flash_bin.c b/cmd/sbc_harness/fs_harness_flash_bin.c index ea60447..8eebe9e 100644 --- a/cmd/sbc_harness/fs_harness_flash_bin.c +++ b/cmd/sbc_harness/fs_harness_flash_bin.c @@ -17,10 +17,8 @@ #define IMPLEMENTATION_FOR_FS_HARNESS_FLASH_BIN YES #include "fs_harness_flash_bin.h" -LO_IMPLEMENTATION_C(lib9p_srv_file, struct flash_file, flash_file, static); - -LO_IMPLEMENTATION_H(lib9p_srv_fio, struct flash_file, flash_file); -LO_IMPLEMENTATION_C(lib9p_srv_fio, struct flash_file, flash_file, static); +LO_IMPLEMENTATION_C(lib9p_srv_file, struct flash_file, flash_file); +LO_IMPLEMENTATION_STATIC(lib9p_srv_fio, struct flash_file, flash_file); #define DATA_START ((const char *)(XIP_NOALLOC_BASE)) #define DATA_SIZE PICO_FLASH_SIZE_BYTES @@ -135,10 +133,10 @@ static void ab_flash_write_sector(size_t pos, uint8_t *dat) { /* srv_file *******************************************************************/ -static void flash_file_free(struct flash_file *self) { +void flash_file_free(struct flash_file *self) { assert(self); } -static struct lib9p_qid flash_file_qid(struct flash_file *self) { +struct lib9p_qid flash_file_qid(struct flash_file *self) { assert(self); return (struct lib9p_qid){ @@ -148,7 +146,7 @@ static struct lib9p_qid flash_file_qid(struct flash_file *self) { }; } -static lib9p_srv_stat_or_error flash_file_stat(struct flash_file *self, struct lib9p_srv_ctx *ctx) { +lib9p_srv_stat_or_error flash_file_stat(struct flash_file *self, struct lib9p_srv_ctx *ctx) { assert(self); assert(ctx); @@ -165,24 +163,23 @@ static lib9p_srv_stat_or_error flash_file_stat(struct flash_file *self, struct l .extension = lib9p_str(NULL), })); } -static error flash_file_wstat(struct flash_file *self, struct lib9p_srv_ctx *ctx, - struct lib9p_srv_stat) { +error flash_file_wstat(struct flash_file *self, struct lib9p_srv_ctx *ctx, struct lib9p_srv_stat) { assert(self); assert(ctx); return error_new(E_POSIX_EROFS, "read-only part of filesystem"); } -static error flash_file_remove(struct flash_file *self, struct lib9p_srv_ctx *ctx) { +error flash_file_remove(struct flash_file *self, struct lib9p_srv_ctx *ctx) { assert(self); assert(ctx); return error_new(E_POSIX_EROFS, "read-only part of filesystem"); } -LIB9P_SRV_NOTDIR(struct flash_file, flash_file); +LIB9P_SRV_NOTDIR(, struct flash_file, flash_file); -static lib9p_srv_fio_or_error flash_file_fopen(struct flash_file *self, struct lib9p_srv_ctx *ctx, - bool rd, bool wr, bool trunc) { +lib9p_srv_fio_or_error flash_file_fopen(struct flash_file *self, struct lib9p_srv_ctx *ctx, + bool rd, bool wr, bool trunc) { assert(self); assert(ctx); @@ -206,6 +203,9 @@ static lib9p_srv_fio_or_error flash_file_fopen(struct flash_file *self, struct l /* srv_fio ********************************************************************/ +static struct lib9p_qid flash_file_ioqid(struct flash_file *self) { + return flash_file_qid(self); +} static uint32_t flash_file_iounit(struct flash_file *self) { assert(self); return FLASH_SECTOR_SIZE; |