Skip to content

Commit 5fc2678

Browse files
miguelafsilva5DavidMCerdeira
authored andcommitted
fix: Add missing prototypes
The missing prototype error was being triggered due to one of the following: - the prototype was effectively missing; - the prototype was ill defined (mainly, no paramter function prototypes missed 'void' as paramter list; - the function did not have a prototype but did not require it. Mostly, because it was only used in the compilation unit - in this case to avoid, the error it must be defined as static; In some other cases these functions had a prototype defined which was not necessary and was thus removed. Signed-off-by: Miguel Silva <[email protected]>
1 parent eb64e58 commit 5fc2678

Some content is hidden

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

58 files changed

+194
-178
lines changed

src/arch/armv8/aarch32/aborts.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
* Copyright (c) Bao Project and Contributors. All rights reserved.
44
*/
55

6-
#include <bao.h>
6+
#include <arch/aborts.h>
77
#include <arch/sysregs.h>
88
#include <cpu.h>
99

src/arch/armv8/aarch64/aborts.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
* Copyright (c) Bao Project and Contributors. All rights reserved.
44
*/
55

6-
#include <bao.h>
6+
#include <arch/aborts.h>
77
#include <arch/sysregs.h>
88
#include <cpu.h>
99

src/arch/armv8/aborts.c

Lines changed: 7 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,8 @@
1414

1515
typedef void (*abort_handler_t)(unsigned long, unsigned long, unsigned long, unsigned long);
1616

17-
void aborts_data_lower(unsigned long iss, unsigned long far, unsigned long il, unsigned long ec)
17+
static void aborts_data_lower(unsigned long iss, unsigned long far, unsigned long il,
18+
unsigned long ec)
1819
{
1920
UNUSED_ARG(ec);
2021

@@ -52,7 +53,7 @@ void aborts_data_lower(unsigned long iss, unsigned long far, unsigned long il, u
5253
}
5354
}
5455

55-
long int standard_service_call(unsigned long _fn_num)
56+
static long int standard_service_call(unsigned long _fn_num)
5657
{
5758
UNUSED_ARG(_fn_num);
5859

@@ -99,12 +100,12 @@ static inline void syscall_handler(unsigned long iss, unsigned long far, unsigne
99100
vcpu_writereg(cpu()->vcpu, 0, (unsigned long)ret);
100101
}
101102

102-
void hvc_handler(unsigned long iss, unsigned long far, unsigned long il, unsigned long ec)
103+
static void hvc_handler(unsigned long iss, unsigned long far, unsigned long il, unsigned long ec)
103104
{
104105
syscall_handler(iss, far, il, ec);
105106
}
106107

107-
void smc_handler(unsigned long iss, unsigned long far, unsigned long il, unsigned long ec)
108+
static void smc_handler(unsigned long iss, unsigned long far, unsigned long il, unsigned long ec)
108109
{
109110
UNUSED_ARG(far);
110111

@@ -128,7 +129,7 @@ static regaddr_t reg_addr_translate(unsigned long iss)
128129
}
129130
}
130131

131-
void sysreg_handler(unsigned long iss, unsigned long far, unsigned long il, unsigned long ec)
132+
static void sysreg_handler(unsigned long iss, unsigned long far, unsigned long il, unsigned long ec)
132133
{
133134
UNUSED_ARG(far);
134135

@@ -174,7 +175,7 @@ abort_handler_t abort_handlers[64] = {
174175
[ESR_EC_HVC64] = hvc_handler,
175176
};
176177

177-
void aborts_sync_handler()
178+
void aborts_sync_handler(void)
178179
{
179180
unsigned long esr = sysreg_esr_el2_read();
180181
unsigned long far = sysreg_far_el2_read();

src/arch/armv8/armv8-a/aarch64/vmm.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@
77
#include <arch/sysregs.h>
88
#include <page_table.h>
99

10-
void vmm_arch_init_tcr()
10+
void vmm_arch_init_tcr(void)
1111
{
1212
/**
1313
* Check available physical address range which will limit IPA size. Patch 2-stage page table

src/arch/armv8/armv8-a/inc/arch/smmuv2.h

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -373,10 +373,10 @@ struct smmu_cntxt_hw {
373373

374374
typedef deviceid_t streamid_t;
375375

376-
void smmu_init();
376+
void smmu_init(void);
377377

378-
ssize_t smmu_alloc_ctxbnk();
379-
ssize_t smmu_alloc_sme();
378+
ssize_t smmu_alloc_ctxbnk(void);
379+
ssize_t smmu_alloc_sme(void);
380380
void smmu_write_ctxbnk(size_t ctx_id, paddr_t root_pt, asid_t vm_id);
381381
void smmu_write_sme(size_t sme, streamid_t mask, streamid_t id, bool group);
382382
void smmu_write_s2c(size_t sme, size_t ctx_id);

src/arch/armv8/armv8-a/iommu.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@
99
#include <mem.h>
1010
#include <config.h>
1111

12-
bool iommu_arch_init()
12+
bool iommu_arch_init(void)
1313
{
1414
if (cpu_is_master() && platform.arch.smmu.base) {
1515
smmu_init();

src/arch/armv8/armv8-a/psci.c

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -45,7 +45,7 @@ static void psci_restore_state()
4545
gicc_restore_state(&cpu()->arch.profile.psci_off_state.gicc_state);
4646
}
4747

48-
void psci_wake_from_powerdown()
48+
static void psci_wake_from_powerdown()
4949
{
5050
if (cpu()->vcpu == NULL) {
5151
ERROR("cpu woke up but theres no vcpu to run");
@@ -56,12 +56,12 @@ void psci_wake_from_powerdown()
5656
vcpu_run(cpu()->vcpu);
5757
}
5858

59-
void psci_wake_from_idle()
59+
static void psci_wake_from_idle()
6060
{
6161
cpu_idle_wakeup();
6262
}
6363

64-
void psci_wake_from_off();
64+
void psci_wake_from_off(void);
6565

6666
void (*psci_wake_handlers[PSCI_WAKEUP_NUM])(void) = {
6767
[PSCI_WAKEUP_CPU_OFF] = psci_wake_from_off,

src/arch/armv8/armv8-a/smmuv2.c

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -116,7 +116,7 @@ static void smmu_check_features()
116116
}
117117
}
118118

119-
void smmu_init()
119+
void smmu_init(void)
120120
{
121121
/*
122122
* Alloc pages for global address space.
@@ -178,7 +178,7 @@ void smmu_init()
178178
smmu.hw.glbl_rs0->CR0 = cr0;
179179
}
180180

181-
ssize_t smmu_alloc_ctxbnk()
181+
ssize_t smmu_alloc_ctxbnk(void)
182182
{
183183
spin_lock(&smmu.ctx_lock);
184184
/* Find a free context bank. */
@@ -243,7 +243,7 @@ void smmu_write_ctxbnk(size_t ctx_id, paddr_t root_pt, asid_t vm_id)
243243
spin_unlock(&smmu.ctx_lock);
244244
}
245245

246-
ssize_t smmu_alloc_sme()
246+
ssize_t smmu_alloc_sme(void)
247247
{
248248
spin_lock(&smmu.sme_lock);
249249
/* Find a free sme. */

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

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -167,7 +167,7 @@ static mpid_t mpu_entry_allocate()
167167
return reg_num;
168168
}
169169

170-
bool mem_region_get_overlap(struct mp_region* reg1, struct mp_region* reg2,
170+
static bool mem_region_get_overlap(struct mp_region* reg1, struct mp_region* reg2,
171171
struct mp_region* overlap)
172172
{
173173
bool regions_overlap = mem_regions_overlap(reg1, reg2);
@@ -541,7 +541,7 @@ bool mpu_unmap(priv_t priv, struct mp_region* mpr)
541541
return size_left == 0;
542542
}
543543

544-
void mpu_init()
544+
void mpu_init(void)
545545
{
546546
bitmap_clear_consecutive(cpu()->arch.profile.mpu.bitmap, 0, mpu_num_entries());
547547
list_init(&cpu()->arch.profile.mpu.order.list);

src/arch/armv8/asm_defs.c

Lines changed: 3 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -8,8 +8,7 @@
88
#include <vm.h>
99
#include <platform.h>
1010

11-
void cpu_defines() __attribute__((used));
12-
void cpu_defines()
11+
__attribute__((used)) static void cpu_defines()
1312
{
1413
DEFINE_SIZE(CPU_SIZE, struct cpu);
1514

@@ -19,16 +18,14 @@ void cpu_defines()
1918
DEFINE_OFFSET(CPU_VCPU_OFF, struct cpu, vcpu);
2019
}
2120

22-
void vcpu_defines() __attribute__((used));
23-
void vcpu_defines()
21+
__attribute__((used)) static void vcpu_defines()
2422
{
2523
DEFINE_SIZE(VCPU_ARCH_SIZE, struct vcpu_arch);
2624
DEFINE_OFFSET(VCPU_REGS_OFF, struct vcpu, regs);
2725
DEFINE_SIZE(VCPU_REGS_SIZE, struct arch_regs);
2826
}
2927

30-
void platform_defines() __attribute__((used));
31-
void platform_defines()
28+
__attribute__((used)) static void platform_defines()
3229
{
3330
DEFINE_OFFSET(PLAT_CPUNUM_OFF, struct platform, cpu_num);
3431
DEFINE_OFFSET(PLAT_ARCH_OFF, struct platform, arch);

0 commit comments

Comments
 (0)