blob: 093c81d91816170c50d751fd354495b08aeb1c38 [file] [log] [blame]
Simon Glass20bf89a2012-02-15 15:51:15 -08001/*
2 * Copyright (c) 2011-2012 The Chromium OS Authors.
Wolfgang Denkd79de1d2013-07-08 09:37:19 +02003 * SPDX-License-Identifier: GPL-2.0+
Simon Glass20bf89a2012-02-15 15:51:15 -08004 */
5
6#ifndef __SANDBOX_STATE_H
7#define __SANDBOX_STATE_H
8
Simon Glass8a3e0352012-02-15 15:51:16 -08009#include <config.h>
10
Simon Glass20bf89a2012-02-15 15:51:15 -080011/* How we exited U-Boot */
12enum exit_type_id {
13 STATE_EXIT_NORMAL,
14 STATE_EXIT_COLD_REBOOT,
15 STATE_EXIT_POWER_OFF,
16};
17
18/* The complete state of the test system */
19struct sandbox_state {
20 const char *cmd; /* Command to execute */
Simon Glass15393432013-04-20 08:42:41 +000021 const char *fdt_fname; /* Filename of FDT binary */
Simon Glass20bf89a2012-02-15 15:51:15 -080022 enum exit_type_id exit_type; /* How we exited U-Boot */
Simon Glass8a3e0352012-02-15 15:51:16 -080023 const char *parse_err; /* Error to report from parsing */
24 int argc; /* Program arguments */
25 char **argv;
Simon Glass20bf89a2012-02-15 15:51:15 -080026};
27
28/**
29 * Record the exit type to be reported by the test program.
30 *
31 * @param exit_type Exit type to record
32 */
33void state_record_exit(enum exit_type_id exit_type);
34
35/**
36 * Gets a pointer to the current state.
37 *
38 * @return pointer to state
39 */
40struct sandbox_state *state_get_current(void);
41
42/**
43 * Initialize the test system state
44 */
45int state_init(void);
46
47#endif