2 * Copyright (c) 2011-2012 The Chromium OS Authors.
3 * SPDX-License-Identifier: GPL-2.0+
6 #ifndef __SANDBOX_STATE_H
7 #define __SANDBOX_STATE_H
11 /* How we exited U-Boot */
14 STATE_EXIT_COLD_REBOOT,
18 struct sandbox_spi_info {
20 const struct sandbox_spi_emu_ops *ops;
23 /* The complete state of the test system */
24 struct sandbox_state {
25 const char *cmd; /* Command to execute */
26 const char *fdt_fname; /* Filename of FDT binary */
27 enum exit_type_id exit_type; /* How we exited U-Boot */
28 const char *parse_err; /* Error to report from parsing */
29 int argc; /* Program arguments */
32 /* Pointer to information for each SPI bus/cs */
33 struct sandbox_spi_info spi[CONFIG_SANDBOX_SPI_MAX_BUS]
34 [CONFIG_SANDBOX_SPI_MAX_CS];
38 * Record the exit type to be reported by the test program.
40 * @param exit_type Exit type to record
42 void state_record_exit(enum exit_type_id exit_type);
45 * Gets a pointer to the current state.
47 * @return pointer to state
49 struct sandbox_state *state_get_current(void);
52 * Initialize the test system state