From 181cbd4017305142eb26df0aa065b8bb95921f83 Mon Sep 17 00:00:00 2001 From: Ovidiu Panait Date: Tue, 13 Sep 2022 21:31:26 +0300 Subject: common/board_f: remove XTRN_DECLARE_GLOBAL_DATA_PTR dead code The XTRN_DECLARE_GLOBAL_DATA_PTR declarations in ppc code are permanently commented out, so there are no users for this macro: #if 1 #define DECLARE_GLOBAL_DATA_PTR register volatile gd_t *gd asm ("r2") #else /* We could use plain global data, but the resulting code is bigger */ #define XTRN_DECLARE_GLOBAL_DATA_PTR extern #define DECLARE_GLOBAL_DATA_PTR XTRN_DECLARE_GLOBAL_DATA_PTR \ gd_t *gd #endif Remove all references to this macro, but add a documentation note regarding the possibility of using plain global data for the GD pointer. Signed-off-by: Ovidiu Panait Reviewed-by: Simon Glass Reviewed-by: Tom Rini --- doc/develop/global_data.rst | 5 +++++ 1 file changed, 5 insertions(+) (limited to 'doc/develop') diff --git a/doc/develop/global_data.rst b/doc/develop/global_data.rst index 2ac893de491..d143f27eedd 100644 --- a/doc/develop/global_data.rst +++ b/doc/develop/global_data.rst @@ -36,6 +36,11 @@ On most architectures the global data pointer is stored in a register. The sandbox, x86_64, and Xtensa are notable exceptions. +Current implementation uses a register for the GD pointer because this results +in smaller code. However, using plain global data for the GD pointer would be +possible too (and simpler, as it does not require the reservation of a specific +register for it), but the resulting code is bigger. + Clang for ARM does not support assigning a global register. When using Clang gd is defined as an inline function using assembly code. This adds a few bytes to the code size. -- cgit v1.2.3