Simon Glass | 20bf89a | 2012-02-15 15:51:15 -0800 | [diff] [blame] | 1 | /* |
| 2 | * Copyright (c) 2011-2012 The Chromium OS Authors. |
Wolfgang Denk | d79de1d | 2013-07-08 09:37:19 +0200 | [diff] [blame] | 3 | * SPDX-License-Identifier: GPL-2.0+ |
Simon Glass | 20bf89a | 2012-02-15 15:51:15 -0800 | [diff] [blame] | 4 | */ |
| 5 | |
| 6 | #ifndef __SANDBOX_STATE_H |
| 7 | #define __SANDBOX_STATE_H |
| 8 | |
Simon Glass | 8a3e035 | 2012-02-15 15:51:16 -0800 | [diff] [blame] | 9 | #include <config.h> |
| 10 | |
Simon Glass | 20bf89a | 2012-02-15 15:51:15 -0800 | [diff] [blame] | 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 */ |
Simon Glass | 1539343 | 2013-04-20 08:42:41 +0000 | [diff] [blame] | 21 | const char *fdt_fname; /* Filename of FDT binary */ |
Simon Glass | 20bf89a | 2012-02-15 15:51:15 -0800 | [diff] [blame] | 22 | enum exit_type_id exit_type; /* How we exited U-Boot */ |
Simon Glass | 8a3e035 | 2012-02-15 15:51:16 -0800 | [diff] [blame] | 23 | const char *parse_err; /* Error to report from parsing */ |
| 24 | int argc; /* Program arguments */ |
| 25 | char **argv; |
Simon Glass | 20bf89a | 2012-02-15 15:51:15 -0800 | [diff] [blame] | 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 |