Skip to content

Commit 0d578b6

Browse files
committed
Apply clang-format
Unchanged file from zephyrproject-rtos#27058 rebased on current master find . -iname *.h -o -iname *.cpp -o -iname *.c | xargs clang-format-12 -style=file -i
1 parent 423587c commit 0d578b6

File tree

3,400 files changed

+114421
-124893
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

3,400 files changed

+114421
-124893
lines changed

arch/arc/core/arc_connect.c

+97-68
Large diffs are not rendered by default.

arch/arc/core/arc_smp.c

+5-8
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,6 @@
1616
#include <soc.h>
1717
#include <init.h>
1818

19-
2019
#ifndef IRQ_ICI
2120
#define IRQ_ICI 19
2221
#endif
@@ -119,15 +118,14 @@ static int arc_smp_init(const struct device *dev)
119118
bcr.val = z_arc_v2_aux_reg_read(_ARC_V2_CONNECT_BCR);
120119

121120
if (bcr.ipi) {
122-
/* register ici interrupt, just need master core to register once */
121+
/* register ici interrupt, just need master core to register once */
123122
z_arc_connect_ici_clear();
124-
IRQ_CONNECT(IRQ_ICI, ARCV2_ICI_IRQ_PRIORITY,
125-
sched_ipi_handler, NULL, 0);
123+
IRQ_CONNECT(IRQ_ICI, ARCV2_ICI_IRQ_PRIORITY, sched_ipi_handler,
124+
NULL, 0);
126125

127126
irq_enable(IRQ_ICI);
128127
} else {
129-
__ASSERT(0,
130-
"ARC connect has no inter-core interrupt\n");
128+
__ASSERT(0, "ARC connect has no inter-core interrupt\n");
131129
return -ENODEV;
132130
}
133131

@@ -139,8 +137,7 @@ static int arc_smp_init(const struct device *dev)
139137
z_arc_connect_gfrc_core_set((1 << CONFIG_MP_NUM_CPUS) - 1);
140138
z_arc_connect_gfrc_clear();
141139
} else {
142-
__ASSERT(0,
143-
"ARC connect has no global free running counter\n");
140+
__ASSERT(0, "ARC connect has no global free running counter\n");
144141
return -ENODEV;
145142
}
146143

arch/arc/core/cache.c

+13-15
Original file line numberDiff line numberDiff line change
@@ -35,17 +35,16 @@
3535
#define DCACHE_LINE_SIZE CONFIG_CACHE_LINE_SIZE
3636
#endif
3737

38-
#define DC_CTRL_DC_ENABLE 0x0 /* enable d-cache */
39-
#define DC_CTRL_DC_DISABLE 0x1 /* disable d-cache */
40-
#define DC_CTRL_INVALID_ONLY 0x0 /* invalid d-cache only */
41-
#define DC_CTRL_INVALID_FLUSH 0x40 /* invalid and flush d-cache */
42-
#define DC_CTRL_ENABLE_FLUSH_LOCKED 0x80 /* locked d-cache can be flushed */
43-
#define DC_CTRL_DISABLE_FLUSH_LOCKED 0x0 /* locked d-cache cannot be flushed */
44-
#define DC_CTRL_FLUSH_STATUS 0x100/* flush status */
45-
#define DC_CTRL_DIRECT_ACCESS 0x0 /* direct access mode */
46-
#define DC_CTRL_INDIRECT_ACCESS 0x20 /* indirect access mode */
47-
#define DC_CTRL_OP_SUCCEEDED 0x4 /* d-cache operation succeeded */
48-
38+
#define DC_CTRL_DC_ENABLE 0x0 /* enable d-cache */
39+
#define DC_CTRL_DC_DISABLE 0x1 /* disable d-cache */
40+
#define DC_CTRL_INVALID_ONLY 0x0 /* invalid d-cache only */
41+
#define DC_CTRL_INVALID_FLUSH 0x40 /* invalid and flush d-cache */
42+
#define DC_CTRL_ENABLE_FLUSH_LOCKED 0x80 /* locked d-cache can be flushed */
43+
#define DC_CTRL_DISABLE_FLUSH_LOCKED 0x0 /* locked d-cache cannot be flushed */
44+
#define DC_CTRL_FLUSH_STATUS 0x100 /* flush status */
45+
#define DC_CTRL_DIRECT_ACCESS 0x0 /* direct access mode */
46+
#define DC_CTRL_INDIRECT_ACCESS 0x20 /* indirect access mode */
47+
#define DC_CTRL_OP_SUCCEEDED 0x4 /* d-cache operation succeeded */
4948

