Lines Matching full:state
14 #include <asm/state.h>
20 struct sandbox_state *state = state_get_current(); in sandbox_early_getopt_check() local
27 if (!state->parse_err) in sandbox_early_getopt_check()
30 if (strcmp(state->parse_err, "help")) { in sandbox_early_getopt_check()
33 state->parse_err); in sandbox_early_getopt_check()
74 static int sandbox_cmdline_cb_help(struct sandbox_state *state, const char *arg) in sandbox_cmdline_cb_help() argument
84 struct sandbox_state *state = state_get_current(); in sandbox_main_loop_init() local
87 if (state->cmd || state->run_distro_boot) { in sandbox_main_loop_init()
93 if (state->cmd) in sandbox_main_loop_init()
94 retval = run_command_list(state->cmd, -1, 0); in sandbox_main_loop_init()
96 if (state->run_distro_boot) in sandbox_main_loop_init()
100 if (!state->interactive) in sandbox_main_loop_init()
108 static int sandbox_cmdline_cb_boot(struct sandbox_state *state, in sandbox_cmdline_cb_boot() argument
111 state->run_distro_boot = true; in sandbox_cmdline_cb_boot()
116 static int sandbox_cmdline_cb_command(struct sandbox_state *state, in sandbox_cmdline_cb_command() argument
119 state->cmd = arg; in sandbox_cmdline_cb_command()
124 static int sandbox_cmdline_cb_fdt(struct sandbox_state *state, const char *arg) in sandbox_cmdline_cb_fdt() argument
126 state->fdt_fname = arg; in sandbox_cmdline_cb_fdt()
131 static int sandbox_cmdline_cb_default_fdt(struct sandbox_state *state, in sandbox_cmdline_cb_default_fdt() argument
138 len = strlen(state->argv[0]) + strlen(fmt) + 1; in sandbox_cmdline_cb_default_fdt()
142 snprintf(fname, len, fmt, state->argv[0]); in sandbox_cmdline_cb_default_fdt()
143 state->fdt_fname = fname; in sandbox_cmdline_cb_default_fdt()
150 static int sandbox_cmdline_cb_interactive(struct sandbox_state *state, in sandbox_cmdline_cb_interactive() argument
153 state->interactive = true; in sandbox_cmdline_cb_interactive()
159 static int sandbox_cmdline_cb_jump(struct sandbox_state *state, in sandbox_cmdline_cb_jump() argument
163 state->jumped_fname = arg; in sandbox_cmdline_cb_jump()
169 static int sandbox_cmdline_cb_memory(struct sandbox_state *state, in sandbox_cmdline_cb_memory() argument
175 state->write_ram_buf = true; in sandbox_cmdline_cb_memory()
176 state->ram_buf_fname = arg; in sandbox_cmdline_cb_memory()
183 state->ram_buf_read = true; in sandbox_cmdline_cb_memory()
190 static int sandbox_cmdline_cb_rm_memory(struct sandbox_state *state, in sandbox_cmdline_cb_rm_memory() argument
193 state->ram_buf_rm = true; in sandbox_cmdline_cb_rm_memory()
199 static int sandbox_cmdline_cb_state(struct sandbox_state *state, in sandbox_cmdline_cb_state() argument
202 state->state_fname = arg; in sandbox_cmdline_cb_state()
205 SANDBOX_CMDLINE_OPT_SHORT(state, 's', 1, "Specify the sandbox state FDT");
207 static int sandbox_cmdline_cb_read(struct sandbox_state *state, in sandbox_cmdline_cb_read() argument
210 state->read_state = true; in sandbox_cmdline_cb_read()
213 SANDBOX_CMDLINE_OPT_SHORT(read, 'r', 0, "Read the state FDT on startup");
215 static int sandbox_cmdline_cb_write(struct sandbox_state *state, in sandbox_cmdline_cb_write() argument
218 state->write_state = true; in sandbox_cmdline_cb_write()
221 SANDBOX_CMDLINE_OPT_SHORT(write, 'w', 0, "Write state FDT on exit");
223 static int sandbox_cmdline_cb_ignore_missing(struct sandbox_state *state, in sandbox_cmdline_cb_ignore_missing() argument
226 state->ignore_missing_state_on_read = true; in sandbox_cmdline_cb_ignore_missing()
230 "Ignore missing state on read");
232 static int sandbox_cmdline_cb_show_lcd(struct sandbox_state *state, in sandbox_cmdline_cb_show_lcd() argument
235 state->show_lcd = true; in sandbox_cmdline_cb_show_lcd()
247 static int sandbox_cmdline_cb_terminal(struct sandbox_state *state, in sandbox_cmdline_cb_terminal() argument
254 state->term_raw = i; in sandbox_cmdline_cb_terminal()
269 static int sandbox_cmdline_cb_verbose(struct sandbox_state *state, in sandbox_cmdline_cb_verbose() argument
272 state->show_test_output = true; in sandbox_cmdline_cb_verbose()
277 static int sandbox_cmdline_cb_log_level(struct sandbox_state *state, in sandbox_cmdline_cb_log_level() argument
280 state->default_log_level = simple_strtol(arg, NULL, 10); in sandbox_cmdline_cb_log_level()
287 static int sandbox_cmdline_cb_show_of_platdata(struct sandbox_state *state, in sandbox_cmdline_cb_show_of_platdata() argument
290 state->show_of_platdata = true; in sandbox_cmdline_cb_show_of_platdata()
303 static void setup_ram_buf(struct sandbox_state *state) in setup_ram_buf() argument
306 if (!state->ram_buf_read) { in setup_ram_buf()
307 memset(state->ram_buf, '\0', state->ram_size); in setup_ram_buf()
308 printf("clear %p %x\n", state->ram_buf, state->ram_size); in setup_ram_buf()
311 gd->arch.ram_buf = state->ram_buf; in setup_ram_buf()
312 gd->ram_size = state->ram_size; in setup_ram_buf()
315 void state_show(struct sandbox_state *state) in state_show() argument
320 for (p = state->argv; *p; p++) in state_show()
327 struct sandbox_state *state; in main() local
335 state = state_get_current(); in main()
336 if (os_parse_args(state, argc, argv)) in main()
339 ret = sandbox_read_state(state, state->state_fname); in main()
349 gd->default_log_level = state->default_log_level; in main()
351 setup_ram_buf(state); in main()