diff options
author | Greg Bellows <greg.bellows@linaro.org> | 2014-09-12 15:48:07 -0500 |
---|---|---|
committer | Greg Bellows <greg.bellows@linaro.org> | 2014-09-12 15:56:53 -0500 |
commit | 551f7f74f2b9743cf671375c45f8cc7aa80cedc9 (patch) | |
tree | 99580b457a25ad4e78fe72855707c76cdeda7075 | |
parent | 5db4ba09d5d6df5eb52f0f6dda5ae04a12a12a85 (diff) |
Cleanup nonsecure name space
Signed-off-by: Greg Bellows <greg.bellows@linaro.org>
-rw-r--r-- | arm/Makefile.tztest | 2 | ||||
-rw-r--r-- | arm/nonsecure_init.S | 10 | ||||
-rw-r--r-- | arm/nonsecure_svc.c (renamed from arm/tztest_nonsecure_svc.c) | 29 |
3 files changed, 21 insertions, 20 deletions
diff --git a/arm/Makefile.tztest b/arm/Makefile.tztest index c3bb363..c2dbd4d 100644 --- a/arm/Makefile.tztest +++ b/arm/Makefile.tztest @@ -14,7 +14,7 @@ TZSECOBJS = $(ARCH)/secure_init.o \ $(ARCH)/sm_asm.o \ $(ARCH)/sm.o TZNSECOBJS = $(ARCH)/nonsecure_init.o \ - $(ARCH)/tztest_nonsecure_svc.o \ + $(ARCH)/nonsecure_svc.o \ $(ARCH)/tztest.o TZOBJS = $(ARCH)/tztest_mmu.o \ $(ARCH)/tztest_common.o diff --git a/arm/nonsecure_init.S b/arm/nonsecure_init.S index 918c864..54e33ae 100644 --- a/arm/nonsecure_init.S +++ b/arm/nonsecure_init.S @@ -43,24 +43,24 @@ nonsecure_vectors: nonsecure_undef_vec: srsdb sp!, #CPSR_MODE_UND - bl nsec_undef_handler + bl nonsecure_undef_handler rfefd sp! nonsecure_pabort_vec: mrc p15, 0, r0, c5, c0, 1 /* IFSR */ mrc p15, 0, r1, c6, c0, 2 /* IFAR */ - bl nsec_pabort_handler + bl nonsecure_pabort_handler b end nonsecure_dabort_vec: mrc p15, 0, r0, c5, c0, 0 /* DFSR */ mrc p15, 0, r1, c6, c0, 0 /* DFAR */ - bl nsec_dabort_handler + bl nonsecure_dabort_handler b end nonsecure_svc_vec: srsdb sp!, #CPSR_MODE_SVC - bl nsec_svc_handler + bl nonsecure_svc_handler rfefd sp! nonsecure_init: @@ -109,7 +109,7 @@ nonsecure_mmu_init: mcr p15, 0, r10, c3, c0, 0 /* This function will return the initialized base address */ - bl tztest_nonsecure_pagetable_init + bl nonsecure_pagetable_init /* Set TTBR0 to the initialized address plus enable shareable write-back * write-allocate. diff --git a/arm/tztest_nonsecure_svc.c b/arm/nonsecure_svc.c index 1edba41..0e34498 100644 --- a/arm/tztest_nonsecure_svc.c +++ b/arm/nonsecure_svc.c @@ -1,7 +1,7 @@ #include "tztest.h" -uint32_t nsec_dispatch_secure_usr_function(uint32_t (*)(uint32_t), uint32_t); -uint32_t nsec_dispatch_secure_svc_function(uint32_t (*)(uint32_t), uint32_t); +uint32_t nonsecure_dispatch_secure_usr_function(uint32_t (*)(uint32_t), uint32_t); +uint32_t nonsecure_dispatch_secure_svc_function(uint32_t (*)(uint32_t), uint32_t); extern uint32_t _nsec_l1_page_table; uint32_t *nsec_l1_page_table = &_nsec_l1_page_table; extern uint32_t _ram_nsectext_start; @@ -24,8 +24,10 @@ uint32_t nsecstack_start = (uint32_t)&_nsecstack_start; uint32_t nsectext_size = (uint32_t)&_nsectext_size; uint32_t nsecdata_size = (uint32_t)&_nsecdata_size; uint32_t nsecstack_size = (uint32_t)&_nsecstack_size; +tztest_smc_desc_t smc_desc; -void nsec_svc_handler(volatile uint32_t op, volatile tztest_svc_desc_t *desc) +void nonsecure_svc_handler(volatile uint32_t op, + volatile tztest_svc_desc_t *desc) { int ret = 0; switch (op) { @@ -36,16 +38,16 @@ void nsec_svc_handler(volatile uint32_t op, volatile tztest_svc_desc_t *desc) case SVC_DISPATCH_SECURE_USR: DEBUG_MSG("Dispatching secure usr function\n"); desc->dispatch.ret = - nsec_dispatch_secure_usr_function(desc->dispatch.func, - desc->dispatch.arg); + nonsecure_dispatch_secure_usr_function(desc->dispatch.func, + desc->dispatch.arg); DEBUG_MSG("Returning from secure usr function, ret = 0x%x\n", desc->dispatch.ret); break; case SVC_DISPATCH_SECURE_SVC: DEBUG_MSG("Dispatching secure svc function\n"); desc->dispatch.ret = - nsec_dispatch_secure_svc_function(desc->dispatch.func, - desc->dispatch.arg); + nonsecure_dispatch_secure_svc_function(desc->dispatch.func, + desc->dispatch.arg); DEBUG_MSG("Returning from secure svc function, ret = 0x%x\n", desc->dispatch.ret); break; @@ -69,19 +71,19 @@ void nsec_svc_handler(volatile uint32_t op, volatile tztest_svc_desc_t *desc) } } -void nsec_undef_handler() { +void nonsecure_undef_handler() { DEBUG_MSG("Undefined exception taken\n"); *tztest_exception = CPSR_MODE_UND; *tztest_exception_status = 0; } -void nsec_pabort_handler(int status, DEBUG_ARG int addr) { +void nonsecure_pabort_handler(int status, DEBUG_ARG int addr) { DEBUG_MSG("status = 0x%x\taddress = 0x%x\n", status, addr); *tztest_exception = CPSR_MODE_ABT; *tztest_exception_status = status & 0x1f; } -void nsec_dabort_handler(int status, DEBUG_ARG int addr) { +void nonsecure_dabort_handler(int status, DEBUG_ARG int addr) { DEBUG_MSG("Data Abort: %s\n", FAULT_STR(status & 0x1f)); DEBUG_MSG("status = 0x%x\taddress = 0x%x\n", status & 0x1f, addr); @@ -89,8 +91,7 @@ void nsec_dabort_handler(int status, DEBUG_ARG int addr) { *tztest_exception_status = status & 0x1f; } -tztest_smc_desc_t smc_desc; -uint32_t nsec_dispatch_secure_usr_function(uint32_t (*func)(uint32_t), +uint32_t nonsecure_dispatch_secure_usr_function(uint32_t (*func)(uint32_t), uint32_t arg) { volatile int r0 = SMC_DISPATCH_SECURE_USR; @@ -104,7 +105,7 @@ uint32_t nsec_dispatch_secure_usr_function(uint32_t (*func)(uint32_t), return smc_desc.dispatch.ret; } -uint32_t nsec_dispatch_secure_svc_function(uint32_t (*func)(uint32_t), +uint32_t nonsecure_dispatch_secure_svc_function(uint32_t (*func)(uint32_t), uint32_t arg) { volatile int op = SMC_DISPATCH_SECURE_SVC; @@ -118,7 +119,7 @@ uint32_t nsec_dispatch_secure_svc_function(uint32_t (*func)(uint32_t), return desc.dispatch.ret; } -void tztest_nonsecure_pagetable_init() +void nonsecure_pagetable_init() { pagetable_map_entry_t nsec_pagetable_entries[] = { {.va = (uint32_t)ram_nsectext_start, .pa = (uint32_t)ram_nsectext_start, |