Skip to content

Commit

Permalink
debug: Add release and reinit implementations
Browse files Browse the repository at this point in the history
This allows the debug-UART bridge driver to more gracefully handle
things like 'culvert trace' and wdt reset waits.

Signed-off-by: Zev Weiss <[email protected]>
  • Loading branch information
zevweiss committed Nov 16, 2023
1 parent 4713b9a commit 4527291
Showing 1 changed file with 18 additions and 0 deletions.
18 changes: 18 additions & 0 deletions src/bridge/debug.c
Original file line number Diff line number Diff line change
Expand Up @@ -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);

Expand Down Expand Up @@ -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);
}

0 comments on commit 4527291

Please sign in to comment.