Skip to content

Commit 3dceb8a

Browse files
committed
Merge tag 'for-linus' of https://github.com/openrisc/linux
Pull OpenRISC updates from Stafford Horne: - Fixes from me to cleanup all compiler warnings reported under arch/openrisc - One cleanup from Linus Walleij to convert pfn macros to static inlines * tag 'for-linus' of https://github.com/openrisc/linux: openrisc: Remove kernel-doc marker from ioremap comment openrisc: Remove unused tlb_init function openriac: Remove unused nommu_dump_state function openrisc: Include cpu.h and switch_to.h for prototypes openrisc: Add prototype for die to bug.h openrisc: Add prototype for show_registers to processor.h openrisc: Declare do_signal function as static openrisc: Add missing prototypes for assembly called fnctions openrisc: Make pfn accessors statics inlines
2 parents 3f86ed6 + c289330 commit 3dceb8a

File tree

13 files changed

+51
-93
lines changed

13 files changed

+51
-93
lines changed

arch/openrisc/include/asm/bug.h

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
/* SPDX-License-Identifier: GPL-2.0-only */
2+
#ifndef __ASM_OPENRISC_BUG_H
3+
#define __ASM_OPENRISC_BUG_H
4+
5+
#include <asm-generic/bug.h>
6+
7+
struct pt_regs;
8+
9+
void __noreturn die(const char *str, struct pt_regs *regs, long err);
10+
11+
#endif /* __ASM_OPENRISC_BUG_H */

arch/openrisc/include/asm/page.h

Lines changed: 9 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -72,8 +72,15 @@ typedef struct page *pgtable_t;
7272
#define __va(x) ((void *)((unsigned long)(x) + PAGE_OFFSET))
7373
#define __pa(x) ((unsigned long) (x) - PAGE_OFFSET)
7474

75-
#define virt_to_pfn(kaddr) (__pa(kaddr) >> PAGE_SHIFT)
76-
#define pfn_to_virt(pfn) __va((pfn) << PAGE_SHIFT)
75+
static inline unsigned long virt_to_pfn(const void *kaddr)
76+
{
77+
return __pa(kaddr) >> PAGE_SHIFT;
78+
}
79+
80+
static inline void * pfn_to_virt(unsigned long pfn)
81+
{
82+
return (void *)((unsigned long)__va(pfn) << PAGE_SHIFT);
83+
}
7784

7885
#define virt_to_page(addr) \
7986
(mem_map + (((unsigned long)(addr)-PAGE_OFFSET) >> PAGE_SHIFT))

