blob: 56d5041411c77b993bf0a5622106dcf863a32385 [file] [log] [blame]
Simon Glass6fb62072012-02-15 15:51:15 -08001/*
2 * Copyright (c) 2011-2012 The Chromium OS Authors.
Wolfgang Denk1a459662013-07-08 09:37:19 +02003 * SPDX-License-Identifier: GPL-2.0+
Simon Glass6fb62072012-02-15 15:51:15 -08004 */
5
6#include <common.h>
7#include <asm/state.h>
8
9/* Main state record for the sandbox */
10static struct sandbox_state main_state;
11static struct sandbox_state *state; /* Pointer to current state record */
12
13void state_record_exit(enum exit_type_id exit_type)
14{
15 state->exit_type = exit_type;
16}
17
18struct sandbox_state *state_get_current(void)
19{
20 assert(state);
21 return state;
22}
23
24int state_init(void)
25{
26 state = &main_state;
27
28 /*
29 * Example of how to use GPIOs:
30 *
31 * sandbox_gpio_set_direction(170, 0);
32 * sandbox_gpio_set_value(170, 0);
33 */
34 return 0;
35}