1 // SPDX-License-Identifier: GPL-2.0-or-later
3 /***************************************************************************
4 * Copyright (C) 2009 Zachary T Welch <zw@superlucidity.net> *
5 ***************************************************************************/
11 #include <helper/log.h>
14 #include "target_type.h"
17 static const struct command_registration testee_command_handlers
[] = {
21 .help
= "testee target commands",
22 .chain
= hello_command_handlers
,
25 COMMAND_REGISTRATION_DONE
28 static int testee_init(struct command_context
*cmd_ctx
, struct target
*target
)
32 static int testee_poll(struct target
*target
)
34 if ((target
->state
== TARGET_RUNNING
) || (target
->state
== TARGET_DEBUG_RUNNING
))
35 target
->state
= TARGET_HALTED
;
38 static int testee_halt(struct target
*target
)
40 target
->state
= TARGET_HALTED
;
43 static int testee_reset_assert(struct target
*target
)
45 target
->state
= TARGET_RESET
;
48 static int testee_reset_deassert(struct target
*target
)
50 target
->state
= TARGET_RUNNING
;
53 struct target_type testee_target
= {
55 .commands
= testee_command_handlers
,
57 .init_target
= &testee_init
,
60 .assert_reset
= &testee_reset_assert
,
61 .deassert_reset
= &testee_reset_deassert
,