Simon Glass | 6fb6207 | 2012-02-15 15:51:15 -0800 | [diff] [blame] | 1 | /* |
| 2 | * Copyright (c) 2011-2012 The Chromium OS Authors. |
Wolfgang Denk | 1a45966 | 2013-07-08 09:37:19 +0200 | [diff] [blame^] | 3 | * SPDX-License-Identifier: GPL-2.0+ |
Simon Glass | 6fb6207 | 2012-02-15 15:51:15 -0800 | [diff] [blame] | 4 | */ |
| 5 | |
| 6 | #include <common.h> |
| 7 | #include <asm/state.h> |
| 8 | |
| 9 | /* Main state record for the sandbox */ |
| 10 | static struct sandbox_state main_state; |
| 11 | static struct sandbox_state *state; /* Pointer to current state record */ |
| 12 | |
| 13 | void state_record_exit(enum exit_type_id exit_type) |
| 14 | { |
| 15 | state->exit_type = exit_type; |
| 16 | } |
| 17 | |
| 18 | struct sandbox_state *state_get_current(void) |
| 19 | { |
| 20 | assert(state); |
| 21 | return state; |
| 22 | } |
| 23 | |
| 24 | int 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 | } |