Message ID | 20191022192948.11080-2-simon.k.r.goldschmidt@gmail.com |
---|---|
State | Accepted |
Commit | 93db2b83ed515fd5700b6c5abb0fba612ef2cdcb |
Delegated to: | Tom Rini |
Headers | show |
Series | make ERR_PTR/PTR_ERR architecture specific | expand |
On Tue, Oct 22, 2019 at 09:29:46PM +0200, Simon Goldschmidt wrote: > Some U-Boot pointers have redundant information, so we can use a scheme > where we can return either an error code or a pointer with the same > return value. The default implementation just casts the pointer to a > number, however, this may fail on platforms where the end of the address > range is used for valid pointers (e.g. 0xffffff00 is a valid heap pointer > in socfpga SPL). For such platforms, this value provides an upper range > of those error pointer values - up to 'MAX_ERRNO' bytes below this value > must be unused/invalid addresses. > > Signed-off-by: Simon Goldschmidt <simon.k.r.goldschmidt@gmail.com> Applied to u-boot/master, thanks!
diff --git a/Kconfig b/Kconfig index 66b059f749..cda4f58ff7 100644 --- a/Kconfig +++ b/Kconfig @@ -281,6 +281,20 @@ config SYS_LDSCRIPT Path within the source tree to the linker script to use for the main U-Boot binary. +config ERR_PTR_OFFSET + hex + default 0x0 + help + Some U-Boot pointers have redundant information, so we can use a + scheme where we can return either an error code or a pointer with the + same return value. The default implementation just casts the pointer + to a number, however, this may fail on platforms where the end of the + address range is used for valid pointers (e.g. 0xffffff00 is a valid + heap pointer in socfpga SPL). + For such platforms, this value provides an upper range of those error + pointer values - up to 'MAX_ERRNO' bytes below this value must be + unused/invalid addresses. + endmenu # General setup menu "Boot images"
Some U-Boot pointers have redundant information, so we can use a scheme where we can return either an error code or a pointer with the same return value. The default implementation just casts the pointer to a number, however, this may fail on platforms where the end of the address range is used for valid pointers (e.g. 0xffffff00 is a valid heap pointer in socfpga SPL). For such platforms, this value provides an upper range of those error pointer values - up to 'MAX_ERRNO' bytes below this value must be unused/invalid addresses. Signed-off-by: Simon Goldschmidt <simon.k.r.goldschmidt@gmail.com> --- Kconfig | 14 ++++++++++++++ 1 file changed, 14 insertions(+)