5049
static bool dcache_available(void)
5150
{
@@ -99,7 +98,6 @@ void arch_dcache_flush(void *start_addr_ptr, size_t size)
9998
} while (start_addr < end_addr);
10099

101100
arch_irq_unlock(key); /* --exit critical section-- */
102-
103101
}
104102

105103
void arch_dcache_invd(void *start_addr_ptr, size_t size)
@@ -133,10 +131,10 @@ static void init_dcache_line_size(void)
133131
uint32_t val;
134132

135133
val = z_arc_v2_aux_reg_read(_ARC_V2_D_CACHE_BUILD);
136-
__ASSERT((val&0xff) != 0U, "d-cache is not present");
137-
val = ((val>>16) & 0xf) + 1;
134+
__ASSERT((val & 0xff) != 0U, "d-cache is not present");
135+
val = ((val >> 16) & 0xf) + 1;
138136
val *= 16U;
139-
sys_cache_line_size = (size_t) val;
137+
sys_cache_line_size = (size_t)val;
140138
}
141139
#endif
142140

arch/arc/core/fatal.c

+10-10
Original file line numberDiff line numberDiff line change
@@ -24,17 +24,17 @@ LOG_MODULE_DECLARE(os);
2424
#ifdef CONFIG_ARC_EXCEPTION_DEBUG
2525
static void dump_arc_esf(const z_arch_esf_t *esf)
2626
{
27-
LOG_ERR(" r0: 0x%08x r1: 0x%08x r2: 0x%08x r3: 0x%08x",
28-
esf->r0, esf->r1, esf->r2, esf->r3);
29-
LOG_ERR(" r4: 0x%08x r5: 0x%08x r6: 0x%08x r7: 0x%08x",
30-
esf->r4, esf->r5, esf->r6, esf->r7);
31-
LOG_ERR(" r8: 0x%08x r9: 0x%08x r10: 0x%08x r11: 0x%08x",
32-
esf->r8, esf->r9, esf->r10, esf->r11);
33-
LOG_ERR("r12: 0x%08x r13: 0x%08x pc: 0x%08x",
34-
esf->r12, esf->r13, esf->pc);
27+
LOG_ERR(" r0: 0x%08x r1: 0x%08x r2: 0x%08x r3: 0x%08x", esf->r0,
28+
esf->r1, esf->r2, esf->r3);
29+
LOG_ERR(" r4: 0x%08x r5: 0x%08x r6: 0x%08x r7: 0x%08x", esf->r4,
30+
esf->r5, esf->r6, esf->r7);
31+
LOG_ERR(" r8: 0x%08x r9: 0x%08x r10: 0x%08x r11: 0x%08x", esf->r8,
32+
esf->r9, esf->r10, esf->r11);
33+
LOG_ERR("r12: 0x%08x r13: 0x%08x pc: 0x%08x", esf->r12, esf->r13,
34+
esf->pc);
3535
LOG_ERR(" blink: 0x%08x status32: 0x%08x", esf->blink, esf->status32);
36-
LOG_ERR("lp_end: 0x%08x lp_start: 0x%08x lp_count: 0x%08x",
37-
esf->lp_end, esf->lp_start, esf->lp_count);
36+
LOG_ERR("lp_end: 0x%08x lp_start: 0x%08x lp_count: 0x%08x", esf->lp_end,
37+
esf->lp_start, esf->lp_count);
3838
}
3939
#endif
4040

arch/arc/core/fault.c

