Unverified Commit 73a96051 authored by davidcunado-arm's avatar davidcunado-arm Committed by GitHub
Browse files

Merge pull request #1282 from robertovargas-arm/misra-changes

Misra changes
parents fd50c18a fd116b9f
...@@ -200,6 +200,8 @@ BL_COMMON_SOURCES += common/bl_common.c \ ...@@ -200,6 +200,8 @@ BL_COMMON_SOURCES += common/bl_common.c \
${STDLIB_SRCS} ${STDLIB_SRCS}
INCLUDES += -Iinclude/bl1 \ INCLUDES += -Iinclude/bl1 \
-Iinclude/bl2 \
-Iinclude/bl2u \
-Iinclude/bl31 \ -Iinclude/bl31 \
-Iinclude/common \ -Iinclude/common \
-Iinclude/common/${ARCH} \ -Iinclude/common/${ARCH} \
......
...@@ -163,7 +163,7 @@ void bl1_main(void) ...@@ -163,7 +163,7 @@ void bl1_main(void)
* TODO: Add support for alternative image load mechanism e.g using virtio/elf * TODO: Add support for alternative image load mechanism e.g using virtio/elf
* loader etc. * loader etc.
******************************************************************************/ ******************************************************************************/
void bl1_load_bl2(void) static void bl1_load_bl2(void)
{ {
image_desc_t *image_desc; image_desc_t *image_desc;
image_info_t *image_info; image_info_t *image_info;
......
/* /*
* Copyright (c) 2013-2014, ARM Limited and Contributors. All rights reserved. * Copyright (c) 2013-2018, ARM Limited and Contributors. All rights reserved.
* *
* SPDX-License-Identifier: BSD-3-Clause * SPDX-License-Identifier: BSD-3-Clause
*/ */
#include <arch.h> #include <arch.h>
#include <arch_helpers.h> #include <arch_helpers.h>
#include "../bl2_private.h"
/******************************************************************************* /*******************************************************************************
* Place holder function to perform any S-EL1 specific architectural setup. At * Place holder function to perform any S-EL1 specific architectural setup. At
......
...@@ -14,6 +14,7 @@ ...@@ -14,6 +14,7 @@
#include <platform.h> #include <platform.h>
#include <platform_def.h> #include <platform_def.h>
#include <stdint.h> #include <stdint.h>
#include "bl2_private.h"
/******************************************************************************* /*******************************************************************************
......
/* /*
* Copyright (c) 2013-2017, ARM Limited and Contributors. All rights reserved. * Copyright (c) 2013-2018, ARM Limited and Contributors. All rights reserved.
* *
* SPDX-License-Identifier: BSD-3-Clause * SPDX-License-Identifier: BSD-3-Clause
*/ */
...@@ -7,6 +7,7 @@ ...@@ -7,6 +7,7 @@
#include <arch_helpers.h> #include <arch_helpers.h>
#include <auth_mod.h> #include <auth_mod.h>
#include <bl1.h> #include <bl1.h>
#include <bl2.h>
#include <bl_common.h> #include <bl_common.h>
#include <console.h> #include <console.h>
#include <debug.h> #include <debug.h>
......
/* /*
* Copyright (c) 2013-2017, ARM Limited and Contributors. All rights reserved. * Copyright (c) 2013-2018, ARM Limited and Contributors. All rights reserved.
* *
* SPDX-License-Identifier: BSD-3-Clause * SPDX-License-Identifier: BSD-3-Clause
*/ */
...@@ -17,6 +17,6 @@ struct entry_point_info; ...@@ -17,6 +17,6 @@ struct entry_point_info;
*****************************************/ *****************************************/
void bl2_arch_setup(void); void bl2_arch_setup(void);
struct entry_point_info *bl2_load_images(void); struct entry_point_info *bl2_load_images(void);
void bl2_run_next_image(const entry_point_info_t *bl_ep_info); void bl2_run_next_image(const struct entry_point_info *bl_ep_info);
#endif /* __BL2_PRIVATE_H__ */ #endif /* __BL2_PRIVATE_H__ */
/* /*
* Copyright (c) 2015-2017, ARM Limited and Contributors. All rights reserved. * Copyright (c) 2015-2018, ARM Limited and Contributors. All rights reserved.
* *
* SPDX-License-Identifier: BSD-3-Clause * SPDX-License-Identifier: BSD-3-Clause
*/ */
...@@ -9,6 +9,7 @@ ...@@ -9,6 +9,7 @@
#include <assert.h> #include <assert.h>
#include <auth_mod.h> #include <auth_mod.h>
#include <bl1.h> #include <bl1.h>
#include <bl2u.h>
#include <bl_common.h> #include <bl_common.h>
#include <console.h> #include <console.h>
#include <debug.h> #include <debug.h>
......
/* /*
* Copyright (c) 2013-2016, ARM Limited and Contributors. All rights reserved. * Copyright (c) 2013-2018, ARM Limited and Contributors. All rights reserved.
* *
* SPDX-License-Identifier: BSD-3-Clause * SPDX-License-Identifier: BSD-3-Clause
*/ */
...@@ -99,7 +99,7 @@ void cm_set_context_by_mpidr(uint64_t mpidr, void *context, uint32_t security_st ...@@ -99,7 +99,7 @@ void cm_set_context_by_mpidr(uint64_t mpidr, void *context, uint32_t security_st
* existing cm library routines. This function is expected to be invoked for * existing cm library routines. This function is expected to be invoked for
* initializing the cpu_context for the CPU specified by MPIDR for first use. * initializing the cpu_context for the CPU specified by MPIDR for first use.
******************************************************************************/ ******************************************************************************/
void cm_init_context(unsigned long mpidr, const entry_point_info_t *ep) void cm_init_context(uint64_t mpidr, const entry_point_info_t *ep)
{ {
if ((mpidr & MPIDR_AFFINITY_MASK) == if ((mpidr & MPIDR_AFFINITY_MASK) ==
(read_mpidr_el1() & MPIDR_AFFINITY_MASK)) (read_mpidr_el1() & MPIDR_AFFINITY_MASK))
......
/* /*
* Copyright (c) 2013-2017, ARM Limited and Contributors. All rights reserved. * Copyright (c) 2013-2018, ARM Limited and Contributors. All rights reserved.
* *
* SPDX-License-Identifier: BSD-3-Clause * SPDX-License-Identifier: BSD-3-Clause
*/ */
...@@ -17,6 +17,7 @@ ...@@ -17,6 +17,7 @@
#include <pmf.h> #include <pmf.h>
#include <runtime_instr.h> #include <runtime_instr.h>
#include <runtime_svc.h> #include <runtime_svc.h>
#include <std_svc.h>
#include <string.h> #include <string.h>
#if ENABLE_RUNTIME_INSTRUMENTATION #if ENABLE_RUNTIME_INSTRUMENTATION
......
/* /*
* Copyright (c) 2016, ARM Limited and Contributors. All rights reserved. * Copyright (c) 2016-2018, ARM Limited and Contributors. All rights reserved.
* *
* SPDX-License-Identifier: BSD-3-Clause * SPDX-License-Identifier: BSD-3-Clause
*/ */
...@@ -10,8 +10,6 @@ ...@@ -10,8 +10,6 @@
#include <desc_image_load.h> #include <desc_image_load.h>
extern bl_mem_params_node_t *bl_mem_params_desc_ptr;
extern unsigned int bl_mem_params_desc_num;
static bl_load_info_t bl_load_info; static bl_load_info_t bl_load_info;
static bl_params_t next_bl_params; static bl_params_t next_bl_params;
......
/* /*
* Copyright (c) 2016-2017, ARM Limited and Contributors. All rights reserved. * Copyright (c) 2016-2018, ARM Limited and Contributors. All rights reserved.
* *
* SPDX-License-Identifier: BSD-3-Clause * SPDX-License-Identifier: BSD-3-Clause
*/ */
...@@ -49,6 +49,9 @@ unsigned int gicd_read_icactiver(uintptr_t base, unsigned int id); ...@@ -49,6 +49,9 @@ unsigned int gicd_read_icactiver(uintptr_t base, unsigned int id);
unsigned int gicd_read_ipriorityr(uintptr_t base, unsigned int id); unsigned int gicd_read_ipriorityr(uintptr_t base, unsigned int id);
unsigned int gicd_read_icfgr(uintptr_t base, unsigned int id); unsigned int gicd_read_icfgr(uintptr_t base, unsigned int id);
unsigned int gicd_read_nsacr(uintptr_t base, unsigned int id); unsigned int gicd_read_nsacr(uintptr_t base, unsigned int id);
unsigned int gicd_read_spendsgir(uintptr_t base, unsigned int id);
unsigned int gicd_read_cpendsgir(uintptr_t base, unsigned int id);
unsigned int gicd_read_itargetsr(uintptr_t base, unsigned int id);
void gicd_write_igroupr(uintptr_t base, unsigned int id, unsigned int val); void gicd_write_igroupr(uintptr_t base, unsigned int id, unsigned int val);
void gicd_write_isenabler(uintptr_t base, unsigned int id, unsigned int val); void gicd_write_isenabler(uintptr_t base, unsigned int id, unsigned int val);
void gicd_write_icenabler(uintptr_t base, unsigned int id, unsigned int val); void gicd_write_icenabler(uintptr_t base, unsigned int id, unsigned int val);
...@@ -59,6 +62,9 @@ void gicd_write_icactiver(uintptr_t base, unsigned int id, unsigned int val); ...@@ -59,6 +62,9 @@ void gicd_write_icactiver(uintptr_t base, unsigned int id, unsigned int val);
void gicd_write_ipriorityr(uintptr_t base, unsigned int id, unsigned int val); void gicd_write_ipriorityr(uintptr_t base, unsigned int id, unsigned int val);
void gicd_write_icfgr(uintptr_t base, unsigned int id, unsigned int val); void gicd_write_icfgr(uintptr_t base, unsigned int id, unsigned int val);
void gicd_write_nsacr(uintptr_t base, unsigned int id, unsigned int val); void gicd_write_nsacr(uintptr_t base, unsigned int id, unsigned int val);
void gicd_write_spendsgir(uintptr_t base, unsigned int id, unsigned int val);
void gicd_write_cpendsgir(uintptr_t base, unsigned int id, unsigned int val);
void gicd_write_itargetsr(uintptr_t base, unsigned int id, unsigned int val);
/******************************************************************************* /*******************************************************************************
* GIC Distributor function prototypes for accessing the GIC registers * GIC Distributor function prototypes for accessing the GIC registers
......
/* /*
* Copyright (c) 2015-2017, ARM Limited and Contributors. All rights reserved. * Copyright (c) 2015-2018, ARM Limited and Contributors. All rights reserved.
* *
* SPDX-License-Identifier: BSD-3-Clause * SPDX-License-Identifier: BSD-3-Clause
*/ */
...@@ -9,6 +9,7 @@ ...@@ -9,6 +9,7 @@
#include <assert.h> #include <assert.h>
#include <debug.h> #include <debug.h>
#include <gic_common.h> #include <gic_common.h>
#include <gicv2.h>
#include <interrupt_props.h> #include <interrupt_props.h>
#include "../common/gic_common_private.h" #include "../common/gic_common_private.h"
#include "gicv2_private.h" #include "gicv2_private.h"
......
/* /*
* Copyright (c) 2015-2017, ARM Limited and Contributors. All rights reserved. * Copyright (c) 2015-2018, ARM Limited and Contributors. All rights reserved.
* *
* SPDX-License-Identifier: BSD-3-Clause * SPDX-License-Identifier: BSD-3-Clause
*/ */
...@@ -22,7 +22,7 @@ static const gicv2_driver_data_t *driver_data; ...@@ -22,7 +22,7 @@ static const gicv2_driver_data_t *driver_data;
* spinlock are used either at boot time (when only a single CPU is active), or * spinlock are used either at boot time (when only a single CPU is active), or
* when the system is fully coherent. * when the system is fully coherent.
*/ */
spinlock_t gic_lock; static spinlock_t gic_lock;
/******************************************************************************* /*******************************************************************************
* Enable secure interrupts and use FIQs to route them. Disable legacy bypass * Enable secure interrupts and use FIQs to route them. Disable legacy bypass
......
/* /*
* Copyright (c) 2015-2017, ARM Limited and Contributors. All rights reserved. * Copyright (c) 2015-2018, ARM Limited and Contributors. All rights reserved.
* *
* SPDX-License-Identifier: BSD-3-Clause * SPDX-License-Identifier: BSD-3-Clause
*/ */
...@@ -21,7 +21,7 @@ static unsigned int gicv2_compat; ...@@ -21,7 +21,7 @@ static unsigned int gicv2_compat;
* spinlock are used either at boot time (when only a single CPU is active), or * spinlock are used either at boot time (when only a single CPU is active), or
* when the system is fully coherent. * when the system is fully coherent.
*/ */
spinlock_t gic_lock; static spinlock_t gic_lock;
/* /*
* Redistributor power operations are weakly bound so that they can be * Redistributor power operations are weakly bound so that they can be
......
/* /*
* Copyright (c) 2015-2017, ARM Limited and Contributors. All rights reserved. * Copyright (c) 2015-2018, ARM Limited and Contributors. All rights reserved.
* *
* SPDX-License-Identifier: BSD-3-Clause * SPDX-License-Identifier: BSD-3-Clause
*/ */
...@@ -79,6 +79,8 @@ void gicd_clr_igrpmodr(uintptr_t base, unsigned int id); ...@@ -79,6 +79,8 @@ void gicd_clr_igrpmodr(uintptr_t base, unsigned int id);
void gicr_clr_igrpmodr0(uintptr_t base, unsigned int id); void gicr_clr_igrpmodr0(uintptr_t base, unsigned int id);
void gicr_clr_igroupr0(uintptr_t base, unsigned int id); void gicr_clr_igroupr0(uintptr_t base, unsigned int id);
void gicr_set_ipriorityr(uintptr_t base, unsigned int id, unsigned int pri); void gicr_set_ipriorityr(uintptr_t base, unsigned int id, unsigned int pri);
void gicr_set_icfgr0(uintptr_t base, unsigned int id, unsigned int cfg);
void gicr_set_icfgr1(uintptr_t base, unsigned int id, unsigned int cfg);
/******************************************************************************* /*******************************************************************************
* Private GICv3 helper function prototypes * Private GICv3 helper function prototypes
......
...@@ -34,7 +34,7 @@ typedef struct tzc400_instance { ...@@ -34,7 +34,7 @@ typedef struct tzc400_instance {
uint8_t num_regions; uint8_t num_regions;
} tzc400_instance_t; } tzc400_instance_t;
tzc400_instance_t tzc400; static tzc400_instance_t tzc400;
static inline unsigned int _tzc400_read_build_config(uintptr_t base) static inline unsigned int _tzc400_read_build_config(uintptr_t base)
{ {
......
/* /*
* Copyright (c) 2016-2017, ARM Limited and Contributors. All rights reserved. * Copyright (c) 2016-2018, ARM Limited and Contributors. All rights reserved.
* *
* SPDX-License-Identifier: BSD-3-Clause * SPDX-License-Identifier: BSD-3-Clause
*/ */
...@@ -93,7 +93,7 @@ ...@@ -93,7 +93,7 @@
* It is used to program region 0 ATTRIBUTES and ACCESS register. * It is used to program region 0 ATTRIBUTES and ACCESS register.
*/ */
#define DEFINE_TZC_COMMON_CONFIGURE_REGION0(fn_name) \ #define DEFINE_TZC_COMMON_CONFIGURE_REGION0(fn_name) \
void _tzc##fn_name##_configure_region0(uintptr_t base, \ static void _tzc##fn_name##_configure_region0(uintptr_t base, \
tzc_region_attributes_t sec_attr, \ tzc_region_attributes_t sec_attr, \
unsigned int ns_device_access) \ unsigned int ns_device_access) \
{ \ { \
...@@ -124,7 +124,7 @@ ...@@ -124,7 +124,7 @@
* that function). * that function).
*/ */
#define DEFINE_TZC_COMMON_CONFIGURE_REGION(fn_name) \ #define DEFINE_TZC_COMMON_CONFIGURE_REGION(fn_name) \
void _tzc##fn_name##_configure_region(uintptr_t base, \ static void _tzc##fn_name##_configure_region(uintptr_t base, \
unsigned int filters, \ unsigned int filters, \
int region_no, \ int region_no, \
unsigned long long region_base, \ unsigned long long region_base, \
......
/* /*
* Copyright (c) 2015, ARM Limited and Contributors. All rights reserved. * Copyright (c) 2015-2018, ARM Limited and Contributors. All rights reserved.
* *
* SPDX-License-Identifier: BSD-3-Clause * SPDX-License-Identifier: BSD-3-Clause
*/ */
...@@ -12,7 +12,7 @@ ...@@ -12,7 +12,7 @@
/*********************************************************** /***********************************************************
* The delay timer implementation * The delay timer implementation
***********************************************************/ ***********************************************************/
static const timer_ops_t *ops; static const timer_ops_t *timer_ops;
/*********************************************************** /***********************************************************
* Delay for the given number of microseconds. The driver must * Delay for the given number of microseconds. The driver must
...@@ -20,26 +20,27 @@ static const timer_ops_t *ops; ...@@ -20,26 +20,27 @@ static const timer_ops_t *ops;
***********************************************************/ ***********************************************************/
void udelay(uint32_t usec) void udelay(uint32_t usec)
{ {
assert(ops != NULL && assert(timer_ops != NULL &&
(ops->clk_mult != 0) && (timer_ops->clk_mult != 0) &&
(ops->clk_div != 0) && (timer_ops->clk_div != 0) &&
(ops->get_timer_value != NULL)); (timer_ops->get_timer_value != NULL));
uint32_t start, delta, total_delta; uint32_t start, delta, total_delta;
assert(usec < UINT32_MAX / ops->clk_div); assert(usec < UINT32_MAX / timer_ops->clk_div);
start = ops->get_timer_value(); start = timer_ops->get_timer_value();
/* Add an extra tick to avoid delaying less than requested. */ /* Add an extra tick to avoid delaying less than requested. */
total_delta = div_round_up(usec * ops->clk_div, ops->clk_mult) + 1; total_delta =
div_round_up(usec * timer_ops->clk_div, timer_ops->clk_mult) + 1;
do { do {
/* /*
* If the timer value wraps around, the subtraction will * If the timer value wraps around, the subtraction will
* overflow and it will still give the correct result. * overflow and it will still give the correct result.
*/ */
delta = start - ops->get_timer_value(); /* Decreasing counter */ delta = start - timer_ops->get_timer_value(); /* Decreasing counter */
} while (delta < total_delta); } while (delta < total_delta);
} }
...@@ -64,5 +65,5 @@ void timer_init(const timer_ops_t *ops_ptr) ...@@ -64,5 +65,5 @@ void timer_init(const timer_ops_t *ops_ptr)
(ops_ptr->clk_div != 0) && (ops_ptr->clk_div != 0) &&
(ops_ptr->get_timer_value != NULL)); (ops_ptr->get_timer_value != NULL));
ops = ops_ptr; timer_ops = ops_ptr;
} }
...@@ -69,7 +69,7 @@ static inline int is_valid_header(fip_toc_header_t *header) ...@@ -69,7 +69,7 @@ static inline int is_valid_header(fip_toc_header_t *header)
/* Identify the device type as a virtual driver */ /* Identify the device type as a virtual driver */
io_type_t device_type_fip(void) static io_type_t device_type_fip(void)
{ {
return IO_TYPE_FIRMWARE_IMAGE_PACKAGE; return IO_TYPE_FIRMWARE_IMAGE_PACKAGE;
} }
......
/* /*
* Copyright (c) 2014-2017, ARM Limited and Contributors. All rights reserved. * Copyright (c) 2014-2018, ARM Limited and Contributors. All rights reserved.
* *
* SPDX-License-Identifier: BSD-3-Clause * SPDX-License-Identifier: BSD-3-Clause
*/ */
...@@ -7,6 +7,7 @@ ...@@ -7,6 +7,7 @@
#include <assert.h> #include <assert.h>
#include <debug.h> #include <debug.h>
#include <io_driver.h> #include <io_driver.h>
#include <io_memmap.h>
#include <io_storage.h> #include <io_storage.h>
#include <string.h> #include <string.h>
#include <utils.h> #include <utils.h>
...@@ -28,7 +29,7 @@ typedef struct { ...@@ -28,7 +29,7 @@ typedef struct {
static file_state_t current_file = {0}; static file_state_t current_file = {0};
/* Identify the device type as memmap */ /* Identify the device type as memmap */
io_type_t device_type_memmap(void) static io_type_t device_type_memmap(void)
{ {
return IO_TYPE_MEMMAP; return IO_TYPE_MEMMAP;
} }
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment