aboutsummaryrefslogtreecommitdiffstats
path: root/include/lib/utils.h
diff options
context:
space:
mode:
authordavidcunado-arm <david.cunado@arm.com>2017-10-04 16:23:59 +0100
committerGitHub <noreply@github.com>2017-10-04 16:23:59 +0100
commitc64d1345a8227ec9c9d8f8fa6a6c3e5e487b82f0 (patch)
tree2604ec7cfc96c5ea1ea9456bd958b45a15d44e75 /include/lib/utils.h
parentcb2cfae365eedb94619f8f88f98aee8f866d9a14 (diff)
parentb09ba056c4203a3fcca78675aa3de257023b7d70 (diff)
downloadplatform_external_arm-trusted-firmware-c64d1345a8227ec9c9d8f8fa6a6c3e5e487b82f0.tar.gz
platform_external_arm-trusted-firmware-c64d1345a8227ec9c9d8f8fa6a6c3e5e487b82f0.tar.bz2
platform_external_arm-trusted-firmware-c64d1345a8227ec9c9d8f8fa6a6c3e5e487b82f0.zip
Merge pull request #1109 from robertovargas-arm/mem_protect
Mem protect
Diffstat (limited to 'include/lib/utils.h')
-rw-r--r--include/lib/utils.h19
1 files changed, 19 insertions, 0 deletions
diff --git a/include/lib/utils.h b/include/lib/utils.h
index b75813f77..cfc830220 100644
--- a/include/lib/utils.h
+++ b/include/lib/utils.h
@@ -19,6 +19,25 @@
#include <types.h>
+typedef struct mem_region_t {
+ uintptr_t base;
+ size_t nbytes;
+} mem_region_t;
+
+/*
+ * zero_normalmem all the regions defined in tbl.
+ */
+void clear_mem_regions(mem_region_t *tbl, size_t nregions);
+
+
+/*
+ * checks that a region (addr + nbytes-1) of memory is totally covered by
+ * one of the regions defined in tbl. Caller must ensure that (addr+nbytes-1)
+ * doesn't overflow.
+ */
+int mem_region_in_array_chk(mem_region_t *tbl, size_t nregions,
+ uintptr_t addr, size_t nbytes);
+
/*
* Fill a region of normal memory of size "length" in bytes with zero bytes.
*