]> git.ipfire.org Git - thirdparty/grub.git/commit
ieee1275: Drop HEAP_MAX_ADDR and HEAP_MIN_SIZE constants
authorDaniel Axtens <dja@axtens.net>
Tue, 20 Jul 2021 21:14:46 +0000 (17:14 -0400)
committerDaniel Kiper <daniel.kiper@oracle.com>
Thu, 22 Jul 2021 13:32:51 +0000 (15:32 +0200)
commit70ecee1e21fcd9fd238f480ed473d2d4fa2b9445
treeb033ad4a06d8678872319bb92bad7a824f75e75d
parentaaea244a6ddd1e35aed60a5c7a08ddc41f51805b
ieee1275: Drop HEAP_MAX_ADDR and HEAP_MIN_SIZE constants

The HEAP_MAX_ADDR is confusing. Currently it is set to 32MB, except on
ieee1275 on x86, where it is 64MB.

There is a comment which purports to explain it:

  /* If possible, we will avoid claiming heap above this address, because it
     seems to cause relocation problems with OSes that link at 4 MiB */

This doesn't make a lot of sense when the constants are well above 4MB
already. It was not always this way. Prior to commit 7b5d0fe4440c
(Increase heap limit) in 2010, HEAP_MAX_SIZE and HEAP_MAX_ADDR were
indeed 4MB. However, when the constants were increased the comment was
left unchanged.

It's been over a decade. It doesn't seem like we have problems with
claims over 4MB on powerpc or x86 ieee1275. The SPARC does things
completely differently and never used the constant.

Drop the constant and the check.

The only use of HEAP_MIN_SIZE was to potentially override the
HEAP_MAX_ADDR check. It is now unused. Remove it too.

Signed-off-by: Daniel Axtens <dja@axtens.net>
Signed-off-by: Stefan Berger <stefanb@linux.ibm.com>
Tested-by: Stefan Berger <stefanb@linux.ibm.com>
Reviewed-by: Daniel Kiper <daniel.kiper@oracle.com>
grub-core/kern/ieee1275/init.c