|
ra8-firmware 0.1.0
Bare-metal firmware for the Renesas RA8 family (RA8D2 / RA8P1)
|
The application layer's one composition seam: the bound working set. More...
Go to the source code of this file.
Functions | |
| void | mdl_app_bind (mdl_app_context_t *ctx) |
| Bind the caller-owned working set every application mode will use. | |
| mdl_app_context_t * | priv_mdl_app_context (void) |
| The working set the composition root bound with mdl_app_bind. | |
Variables | |
| static mdl_app_context_t * | s_app_ctx = nullptr |
| The one context every application mode currently reads. | |
The application layer's one composition seam: the bound working set.
Holds the pointer a form hands to mdl_app_bind and nothing else. The modes reach their shared bounded state through the accessor here, so the downloader owns no storage of its own and a test can bind a fixture context in place of the production one.
Definition in file mdl_app.c.
| void mdl_app_bind | ( | mdl_app_context_t * | ctx | ) |
Bind the caller-owned working set every application mode will use.
The composition seam for the application layer. A form declares one mdl_app_context_t in its own storage – static on a host, a reserved SRAM region on the device – initialises the members it owns (the two streams, the storage facade, the exporter workspace) and hands the address here. Every mode then reads that one context through a module-private accessor, so the downloader needs no global of its own and a test can bind a fixture context instead of the production one.
Binding is unconditional and reports nothing: there is exactly one thing it can do and one way to get it wrong, and passing a context the modes cannot dereference is a composition defect rather than a runtime condition – the same contract mdl_export_workspace_init already publishes for the exporter arena.
| [in,out] | ctx | Caller-owned context, live until the next bind. |
ctx addresses writable storage for one complete context. ctx is the context every subsequent mode reads. Definition at line 28 of file mdl_app.c.
References s_app_ctx.
Referenced by internal_main_init().
| mdl_app_context_t * priv_mdl_app_context | ( | void | ) |
The working set the composition root bound with mdl_app_bind.
The one way an application mode reaches shared bounded state. It is a function rather than an extern object so the storage stays owned by the form and this layer keeps no global of its own.
| non-NULL | The context most recently passed to mdl_app_bind. |
| nullptr | No form has bound a context yet. |
Definition at line 33 of file mdl_app.c.
References RA8_PRIV, and s_app_ctx.
Referenced by internal_admin_latch(), internal_apply_order(), internal_build_export_metadata(), internal_cover_cached(), internal_cover_current(), internal_cover_finish(), internal_cover_stream(), internal_direct_latch(), internal_direct_pack_failure(), internal_download_page_image(), internal_download_page_images(), internal_export_after(), internal_export_fresh_separate(), internal_extract_cover(), internal_extract_optional_metadata(), internal_extract_page_images(), internal_extract_series_metadata(), internal_fetch_artifact(), internal_finish_artifact_fetch(), internal_init_site_identity(), internal_library_report(), internal_list_cb(), internal_make_ctx(), internal_pack_directory_output(), internal_pack_file_output(), internal_prepare_artifact_path(), internal_prepare_diag3(), internal_prepare_filter_chapters(), internal_prepare_output_dir(), internal_publish_page_image(), internal_reconcile_series_state(), internal_remove_stale_page_variants(), internal_report_cover_failure(), internal_report_stats(), internal_resolve_removal_target(), internal_run_prepared(), internal_run_series_network(), internal_run_series_paths(), internal_save_series_state(), internal_select_run_window(), internal_select_window(), internal_snapshot_prior_metadata(), internal_update_all_cb(), internal_verify_artifact_entry(), internal_verify_artifacts(), internal_verify_library_root(), internal_verify_page_rec(), internal_verify_series_dir(), internal_warn_no_contact(), mdl_app_run_artifact(), mdl_app_run_discover(), mdl_app_run_init_site(), mdl_app_run_list(), mdl_app_run_pack(), mdl_app_run_page(), mdl_app_run_remove(), mdl_app_run_series(), mdl_app_run_update_all(), mdl_app_run_verify(), priv_mdl_app_ensure_series_cover(), priv_mdl_app_prepare_chapters(), priv_mdl_app_prepare_series_dir(), priv_mdl_app_report_cache(), and priv_mdl_app_start_session().
|
static |
The one context every application mode currently reads.
Null until a form calls mdl_app_bind. It is a POINTER rather than the object because the working set is several megabytes and the form – host static storage, or a reserved SRAM region on the device – is the only layer that can decide where those bytes live.
Definition at line 26 of file mdl_app.c.
Referenced by mdl_app_bind(), and priv_mdl_app_context().