summaryrefslogtreecommitdiff
path: root/cactus
diff options
context:
space:
mode:
authorAntonio Nino Diaz <antonio.ninodiaz@arm.com>2017-12-01 14:20:09 +0000
committerSandrine Bailleux <sandrine.bailleux@arm.com>2017-12-05 10:19:42 +0000
commitd3a694ff12d033d32d2289414422a32d2c5640fb (patch)
treea82fcc3fe8ae3054a54fd39bad10533bb20ace17 /cactus
parentcf79a6bba607894af500b454a04e5d4a3034665e (diff)
SPM: Rename SP_MEM_ATTR*** defines
The defines have been renamed to match the names used in the documentation. Change-Id: I1b2dc9087953aa283790da2c9e895869a2c36a81 Signed-off-by: Antonio Nino Diaz <antonio.ninodiaz@arm.com>
Diffstat (limited to 'cactus')
-rw-r--r--cactus/aarch64/cactus_entrypoint.S10
-rw-r--r--cactus/cactus_tests.h4
-rw-r--r--cactus/cactus_tests_memory_attributes.c30
3 files changed, 22 insertions, 22 deletions
diff --git a/cactus/aarch64/cactus_entrypoint.S b/cactus/aarch64/cactus_entrypoint.S
index a9f1920..aeab6de 100644
--- a/cactus/aarch64/cactus_entrypoint.S
+++ b/cactus/aarch64/cactus_entrypoint.S
@@ -40,7 +40,7 @@ func cactus_entrypoint
.macro set_sp_mem_attributes
cmp x2, #0 /* If size is 0, skip the call. */
beq 1f
- mov_imm x0, SP_MEM_ATTRIBUTES_SET_AARCH64
+ mov_imm x0, SP_MEMORY_ATTRIBUTES_SET_AARCH64
svc #0
cmp x0, #0
bne .return_error
@@ -51,21 +51,21 @@ func cactus_entrypoint
adr x2, __TEXT_END__
sub x2, x2, x1 /* __TEXT_SIZE__ */
lsr x2, x2, PAGE_SIZE_SHIFT /* __TEXT_SIZE__ in pages */
- mov x3, SP_MEM_ATTR_ACCESS_RO | SP_MEM_ATTR_EXEC
+ mov x3, SP_MEMORY_ATTRIBUTES_ACCESS_RO | SP_MEMORY_ATTRIBUTES_EXEC
set_sp_mem_attributes
adr x1, __RODATA_START__
adr x2, __RODATA_END__
sub x2, x2, x1 /* __RODATA_SIZE__ */
lsr x2, x2, PAGE_SIZE_SHIFT /* __RODATA_SIZE__ in pages */
- mov x3, SP_MEM_ATTR_ACCESS_RO | SP_MEM_ATTR_NON_EXEC
+ mov x3, SP_MEMORY_ATTRIBUTES_ACCESS_RO | SP_MEMORY_ATTRIBUTES_NON_EXEC
set_sp_mem_attributes
adr x1, __RWDATA_START__
adr x2, __RWDATA_END__
sub x2, x2, x1 /* __RWDATA_SIZE__ */
lsr x2, x2, PAGE_SIZE_SHIFT /* __RWDATA_SIZE__ in pages */
- mov x3, SP_MEM_ATTR_ACCESS_RW | SP_MEM_ATTR_NON_EXEC
+ mov x3, SP_MEMORY_ATTRIBUTES_ACCESS_RW | SP_MEMORY_ATTRIBUTES_NON_EXEC
set_sp_mem_attributes
/*
@@ -80,7 +80,7 @@ func cactus_entrypoint
sub x2, x1, x2 /* x2 = Used size, x22 = Total size */
sub x2, x22, x2 /* x2 = Unused size */
lsr x2, x2, PAGE_SIZE_SHIFT /* Unused size in pages */
- mov x3, SP_MEM_ATTR_ACCESS_NOACCESS | SP_MEM_ATTR_NON_EXEC
+ mov x3, SP_MEMORY_ATTRIBUTES_ACCESS_NOACCESS | SP_MEMORY_ATTRIBUTES_NON_EXEC
set_sp_mem_attributes
adr x0, __BSS_START__
diff --git a/cactus/cactus_tests.h b/cactus/cactus_tests.h
index 85261a9..81f7cd7 100644
--- a/cactus/cactus_tests.h
+++ b/cactus/cactus_tests.h
@@ -31,8 +31,8 @@ void misc_tests(void);
void system_setup_tests(void);
/*
- * Exercise the SP_MEM_ATTRIBUTES_SET_AARCH64 SMC interface. A variety of valid
- * and invalid requests to change memory attributes are tested.
+ * Exercise the SP_MEMORY_ATTRIBUTES_SET_AARCH64 SMC interface. A variety of
+ * valid and invalid requests to change memory attributes are tested.
*
* These tests report their results on the UART. They do not recover from a
* failure : when an error is encountered they endlessly loop.
diff --git a/cactus/cactus_tests_memory_attributes.c b/cactus/cactus_tests_memory_attributes.c
index d6dfc69..fae5e52 100644
--- a/cactus/cactus_tests_memory_attributes.c
+++ b/cactus/cactus_tests_memory_attributes.c
@@ -26,18 +26,18 @@ static uintptr_t cactus_tests_size;
/*
* Given the required instruction and data access permissions,
* create a memory access controls value that is formatted as expected
- * by the SP_MEM_ATTRIBUTES_SET_AARCH64 SMC.
+ * by the SP_MEMORY_ATTRIBUTES_SET_AARCH64 SMC.
*/
static inline uint32_t mem_access_perm(int instr_access_perm,
int data_access_perm)
{
return instr_access_perm |
- ((data_access_perm & SP_MEM_ATTR_ACCESS_MASK)
- << SP_MEM_ATTR_ACCESS_SHIFT);
+ ((data_access_perm & SP_MEMORY_ATTRIBUTES_ACCESS_MASK)
+ << SP_MEMORY_ATTRIBUTES_ACCESS_SHIFT);
}
/*
- * Send an SP_MEM_ATTRIBUTES_SET_AARCH64 SVC with the given arguments.
+ * Send an SP_MEMORY_ATTRIBUTES_SET_AARCH64 SVC with the given arguments.
* Return the return value of the SVC.
*/
static int32_t request_mem_attr_changes(uintptr_t base_address,
@@ -49,7 +49,7 @@ static int32_t request_mem_attr_changes(uintptr_t base_address,
INFO(" Number of pages: %i\n", pages_count);
INFO(" Attributes : 0x%x\n", memory_access_controls);
- uint64_t ret = cactus_svc(SP_MEM_ATTRIBUTES_SET_AARCH64,
+ uint64_t ret = cactus_svc(SP_MEMORY_ATTRIBUTES_SET_AARCH64,
base_address,
pages_count,
memory_access_controls,
@@ -59,7 +59,7 @@ static int32_t request_mem_attr_changes(uintptr_t base_address,
}
/*
- * Send an SP_MEM_ATTRIBUTES_GET_AARCH64 SVC with the given arguments.
+ * Send an SP_MEMORY_ATTRIBUTES_GET_AARCH64 SVC with the given arguments.
* Return the return value of the SVC.
*/
static int32_t request_get_mem_attr(uintptr_t base_address)
@@ -67,7 +67,7 @@ static int32_t request_get_mem_attr(uintptr_t base_address)
INFO("Requesting memory attributes\n");
INFO(" Base address : %p\n", (void *) base_address);
- uint64_t ret = cactus_svc(SP_MEM_ATTRIBUTES_GET_AARCH64,
+ uint64_t ret = cactus_svc(SP_MEMORY_ATTRIBUTES_GET_AARCH64,
base_address,
0, 0, 0, 0, 0, 0);
@@ -104,9 +104,9 @@ static void mem_attr_changes_unittest(uintptr_t addr, int pages_count)
assert(addr >= cactus_tests_start);
assert(end_addr < (cactus_tests_start + cactus_tests_size));
- old_attr = mem_access_perm(SP_MEM_ATTR_NON_EXEC, SP_MEM_ATTR_ACCESS_RO);
+ old_attr = mem_access_perm(SP_MEMORY_ATTRIBUTES_NON_EXEC, SP_MEMORY_ATTRIBUTES_ACCESS_RO);
/* Memory was read-only, let's try changing that to RW */
- new_attr = mem_access_perm(SP_MEM_ATTR_NON_EXEC, SP_MEM_ATTR_ACCESS_RW);
+ new_attr = mem_access_perm(SP_MEMORY_ATTRIBUTES_NON_EXEC, SP_MEMORY_ATTRIBUTES_ACCESS_RW);
ret = request_mem_attr_changes(addr, pages_count, new_attr);
expect(ret, SPM_SUCCESS);
@@ -159,7 +159,7 @@ void mem_attr_changes_tests(const secure_partition_boot_info_t *boot_info)
const char *test_desc1 = "Read-write, executable";
announce_test_start(test_desc1);
- attributes = mem_access_perm(SP_MEM_ATTR_EXEC, SP_MEM_ATTR_ACCESS_RW);
+ attributes = mem_access_perm(SP_MEMORY_ATTRIBUTES_EXEC, SP_MEMORY_ATTRIBUTES_ACCESS_RW);
ret = request_mem_attr_changes(CACTUS_RWDATA_START, 1, attributes);
expect(ret, SPM_INVALID_PARAMETER);
announce_test_end(test_desc1);
@@ -167,7 +167,7 @@ void mem_attr_changes_tests(const secure_partition_boot_info_t *boot_info)
const char *test_desc2 = "Size == 0";
announce_test_start(test_desc2);
- attributes = mem_access_perm(SP_MEM_ATTR_NON_EXEC, SP_MEM_ATTR_ACCESS_RW);
+ attributes = mem_access_perm(SP_MEMORY_ATTRIBUTES_NON_EXEC, SP_MEMORY_ATTRIBUTES_ACCESS_RW);
ret = request_mem_attr_changes(CACTUS_RWDATA_START, 0, attributes);
expect(ret, SPM_INVALID_PARAMETER);
announce_test_end(test_desc2);
@@ -175,7 +175,7 @@ void mem_attr_changes_tests(const secure_partition_boot_info_t *boot_info)
const char *test_desc3 = "Unaligned address";
announce_test_start(test_desc3);
- attributes = mem_access_perm(SP_MEM_ATTR_NON_EXEC, SP_MEM_ATTR_ACCESS_RW);
+ attributes = mem_access_perm(SP_MEMORY_ATTRIBUTES_NON_EXEC, SP_MEMORY_ATTRIBUTES_ACCESS_RW);
/* Choose an address not aligned to a page boundary. */
addr = cactus_tests_start + 5;
ret = request_mem_attr_changes(addr, 1, attributes);
@@ -186,7 +186,7 @@ void mem_attr_changes_tests(const secure_partition_boot_info_t *boot_info)
announce_test_start(test_desc4);
addr = boot_info->sp_mem_limit + 2 * PAGE_SIZE;
- attributes = mem_access_perm(SP_MEM_ATTR_NON_EXEC, SP_MEM_ATTR_ACCESS_RW);
+ attributes = mem_access_perm(SP_MEMORY_ATTRIBUTES_NON_EXEC, SP_MEMORY_ATTRIBUTES_ACCESS_RW);
ret = request_mem_attr_changes(addr, 3, attributes);
expect(ret, SPM_INVALID_PARAMETER);
announce_test_end(test_desc4);
@@ -195,7 +195,7 @@ void mem_attr_changes_tests(const secure_partition_boot_info_t *boot_info)
announce_test_start(test_desc5);
addr = boot_info->sp_mem_base - 2 * PAGE_SIZE;
- attributes = mem_access_perm(SP_MEM_ATTR_NON_EXEC, SP_MEM_ATTR_ACCESS_RW);
+ attributes = mem_access_perm(SP_MEMORY_ATTRIBUTES_NON_EXEC, SP_MEMORY_ATTRIBUTES_ACCESS_RW);
ret = request_mem_attr_changes(addr, 6, attributes);
expect(ret, SPM_INVALID_PARAMETER);
announce_test_end(test_desc5);
@@ -210,7 +210,7 @@ void mem_attr_changes_tests(const secure_partition_boot_info_t *boot_info)
* and we would get the error message.
*/
addr = ((uintptr_t)PLAT_ARM_UART_BASE + 0x200000ULL) & ~(0x200000ULL - 1ULL);
- attributes = mem_access_perm(SP_MEM_ATTR_NON_EXEC, SP_MEM_ATTR_ACCESS_RW);
+ attributes = mem_access_perm(SP_MEMORY_ATTRIBUTES_NON_EXEC, SP_MEMORY_ATTRIBUTES_ACCESS_RW);
ret = request_mem_attr_changes(addr, 1, attributes);
expect(ret, SPM_INVALID_PARAMETER);
announce_test_end(test_desc6);