Skip to content

Commit

Permalink
kernel: fix build errors for clang
Browse files Browse the repository at this point in the history
  • Loading branch information
binarycraft007 committed Feb 28, 2024
1 parent be04c66 commit 1fa0dc9
Show file tree
Hide file tree
Showing 3 changed files with 13 additions and 5 deletions.
4 changes: 2 additions & 2 deletions kernel/include/cache.h
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,7 @@ enum dma_data_direction
static inline uint32_t current_el(void)
{
uint32_t el;
asm volatile("mrs %0, CurrentEL" : "=r"(el));
asm volatile("mrs %w0, CurrentEL" : "=r"(el));
return el >> 2;
}

Expand Down Expand Up @@ -115,4 +115,4 @@ void __dma_flush_range(unsigned long start, unsigned long end);
void __dma_map_area(unsigned long start, unsigned long size, enum dma_data_direction dir);
void __dma_unmap_area(unsigned long start, unsigned long size, enum dma_data_direction dir);

#endif
#endif
9 changes: 8 additions & 1 deletion kernel/linux/include/linux/rcupdate.h
Original file line number Diff line number Diff line change
Expand Up @@ -78,6 +78,7 @@ static inline void synchronize_rcu(void)
static inline unsigned long get_completed_synchronize_rcu(void)
{
kfunc_call(get_completed_synchronize_rcu)
return 0;
}
static inline void get_completed_synchronize_rcu_full(struct rcu_gp_oldstate *rgosp)
{
Expand Down Expand Up @@ -136,18 +137,22 @@ static inline void rcu_irq_work_resched(void)
static inline int rcu_read_lock_held(void)
{
kfunc_call(rcu_read_lock_held);
return 0;
}
static inline int rcu_read_lock_bh_held(void)
{
kfunc_call(rcu_read_lock_bh_held);
return 0;
}
static inline int rcu_read_lock_sched_held(void)
{
kfunc_call(rcu_read_lock_sched_held);
return 0;
}
static inline int rcu_read_lock_any_held(void)
{
kfunc_call(rcu_read_lock_any_held);
return 0;
}

static inline void rcu_init_nohz(void)
Expand All @@ -157,10 +162,12 @@ static inline void rcu_init_nohz(void)
static inline int rcu_nocb_cpu_offload(int cpu)
{
kfunc_call(rcu_nocb_cpu_offload, cpu);
return 0;
}
static inline int rcu_nocb_cpu_deoffload(int cpu)
{
kfunc_call(rcu_nocb_cpu_deoffload, cpu);
return 0;
}
static inline void rcu_nocb_flush_deferred_wakeup(void)
{
Expand Down Expand Up @@ -343,4 +350,4 @@ static inline bool rcu_head_after_call_rcu(struct rcu_head *rhp, rcu_callback_t
return false;
}

#endif
#endif
5 changes: 3 additions & 2 deletions kernel/patch/module/module.c
Original file line number Diff line number Diff line change
Expand Up @@ -175,6 +175,7 @@ static int simplify_symbols(struct module *mod, const struct load_info *info)
int ret = 0;

for (i = 1; i < symsec->sh_size / sizeof(Elf_Sym); i++) {
unsigned long addr;
const char *name = info->strtab + sym[i].st_name;
switch (sym[i].st_shndx) {
case SHN_COMMON:
Expand All @@ -186,7 +187,7 @@ static int simplify_symbols(struct module *mod, const struct load_info *info)
case SHN_ABS:
break;
case SHN_UNDEF:
unsigned long addr = symbol_lookup_name(name);
addr = symbol_lookup_name(name);
// kernel symbol cause overflow in relocation
// if (!addr) addr = kallsyms_lookup_name(name);
if (!addr) {
Expand Down Expand Up @@ -674,4 +675,4 @@ int module_init()
INIT_LIST_HEAD(&modules.list);
spin_lock_init(&module_lock);
return 0;
}
}

0 comments on commit 1fa0dc9

Please sign in to comment.