2 * Copyright (c) 2011-2012 The Chromium OS Authors.
3 * SPDX-License-Identifier: GPL-2.0+
10 /* Main state record for the sandbox */
11 static struct sandbox_state main_state;
12 static struct sandbox_state *state; /* Pointer to current state record */
14 void state_record_exit(enum exit_type_id exit_type)
16 state->exit_type = exit_type;
19 struct sandbox_state *state_get_current(void)
29 state->ram_size = CONFIG_SYS_SDRAM_SIZE;
30 state->ram_buf = os_malloc(state->ram_size);
31 assert(state->ram_buf);
34 * Example of how to use GPIOs:
36 * sandbox_gpio_set_direction(170, 0);
37 * sandbox_gpio_set_value(170, 0);
42 int state_uninit(void)
48 if (state->write_ram_buf) {
49 err = os_write_ram_buf(state->ram_buf_fname);
51 printf("Failed to write RAM buffer\n");