1 /* 2 * Copyright (c) 2011-2012 The Chromium OS Authors. 3 * SPDX-License-Identifier: GPL-2.0+ 4 */ 5 6 #ifndef __SANDBOX_STATE_H 7 #define __SANDBOX_STATE_H 8 9 #include <config.h> 10 11 /* How we exited U-Boot */ 12 enum 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 */ 19 struct sandbox_state { 20 const char *cmd; /* Command to execute */ 21 const char *fdt_fname; /* Filename of FDT binary */ 22 enum exit_type_id exit_type; /* How we exited U-Boot */ 23 const char *parse_err; /* Error to report from parsing */ 24 int argc; /* Program arguments */ 25 char **argv; 26 }; 27 28 /** 29 * Record the exit type to be reported by the test program. 30 * 31 * @param exit_type Exit type to record 32 */ 33 void 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 */ 40 struct sandbox_state *state_get_current(void); 41 42 /** 43 * Initialize the test system state 44 */ 45 int state_init(void); 46 47 #endif 48