1*6fb62078SSimon Glass /* 2*6fb62078SSimon Glass * Copyright (c) 2011-2012 The Chromium OS Authors. 3*6fb62078SSimon Glass * See file CREDITS for list of people who contributed to this 4*6fb62078SSimon Glass * project. 5*6fb62078SSimon Glass * 6*6fb62078SSimon Glass * This program is free software; you can redistribute it and/or 7*6fb62078SSimon Glass * modify it under the terms of the GNU General Public License as 8*6fb62078SSimon Glass * published by the Free Software Foundation; either version 2 of 9*6fb62078SSimon Glass * the License, or (at your option) any later version. 10*6fb62078SSimon Glass * 11*6fb62078SSimon Glass * This program is distributed in the hope that it will be useful, 12*6fb62078SSimon Glass * but WITHOUT ANY WARRANTY; without even the implied warranty of 13*6fb62078SSimon Glass * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 14*6fb62078SSimon Glass * GNU General Public License for more details. 15*6fb62078SSimon Glass * 16*6fb62078SSimon Glass * You should have received a copy of the GNU General Public License 17*6fb62078SSimon Glass * along with this program; if not, write to the Free Software 18*6fb62078SSimon Glass * Foundation, Inc., 59 Temple Place, Suite 330, Boston, 19*6fb62078SSimon Glass * MA 02111-1307 USA 20*6fb62078SSimon Glass */ 21*6fb62078SSimon Glass 22*6fb62078SSimon Glass #ifndef __SANDBOX_STATE_H 23*6fb62078SSimon Glass #define __SANDBOX_STATE_H 24*6fb62078SSimon Glass 25*6fb62078SSimon Glass /* How we exited U-Boot */ 26*6fb62078SSimon Glass enum exit_type_id { 27*6fb62078SSimon Glass STATE_EXIT_NORMAL, 28*6fb62078SSimon Glass STATE_EXIT_COLD_REBOOT, 29*6fb62078SSimon Glass STATE_EXIT_POWER_OFF, 30*6fb62078SSimon Glass }; 31*6fb62078SSimon Glass 32*6fb62078SSimon Glass /* The complete state of the test system */ 33*6fb62078SSimon Glass struct sandbox_state { 34*6fb62078SSimon Glass const char *cmd; /* Command to execute */ 35*6fb62078SSimon Glass enum exit_type_id exit_type; /* How we exited U-Boot */ 36*6fb62078SSimon Glass }; 37*6fb62078SSimon Glass 38*6fb62078SSimon Glass /** 39*6fb62078SSimon Glass * Record the exit type to be reported by the test program. 40*6fb62078SSimon Glass * 41*6fb62078SSimon Glass * @param exit_type Exit type to record 42*6fb62078SSimon Glass */ 43*6fb62078SSimon Glass void state_record_exit(enum exit_type_id exit_type); 44*6fb62078SSimon Glass 45*6fb62078SSimon Glass /** 46*6fb62078SSimon Glass * Gets a pointer to the current state. 47*6fb62078SSimon Glass * 48*6fb62078SSimon Glass * @return pointer to state 49*6fb62078SSimon Glass */ 50*6fb62078SSimon Glass struct sandbox_state *state_get_current(void); 51*6fb62078SSimon Glass 52*6fb62078SSimon Glass /** 53*6fb62078SSimon Glass * Initialize the test system state 54*6fb62078SSimon Glass */ 55*6fb62078SSimon Glass int state_init(void); 56*6fb62078SSimon Glass 57*6fb62078SSimon Glass #endif 58