[ci] open ci check with function declaration warning (#8546)

This commit is contained in:
Yuqiang Wang 2024-02-21 11:45:04 +08:00 committed by GitHub
parent 52a5b5cc48
commit c6bdee3c50
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
22 changed files with 49 additions and 44 deletions

View File

@ -67,8 +67,6 @@ static void __rt_assert_handler(const char *ex_string, const char *func, rt_size
//BSP的C入口 //BSP的C入口
void primary_cpu_entry(void) void primary_cpu_entry(void)
{ {
extern void entry(void);
//初始化BSS //初始化BSS
init_bss(); init_bss();
//关中断 //关中断

View File

@ -74,8 +74,6 @@ static void __rt_assert_handler(const char *ex_string, const char *func, rt_size
// BSP的C入口 // BSP的C入口
void primary_cpu_entry(void) void primary_cpu_entry(void)
{ {
extern void entry(void);
// 关中断 // 关中断
rt_hw_interrupt_disable(); rt_hw_interrupt_disable();
rt_assert_set_hook(__rt_assert_handler); rt_assert_set_hook(__rt_assert_handler);

View File

@ -53,8 +53,6 @@ static void __rt_assert_handler(const char *ex_string, const char *func, rt_size
void primary_cpu_entry(void) void primary_cpu_entry(void)
{ {
extern void entry(void);
/* disable global interrupt */ /* disable global interrupt */
rt_hw_interrupt_disable(); rt_hw_interrupt_disable();
rt_assert_set_hook(__rt_assert_handler); rt_assert_set_hook(__rt_assert_handler);

View File

@ -53,8 +53,6 @@ static void __rt_assert_handler(const char *ex_string, const char *func, rt_size
void primary_cpu_entry(void) void primary_cpu_entry(void)
{ {
extern void entry(void);
/* disable global interrupt */ /* disable global interrupt */
rt_hw_interrupt_disable(); rt_hw_interrupt_disable();
rt_assert_set_hook(__rt_assert_handler); rt_assert_set_hook(__rt_assert_handler);

View File

@ -34,8 +34,6 @@ void init_bss(void)
void primary_cpu_entry(void) void primary_cpu_entry(void)
{ {
extern void entry(void);
/* disable global interrupt */ /* disable global interrupt */
init_bss(); init_bss();
rt_hw_interrupt_disable(); rt_hw_interrupt_disable();

View File

@ -44,8 +44,6 @@ struct mem_desc platform_mem_desc[] = {
void primary_cpu_entry(void) void primary_cpu_entry(void)
{ {
extern void entry(void);
/* disable global interrupt */ /* disable global interrupt */
rt_hw_interrupt_disable(); rt_hw_interrupt_disable();

View File

@ -23,8 +23,8 @@
/* syscall handlers */ /* syscall handlers */
void arch_clone_exit(void); void arch_clone_exit(void);
void arch_fork_exit(void); void arch_fork_exit(void);
void arch_syscall_exit(); void arch_syscall_exit(void);
void arch_ret_to_user(); void arch_ret_to_user(void);
/* ELF relocation */ /* ELF relocation */
#ifdef ARCH_MM_MMU #ifdef ARCH_MM_MMU

View File

@ -134,7 +134,7 @@ rt_isr_handler_t rt_hw_interrupt_install(int vector,
const char *name); const char *name);
#ifdef RT_USING_SMP #ifdef RT_USING_SMP
rt_base_t rt_hw_local_irq_disable(); rt_base_t rt_hw_local_irq_disable(void);
void rt_hw_local_irq_enable(rt_base_t level); void rt_hw_local_irq_enable(rt_base_t level);
rt_base_t rt_cpus_lock(void); rt_base_t rt_cpus_lock(void);
@ -235,9 +235,9 @@ void rt_hw_secondary_cpu_idle_exec(void);
#endif #endif
#ifndef RT_USING_CACHE #ifndef RT_USING_CACHE
#define rt_hw_isb() #define rt_hw_isb(void)
#define rt_hw_dmb() #define rt_hw_dmb(void)
#define rt_hw_dsb() #define rt_hw_dsb(void)
#endif #endif
#ifdef __cplusplus #ifdef __cplusplus

View File

@ -42,6 +42,10 @@
extern "C" { extern "C" {
#endif #endif
#ifdef __GNUC__
int entry(void);
#endif
/** /**
* @addtogroup KernelObject * @addtogroup KernelObject
* @{ * @{
@ -207,6 +211,7 @@ void rt_system_scheduler_init(void);
void rt_system_scheduler_start(void); void rt_system_scheduler_start(void);
void rt_schedule(void); void rt_schedule(void);
void rt_scheduler_do_irq_switch(void *context);
void rt_schedule_insert_thread(struct rt_thread *thread); void rt_schedule_insert_thread(struct rt_thread *thread);
void rt_schedule_remove_thread(struct rt_thread *thread); void rt_schedule_remove_thread(struct rt_thread *thread);
@ -334,6 +339,15 @@ void rt_memheap_info(struct rt_memheap *heap,
rt_size_t *max_used); rt_size_t *max_used);
#endif /* RT_USING_MEMHEAP */ #endif /* RT_USING_MEMHEAP */
#ifdef RT_USING_MEMHEAP_AS_HEAP
/**
* memory heap as heap
*/
void *_memheap_alloc(struct rt_memheap *heap, rt_size_t size);
void _memheap_free(void *rmem);
void *_memheap_realloc(struct rt_memheap *heap, void *rmem, rt_size_t newsize);
#endif
#ifdef RT_USING_SLAB #ifdef RT_USING_SLAB
/** /**
* slab object interface * slab object interface
@ -664,6 +678,8 @@ void rt_cpus_unlock(rt_base_t level);
struct rt_cpu *rt_cpu_self(void); struct rt_cpu *rt_cpu_self(void);
struct rt_cpu *rt_cpu_index(int index); struct rt_cpu *rt_cpu_index(int index);
void rt_cpus_lock_status_restore(struct rt_thread *thread);
#endif /* RT_USING_SMP */ #endif /* RT_USING_SMP */
/* /*

View File

@ -602,6 +602,13 @@ static int _map_single_page_2M(unsigned long *lv0_tbl, unsigned long va,
return 0; return 0;
} }
void *rt_hw_mmu_tbl_get()
{
uintptr_t tbl;
__asm__ volatile("MRS %0, TTBR0_EL1" : "=r"(tbl));
return rt_kmem_p2v((void *)(tbl & ((1ul << 48) - 2)));
}
void *rt_ioremap_early(void *paddr, size_t size) void *rt_ioremap_early(void *paddr, size_t size)
{ {
volatile size_t count; volatile size_t count;

View File

@ -109,13 +109,7 @@ void rt_hw_mmu_kernel_map_init(struct rt_aspace *aspace, rt_size_t vaddr_start,
rt_size_t size); rt_size_t size);
void *rt_hw_mmu_pgtbl_create(void); void *rt_hw_mmu_pgtbl_create(void);
void rt_hw_mmu_pgtbl_delete(void *pgtbl); void rt_hw_mmu_pgtbl_delete(void *pgtbl);
void *rt_hw_mmu_tbl_get(void);
rt_inline void *rt_hw_mmu_tbl_get()
{
uintptr_t tbl;
__asm__ volatile("MRS %0, TTBR0_EL1" : "=r"(tbl));
return rt_kmem_p2v((void *)(tbl & ((1ul << 48) - 2)));
}
static inline void *rt_hw_mmu_kernel_v2p(void *v_addr) static inline void *rt_hw_mmu_kernel_v2p(void *v_addr)
{ {

View File

@ -122,7 +122,7 @@ void rt_hw_mmu_switch(void *tbl);
void *rt_hw_mmu_v2p(struct rt_aspace *aspace, void *vaddr); void *rt_hw_mmu_v2p(struct rt_aspace *aspace, void *vaddr);
void rt_hw_mmu_kernel_map_init(struct rt_aspace *aspace, size_t vaddr_start, size_t size); void rt_hw_mmu_kernel_map_init(struct rt_aspace *aspace, size_t vaddr_start, size_t size);
void *rt_hw_mmu_tbl_get(); void *rt_hw_mmu_tbl_get(void);
int rt_hw_mmu_control(struct rt_aspace *aspace, void *vaddr, size_t size, enum rt_mmu_cntl cmd); int rt_hw_mmu_control(struct rt_aspace *aspace, void *vaddr, size_t size, enum rt_mmu_cntl cmd);

View File

@ -39,17 +39,17 @@
#ifndef __ASSEMBLY__ #ifndef __ASSEMBLY__
#include <rtdef.h> #include <rtdef.h>
rt_inline void rt_hw_dsb() rt_inline void rt_hw_dsb(void)
{ {
__asm__ volatile("fence":::"memory"); __asm__ volatile("fence":::"memory");
} }
rt_inline void rt_hw_dmb() rt_inline void rt_hw_dmb(void)
{ {
__asm__ volatile("fence":::"memory"); __asm__ volatile("fence":::"memory");
} }
rt_inline void rt_hw_isb() rt_inline void rt_hw_isb(void)
{ {
__asm__ volatile(OPC_FENCE_I:::"memory"); __asm__ volatile(OPC_FENCE_I:::"memory");
} }

View File

@ -56,7 +56,7 @@ struct mem_desc
#define MMU_MAP_ERROR_NOPAGE -3 #define MMU_MAP_ERROR_NOPAGE -3
#define MMU_MAP_ERROR_CONFLICT -4 #define MMU_MAP_ERROR_CONFLICT -4
void *rt_hw_mmu_tbl_get(); void *rt_hw_mmu_tbl_get(void);
int rt_hw_mmu_map_init(rt_aspace_t aspace, void *v_address, rt_size_t size, int rt_hw_mmu_map_init(rt_aspace_t aspace, void *v_address, rt_size_t size,
rt_size_t *vtable, rt_size_t pv_off); rt_size_t *vtable, rt_size_t pv_off);
void rt_hw_mmu_setup(rt_aspace_t aspace, struct mem_desc *mdesc, int desc_nr); void rt_hw_mmu_setup(rt_aspace_t aspace, struct mem_desc *mdesc, int desc_nr);

View File

@ -18,12 +18,12 @@
#include "riscv_mmu.h" #include "riscv_mmu.h"
void mmu_enable_user_page_access() void mmu_enable_user_page_access(void)
{ {
set_csr(sstatus,SSTATUS_SUM); set_csr(sstatus,SSTATUS_SUM);
} }
void mmu_disable_user_page_access() void mmu_disable_user_page_access(void)
{ {
clear_csr(sstatus,SSTATUS_SUM); clear_csr(sstatus,SSTATUS_SUM);
} }

View File

@ -108,8 +108,8 @@
#define ARCH_MAP_FAILED ((void *)0x8000000000000000) #define ARCH_MAP_FAILED ((void *)0x8000000000000000)
void mmu_set_pagetable(rt_ubase_t addr); void mmu_set_pagetable(rt_ubase_t addr);
void mmu_enable_user_page_access(); void mmu_enable_user_page_access(void);
void mmu_disable_user_page_access(); void mmu_disable_user_page_access(void);
#define RT_HW_MMU_PROT_READ 1 #define RT_HW_MMU_PROT_READ 1
#define RT_HW_MMU_PROT_WRITE 2 #define RT_HW_MMU_PROT_WRITE 2

View File

@ -61,17 +61,17 @@ typedef union {
#ifndef __ASSEMBLY__ #ifndef __ASSEMBLY__
#include <rtdef.h> #include <rtdef.h>
rt_inline void rt_hw_dsb() rt_inline void rt_hw_dsb(void)
{ {
asm volatile("fence":::"memory"); asm volatile("fence":::"memory");
} }
rt_inline void rt_hw_dmb() rt_inline void rt_hw_dmb(void)
{ {
asm volatile("fence":::"memory"); asm volatile("fence":::"memory");
} }
rt_inline void rt_hw_isb() rt_inline void rt_hw_isb(void)
{ {
asm volatile(".long 0x0000100F":::"memory"); asm volatile(".long 0x0000100F":::"memory");
} }

View File

@ -56,7 +56,7 @@ struct mem_desc
#define MMU_MAP_ERROR_NOPAGE -3 #define MMU_MAP_ERROR_NOPAGE -3
#define MMU_MAP_ERROR_CONFLICT -4 #define MMU_MAP_ERROR_CONFLICT -4
void *rt_hw_mmu_tbl_get(); void *rt_hw_mmu_tbl_get(void);
int rt_hw_mmu_map_init(rt_aspace_t aspace, void *v_address, rt_size_t size, int rt_hw_mmu_map_init(rt_aspace_t aspace, void *v_address, rt_size_t size,
rt_size_t *vtable, rt_size_t pv_off); rt_size_t *vtable, rt_size_t pv_off);
void rt_hw_mmu_setup(rt_aspace_t aspace, struct mem_desc *mdesc, int desc_nr); void rt_hw_mmu_setup(rt_aspace_t aspace, struct mem_desc *mdesc, int desc_nr);

View File

@ -18,12 +18,12 @@
#include "riscv_mmu.h" #include "riscv_mmu.h"
void mmu_enable_user_page_access() void mmu_enable_user_page_access(void)
{ {
set_csr(sstatus, SSTATUS_SUM); set_csr(sstatus, SSTATUS_SUM);
} }
void mmu_disable_user_page_access() void mmu_disable_user_page_access(void)
{ {
clear_csr(sstatus, SSTATUS_SUM); clear_csr(sstatus, SSTATUS_SUM);
} }

View File

@ -91,8 +91,8 @@
#define ARCH_MAP_FAILED ((void *)0x8000000000000000) #define ARCH_MAP_FAILED ((void *)0x8000000000000000)
void mmu_set_pagetable(rt_ubase_t addr); void mmu_set_pagetable(rt_ubase_t addr);
void mmu_enable_user_page_access(); void mmu_enable_user_page_access(void);
void mmu_disable_user_page_access(); void mmu_disable_user_page_access(void);
#define RT_HW_MMU_PROT_READ 1 #define RT_HW_MMU_PROT_READ 1
#define RT_HW_MMU_PROT_WRITE 2 #define RT_HW_MMU_PROT_WRITE 2

View File

@ -38,7 +38,7 @@ if rtconfig.PLATFORM in GetGCCLikePLATFORM():
LOCAL_CFLAGS += ' -Warray-bounds -Wuninitialized' # memory access warning LOCAL_CFLAGS += ' -Warray-bounds -Wuninitialized' # memory access warning
LOCAL_CFLAGS += ' -Wreturn-type -Wcomment -Wswitch' # code style warning LOCAL_CFLAGS += ' -Wreturn-type -Wcomment -Wswitch' # code style warning
LOCAL_CFLAGS += ' -Wparentheses -Wlogical-op ' # operation warning LOCAL_CFLAGS += ' -Wparentheses -Wlogical-op ' # operation warning
# LOCAL_CFLAGS += ' -Wmissing-declarations -Wmissing-prototypes -Wstrict-prototypes' # function declaration warning LOCAL_CFLAGS += ' -Wmissing-declarations -Wmissing-prototypes -Wstrict-prototypes' # function declaration warning
if 'mips' not in rtconfig.PREFIX: # mips toolchain does not support if 'mips' not in rtconfig.PREFIX: # mips toolchain does not support
LOCAL_CFLAGS += ' -Wimplicit-fallthrough' # implicit fallthrough warning LOCAL_CFLAGS += ' -Wimplicit-fallthrough' # implicit fallthrough warning
LOCAL_CFLAGS += ' -Wduplicated-cond -Wduplicated-branches' # duplicated condition warning LOCAL_CFLAGS += ' -Wduplicated-cond -Wduplicated-branches' # duplicated condition warning

View File

@ -94,7 +94,7 @@ RTM_EXPORT(rt_spin_unlock)
*/ */
rt_base_t rt_spin_lock_irqsave(struct rt_spinlock *lock) rt_base_t rt_spin_lock_irqsave(struct rt_spinlock *lock)
{ {
unsigned long level; rt_base_t level;
level = rt_hw_local_irq_disable(); level = rt_hw_local_irq_disable();
rt_enter_critical(); rt_enter_critical();