diff options
Diffstat (limited to 'cactus/cactus_tests_memory_attributes.c')
-rw-r--r-- | cactus/cactus_tests_memory_attributes.c | 30 |
1 files changed, 15 insertions, 15 deletions
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); |