Skip to content

Commit 3b62de2

Browse files
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.
2 parents 185e788 + 741fc3f commit 3b62de2

File tree

12 files changed

+39
-21
lines changed

12 files changed

+39
-21
lines changed

arch/riscv/include/asm/Kbuild

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -40,6 +40,7 @@ generic-y += resource.h
4040
generic-y += scatterlist.h
4141
generic-y += sections.h
4242
generic-y += sembuf.h
43+
generic-y += serial.h
4344
generic-y += setup.h
4445
generic-y += shmbuf.h
4546
generic-y += shmparam.h

arch/riscv/include/asm/asm.h

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -58,17 +58,17 @@
5858
#endif
5959

6060
#if (__SIZEOF_INT__ == 4)
61-
#define INT __ASM_STR(.word)
62-
#define SZINT __ASM_STR(4)
63-
#define LGINT __ASM_STR(2)
61+
#define RISCV_INT __ASM_STR(.word)
62+
#define RISCV_SZINT __ASM_STR(4)
63+
#define RISCV_LGINT __ASM_STR(2)
6464
#else
6565
#error "Unexpected __SIZEOF_INT__"
6666
#endif
6767

6868
#if (__SIZEOF_SHORT__ == 2)
69-
#define SHORT __ASM_STR(.half)
70-
#define SZSHORT __ASM_STR(2)
71-
#define LGSHORT __ASM_STR(1)
69+
#define RISCV_SHORT __ASM_STR(.half)
70+
#define RISCV_SZSHORT __ASM_STR(2)
71+
#define RISCV_LGSHORT __ASM_STR(1)
7272
#else
7373
#error "Unexpected __SIZEOF_SHORT__"
7474
#endif

arch/riscv/include/asm/bug.h

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -27,8 +27,8 @@
2727
typedef u32 bug_insn_t;
2828

2929
#ifdef CONFIG_GENERIC_BUG_RELATIVE_POINTERS
30-
#define __BUG_ENTRY_ADDR INT " 1b - 2b"
31-
#define __BUG_ENTRY_FILE INT " %0 - 2b"
30+
#define __BUG_ENTRY_ADDR RISCV_INT " 1b - 2b"
31+
#define __BUG_ENTRY_FILE RISCV_INT " %0 - 2b"
3232
#else
3333
#define __BUG_ENTRY_ADDR RISCV_PTR " 1b"
3434
#define __BUG_ENTRY_FILE RISCV_PTR " %0"
@@ -38,7 +38,7 @@ typedef u32 bug_insn_t;
3838
#define __BUG_ENTRY \
3939
__BUG_ENTRY_ADDR "\n\t" \
4040
__BUG_ENTRY_FILE "\n\t" \
41-
SHORT " %1"
41+
RISCV_SHORT " %1"
4242
#else
4343
#define __BUG_ENTRY \
4444
__BUG_ENTRY_ADDR

arch/riscv/include/asm/io.h

Lines changed: 9 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,8 @@
1919
#ifndef _ASM_RISCV_IO_H
2020
#define _ASM_RISCV_IO_H
2121

22+
#include <linux/types.h>
23+
2224
#ifdef CONFIG_MMU
2325

2426
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);
3234
#define ioremap_wc(addr, size) ioremap((addr), (size))
3335
#define ioremap_wt(addr, size) ioremap((addr), (size))
3436

35-
extern void iounmap(void __iomem *addr);
37+
extern void iounmap(volatile void __iomem *addr);
3638

3739
#endif /* CONFIG_MMU */
3840

@@ -266,9 +268,9 @@ __io_reads_ins(reads, u32, l, __io_br(), __io_ar())
266268
__io_reads_ins(ins, u8, b, __io_pbr(), __io_par())
267269
__io_reads_ins(ins, u16, w, __io_pbr(), __io_par())
268270
__io_reads_ins(ins, u32, l, __io_pbr(), __io_par())
269-
#define insb(addr, buffer, count) __insb((void __iomem *)addr, buffer, count)
270-
#define insw(addr, buffer, count) __insw((void __iomem *)addr, buffer, count)
271-
#define insl(addr, buffer, count) __insl((void __iomem *)addr, buffer, count)
271+
#define insb(addr, buffer, count) __insb((void __iomem *)(long)addr, buffer, count)
272+
#define insw(addr, buffer, count) __insw((void __iomem *)(long)addr, buffer, count)
273+
#define insl(addr, buffer, count) __insl((void __iomem *)(long)addr, buffer, count)
272274

