target/xtensa: avoid IHI for writes to non-executable memory
[openocd.git] / src / target / testee.c
blob687565271d1b3351fc98e54d5561eae8c5868515
1 // SPDX-License-Identifier: GPL-2.0-or-later
3 /***************************************************************************
4 * Copyright (C) 2009 Zachary T Welch <zw@superlucidity.net> *
5 ***************************************************************************/
7 #ifdef HAVE_CONFIG_H
8 #include "config.h"
9 #endif
11 #include <helper/log.h>
13 #include "target.h"
14 #include "target_type.h"
15 #include "hello.h"
17 static const struct command_registration testee_command_handlers[] = {
19 .name = "testee",
20 .mode = COMMAND_ANY,
21 .help = "testee target commands",
22 .chain = hello_command_handlers,
23 .usage = "",
25 COMMAND_REGISTRATION_DONE
28 static int testee_init(struct command_context *cmd_ctx, struct target *target)
30 return ERROR_OK;
32 static int testee_poll(struct target *target)
34 if ((target->state == TARGET_RUNNING) || (target->state == TARGET_DEBUG_RUNNING))
35 target->state = TARGET_HALTED;
36 return ERROR_OK;
38 static int testee_halt(struct target *target)
40 target->state = TARGET_HALTED;
41 return ERROR_OK;
43 static int testee_reset_assert(struct target *target)
45 target->state = TARGET_RESET;
46 return ERROR_OK;
48 static int testee_reset_deassert(struct target *target)
50 target->state = TARGET_RUNNING;
51 return ERROR_OK;
53 struct target_type testee_target = {
54 .name = "testee",
55 .commands = testee_command_handlers,
57 .init_target = &testee_init,
58 .poll = &testee_poll,
59 .halt = &testee_halt,
60 .assert_reset = &testee_reset_assert,
61 .deassert_reset = &testee_reset_deassert,