riscv: add prototypes for assembly language functions from head.S

Add prototypes for assembly language functions defined in head.S,
and include these prototypes into C source files that call those
functions.

This patch resolves the following warnings from sparse:

arch/riscv/kernel/setup.c:39:10: warning: symbol 'hart_lottery' was not declared. Should it be static?
arch/riscv/kernel/setup.c:42:13: warning: symbol 'parse_dtb' was not declared. Should it be static?
arch/riscv/kernel/smpboot.c:33:6: warning: symbol '__cpu_up_stack_pointer' was not declared. Should it be static?
arch/riscv/kernel/smpboot.c:34:6: warning: symbol '__cpu_up_task_pointer' was not declared. Should it be static?
arch/riscv/mm/fault.c:25:17: warning: symbol 'do_page_fault' was not declared. Should it be static?

This change should have no functional impact.

Signed-off-by: Paul Walmsley <paul.walmsley@sifive.com>
This commit is contained in:
Paul Walmsley 2019-10-17 15:00:17 -07:00
parent d6d5df1db6
commit ffaee2728f
5 changed files with 29 additions and 0 deletions

21
arch/riscv/kernel/head.h Normal file
View File

@ -0,0 +1,21 @@
/* SPDX-License-Identifier: GPL-2.0 */
/*
* Copyright (C) 2019 SiFive, Inc.
*/
#ifndef __ASM_HEAD_H
#define __ASM_HEAD_H
#include <linux/linkage.h>
#include <linux/init.h>
extern atomic_t hart_lottery;
asmlinkage void do_page_fault(struct pt_regs *regs);
asmlinkage void __init setup_vm(uintptr_t dtb_pa);
extern void *__cpu_up_stack_pointer[];
extern void *__cpu_up_task_pointer[];
void __init parse_dtb(void);
#endif /* __ASM_HEAD_H */

View File

@ -24,6 +24,8 @@
#include <asm/tlbflush.h>
#include <asm/thread_info.h>
#include "head.h"
#ifdef CONFIG_DUMMY_CONSOLE
struct screen_info screen_info = {
.orig_video_lines = 30,

View File

@ -30,6 +30,8 @@
#include <asm/sections.h>
#include <asm/sbi.h>
#include "head.h"
void *__cpu_up_stack_pointer[NR_CPUS];
void *__cpu_up_task_pointer[NR_CPUS];
static DECLARE_COMPLETION(cpu_running);

View File

@ -18,6 +18,8 @@
#include <asm/ptrace.h>
#include <asm/tlbflush.h>
#include "../kernel/head.h"
/*
* This routine handles page faults. It determines the address and the
* problem, and then passes it off to one of the appropriate routines.

View File

@ -19,6 +19,8 @@
#include <asm/pgtable.h>
#include <asm/io.h>
#include "../kernel/head.h"
unsigned long empty_zero_page[PAGE_SIZE / sizeof(unsigned long)]
__page_aligned_bss;
EXPORT_SYMBOL(empty_zero_page);