273275
__io_writes_outs(writes, u8, b, __io_bw(), __io_aw())
274276
__io_writes_outs(writes, u16, w, __io_bw(), __io_aw())
@@ -280,9 +282,9 @@ __io_writes_outs(writes, u32, l, __io_bw(), __io_aw())
280282
__io_writes_outs(outs, u8, b, __io_pbw(), __io_paw())
281283
__io_writes_outs(outs, u16, w, __io_pbw(), __io_paw())
282284
__io_writes_outs(outs, u32, l, __io_pbw(), __io_paw())
283-
#define outsb(addr, buffer, count) __outsb((void __iomem *)addr, buffer, count)
284-
#define outsw(addr, buffer, count) __outsw((void __iomem *)addr, buffer, count)
285-
#define outsl(addr, buffer, count) __outsl((void __iomem *)addr, buffer, count)
285+
#define outsb(addr, buffer, count) __outsb((void __iomem *)(long)addr, buffer, count)
286+
#define outsw(addr, buffer, count) __outsw((void __iomem *)(long)addr, buffer, count)
287+
#define outsl(addr, buffer, count) __outsl((void __iomem *)(long)addr, buffer, count)
286288

287289
#ifdef CONFIG_64BIT
288290
__io_reads_ins(reads, u64, q, __io_br(), __io_ar())

arch/riscv/include/asm/mmu_context.h

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,7 @@
1515
#ifndef _ASM_RISCV_MMU_CONTEXT_H
1616
#define _ASM_RISCV_MMU_CONTEXT_H
1717

18+
#include <linux/mm_types.h>
1819
#include <asm-generic/mm_hooks.h>
1920

2021
#include <linux/mm.h>

arch/riscv/include/asm/timex.h

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@
1818

1919
typedef unsigned long cycles_t;
2020

21-
static inline cycles_t get_cycles(void)
21+
static inline cycles_t get_cycles_inline(void)
2222
{
2323
cycles_t n;
2424

@@ -27,6 +27,7 @@ static inline cycles_t get_cycles(void)
2727
: "=r" (n));
2828
return n;
2929
}
30+
#define get_cycles get_cycles_inline
3031

3132
#ifdef CONFIG_64BIT
3233
static inline uint64_t get_cycles64(void)

arch/riscv/kernel/head.S

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -152,6 +152,3 @@ END(_start)
152152
__PAGE_ALIGNED_BSS
153153
/* Empty zero page */
154154
.balign PAGE_SIZE
155-
ENTRY(empty_zero_page)
156-
.fill (empty_zero_page + PAGE_SIZE) - ., 1, 0x00
157-
END(empty_zero_page)

arch/riscv/kernel/riscv_ksyms.c

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -12,4 +12,7 @@
1212
/*
1313
* Assembly functions that may be used (directly or indirectly) by modules
1414
*/
15+
EXPORT_SYMBOL(__clear_user);
1516
EXPORT_SYMBOL(__copy_user);
17+
EXPORT_SYMBOL(memset);
18+
EXPORT_SYMBOL(memcpy);

arch/riscv/kernel/setup.c

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -58,7 +58,12 @@ static char __initdata builtin_cmdline[COMMAND_LINE_SIZE] = CONFIG_CMDLINE;
5858
#endif /* CONFIG_CMDLINE_BOOL */
5959

6060
unsigned long va_pa_offset;
61+
EXPORT_SYMBOL(va_pa_offset);
6162
unsigned long pfn_base;
63+
EXPORT_SYMBOL(pfn_base);
64+
65+
unsigned long empty_zero_page[PAGE_SIZE / sizeof(unsigned long)] __page_aligned_bss;
66+
EXPORT_SYMBOL(empty_zero_page);
6267

6368
/* The lucky hart to first increment this variable will boot the other cores */
6469
atomic_t hart_lottery;

arch/riscv/kernel/smp.c

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -38,6 +38,13 @@ enum ipi_message_type {
3838
IPI_MAX
3939
};
4040

41+
42+
/* Unsupported */
43+
int setup_profiling_timer(unsigned int multiplier)
44+
{
45+
return -EINVAL;
46+
}
47+
4148
irqreturn_t handle_ipi(void)
4249
{
4350
unsigned long *pending_ipis = &ipi_data[smp_processor_id()].bits;

arch/riscv/lib/delay.c

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -84,6 +84,7 @@ void __delay(unsigned long cycles)
8484
while ((unsigned long)(get_cycles() - t0) < cycles)
8585
cpu_relax();
8686
}
87+
EXPORT_SYMBOL(__delay);
8788

8889
void udelay(unsigned long usecs)
8990
{

arch/riscv/mm/ioremap.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -85,7 +85,7 @@ EXPORT_SYMBOL(ioremap);
8585
*
8686
* Caller must ensure there is only one unmapping for the same pointer.
8787
*/
88-
void iounmap(void __iomem *addr)
88+
void iounmap(volatile void __iomem *addr)
8989
{
9090
vunmap((void *)((unsigned long)addr & PAGE_MASK));
9191
}

0 commit comments

Comments
 (0)