arch/openrisc/include/asm/processor.h

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -73,6 +73,7 @@ struct thread_struct {
7373

7474
void start_thread(struct pt_regs *regs, unsigned long nip, unsigned long sp);
7575
unsigned long __get_wchan(struct task_struct *p);
76+
void show_registers(struct pt_regs *regs);
7677

7778
#define cpu_relax() barrier()
7879

arch/openrisc/kernel/process.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,7 @@
1414
*/
1515

1616
#define __KERNEL_SYSCALLS__
17+
#include <linux/cpu.h>
1718
#include <linux/errno.h>
1819
#include <linux/sched.h>
1920
#include <linux/sched/debug.h>
@@ -38,6 +39,7 @@
3839
#include <asm/io.h>
3940
#include <asm/processor.h>
4041
#include <asm/spr_defs.h>
42+
#include <asm/switch_to.h>
4143

4244
#include <linux/smp.h>
4345

@@ -119,8 +121,6 @@ void flush_thread(void)
119121

120122
void show_regs(struct pt_regs *regs)
121123
{
122-
extern void show_registers(struct pt_regs *regs);
123-
124124
show_regs_print_info(KERN_DEFAULT);
125125
/* __PHX__ cleanup this mess */
126126
show_registers(regs);

arch/openrisc/kernel/ptrace.c

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -27,6 +27,10 @@
2727
#include <asm/thread_info.h>
2828
#include <asm/page.h>
2929

30+
asmlinkage long do_syscall_trace_enter(struct pt_regs *regs);
31+
32+
asmlinkage void do_syscall_trace_leave(struct pt_regs *regs);
33+
3034
/*
3135
* Copy the thread state to a regset that can be interpreted by userspace.
3236
*

arch/openrisc/kernel/signal.c

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -34,6 +34,11 @@ struct rt_sigframe {
3434
unsigned char retcode[16]; /* trampoline code */
3535
};
3636

37+
asmlinkage long _sys_rt_sigreturn(struct pt_regs *regs);
38+
39+
asmlinkage int do_work_pending(struct pt_regs *regs, unsigned int thread_flags,
40+
int syscall);
41+
3742
static int restore_sigcontext(struct pt_regs *regs,
3843
struct sigcontext __user *sc)
3944
{
@@ -224,7 +229,7 @@ handle_signal(struct ksignal *ksig, struct pt_regs *regs)
224229
* mode below.
225230
*/
226231

227-
int do_signal(struct pt_regs *regs, int syscall)
232+
static int do_signal(struct pt_regs *regs, int syscall)
228233
{
229234
struct ksignal ksig;
230235
unsigned long continue_addr = 0;

arch/openrisc/kernel/smp.c

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -23,6 +23,8 @@
2323
#include <asm/cacheflush.h>
2424
#include <asm/time.h>
2525

26+
asmlinkage __init void secondary_start_kernel(void);
27+
2628
static void (*smp_cross_call)(const struct cpumask *, unsigned int);
2729

2830
unsigned long secondary_release = -1;

arch/openrisc/kernel/time.c

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -25,6 +25,8 @@
2525
#include <asm/cpuinfo.h>
2626
#include <asm/time.h>
2727

28+
irqreturn_t __irq_entry timer_interrupt(struct pt_regs *regs);
29+
2830
/* Test the timer ticks to count, used in sync routine */
2931
inline void openrisc_timer_set(unsigned long count)
3032
{

arch/openrisc/kernel/traps.c

Lines changed: 10 additions & 75 deletions
Original file line numberDiff line numberDiff line change
@@ -30,14 +30,23 @@
3030
#include <linux/kallsyms.h>
3131
#include <linux/uaccess.h>
3232

33+
#include <asm/bug.h>
3334
#include <asm/io.h>
35+
#include <asm/processor.h>
3436
#include <asm/unwinder.h>
3537
#include <asm/sections.h>
3638

37-
static int kstack_depth_to_print = 0x180;
3839
int lwa_flag;
3940
static unsigned long __user *lwa_addr;
4041

42+
asmlinkage void unhandled_exception(struct pt_regs *regs, int ea, int vector);
43+
asmlinkage void do_trap(struct pt_regs *regs, unsigned long address);
44+
asmlinkage void do_fpe_trap(struct pt_regs *regs, unsigned long address);
45+
asmlinkage void do_unaligned_access(struct pt_regs *regs, unsigned long address);
46+
asmlinkage void do_bus_fault(struct pt_regs *regs, unsigned long address);
47+
asmlinkage void do_illegal_instruction(struct pt_regs *regs,
48+
unsigned long address);
49+
4150
static void print_trace(void *data, unsigned long addr, int reliable)
4251
{
4352
const char *loglvl = data;
@@ -143,80 +152,6 @@ void show_registers(struct pt_regs *regs)
143152
printk("\n");
144153
}
145154

146-
void nommu_dump_state(struct pt_regs *regs,
147-
unsigned long ea, unsigned long vector)
148-
{
149-
int i;
150-
unsigned long addr, stack = regs->sp;
151-
152-
printk("\n\r[nommu_dump_state] :: ea %lx, vector %lx\n\r", ea, vector);
153-
154-
printk("CPU #: %d\n"
155-
" PC: %08lx SR: %08lx SP: %08lx\n",
156-
0, regs->pc, regs->sr, regs->sp);
157-
printk("GPR00: %08lx GPR01: %08lx GPR02: %08lx GPR03: %08lx\n",
158-
0L, regs->gpr[1], regs->gpr[2], regs->gpr[3]);
159-
printk("GPR04: %08lx GPR05: %08lx GPR06: %08lx GPR07: %08lx\n",
160-
regs->gpr[4], regs->gpr[5], regs->gpr[6], regs->gpr[7]);
161-
printk("GPR08: %08lx GPR09: %08lx GPR10: %08lx GPR11: %08lx\n",
162-
regs->gpr[8], regs->gpr[9], regs->gpr[10], regs->gpr[11]);
163-
printk("GPR12: %08lx GPR13: %08lx GPR14: %08lx GPR15: %08lx\n",
164-
regs->gpr[12], regs->gpr[13], regs->gpr[14], regs->gpr[15]);
165-
printk("GPR16: %08lx GPR17: %08lx GPR18: %08lx GPR19: %08lx\n",
166-
regs->gpr[16], regs->gpr[17], regs->gpr[18], regs->gpr[19]);
167-
printk("GPR20: %08lx GPR21: %08lx GPR22: %08lx GPR23: %08lx\n",
168-
regs->gpr[20], regs->gpr[21], regs->gpr[22], regs->gpr[23]);
169-
printk("GPR24: %08lx GPR25: %08lx GPR26: %08lx GPR27: %08lx\n",
170-
regs->gpr[24], regs->gpr[25], regs->gpr[26], regs->gpr[27]);
171-
printk("GPR28: %08lx GPR29: %08lx GPR30: %08lx GPR31: %08lx\n",
172-
regs->gpr[28], regs->gpr[29], regs->gpr[30], regs->gpr[31]);
173-
printk(" RES: %08lx oGPR11: %08lx\n",
174-
regs->gpr[11], regs->orig_gpr11);
175-
176-
printk("Process %s (pid: %d, stackpage=%08lx)\n",
177-
((struct task_struct *)(__pa(current)))->comm,
178-
((struct task_struct *)(__pa(current)))->pid,
179-
(unsigned long)current);
180-
181-
printk("\nStack: ");
182-
printk("Stack dump [0x%08lx]:\n", (unsigned long)stack);
183-
for (i = 0; i < kstack_depth_to_print; i++) {
184-
if (((long)stack & (THREAD_SIZE - 1)) == 0)
185-
break;
186-
stack++;
187-
188-
printk("%lx :: sp + %02d: 0x%08lx\n", stack, i * 4,
189-
*((unsigned long *)(__pa(stack))));
190-
}
191-
printk("\n");
192-
193-
printk("Call Trace: ");
194-
i = 1;
195-
while (((long)stack & (THREAD_SIZE - 1)) != 0) {
196-
addr = *((unsigned long *)__pa(stack));
197-
stack++;
198-
199-
if (kernel_text_address(addr)) {
200-
if (i && ((i % 6) == 0))
201-
printk("\n ");
202-
printk(" [<%08lx>]", addr);
203-
i++;
204-
}
205-
}
206-
printk("\n");
207-
208-
printk("\nCode: ");
209-
210-
for (i = -24; i < 24; i++) {
211-
unsigned long word;
212-
213-
word = ((unsigned long *)(__pa(regs->pc)))[i];
214-
215-
print_data(regs->pc, word, i);
216-
}
217-
printk("\n");
218-
}
219-
220155
/* This is normally the 'Oops' routine */
221156
void __noreturn die(const char *str, struct pt_regs *regs, long err)
222157
{

arch/openrisc/mm/fault.c

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,7 @@
1818
#include <linux/perf_event.h>
1919

2020
#include <linux/uaccess.h>
21+
#include <asm/bug.h>
2122
#include <asm/mmu_context.h>
2223
#include <asm/siginfo.h>
2324
#include <asm/signal.h>
@@ -30,7 +31,8 @@
3031
*/
3132
volatile pgd_t *current_pgd[NR_CPUS];
3233

33-
extern void __noreturn die(char *, struct pt_regs *, long);
34+
asmlinkage void do_page_fault(struct pt_regs *regs, unsigned long address,
35+
unsigned long vector, int write_acc);
3436

3537
/*
3638
* This routine handles page faults. It determines the address,

0 commit comments

Comments
 (0)