security/memory: Add x86_64 support

Fix compiler warning by adding an additional check for the fastpath
memset.

Change-Id: I9a80438995bafe7e436f3fe2180b8c9574eeff23
Signed-off-by: Patrick Rudolph <siro@das-labor.org>
Reviewed-on: https://review.coreboot.org/c/coreboot/+/35682
Reviewed-by: Arthur Heymans <arthur@aheymans.xyz>
Tested-by: build bot (Jenkins) <no-reply@coreboot.org>
This commit is contained in:
Patrick Rudolph 2019-09-28 17:53:24 +02:00
parent 96ae7a3a2d
commit 0e6e457702
1 changed files with 2 additions and 1 deletions

View File

@ -127,7 +127,8 @@ static void clear_memory(void *unused)
__func__, range_entry_base(r), range_entry_end(r));
/* Does regular memset work? */
if (!(range_entry_end(r) >> sizeof(void *) * 8)) {
if (sizeof(resource_t) == sizeof(void *) ||
!(range_entry_end(r) >> (sizeof(void *) * 8))) {
/* fastpath */
memset((void *)(uintptr_t)range_entry_base(r), 0,
range_entry_size(r));