arm-trusted-firmware/include/lib/bl_aux_params/bl_aux_params.h
Julius Werner 57bf605772 Factor out cross-BL API into export headers suitable for 3rd party code
This patch adds a new include/export/ directory meant for inclusion in
third-party code. This is useful for cases where third-party code needs
to interact with TF-A interfaces and data structures (such as a custom
BL2-implementation like coreboot handing off to BL31). Directly
including headers from the TF-A repository avoids having to duplicate
all these definitions (and risk them going stale), but with the current
header structure this is not possible because handoff API definitions
are too deeply intertwined with other TF code/headers and chain-include
other headers that will not be available in the other environment.

The new approach aims to solve this by separating only the parts that
are really needed into these special headers that are self-contained and
will not chain-include other (non-export) headers. TF-A code should
never include them directly but should instead always include the
respective wrapper header, which will include the required prerequisites
(like <stdint.h>) before including the export header. Third-party code
can include the export headers via its own wrappers that make sure the
necessary definitions are available in whatever way that environment can
provide them.

Change-Id: Ifd769320ba51371439a8e5dd5b79c2516c3b43ab
Signed-off-by: Julius Werner <jwerner@chromium.org>
2019-07-23 20:25:34 -07:00

30 lines
957 B
C

/*
* Copyright (c) 2019, ARM Limited and Contributors. All rights reserved.
*
* SPDX-License-Identifier: BSD-3-Clause
*/
#ifndef LIB_BL_AUX_PARAMS_H
#define LIB_BL_AUX_PARAMS_H
#include <stdbool.h>
#include <stdint.h>
#include <export/lib/bl_aux_params/bl_aux_params_exp.h>
/*
* Handler function that handles an individual aux parameter. Return true if
* the parameter was handled, and flase if bl_aux_params_parse() should make its
* own attempt at handling it (for generic parameters).
*/
typedef bool (*bl_aux_param_handler_t)(struct bl_aux_param_header *param);
/*
* Interprets head as the start of an aux parameter list, and passes the
* parameters individually to handler(). Handles generic parameters directly if
* handler() hasn't already done so. If only generic parameters are expected,
* handler() can be NULL.
*/
void bl_aux_params_parse(u_register_t head,
bl_aux_param_handler_t handler);
#endif /* LIB_BL_AUX_PARAMS_H */