blob: c50175dd65e300a37872092f53a51799cc688ee8 [file] [log] [blame]
/*
* Copyright (c) 2020 The Fuchsia Authors
*
* SPDX-License-Identifier: BSD-3-Clause
*/
#ifndef _ZIRCON_UBOOT_BOOT_ARGS_H_
#define _ZIRCON_UBOOT_BOOT_ARGS_H_
#include <linux/types.h>
#include <zircon_uboot/zircon.h>
/**
* zircon_store_cmdline() - Copies and stores command line boot items
* to be added later to the ZBI. This can be called multiple times to append
* more items.
*
* @boot_arg: NULL terminated, space separated command line arguments.
* Within each argument, spaces are not permitted.
*
* Return 0 on success, negative value on error.
*/
int zircon_store_cmdline(const char *boot_arg);
/**
* zircon_clear_stored_cmdline() - Clears stored boot args
*
* Return 0 on success, negative value on error.
*/
int zircon_clear_stored_cmdline(void);
/**
* zircon_append_cmdline() - Adds stored command line ZBI items to the
* given |zbi| container.
*
* @zbi: The ZBI container to add the boot args to.
* @capacity: The ZBI container capacity.
*
* Return: 0 on success, negative value on error.
*/
int zircon_append_cmdline(zbi_header_t *zbi, size_t capacity);
#endif // _ZIRCON_UBOOT_BOOT_ARGS_H_