summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorPatrick Rudolph <siro@das-labor.org>2019-09-28 17:53:24 +0200
committerPatrick Rudolph <siro@das-labor.org>2019-10-20 11:30:47 +0000
commit0e6e45770293781a19bd92d440bc6da6da642f7f (patch)
tree610152ce6c0ed62c44fbf62e951b208c6bfcf16b /src
parent96ae7a3a2d38b96c1dfee57fda2c2eaab7e9e762 (diff)
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>
Diffstat (limited to 'src')
-rw-r--r--src/security/memory/memory_clear.c3
1 files changed, 2 insertions, 1 deletions
diff --git a/src/security/memory/memory_clear.c b/src/security/memory/memory_clear.c
index 638c41a929..45bee91036 100644
--- a/src/security/memory/memory_clear.c
+++ b/src/security/memory/memory_clear.c
@@ -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));