From b0f9241ec18656054de4372cb9626001394777f5 Mon Sep 17 00:00:00 2001 From: Hidenori Matsubayashi Date: Sun, 9 Oct 2022 13:47:00 +0900 Subject: [PATCH] arch/arm64: update to follow NuttX C Coding Standard This change moves the static vars to the appropriate place to follow the coding standard. It also adds comments as sections and `static` where necessary. Signed-off-by: Hidenori Matsubayashi --- arch/arm64/src/common/arm64_cpu_psci.c | 20 ++++++++++++-------- arch/arm64/src/common/arm64_gicv3.c | 6 +++++- arch/arm64/src/common/arm64_mmu.c | 12 ++++++------ 3 files changed, 23 insertions(+), 15 deletions(-) diff --git a/arch/arm64/src/common/arm64_cpu_psci.c b/arch/arm64/src/common/arm64_cpu_psci.c index cc384a98cc..1597088761 100644 --- a/arch/arm64/src/common/arm64_cpu_psci.c +++ b/arch/arm64/src/common/arm64_cpu_psci.c @@ -1,4 +1,4 @@ -/**************************************************************************** +/*************************************************************************** * arch/arm64/src/common/arm64_cpu_psci.c * * Licensed to the Apache Software Foundation (ASF) under one or more @@ -16,11 +16,11 @@ * License for the specific language governing permissions and limitations * under the License. * - ****************************************************************************/ + ***************************************************************************/ -/**************************************************************************** +/*************************************************************************** * Included Files - ****************************************************************************/ + ***************************************************************************/ #include #include @@ -36,11 +36,15 @@ #include "arm64_cpu_psci.h" +/*************************************************************************** + * Private Data + ***************************************************************************/ + static struct psci_interface psci_data; -/**************************************************************************** +/*************************************************************************** * Private Functions - ****************************************************************************/ + ***************************************************************************/ static int psci_to_dev_err(int ret) { @@ -137,9 +141,9 @@ static int psci_detect(void) return 0; } -/**************************************************************************** +/*************************************************************************** * Public Functions - ****************************************************************************/ + ***************************************************************************/ uint32_t psci_version(void) { diff --git a/arch/arm64/src/common/arm64_gicv3.c b/arch/arm64/src/common/arm64_gicv3.c index 8416476359..f4ab3fb205 100644 --- a/arch/arm64/src/common/arm64_gicv3.c +++ b/arch/arm64/src/common/arm64_gicv3.c @@ -59,9 +59,13 @@ #define IGROUPR_VAL 0xFFFFFFFFU +/*************************************************************************** + * Private Data + ***************************************************************************/ + /* Redistributor base addresses for each core */ -unsigned long gic_rdists[CONFIG_SMP_NCPUS]; +static unsigned long gic_rdists[CONFIG_SMP_NCPUS]; /*************************************************************************** * Private Functions diff --git a/arch/arm64/src/common/arm64_mmu.c b/arch/arm64/src/common/arm64_mmu.c index 709ef89237..3a351f1ff6 100644 --- a/arch/arm64/src/common/arm64_mmu.c +++ b/arch/arm64/src/common/arm64_mmu.c @@ -131,12 +131,6 @@ #define NUM_BASE_LEVEL_ENTRIES GET_NUM_BASE_LEVEL_ENTRIES( \ CONFIG_ARM64_VA_BITS) -static uint64_t base_xlat_table[NUM_BASE_LEVEL_ENTRIES] aligned_data( - NUM_BASE_LEVEL_ENTRIES * sizeof(uint64_t)); - -static uint64_t xlat_tables[CONFIG_MAX_XLAT_TABLES][XLAT_TABLE_ENTRIES] -aligned_data(XLAT_TABLE_ENTRIES * sizeof(uint64_t)); - #if (CONFIG_ARM64_PA_BITS == 48) #define TCR_PS_BITS TCR_PS_BITS_256TB #elif (CONFIG_ARM64_PA_BITS == 44) @@ -155,6 +149,12 @@ aligned_data(XLAT_TABLE_ENTRIES * sizeof(uint64_t)); * Private Data ***************************************************************************/ +static uint64_t base_xlat_table[NUM_BASE_LEVEL_ENTRIES] aligned_data( + NUM_BASE_LEVEL_ENTRIES * sizeof(uint64_t)); + +static uint64_t xlat_tables[CONFIG_MAX_XLAT_TABLES][XLAT_TABLE_ENTRIES] +aligned_data(XLAT_TABLE_ENTRIES * sizeof(uint64_t)); + /* NuttX RTOS execution regions with appropriate attributes */ static const struct arm_mmu_region mmu_nxrt_regions[] =