summaryrefslogtreecommitdiff
path: root/cmd/sbc_harness
diff options
context:
space:
mode:
Diffstat (limited to 'cmd/sbc_harness')
-rw-r--r--cmd/sbc_harness/fs_harness_flash_bin.c26
-rw-r--r--cmd/sbc_harness/fs_harness_uptime_txt.c25
2 files changed, 24 insertions, 27 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;
diff --git a/cmd/sbc_harness/fs_harness_uptime_txt.c b/cmd/sbc_harness/fs_harness_uptime_txt.c
index 021a8bd..4d35385 100644
--- a/cmd/sbc_harness/fs_harness_uptime_txt.c
+++ b/cmd/sbc_harness/fs_harness_uptime_txt.c
@@ -11,23 +11,21 @@
#include "fs_harness_uptime_txt.h"
-LO_IMPLEMENTATION_C(lib9p_srv_file, struct uptime_file, uptime_file, static);
+LO_IMPLEMENTATION_C(lib9p_srv_file, struct uptime_file, uptime_file);
struct uptime_fio {
struct uptime_file *parent;
size_t buf_len;
char buf[24]; /* len(str(UINT64_MAX)+"ns\n\0") */
};
-
-LO_IMPLEMENTATION_H(lib9p_srv_fio, struct uptime_fio, uptime_fio);
-LO_IMPLEMENTATION_C(lib9p_srv_fio, struct uptime_fio, uptime_fio, static);
+LO_IMPLEMENTATION_STATIC(lib9p_srv_fio, struct uptime_fio, uptime_fio);
/* srv_file *******************************************************************/
-static void uptime_file_free(struct uptime_file *self) {
+void uptime_file_free(struct uptime_file *self) {
assert(self);
}
-static struct lib9p_qid uptime_file_qid(struct uptime_file *self) {
+struct lib9p_qid uptime_file_qid(struct uptime_file *self) {
assert(self);
return (struct lib9p_qid){
@@ -37,7 +35,7 @@ static struct lib9p_qid uptime_file_qid(struct uptime_file *self) {
};
}
-static lib9p_srv_stat_or_error uptime_file_stat(struct uptime_file *self, struct lib9p_srv_ctx *ctx) {
+lib9p_srv_stat_or_error uptime_file_stat(struct uptime_file *self, struct lib9p_srv_ctx *ctx) {
assert(self);
assert(ctx);
@@ -64,24 +62,23 @@ static lib9p_srv_stat_or_error uptime_file_stat(struct uptime_file *self, struct
.extension = lib9p_str(NULL),
}));
}
-static error uptime_file_wstat(struct uptime_file *self, struct lib9p_srv_ctx *ctx,
- struct lib9p_srv_stat) {
+error uptime_file_wstat(struct uptime_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 uptime_file_remove(struct uptime_file *self, struct lib9p_srv_ctx *ctx) {
+error uptime_file_remove(struct uptime_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 uptime_file, uptime_file);
+LIB9P_SRV_NOTDIR(, struct uptime_file, uptime_file);
-static lib9p_srv_fio_or_error uptime_file_fopen(struct uptime_file *self, struct lib9p_srv_ctx *ctx,
- bool LM_UNUSED(rd), bool LM_UNUSED(wr), bool LM_UNUSED(trunc)) {
+lib9p_srv_fio_or_error uptime_file_fopen(struct uptime_file *self, struct lib9p_srv_ctx *ctx,
+ bool LM_UNUSED(rd), bool LM_UNUSED(wr), bool LM_UNUSED(trunc)) {
assert(self);
assert(ctx);
@@ -104,7 +101,7 @@ static void uptime_fio_iofree(struct uptime_fio *self) {
free(self);
}
-static struct lib9p_qid uptime_fio_qid(struct uptime_fio *self) {
+static struct lib9p_qid uptime_fio_ioqid(struct uptime_fio *self) {
assert(self);
assert(self->parent);
return uptime_file_qid(self->parent);