|
| static bool | full_path (const char *path, char *out, size_t n) |
| | The full path of path, a path from the card's root.
|
| static fm_err_t | err_of (int e) |
| | The core's answer for a failed call's errno. A failure with no other reason looks at the slot: a card taken out answers so.
|
| static fm_err_t | gone_or_io (void) |
| | The answer of a call that found nothing it can name.
|
| static bool | io_mounted (void *ctx) |
| | fm_io_t mounted().
|
| static unsigned | io_mounts (void *ctx) |
| | fm_io_t mounts().
|
| static bool | io_hold (void *ctx, unsigned mount) |
| | fm_io_t hold().
|
| static void | io_release (void *ctx) |
| | fm_io_t release().
|
| static void | walk_take (const storage_entry_t *entry, void *ctx) |
| | One entry of storage_walk_counted() handed to the core.
|
| static fm_err_t | io_walk (void *ctx, const char *dir, fm_visit_fn visit, void *vctx, unsigned *unlisted) |
| | fm_io_t walk(): storage_walk_counted() with no suffix filter, so every entry is visited or counted: a name starting with "." and a name of 64 characters or more are counted as unlisted.
|
| static fm_err_t | io_stat (void *ctx, const char *path, fm_stat_t *out) |
| | fm_io_t stat(), FatFs's own f_stat() through storage_stat() for a 64-bit size.
|
| static fm_err_t | path_call (const char *path, int call) |
| | A path call on the full path: mkdir(), unlink() or rmdir().
|
| static fm_err_t | io_mkdir (void *ctx, const char *path) |
| | fm_io_t mkdir().
|
| static fm_err_t | io_unlink (void *ctx, const char *path) |
| | fm_io_t unlink().
|
| static fm_err_t | io_rmdir (void *ctx, const char *path) |
| | fm_io_t rmdir(). FatFs refuses a folder with entries with FR_DENIED, which is EACCES and FM_ERR_DENIED.
|
| static fm_err_t | io_rename (void *ctx, const char *from, const char *to) |
| | fm_io_t rename(): FatFs's f_rename(), which renames over no name (FR_EXIST, EEXIST) but the same entry's in another case.
|
| static int | fd_of (void *file) |
| | The descriptor of a handle: fd + 1, so no handle is NULL.
|
| static fm_err_t | io_open (void *ctx, const char *path, fm_mode_t mode, void **file) |
| | fm_io_t open(): a descriptor, the volume held until close(). A new file is O_EXCL: a taken name is FM_ERR_EXISTS.
|
| static fm_err_t | io_read (void *ctx, void *file, uint8_t *buf, size_t cap, size_t *got) |
| | fm_io_t read().
|
| static fm_err_t | io_write (void *ctx, void *file, const uint8_t *buf, size_t len) |
| | fm_io_t write(): all of it, or FM_ERR_FULL for a short write.
|
| static fm_err_t | io_sync (void *ctx, void *file) |
| | fm_io_t sync(): fsync(), the file on the card.
|
| static fm_err_t | io_close (void *ctx, void *file) |
| | fm_io_t close(), and the open's hold given back.
|
| static void | job_bench (fm_bench_t *out, void *ctx) |
| | The runner's bench(): the control task's snapshot and the logger's open files, now.
|
| static bool | job_cancelled (void *ctx) |
| | The runner's cancelled().
|
| static void | job_progress (uint64_t done, uint64_t total, void *ctx) |
| | The runner's progress().
|
| static void | job_look (void *ctx) |
| | The runner's look(): a card put in, taken out or swapped is found.
|
| static void | log_copy (const fm_req_t *req, int64_t us) |
| | A copy's bytes, time and rate, and the stack cardjob left: the card's figures on this board.
|
| static void | files_task (void *arg) |
| | cardjob: each request handed over, run to its end.
|
| static bool | start_task (void) |
| | cardjob and its chunk, at the first request.
|
| static bool | fio_submit (fm_req_t *req, void *ctx) |
| | files_io_t submit().
|
| static bool | fio_idle (void *ctx) |
| | files_io_t idle().
|
| static void | fio_progress (uint64_t *done, uint64_t *total, void *ctx) |
| | files_io_t progress().
|
| static void | fio_cancel (void *ctx) |
| | files_io_t cancel().
|
| static void | fio_bench (fm_bench_t *out, void *ctx) |
| | files_io_t bench(): the band's ARMED and link, and the logger's open files, for the footer's gate and the rows' marks.
|
| static const char * | fio_volume (void *ctx) |
| | files_io_t volume().
|
| static card_state_t | fio_card (void *ctx) |
| | files_io_t card().
|
|
|
static const char * | TAG = "rcbench" |
| | The log tag of the panel's lines.
|
| static const fm_io_t | k_io |
| | The card as the core sees it.
|
|
static fm_req_t * | s_req |
| | The request handed over, cardjob's from the count up to its answer.
|
|
static atomic_uint | s_sent |
| | Requests handed over: equal to s_done while none is under way.
|
|
static atomic_uint | s_done |
| | Requests answered.
|
|
static atomic_bool | s_cancel |
| | CANCEL, set by the render task, read by cardjob before each step.
|
|
static portMUX_TYPE | s_prog_mux = portMUX_INITIALIZER_UNLOCKED |
| | Guards s_prog_done and s_prog_total, 64-bit each.
|
|
static uint64_t | s_prog_done |
| | The job's bytes done, under s_prog_mux.
|
|
static uint64_t | s_prog_total |
| | The job's bytes to do, under s_prog_mux.
|
|
static TaskHandle_t | s_task |
| | cardjob, NULL until the first request starts it.
|
|
static uint8_t * | s_chunk |
| | cardjob's copy buffer, FM_CHUNK bytes of internal DMA RAM.
|
|
static log_marks_t | s_job_marks |
| | The logger's open files as cardjob last read them.
|
|
static char | s_job_run_dir [CARD_DIR_MAX] |
| | The folder of s_job_marks' run.
|
|
static char | s_job_test_dir [CARD_DIR_MAX] |
| | The folder of s_job_marks' test.
|
|
static log_marks_t | s_ui_marks |
| | The logger's open files as the screen last read them: the task that renders' own.
|
|
static char | s_ui_run_dir [CARD_DIR_MAX] |
| | The folder of s_ui_marks' run.
|
|
static char | s_ui_test_dir [CARD_DIR_MAX] |
| | The folder of s_ui_marks' test.
|
| const files_io_t | k_files_io |
| | FILES' way to the card: its requests run on cardjob.
|
FILES' card task: the file manager's card (fm_io.h) over the storage component, the task cardjob that runs the screen's requests (fm_req.h), and the screen's way to it (files_io_t).
The FILES screen makes no card call: it hands a request over through k_files_io, and cardjob makes every call of it, listings and INFO included, one request at a time. A long copy then holds up neither a frame nor STOP. cardjob runs at priority 1 on core 0, the render loop's, and is created at the first request, not at start-up: its stack (FILES_STACK) and the copy's chunk (FM_CHUNK, internal and DMA-capable, since the card's driver reads a PSRAM target one sector at a time) cost internal RAM only once FILES is used. Both are kept from then on.
Every call runs under the hold of the mount the names were listed from (storage_hold_mount()), which fm_tree.c and fm_ops.c take: a card swapped since is never written under a stale name. A file stays held from open() to close() as well (storage_hold()). A call that fails with no other reason looks at the slot once (storage_check()); a card found gone answers FM_ERR_CARD_GONE.
The bench the write gate reads is the control task's snapshot: ARMED and an arm waiting count as ARMED, the IOmcu link as it stands, and the logger's open files (log_open_marks()). A job reads it before each chunk, so an ARM stops a copy at its next 16KiB.
Each copy logs its bytes, its time and its rate, and the stack cardjob left unused: the card's rate on this board is not measured.
SPDX-License-Identifier: MIT