kern/ieee1275/init/ppc64: Add support for alignment requirements

Add support for memory alignment requirements and adjust a candidate
address to it before checking whether the block is large enough. This
must be done in this order since the alignment adjustment can make
a block smaller than what was requested.

None of the current callers has memory alignment requirements but the
ieee1275 loader for kernel and initrd will use it to convey them.

Signed-off-by: Stefan Berger <stefanb@linux.ibm.com>
Reviewed-by: Daniel Kiper <daniel.kiper@oracle.com>
Cc: Hari Bathini <hbathini@linux.ibm.com>
Cc: Pavithra Prakash <pavrampu@in.ibm.com>
Cc: Michael Ellerman <mpe@ellerman.id.au>
Cc: Carolyn Scherrer <cpscherr@us.ibm.com>
Cc: Mahesh Salgaonkar <mahesh@linux.ibm.com>
Cc: Sourabh Jain <sourabhjain@linux.ibm.com>
This commit is contained in:
Stefan Berger authored and Daniel Kiper committed 2023-12-05 14:29:55 +01:00
1 parent fe5d5e8571
commit d49e86db2c
2 files changed
+15

No files matched your search

+1
View File
@@ -30,6 +30,7 @@ struct regions_claim_request {
grub_uint32_t total; /* number of requested bytes */
bool init_region; /* whether to add memory to the heap using grub_mm_init_region() */
grub_uint64_t addr; /* result address */
grub_size_t align; /* alignment restrictions */
};
#endif /* GRUB_IEEE1275_ALLOC_HEADER */