From d4b0590abbba5924630e794723d96e4093bf4542 Mon Sep 17 00:00:00 2001 From: YAMAMOTO Takashi Date: Tue, 10 Mar 2020 11:44:26 +0900 Subject: [PATCH] Fix some nxstyle complaints in arm addrenv --- arch/arm/src/armv7-a/arm_addrenv.c | 18 +++++++++++------- arch/arm/src/armv7-a/arm_addrenv_kstack.c | 4 +++- arch/arm/src/armv7-a/arm_addrenv_ustack.c | 16 +++++++++------- arch/arm/src/armv7-a/arm_addrenv_utils.c | 13 +++++++++---- 4 files changed, 32 insertions(+), 19 deletions(-) diff --git a/arch/arm/src/armv7-a/arm_addrenv.c b/arch/arm/src/armv7-a/arm_addrenv.c index ea6fc02dae..3ad2315b37 100644 --- a/arch/arm/src/armv7-a/arm_addrenv.c +++ b/arch/arm/src/armv7-a/arm_addrenv.c @@ -32,6 +32,7 @@ * POSSIBILITY OF SUCH DAMAGE. * ****************************************************************************/ + /**************************************************************************** * Address Environment Interfaces * @@ -96,7 +97,8 @@ * If CONFIG_ARCH_KERNEL_STACK=y is selected then the platform specific * code must export these additional interfaces: * - * up_addrenv_kstackalloc - Create a stack in the kernel address environment + * up_addrenv_kstackalloc - Create a stack in the kernel address + * environment * up_addrenv_kstackfree - Destroy the kernel stack. * ****************************************************************************/ @@ -128,6 +130,7 @@ /**************************************************************************** * Pre-processor Definitions ****************************************************************************/ + /* Configuration */ #if (CONFIG_ARCH_TEXT_VBASE & SECTION_MASK) != 0 @@ -267,9 +270,9 @@ int up_addrenv_create(size_t textsize, size_t datasize, size_t heapsize, memset(addrenv, 0, sizeof(group_addrenv_t)); - /* Back the allocation up with physical pages and set up the level 2 mapping - * (which of course does nothing until the L2 page table is hooked into - * the L1 page table). + /* Back the allocation up with physical pages and set up the level 2 + * mapping (which of course does nothing until the L2 page table is hooked + * into the L1 page table). */ /* Allocate .text space pages */ @@ -303,7 +306,8 @@ int up_addrenv_create(size_t textsize, size_t datasize, size_t heapsize, * region. */ - ret = up_addrenv_initdata((uintptr_t)addrenv->data[0] & PMD_PTE_PADDR_MASK); + ret = up_addrenv_initdata((uintptr_t)addrenv->data[0] & + PMD_PTE_PADDR_MASK); if (ret < 0) { berr("ERROR: Failed to initialize .bss/.data region: %d\n", ret); @@ -484,8 +488,8 @@ ssize_t up_addrenv_heapsize(FAR const group_addrenv_t *addrenv) * After an address environment has been established for a task group (via * up_addrenv_create(). This function may be called to instantiate * that address environment in the virtual address space. this might be - * necessary, for example, to load the code for the task group from a file or - * to access address environment private data. + * necessary, for example, to load the code for the task group from a file + * or to access address environment private data. * * Input Parameters: * addrenv - The representation of the task address environment previously diff --git a/arch/arm/src/armv7-a/arm_addrenv_kstack.c b/arch/arm/src/armv7-a/arm_addrenv_kstack.c index 5bb2b688b5..f6e807872c 100644 --- a/arch/arm/src/armv7-a/arm_addrenv_kstack.c +++ b/arch/arm/src/armv7-a/arm_addrenv_kstack.c @@ -32,6 +32,7 @@ * POSSIBILITY OF SUCH DAMAGE. * ****************************************************************************/ + /**************************************************************************** * Address Environment Interfaces * @@ -96,7 +97,8 @@ * If CONFIG_ARCH_KERNEL_STACK=y is selected then the platform specific * code must export these additional interfaces: * - * up_addrenv_kstackalloc - Create a stack in the kernel address environment + * up_addrenv_kstackalloc - Create a stack in the kernel address + * environment * up_addrenv_kstackfree - Destroy the kernel stack. * up_addrenv_vkstack - Return the base address of the kernel stack * diff --git a/arch/arm/src/armv7-a/arm_addrenv_ustack.c b/arch/arm/src/armv7-a/arm_addrenv_ustack.c index 4b7be01bd6..66da563834 100644 --- a/arch/arm/src/armv7-a/arm_addrenv_ustack.c +++ b/arch/arm/src/armv7-a/arm_addrenv_ustack.c @@ -32,6 +32,7 @@ * POSSIBILITY OF SUCH DAMAGE. * ****************************************************************************/ + /**************************************************************************** * Address Environment Interfaces * @@ -110,6 +111,7 @@ /**************************************************************************** * Pre-processor Definitions ****************************************************************************/ + /* Configuration */ #if (CONFIG_ARCH_STACK_VBASE & SECTION_MASK) != 0 @@ -151,9 +153,9 @@ int up_addrenv_ustackalloc(FAR struct tcb_s *tcb, size_t stacksize) memset(tcb->xcp.ustack, 0, ARCH_STACK_NSECTS * sizeof(uintptr_t *)); - /* Back the allocation up with physical pages and set up the level 2 mapping - * (which of course does nothing until the L2 page table is hooked into - * the L1 page table). + /* Back the allocation up with physical pages and set up the level 2 + * mapping (which of course does nothing until the L2 page table is hooked + * into the L1 page table). */ /* Allocate .text space pages */ @@ -235,10 +237,10 @@ int up_addrenv_vustack(FAR const struct tcb_s *tcb, FAR void **vstack) * * Description: * After an address environment has been established for a task's stack - * (via up_addrenv_ustackalloc(). This function may be called to instantiate - * that address environment in the virtual address space. This is a - * necessary step before each context switch to the newly created thread - * (including the initial thread startup). + * (via up_addrenv_ustackalloc(). This function may be called to + * instantiate that address environment in the virtual address space. + * This is a necessary step before each context switch to the newly created + * thread (including the initial thread startup). * * Input Parameters: * tcb - The TCB of the thread with the stack address environment to be diff --git a/arch/arm/src/armv7-a/arm_addrenv_utils.c b/arch/arm/src/armv7-a/arm_addrenv_utils.c index baf24e0d2a..f5c9715357 100644 --- a/arch/arm/src/armv7-a/arm_addrenv_utils.c +++ b/arch/arm/src/armv7-a/arm_addrenv_utils.c @@ -32,6 +32,7 @@ * POSSIBILITY OF SUCH DAMAGE. * ****************************************************************************/ + /**************************************************************************** * Included Files ****************************************************************************/ @@ -130,8 +131,10 @@ int arm_addrenv_create_region(FAR uintptr_t **list, unsigned int listlen, /* Temporarily map the page into the virtual address space */ l1save = mmu_l1_getentry(ARCH_SCRATCH_VBASE); - mmu_l1_setentry(paddr & ~SECTION_MASK, ARCH_SCRATCH_VBASE, MMU_MEMFLAGS); - l2table = (FAR uint32_t *)(ARCH_SCRATCH_VBASE | (paddr & SECTION_MASK)); + mmu_l1_setentry(paddr & ~SECTION_MASK, ARCH_SCRATCH_VBASE, + MMU_MEMFLAGS); + l2table = (FAR uint32_t *)(ARCH_SCRATCH_VBASE | + (paddr & SECTION_MASK)); #endif /* Initialize the page table */ @@ -223,8 +226,10 @@ void arm_addrenv_destroy_region(FAR uintptr_t **list, unsigned int listlen, /* Temporarily map the page into the virtual address space */ l1save = mmu_l1_getentry(ARCH_SCRATCH_VBASE); - mmu_l1_setentry(paddr & ~SECTION_MASK, ARCH_SCRATCH_VBASE, MMU_MEMFLAGS); - l2table = (FAR uint32_t *)(ARCH_SCRATCH_VBASE | (paddr & SECTION_MASK)); + mmu_l1_setentry(paddr & ~SECTION_MASK, ARCH_SCRATCH_VBASE, + MMU_MEMFLAGS); + l2table = (FAR uint32_t *)(ARCH_SCRATCH_VBASE | + (paddr & SECTION_MASK)); #endif /* Return the allocated pages to the page allocator unless we were