From 4527291a21166434292a4983500fa4fe4ac919bd Mon Sep 17 00:00:00 2001 From: Zev Weiss Date: Tue, 14 Nov 2023 19:52:44 -0800 Subject: [PATCH] debug: Add release and reinit implementations This allows the debug-UART bridge driver to more gracefully handle things like 'culvert trace' and wdt reset waits. Signed-off-by: Zev Weiss --- src/bridge/debug.c | 18 ++++++++++++++++++ 1 file changed, 18 insertions(+) diff --git a/src/bridge/debug.c b/src/bridge/debug.c index 9617d48..4e8e0c3 100644 --- a/src/bridge/debug.c +++ b/src/bridge/debug.c @@ -447,11 +447,15 @@ static const struct ahb_ops debug_ahb_ops = { static struct ahb *debug_driver_probe(int argc, char *argv[]); static void debug_driver_destroy(struct ahb *ahb); +static int debug_driver_release(struct ahb *ahb); +static int debug_driver_reinit(struct ahb *ahb); static struct bridge_driver debug_driver = { .name = "debug-uart", .probe = debug_driver_probe, .destroy = debug_driver_destroy, + .release = debug_driver_release, + .reinit = debug_driver_reinit, }; REGISTER_BRIDGE_DRIVER(debug_driver); @@ -569,3 +573,17 @@ static void debug_driver_destroy(struct ahb *ahb) free(ctx); } + +static int debug_driver_release(struct ahb *ahb) +{ + struct debug *ctx = to_debug(ahb); + + return debug_exit(ctx); +} + +static int debug_driver_reinit(struct ahb *ahb) +{ + struct debug *ctx = to_debug(ahb); + + return debug_enter(ctx); +}