diff options
| author | Simon Glass <[email protected]> | 2024-10-21 10:19:27 +0200 |
|---|---|---|
| committer | Tom Rini <[email protected]> | 2024-10-25 14:22:24 -0600 |
| commit | 040ab117c79795ff2a13f70c3c3847fa66db7d04 (patch) | |
| tree | 88a4f9c72626627284929d61539f7095ed95c85d /include | |
| parent | 41fecdc94e3b3714f33a28c139f61cfa48bf16f9 (diff) | |
global_data: Add some more accessors
Add accessors for bloblist, bootstage, trace and video to avoid needing
more #ifdefs in the C code.
Signed-off-by: Simon Glass <[email protected]>
Diffstat (limited to 'include')
| -rw-r--r-- | include/asm-generic/global_data.h | 30 |
1 files changed, 30 insertions, 0 deletions
diff --git a/include/asm-generic/global_data.h b/include/asm-generic/global_data.h index 644a0d77873..9dc0f4308cc 100644 --- a/include/asm-generic/global_data.h +++ b/include/asm-generic/global_data.h @@ -544,6 +544,36 @@ static_assert(sizeof(struct global_data) == GD_SIZE); #define gd_set_upl(val) #endif +#if CONFIG_IS_ENABLED(BLOBLIST) +#define gd_bloblist() gd->bloblist +#else +#define gd_bloblist() NULL +#endif + +#if CONFIG_IS_ENABLED(BOOTSTAGE) +#define gd_bootstage() gd->bootstage +#else +#define gd_bootstage() NULL +#endif + +#if CONFIG_IS_ENABLED(TRACE) +#define gd_trace_buff() gd->trace_buff +#define gd_trace_size() CONFIG_TRACE_BUFFER_SIZE +#else +#define gd_trace_buff() NULL +#define gd_trace_size() 0 +#endif + +#if CONFIG_IS_ENABLED(VIDEO) +#define gd_video_top() gd->video_top +#define gd_video_bottom() gd->video_bottom +#define gd_video_size() (gd->video_top - gd->video_bottom) +#else +#define gd_video_top() 0 +#define gd_video_bottom() 0 +#define gd_video_size() 0 +#endif + /** * enum gd_flags - global data flags * |
