summaryrefslogtreecommitdiffstats
path: root/vpnor/test/dump_flash.cpp
diff options
context:
space:
mode:
authorEvan Lojewski <github@meklort.com>2019-03-14 14:34:33 +1030
committerAndrew Jeffery <andrew@aj.id.au>2019-03-18 10:46:11 +1030
commitf1e547c74563d59f60d918c6fa673bb8cee6e669 (patch)
tree9ac7e157de69b3163b289f1f2f01f2a5c5c31861 /vpnor/test/dump_flash.cpp
parentcb93504ed0fefa23186415accca6c0812174f274 (diff)
downloadphosphor-mboxbridge-f1e547c74563d59f60d918c6fa673bb8cee6e669.tar.gz
phosphor-mboxbridge-f1e547c74563d59f60d918c6fa673bb8cee6e669.zip
mboxd: Add a backend abstraction layer to mboxd.
Introduce a backend abstraction, enabling multiple implementations to be compiled in at once. This change formally abstracts the two existing backends, mtd and vpnor. With the backend abstraction in place, subsequent backends are easier to implement. This change is based of Evan's work and he retains authorship credit. I (AJ) have reworked the patch to pass the vpnor tests, refactored some parts to enable broader use of const structures and others to clarify the initialisation sequences. Due to the existing lack of abstraction the patch has unfortunately wide-ranging impacts. I've whittled it down as much as I consider reasonable. Change-Id: I29984a36dae4ea86ec00b853d2a756f0b9afb3ec Signed-off-by: Evan Lojewski <github@meklort.com> Signed-off-by: Andrew Jeffery <andrew@aj.id.au>
Diffstat (limited to 'vpnor/test/dump_flash.cpp')
-rw-r--r--vpnor/test/dump_flash.cpp5
1 files changed, 2 insertions, 3 deletions
diff --git a/vpnor/test/dump_flash.cpp b/vpnor/test/dump_flash.cpp
index 5179b7c..f285a61 100644
--- a/vpnor/test/dump_flash.cpp
+++ b/vpnor/test/dump_flash.cpp
@@ -68,9 +68,8 @@ int main()
system_set_reserved_size(MEM_SIZE);
system_set_mtd_sizes(PNOR_SIZE, ERASE_SIZE);
- tctx->ctx = mbox_create_test_context(N_WINDOWS, WINDOW_SIZE);
- test::VpnorRoot root(tctx->ctx, toc, BLOCK_SIZE);
- init_vpnor_from_paths(tctx->ctx);
+ tctx->ctx = mbox_create_frontend_context(N_WINDOWS, WINDOW_SIZE);
+ test::VpnorRoot root(&tctx->ctx->backend, toc, BLOCK_SIZE);
rc = mbox_command_dispatch(tctx->ctx, get_info, sizeof(get_info));
assert(rc == 1);
OpenPOWER on IntegriCloud