Files
u-boot/arch/sandbox/include/asm/u-boot-sandbox.h
Simon Glass d798b2e9ef sandbox: Move ulib_init_with_data() declaration to init.h
To avoid needing an #ifdef in the C code, move this sandbox-specific
declaration to the common init.h header.

Update ulib.c to include init.h to avoid warnings. Fix the ordering
while we are here.

Signed-off-by: Simon Glass <simon.glass@canonical.com>
2025-11-12 06:12:02 -07:00

79 lines
2.2 KiB
C

/* SPDX-License-Identifier: GPL-2.0+ */
/*
* Copyright (c) 2011 The Chromium OS Authors.
*
* (C) Copyright 2002
* Sysgo Real-Time Solutions, GmbH <www.elinos.com>
* Marius Groeger <mgroeger@sysgo.de>
*
* (C) Copyright 2002
* Sysgo Real-Time Solutions, GmbH <www.elinos.com>
* Alex Zuepke <azu@sysgo.de>
*/
#ifndef _U_BOOT_SANDBOX_H_
#define _U_BOOT_SANDBOX_H_
#include <linux/compiler_attributes.h>
struct global_data;
/* board/.../... */
int board_init(void);
/* start.c */
int sandbox_early_getopt_check(void);
int sandbox_main_loop_init(void);
/* drivers/video/sandbox_sdl.c */
int sandbox_lcd_sdl_early_init(void);
struct udevice;
/**
* sandbox_reset() - reset sandbox
*
* This functions implements the cold reboot of the sandbox. It relaunches the
* U-Boot binary with the same command line parameters as the original call.
* The PID of the process stays the same. All file descriptors that have not
* been opened with O_CLOEXEC stay open including stdin, stdout, stderr.
*/
void sandbox_reset(void);
/* Exit sandbox (quit U-Boot) */
void __noreturn sandbox_exit(void);
/**
* sandbox_init() - init sandbox
*
* This function initialises sandbox state, parses arguments, and sets up the
* global data structure, but does not call board_init_f().
*
* The caller must zero @data before calling this function. This function sets
* gd to point to @data so it must remain valid for the life of sandbox.
*
* @argc: the number of arguments passed to the program
* @argv: array of argc pointers, plus a NULL terminator
* @data: pointer to global data structure to init
* Return: 0 if OK, -ve on error
*/
int sandbox_init(int argc, char *argv[], struct global_data *data);
/**
* sandbox_main() - main entrypoint for sandbox
*
* @argc: the number of arguments passed to the program
* @argv: array of argc+1 pointers, of which the last one is null
*
* This calls sandbox_init(), then board_init_f/r(). It does not return unless
* something goes wrong.
*
* @argc: the number of arguments passed to the program
* @argv: array of argc pointers, plus a NULL terminator
*
* Return: 1 on error
*/
int sandbox_main(int argc, char *argv[]);
#endif /* _U_BOOT_SANDBOX_H_ */