Skip to content

Commit 565359b

Browse files
committed
style: format files using clang-format-19
Signed-off-by: Manuel Rodríguez <[email protected]>
1 parent 4b999b5 commit 565359b

File tree

6 files changed

+33
-29
lines changed

6 files changed

+33
-29
lines changed

src/arch/armv8/armv8-r/mpu.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -116,7 +116,7 @@ static inline void mpu_entry_set_perms(struct mp_region* mpr, struct mpu_perms m
116116
bool el1_priv = mpu_perms.el1 != PERM_NONE;
117117
perms_t perms = mpu_perms.el1 | mpu_perms.el2;
118118

119-
mpr->mem_flags.prbar &= (uint16_t) ~(PRBAR_PERMS_FLAGS_MSK);
119+
mpr->mem_flags.prbar &= (uint16_t)~(PRBAR_PERMS_FLAGS_MSK);
120120
if (perms & PERM_W) {
121121
mpr->mem_flags.prbar |= PRBAR_AP_RW_EL2;
122122
} else {

src/core/inc/config.h

Lines changed: 13 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -30,23 +30,27 @@
3030
// clang-format on
3131

3232
#define VM_IMAGE_OFFSET(img_name) ((paddr_t) & _##img_name##_vm_beg)
33-
#define VM_IMAGE_SIZE(img_name) ((size_t) & _##img_name##_vm_size)
33+
#define VM_IMAGE_SIZE(img_name) ((size_t)&_##img_name##_vm_size)
3434
#else
3535
#define VM_IMAGE(img_name, img_path)
3636
#define VM_IMAGE_OFFSET(img_name) ((paddr_t)0)
3737
#define VM_IMAGE_SIZE(img_name) ((size_t)0)
3838
#endif
3939

40-
#define VM_IMAGE_BUILTIN(img_name, image_base_addr) \
41-
{ \
42-
.base_addr = image_base_addr, .load_addr = VM_IMAGE_OFFSET(img_name), \
43-
.size = VM_IMAGE_SIZE(img_name), .separately_loaded = false, \
40+
#define VM_IMAGE_BUILTIN(img_name, image_base_addr) \
41+
{ \
42+
.base_addr = image_base_addr, \
43+
.load_addr = VM_IMAGE_OFFSET(img_name), \
44+
.size = VM_IMAGE_SIZE(img_name), \
45+
.separately_loaded = false, \
4446
}
4547

46-
#define VM_IMAGE_LOADED(image_base_addr, image_load_addr, image_size) \
47-
{ \
48-
.base_addr = image_base_addr, .load_addr = image_load_addr, .size = image_size, \
49-
.separately_loaded = true, \
48+
#define VM_IMAGE_LOADED(image_base_addr, image_load_addr, image_size) \
49+
{ \
50+
.base_addr = image_base_addr, \
51+
.load_addr = image_load_addr, \
52+
.size = image_size, \
53+
.separately_loaded = true, \
5054
}
5155

5256
/* CONFIG_HEADER is just defined for compatibility with older configs */

src/core/inc/cpu.h

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -48,9 +48,9 @@ void cpu_send_msg(cpuid_t cpu, struct cpu_msg* msg);
4848

4949
typedef void (*cpu_msg_handler_t)(uint32_t event, uint64_t data);
5050

51-
#define CPU_MSG_HANDLER(handler, handler_id) \
52-
__attribute__((section(".ipi_cpumsg_handlers"), used)) \
53-
cpu_msg_handler_t __cpumsg_handler_##handler = handler; \
51+
#define CPU_MSG_HANDLER(handler, handler_id) \
52+
__attribute__((section(".ipi_cpumsg_handlers"), \
53+
used)) cpu_msg_handler_t __cpumsg_handler_##handler = handler; \
5454
__attribute__((section(".ipi_cpumsg_handlers_id"), used)) volatile const size_t handler_id;
5555

5656
struct cpu_synctoken {

src/core/inc/types.h

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -25,23 +25,23 @@ typedef signed long ssize_t;
2525
typedef unsigned long asid_t;
2626

2727
typedef unsigned long vmid_t;
28-
#define INVALID_VMID ((vmid_t)-1)
28+
#define INVALID_VMID ((vmid_t) - 1)
2929

3030
typedef uintptr_t paddr_t;
3131
typedef uintptr_t regaddr_t;
3232
typedef uintptr_t vaddr_t;
33-
#define MAX_VA ((vaddr_t)-1)
33+
#define MAX_VA ((vaddr_t) - 1)
3434
#define INVALID_VA MAX_VA
3535

3636
typedef size_t mpid_t;
37-
#define INVALID_MPID ((mpid_t)-1)
37+
#define INVALID_MPID ((mpid_t) - 1)
3838

3939
typedef unsigned long colormap_t;
4040

4141
typedef unsigned long cpuid_t;
4242
typedef unsigned long vcpuid_t;
4343
typedef unsigned long cpumap_t;
44-
#define INVALID_CPUID ((cpuid_t)-1)
44+
#define INVALID_CPUID ((cpuid_t) - 1)
4545

4646
typedef unsigned irqid_t;
4747

src/lib/inc/bit.h

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -14,9 +14,9 @@
1414
* word length masks with the cost of an extra shift instruction. For static masks, there should be
1515
* no extra costs.
1616
*/
17-
#define BIT32_MASK(OFF, LEN) ((((UINT32_C(1) << ((LEN)-1)) << 1) - 1) << (OFF))
18-
#define BIT64_MASK(OFF, LEN) ((((UINT64_C(1) << ((LEN)-1)) << 1) - 1) << (OFF))
19-
#define BIT_MASK(OFF, LEN) (((((1UL) << ((LEN)-1)) << 1) - 1) << (OFF))
17+
#define BIT32_MASK(OFF, LEN) ((((UINT32_C(1) << ((LEN) - 1)) << 1) - 1) << (OFF))
18+
#define BIT64_MASK(OFF, LEN) ((((UINT64_C(1) << ((LEN) - 1)) << 1) - 1) << (OFF))
19+
#define BIT_MASK(OFF, LEN) (((((1UL) << ((LEN) - 1)) << 1) - 1) << (OFF))
2020

2121
#ifndef __ASSEMBLER__
2222

@@ -52,7 +52,7 @@
5252
mask <<= 1U; \
5353
pos++; \
5454
} \
55-
return (mask != 0U) ? pos : (ssize_t)-1; \
55+
return (mask != 0U) ? pos : (ssize_t) - 1; \
5656
} \
5757
static inline size_t PRE##_count(TYPE word) \
5858
{ \

src/lib/inc/util.h

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -9,20 +9,20 @@
99
/* UTILITY MACROS */
1010

1111
/* align VAL to TO which must be power a two */
12-
#define ALIGN(VAL, TO) ((((VAL) + (TO)-1) / (TO)) * TO)
12+
#define ALIGN(VAL, TO) ((((VAL) + (TO) - 1) / (TO)) * TO)
1313
#define IS_ALIGNED(VAL, TO) (!((VAL) % (TO)))
14-
#define ALIGN_FLOOR(VAL, TO) ((VAL) & ~((TO)-1))
14+
#define ALIGN_FLOOR(VAL, TO) ((VAL) & ~((TO) - 1))
1515
#define NUM_PAGES(SZ) (ALIGN(SZ, PAGE_SIZE) / PAGE_SIZE)
16-
#define PAGE_OFFSET_MASK ((PAGE_SIZE)-1)
16+
#define PAGE_OFFSET_MASK ((PAGE_SIZE) - 1)
1717
#define PAGE_FRAME_MASK (~(PAGE_OFFSET_MASK))
1818

1919
#define SR_OR(VAL, SHIFT) (((VAL) >> (SHIFT)) | VAL)
2020
/* Next Power Of Two */
21-
#define NPOT(VAL) \
22-
((SR_OR(((VAL)-1), 1) | SR_OR(SR_OR(((VAL)-1), 1), 2) | \
23-
SR_OR(SR_OR(SR_OR(((VAL)-1), 1), 2), 4) | \
24-
SR_OR(SR_OR(SR_OR(SR_OR(((VAL)-1), 1), 2), 4), 8) | \
25-
SR_OR(SR_OR(SR_OR(SR_OR(SR_OR(((VAL)-1), 1), 2), 4), 8), 16)) + \
21+
#define NPOT(VAL) \
22+
((SR_OR(((VAL) - 1), 1) | SR_OR(SR_OR(((VAL) - 1), 1), 2) | \
23+
SR_OR(SR_OR(SR_OR(((VAL) - 1), 1), 2), 4) | \
24+
SR_OR(SR_OR(SR_OR(SR_OR(((VAL) - 1), 1), 2), 4), 8) | \
25+
SR_OR(SR_OR(SR_OR(SR_OR(SR_OR(((VAL) - 1), 1), 2), 4), 8), 16)) + \
2626
1)
2727

2828
/* Previous Power Of Two */

0 commit comments

Comments
 (0)