+9-9
Original file line numberDiff line numberDiff line change
@@ -25,9 +25,8 @@ LOG_MODULE_DECLARE(os);
2525
#ifdef CONFIG_USERSPACE
2626
Z_EXC_DECLARE(z_arc_user_string_nlen);
2727

28-
static const struct z_exc_handle exceptions[] = {
29-
Z_EXC_HANDLE(z_arc_user_string_nlen)
30-
};
28+
static const struct z_exc_handle exceptions[] = { Z_EXC_HANDLE(
29+
z_arc_user_string_nlen) };
3130
#endif
3231

3332
#if defined(CONFIG_MPU_STACK_GUARD)
@@ -87,7 +86,7 @@ static bool z_check_thread_stack_fail(const uint32_t fault_addr, uint32_t sp)
8786
guard_start = guard_end - Z_ARC_STACK_GUARD_SIZE;
8887
}
8988

90-
/* treat any MPU exceptions within the guard region as a stack
89+
/* treat any MPU exceptions within the guard region as a stack
9190
* overflow if the stack pointer is at or below the end of the guard
9291
* region.
9392
*/
@@ -267,7 +266,8 @@ static void dump_privilege_exception(uint32_t cause, uint32_t parameter)
267266
}
268267
}
269268

270-
static void dump_exception_info(uint32_t vector, uint32_t cause, uint32_t parameter)
269+
static void dump_exception_info(uint32_t vector, uint32_t cause,
270+
uint32_t parameter)
271271
{
272272
if (vector >= 0x10 && vector <= 0xFF) {
273273
LOG_ERR("interrupt %u", vector);
@@ -360,7 +360,7 @@ void _Fault(z_arch_esf_t *esf, uint32_t old_sp)
360360
#endif
361361

362362
vector = Z_ARC_V2_ECR_VECTOR(ecr);
363-
cause = Z_ARC_V2_ECR_CODE(ecr);
363+
cause = Z_ARC_V2_ECR_CODE(ecr);
364364
parameter = Z_ARC_V2_ECR_PARAMETER(ecr);
365365

366366
/* exception raised by kernel */
@@ -371,7 +371,7 @@ void _Fault(z_arch_esf_t *esf, uint32_t old_sp)
371371
*/
372372
#ifdef CONFIG_USERSPACE
373373
if ((esf->status32 & _ARC_V2_STATUS32_U) &&
374-
esf->r0 != K_ERR_STACK_CHK_FAIL) {
374+
esf->r0 != K_ERR_STACK_CHK_FAIL) {
375375
esf->r0 = K_ERR_KERNEL_OOPS;
376376
}
377377
#endif
@@ -400,8 +400,8 @@ void _Fault(z_arch_esf_t *esf, uint32_t old_sp)
400400
#endif
401401

402402
#ifdef CONFIG_MPU_STACK_GUARD
403-
if (vector == ARC_EV_PROT_V && ((parameter == 0x4) ||
404-
(parameter == 0x24))) {
403+
if (vector == ARC_EV_PROT_V &&
404+
((parameter == 0x4) || (parameter == 0x24))) {
405405
if (z_check_thread_stack_fail(exc_addr, old_sp)) {
406406
z_arc_fatal_error(K_ERR_STACK_CHK_FAIL, esf);
407407
return;

arch/arc/core/irq_manage.c

+21-25
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,6 @@
2626
#include <irq.h>
2727
#include <sys/printk.h>
2828

29-
3029
/*
3130
* storage space for the interrupt stack of fast_irq
3231
*/
@@ -47,38 +46,36 @@ void z_arc_firq_stack_set(void)
4746
{
4847
#ifdef CONFIG_SMP
4948
char *firq_sp = Z_KERNEL_STACK_BUFFER(
50-
_firq_interrupt_stack[z_arc_v2_core_id()]) +
51-
CONFIG_ARC_FIRQ_STACK_SIZE;
49+
_firq_interrupt_stack[z_arc_v2_core_id()]) +
50+
CONFIG_ARC_FIRQ_STACK_SIZE;
5251
#else
5352
char *firq_sp = Z_KERNEL_STACK_BUFFER(_firq_interrupt_stack) +
54-
CONFIG_ARC_FIRQ_STACK_SIZE;
53+
CONFIG_ARC_FIRQ_STACK_SIZE;
5554
#endif
5655

57-
/* the z_arc_firq_stack_set must be called when irq diasbled, as
56+
/* the z_arc_firq_stack_set must be called when irq diasbled, as
5857
* it can be called not only in the init phase but also other places
5958
*/
6059
unsigned int key = arch_irq_lock();
6160

62-
__asm__ volatile (
63-
/* only ilink will not be banked, so use ilink as channel
61+
__asm__ volatile(
62+
/* only ilink will not be banked, so use ilink as channel
6463
* between 2 banks
6564
*/
66-
"mov %%ilink, %0\n\t"
67-
"lr %0, [%1]\n\t"
68-
"or %0, %0, %2\n\t"
69-
"kflag %0\n\t"
70-
"mov %%sp, %%ilink\n\t"
71-
/* switch back to bank0, use ilink to avoid the pollution of
65+
"mov %%ilink, %0\n\t"
66+
"lr %0, [%1]\n\t"
67+
"or %0, %0, %2\n\t"
68+
"kflag %0\n\t"
69+
"mov %%sp, %%ilink\n\t"
70+
/* switch back to bank0, use ilink to avoid the pollution of
7271
* bank1's gp regs.
7372
*/
74-
"lr %%ilink, [%1]\n\t"
75-
"and %%ilink, %%ilink, %3\n\t"
76-
"kflag %%ilink\n\t"
77-
:
78-
: "r"(firq_sp), "i"(_ARC_V2_STATUS32),
79-
"i"(_ARC_V2_STATUS32_RB(1)),
80-
"i"(~_ARC_V2_STATUS32_RB(7))
81-
);
73+
"lr %%ilink, [%1]\n\t"
74+
"and %%ilink, %%ilink, %3\n\t"
75+
"kflag %%ilink\n\t"
76+
:
77+
: "r"(firq_sp), "i"(_ARC_V2_STATUS32),
78+
"i"(_ARC_V2_STATUS32_RB(1)), "i"(~_ARC_V2_STATUS32_RB(7)));
8279
arch_irq_unlock(key);
8380
}
8481
#endif
@@ -147,11 +144,10 @@ void z_irq_priority_set(unsigned int irq, unsigned int prio, uint32_t flags)
147144
* left prio levels allocated to normal world
148145
*/
149146
#if defined(CONFIG_ARC_SECURE_FIRMWARE)
150-
prio = prio < ARC_N_IRQ_START_LEVEL ?
151-
prio : (ARC_N_IRQ_START_LEVEL - 1);
147+
prio = prio < ARC_N_IRQ_START_LEVEL ? prio :
148+
(ARC_N_IRQ_START_LEVEL - 1);
152149
#elif defined(CONFIG_ARC_NORMAL_FIRMWARE)
153-
prio = prio < ARC_N_IRQ_START_LEVEL ?
154-
ARC_N_IRQ_START_LEVEL : prio;
150+
prio = prio < ARC_N_IRQ_START_LEVEL ? ARC_N_IRQ_START_LEVEL : prio;
155151
#endif
156152
z_arc_v2_irq_unit_prio_set(irq, prio);
157153
}

arch/arc/core/irq_offload.c

+4-5
Original file line numberDiff line numberDiff line change
@@ -22,12 +22,11 @@ void z_irq_do_offload(void)
2222

2323
void arch_irq_offload(irq_offload_routine_t routine, const void *parameter)
2424
{
25-
2625
offload_routine = routine;
2726
offload_param = parameter;
2827

29-
__asm__ volatile ("trap_s %[id]"
30-
:
31-
: [id] "i"(_TRAP_S_SCALL_IRQ_OFFLOAD) : );
32-
28+
__asm__ volatile("trap_s %[id]"
29+
:
30+
: [id] "i"(_TRAP_S_SCALL_IRQ_OFFLOAD)
31+
:);
3332
}

0 commit comments

Comments
 (0)