Skip to content
GitLab
Menu
Projects
Groups
Snippets
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Sign in / Register
Toggle navigation
Menu
Open sidebar
adam.huang
Arm Trusted Firmware
Commits
73a96051
Unverified
Commit
73a96051
authored
Feb 28, 2018
by
davidcunado-arm
Committed by
GitHub
Feb 28, 2018
Browse files
Merge pull request #1282 from robertovargas-arm/misra-changes
Misra changes
parents
fd50c18a
fd116b9f
Changes
75
Hide whitespace changes
Inline
Side-by-side
Makefile
View file @
73a96051
...
...
@@ -200,6 +200,8 @@ BL_COMMON_SOURCES += common/bl_common.c \
${STDLIB_SRCS}
INCLUDES
+=
-Iinclude
/bl1
\
-Iinclude
/bl2
\
-Iinclude
/bl2u
\
-Iinclude
/bl31
\
-Iinclude
/common
\
-Iinclude
/common/
${ARCH}
\
...
...
bl1/bl1_main.c
View file @
73a96051
...
...
@@ -163,7 +163,7 @@ void bl1_main(void)
* TODO: Add support for alternative image load mechanism e.g using virtio/elf
* loader etc.
******************************************************************************/
void
bl1_load_bl2
(
void
)
static
void
bl1_load_bl2
(
void
)
{
image_desc_t
*
image_desc
;
image_info_t
*
image_info
;
...
...
bl2/aarch64/bl2_arch_setup.c
View file @
73a96051
/*
* Copyright (c) 2013-201
4
, ARM Limited and Contributors. All rights reserved.
* Copyright (c) 2013-201
8
, ARM Limited and Contributors. All rights reserved.
*
* SPDX-License-Identifier: BSD-3-Clause
*/
#include <arch.h>
#include <arch_helpers.h>
#include "../bl2_private.h"
/*******************************************************************************
* Place holder function to perform any S-EL1 specific architectural setup. At
...
...
bl2/bl2_image_load_v2.c
View file @
73a96051
...
...
@@ -14,6 +14,7 @@
#include <platform.h>
#include <platform_def.h>
#include <stdint.h>
#include "bl2_private.h"
/*******************************************************************************
...
...
bl2/bl2_main.c
View file @
73a96051
/*
* Copyright (c) 2013-201
7
, ARM Limited and Contributors. All rights reserved.
* Copyright (c) 2013-201
8
, ARM Limited and Contributors. All rights reserved.
*
* SPDX-License-Identifier: BSD-3-Clause
*/
...
...
@@ -7,6 +7,7 @@
#include <arch_helpers.h>
#include <auth_mod.h>
#include <bl1.h>
#include <bl2.h>
#include <bl_common.h>
#include <console.h>
#include <debug.h>
...
...
bl2/bl2_private.h
View file @
73a96051
/*
* Copyright (c) 2013-201
7
, ARM Limited and Contributors. All rights reserved.
* Copyright (c) 2013-201
8
, ARM Limited and Contributors. All rights reserved.
*
* SPDX-License-Identifier: BSD-3-Clause
*/
...
...
@@ -17,6 +17,6 @@ struct entry_point_info;
*****************************************/
void
bl2_arch_setup
(
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__ */
bl2u/bl2u_main.c
View file @
73a96051
/*
* Copyright (c) 2015-201
7
, ARM Limited and Contributors. All rights reserved.
* Copyright (c) 2015-201
8
, ARM Limited and Contributors. All rights reserved.
*
* SPDX-License-Identifier: BSD-3-Clause
*/
...
...
@@ -9,6 +9,7 @@
#include <assert.h>
#include <auth_mod.h>
#include <bl1.h>
#include <bl2u.h>
#include <bl_common.h>
#include <console.h>
#include <debug.h>
...
...
bl31/bl31_context_mgmt.c
View file @
73a96051
/*
* Copyright (c) 2013-201
6
, ARM Limited and Contributors. All rights reserved.
* Copyright (c) 2013-201
8
, ARM Limited and Contributors. All rights reserved.
*
* 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
* 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.
******************************************************************************/
void
cm_init_context
(
u
nsigned
long
mpidr
,
const
entry_point_info_t
*
ep
)
void
cm_init_context
(
u
int64_t
mpidr
,
const
entry_point_info_t
*
ep
)
{
if
((
mpidr
&
MPIDR_AFFINITY_MASK
)
==
(
read_mpidr_el1
()
&
MPIDR_AFFINITY_MASK
))
...
...
bl31/bl31_main.c
View file @
73a96051
/*
* Copyright (c) 2013-201
7
, ARM Limited and Contributors. All rights reserved.
* Copyright (c) 2013-201
8
, ARM Limited and Contributors. All rights reserved.
*
* SPDX-License-Identifier: BSD-3-Clause
*/
...
...
@@ -17,6 +17,7 @@
#include <pmf.h>
#include <runtime_instr.h>
#include <runtime_svc.h>
#include <std_svc.h>
#include <string.h>
#if ENABLE_RUNTIME_INSTRUMENTATION
...
...
common/desc_image_load.c
View file @
73a96051
/*
* 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
*/
...
...
@@ -10,8 +10,6 @@
#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_params_t
next_bl_params
;
...
...
drivers/arm/gic/common/gic_common_private.h
View file @
73a96051
/*
* Copyright (c) 2016-201
7
, ARM Limited and Contributors. All rights reserved.
* Copyright (c) 2016-201
8
, ARM Limited and Contributors. All rights reserved.
*
* SPDX-License-Identifier: BSD-3-Clause
*/
...
...
@@ -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_icfgr
(
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_isenabler
(
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);
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_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
...
...
drivers/arm/gic/v2/gicv2_helpers.c
View file @
73a96051
/*
* Copyright (c) 2015-201
7
, ARM Limited and Contributors. All rights reserved.
* Copyright (c) 2015-201
8
, ARM Limited and Contributors. All rights reserved.
*
* SPDX-License-Identifier: BSD-3-Clause
*/
...
...
@@ -9,6 +9,7 @@
#include <assert.h>
#include <debug.h>
#include <gic_common.h>
#include <gicv2.h>
#include <interrupt_props.h>
#include "../common/gic_common_private.h"
#include "gicv2_private.h"
...
...
drivers/arm/gic/v2/gicv2_main.c
View file @
73a96051
/*
* Copyright (c) 2015-201
7
, ARM Limited and Contributors. All rights reserved.
* Copyright (c) 2015-201
8
, ARM Limited and Contributors. All rights reserved.
*
* SPDX-License-Identifier: BSD-3-Clause
*/
...
...
@@ -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
* 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
...
...
drivers/arm/gic/v3/gicv3_main.c
View file @
73a96051
/*
* Copyright (c) 2015-201
7
, ARM Limited and Contributors. All rights reserved.
* Copyright (c) 2015-201
8
, ARM Limited and Contributors. All rights reserved.
*
* SPDX-License-Identifier: BSD-3-Clause
*/
...
...
@@ -21,7 +21,7 @@ static unsigned int gicv2_compat;
* spinlock are used either at boot time (when only a single CPU is active), or
* 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
...
...
drivers/arm/gic/v3/gicv3_private.h
View file @
73a96051
/*
* Copyright (c) 2015-201
7
, ARM Limited and Contributors. All rights reserved.
* Copyright (c) 2015-201
8
, ARM Limited and Contributors. All rights reserved.
*
* SPDX-License-Identifier: BSD-3-Clause
*/
...
...
@@ -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_igroupr0
(
uintptr_t
base
,
unsigned
int
id
);
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
...
...
drivers/arm/tzc/tzc400.c
View file @
73a96051
...
...
@@ -34,7 +34,7 @@ typedef struct tzc400_instance {
uint8_t
num_regions
;
}
tzc400_instance_t
;
tzc400_instance_t
tzc400
;
static
tzc400_instance_t
tzc400
;
static
inline
unsigned
int
_tzc400_read_build_config
(
uintptr_t
base
)
{
...
...
drivers/arm/tzc/tzc_common_private.h
View file @
73a96051
/*
* Copyright (c) 2016-201
7
, ARM Limited and Contributors. All rights reserved.
* Copyright (c) 2016-201
8
, ARM Limited and Contributors. All rights reserved.
*
* SPDX-License-Identifier: BSD-3-Clause
*/
...
...
@@ -93,7 +93,7 @@
* It is used to program region 0 ATTRIBUTES and ACCESS register.
*/
#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, \
unsigned int ns_device_access) \
{ \
...
...
@@ -124,7 +124,7 @@
* that function).
*/
#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, \
int region_no, \
unsigned long long region_base, \
...
...
drivers/delay_timer/delay_timer.c
View file @
73a96051
/*
* 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
*/
...
...
@@ -12,7 +12,7 @@
/***********************************************************
* 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
...
...
@@ -20,26 +20,27 @@ static const timer_ops_t *ops;
***********************************************************/
void
udelay
(
uint32_t
usec
)
{
assert
(
ops
!=
NULL
&&
(
ops
->
clk_mult
!=
0
)
&&
(
ops
->
clk_div
!=
0
)
&&
(
ops
->
get_timer_value
!=
NULL
));
assert
(
timer_
ops
!=
NULL
&&
(
timer_
ops
->
clk_mult
!=
0
)
&&
(
timer_
ops
->
clk_div
!=
0
)
&&
(
timer_
ops
->
get_timer_value
!=
NULL
));
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. */
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
{
/*
* If the timer value wraps around, the subtraction will
* 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
);
}
...
...
@@ -64,5 +65,5 @@ void timer_init(const timer_ops_t *ops_ptr)
(
ops_ptr
->
clk_div
!=
0
)
&&
(
ops_ptr
->
get_timer_value
!=
NULL
));
ops
=
ops_ptr
;
timer_
ops
=
ops_ptr
;
}
drivers/io/io_fip.c
View file @
73a96051
...
...
@@ -69,7 +69,7 @@ static inline int is_valid_header(fip_toc_header_t *header)
/* 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
;
}
...
...
drivers/io/io_memmap.c
View file @
73a96051
/*
* Copyright (c) 2014-201
7
, ARM Limited and Contributors. All rights reserved.
* Copyright (c) 2014-201
8
, ARM Limited and Contributors. All rights reserved.
*
* SPDX-License-Identifier: BSD-3-Clause
*/
...
...
@@ -7,6 +7,7 @@
#include <assert.h>
#include <debug.h>
#include <io_driver.h>
#include <io_memmap.h>
#include <io_storage.h>
#include <string.h>
#include <utils.h>
...
...
@@ -28,7 +29,7 @@ typedef struct {
static
file_state_t
current_file
=
{
0
};
/* 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
;
}
...
...
Prev
1
2
3
4
Next
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment