Commit 3b62de26 authored by Palmer Dabbelt's avatar Palmer Dabbelt

RISC-V: Fixes for clean allmodconfig build

Olaf said: Here's a short series of patches that produces a working
allmodconfig. Would be nice to see them go in so we can add build
coverage.

I've dropped patches 8 and 10 from the original set:

* [PATCH 08/10] (RISC-V: Set __ARCH_WANT_RENAMEAT to pick up generic
  version) has a better fix that I've sent out for review, we don't want
  renameat.
* [PATCH 10/10] (input: joystick: riscv has get_cycles) has already been
  taken into Dmitry Torokhov's tree.
parents 185e788c 741fc3ff
...@@ -40,6 +40,7 @@ generic-y += resource.h ...@@ -40,6 +40,7 @@ generic-y += resource.h
generic-y += scatterlist.h generic-y += scatterlist.h
generic-y += sections.h generic-y += sections.h
generic-y += sembuf.h generic-y += sembuf.h
generic-y += serial.h
generic-y += setup.h generic-y += setup.h
generic-y += shmbuf.h generic-y += shmbuf.h
generic-y += shmparam.h generic-y += shmparam.h
......
...@@ -58,17 +58,17 @@ ...@@ -58,17 +58,17 @@
#endif #endif
#if (__SIZEOF_INT__ == 4) #if (__SIZEOF_INT__ == 4)
#define INT __ASM_STR(.word) #define RISCV_INT __ASM_STR(.word)
#define SZINT __ASM_STR(4) #define RISCV_SZINT __ASM_STR(4)
#define LGINT __ASM_STR(2) #define RISCV_LGINT __ASM_STR(2)
#else #else
#error "Unexpected __SIZEOF_INT__" #error "Unexpected __SIZEOF_INT__"
#endif #endif
#if (__SIZEOF_SHORT__ == 2) #if (__SIZEOF_SHORT__ == 2)
#define SHORT __ASM_STR(.half) #define RISCV_SHORT __ASM_STR(.half)
#define SZSHORT __ASM_STR(2) #define RISCV_SZSHORT __ASM_STR(2)
#define LGSHORT __ASM_STR(1) #define RISCV_LGSHORT __ASM_STR(1)
#else #else
#error "Unexpected __SIZEOF_SHORT__" #error "Unexpected __SIZEOF_SHORT__"
#endif #endif
......
...@@ -27,8 +27,8 @@ ...@@ -27,8 +27,8 @@
typedef u32 bug_insn_t; typedef u32 bug_insn_t;
#ifdef CONFIG_GENERIC_BUG_RELATIVE_POINTERS #ifdef CONFIG_GENERIC_BUG_RELATIVE_POINTERS
#define __BUG_ENTRY_ADDR INT " 1b - 2b" #define __BUG_ENTRY_ADDR RISCV_INT " 1b - 2b"
#define __BUG_ENTRY_FILE INT " %0 - 2b" #define __BUG_ENTRY_FILE RISCV_INT " %0 - 2b"
#else #else
#define __BUG_ENTRY_ADDR RISCV_PTR " 1b" #define __BUG_ENTRY_ADDR RISCV_PTR " 1b"
#define __BUG_ENTRY_FILE RISCV_PTR " %0" #define __BUG_ENTRY_FILE RISCV_PTR " %0"
...@@ -38,7 +38,7 @@ typedef u32 bug_insn_t; ...@@ -38,7 +38,7 @@ typedef u32 bug_insn_t;
#define __BUG_ENTRY \ #define __BUG_ENTRY \
__BUG_ENTRY_ADDR "\n\t" \ __BUG_ENTRY_ADDR "\n\t" \
__BUG_ENTRY_FILE "\n\t" \ __BUG_ENTRY_FILE "\n\t" \
SHORT " %1" RISCV_SHORT " %1"
#else #else
#define __BUG_ENTRY \ #define __BUG_ENTRY \
__BUG_ENTRY_ADDR __BUG_ENTRY_ADDR
......
...@@ -19,6 +19,8 @@ ...@@ -19,6 +19,8 @@
#ifndef _ASM_RISCV_IO_H #ifndef _ASM_RISCV_IO_H
#define _ASM_RISCV_IO_H #define _ASM_RISCV_IO_H
#include <linux/types.h>
#ifdef CONFIG_MMU #ifdef CONFIG_MMU
extern void __iomem *ioremap(phys_addr_t offset, unsigned long size); extern void __iomem *ioremap(phys_addr_t offset, unsigned long size);
...@@ -32,7 +34,7 @@ extern void __iomem *ioremap(phys_addr_t offset, unsigned long size); ...@@ -32,7 +34,7 @@ extern void __iomem *ioremap(phys_addr_t offset, unsigned long size);
#define ioremap_wc(addr, size) ioremap((addr), (size)) #define ioremap_wc(addr, size) ioremap((addr), (size))
#define ioremap_wt(addr, size) ioremap((addr), (size)) #define ioremap_wt(addr, size) ioremap((addr), (size))
extern void iounmap(void __iomem *addr); extern void iounmap(volatile void __iomem *addr);
#endif /* CONFIG_MMU */ #endif /* CONFIG_MMU */
...@@ -266,9 +268,9 @@ __io_reads_ins(reads, u32, l, __io_br(), __io_ar()) ...@@ -266,9 +268,9 @@ __io_reads_ins(reads, u32, l, __io_br(), __io_ar())
__io_reads_ins(ins, u8, b, __io_pbr(), __io_par()) __io_reads_ins(ins, u8, b, __io_pbr(), __io_par())
__io_reads_ins(ins, u16, w, __io_pbr(), __io_par()) __io_reads_ins(ins, u16, w, __io_pbr(), __io_par())
__io_reads_ins(ins, u32, l, __io_pbr(), __io_par()) __io_reads_ins(ins, u32, l, __io_pbr(), __io_par())
#define insb(addr, buffer, count) __insb((void __iomem *)addr, buffer, count) #define insb(addr, buffer, count) __insb((void __iomem *)(long)addr, buffer, count)
#define insw(addr, buffer, count) __insw((void __iomem *)addr, buffer, count) #define insw(addr, buffer, count) __insw((void __iomem *)(long)addr, buffer, count)
#define insl(addr, buffer, count) __insl((void __iomem *)addr, buffer, count) #define insl(addr, buffer, count) __insl((void __iomem *)(long)addr, buffer, count)
__io_writes_outs(writes, u8, b, __io_bw(), __io_aw()) __io_writes_outs(writes, u8, b, __io_bw(), __io_aw())
__io_writes_outs(writes, u16, w, __io_bw(), __io_aw()) __io_writes_outs(writes, u16, w, __io_bw(), __io_aw())
...@@ -280,9 +282,9 @@ __io_writes_outs(writes, u32, l, __io_bw(), __io_aw()) ...@@ -280,9 +282,9 @@ __io_writes_outs(writes, u32, l, __io_bw(), __io_aw())
__io_writes_outs(outs, u8, b, __io_pbw(), __io_paw()) __io_writes_outs(outs, u8, b, __io_pbw(), __io_paw())
__io_writes_outs(outs, u16, w, __io_pbw(), __io_paw()) __io_writes_outs(outs, u16, w, __io_pbw(), __io_paw())
__io_writes_outs(outs, u32, l, __io_pbw(), __io_paw()) __io_writes_outs(outs, u32, l, __io_pbw(), __io_paw())
#define outsb(addr, buffer, count) __outsb((void __iomem *)addr, buffer, count) #define outsb(addr, buffer, count) __outsb((void __iomem *)(long)addr, buffer, count)
#define outsw(addr, buffer, count) __outsw((void __iomem *)addr, buffer, count) #define outsw(addr, buffer, count) __outsw((void __iomem *)(long)addr, buffer, count)
#define outsl(addr, buffer, count) __outsl((void __iomem *)addr, buffer, count) #define outsl(addr, buffer, count) __outsl((void __iomem *)(long)addr, buffer, count)
#ifdef CONFIG_64BIT #ifdef CONFIG_64BIT
__io_reads_ins(reads, u64, q, __io_br(), __io_ar()) __io_reads_ins(reads, u64, q, __io_br(), __io_ar())
......
...@@ -15,6 +15,7 @@ ...@@ -15,6 +15,7 @@
#ifndef _ASM_RISCV_MMU_CONTEXT_H #ifndef _ASM_RISCV_MMU_CONTEXT_H
#define _ASM_RISCV_MMU_CONTEXT_H #define _ASM_RISCV_MMU_CONTEXT_H
#include <linux/mm_types.h>
#include <asm-generic/mm_hooks.h> #include <asm-generic/mm_hooks.h>
#include <linux/mm.h> #include <linux/mm.h>
......
...@@ -18,7 +18,7 @@ ...@@ -18,7 +18,7 @@
typedef unsigned long cycles_t; typedef unsigned long cycles_t;
static inline cycles_t get_cycles(void) static inline cycles_t get_cycles_inline(void)
{ {
cycles_t n; cycles_t n;
...@@ -27,6 +27,7 @@ static inline cycles_t get_cycles(void) ...@@ -27,6 +27,7 @@ static inline cycles_t get_cycles(void)
: "=r" (n)); : "=r" (n));
return n; return n;
} }
#define get_cycles get_cycles_inline
#ifdef CONFIG_64BIT #ifdef CONFIG_64BIT
static inline uint64_t get_cycles64(void) static inline uint64_t get_cycles64(void)
......
...@@ -152,6 +152,3 @@ END(_start) ...@@ -152,6 +152,3 @@ END(_start)
__PAGE_ALIGNED_BSS __PAGE_ALIGNED_BSS
/* Empty zero page */ /* Empty zero page */
.balign PAGE_SIZE .balign PAGE_SIZE
ENTRY(empty_zero_page)
.fill (empty_zero_page + PAGE_SIZE) - ., 1, 0x00
END(empty_zero_page)
...@@ -12,4 +12,7 @@ ...@@ -12,4 +12,7 @@
/* /*
* Assembly functions that may be used (directly or indirectly) by modules * Assembly functions that may be used (directly or indirectly) by modules
*/ */
EXPORT_SYMBOL(__clear_user);
EXPORT_SYMBOL(__copy_user); EXPORT_SYMBOL(__copy_user);
EXPORT_SYMBOL(memset);
EXPORT_SYMBOL(memcpy);
...@@ -58,7 +58,12 @@ static char __initdata builtin_cmdline[COMMAND_LINE_SIZE] = CONFIG_CMDLINE; ...@@ -58,7 +58,12 @@ static char __initdata builtin_cmdline[COMMAND_LINE_SIZE] = CONFIG_CMDLINE;
#endif /* CONFIG_CMDLINE_BOOL */ #endif /* CONFIG_CMDLINE_BOOL */
unsigned long va_pa_offset; unsigned long va_pa_offset;
EXPORT_SYMBOL(va_pa_offset);
unsigned long pfn_base; unsigned long pfn_base;
EXPORT_SYMBOL(pfn_base);
unsigned long empty_zero_page[PAGE_SIZE / sizeof(unsigned long)] __page_aligned_bss;
EXPORT_SYMBOL(empty_zero_page);
/* The lucky hart to first increment this variable will boot the other cores */ /* The lucky hart to first increment this variable will boot the other cores */
atomic_t hart_lottery; atomic_t hart_lottery;
......
...@@ -38,6 +38,13 @@ enum ipi_message_type { ...@@ -38,6 +38,13 @@ enum ipi_message_type {
IPI_MAX IPI_MAX
}; };
/* Unsupported */
int setup_profiling_timer(unsigned int multiplier)
{
return -EINVAL;
}
irqreturn_t handle_ipi(void) irqreturn_t handle_ipi(void)
{ {
unsigned long *pending_ipis = &ipi_data[smp_processor_id()].bits; unsigned long *pending_ipis = &ipi_data[smp_processor_id()].bits;
......
...@@ -84,6 +84,7 @@ void __delay(unsigned long cycles) ...@@ -84,6 +84,7 @@ void __delay(unsigned long cycles)
while ((unsigned long)(get_cycles() - t0) < cycles) while ((unsigned long)(get_cycles() - t0) < cycles)
cpu_relax(); cpu_relax();
} }
EXPORT_SYMBOL(__delay);
void udelay(unsigned long usecs) void udelay(unsigned long usecs)
{ {
......
...@@ -85,7 +85,7 @@ EXPORT_SYMBOL(ioremap); ...@@ -85,7 +85,7 @@ EXPORT_SYMBOL(ioremap);
* *
* Caller must ensure there is only one unmapping for the same pointer. * Caller must ensure there is only one unmapping for the same pointer.
*/ */
void iounmap(void __iomem *addr) void iounmap(volatile void __iomem *addr)
{ {
vunmap((void *)((unsigned long)addr & PAGE_MASK)); vunmap((void *)((unsigned long)addr & PAGE_MASK));
} }
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment