Skip to content

Commit c135fc8

Browse files
fvincenzoKAGA-KOKO
authored andcommitted
mips: vdso: Enable mips to use common headers
Enable mips to use only the common headers in the implementation of the vDSO library. Signed-off-by: Vincenzo Frascino <[email protected]> Signed-off-by: Thomas Gleixner <[email protected]> Cc: Paul Burton <[email protected]> Link: https://lkml.kernel.org/r/[email protected]
1 parent 5340e87 commit c135fc8

File tree

3 files changed

+28
-19
lines changed

3 files changed

+28
-19
lines changed

arch/mips/include/asm/processor.h

Lines changed: 1 addition & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -22,6 +22,7 @@
2222
#include <asm/dsemul.h>
2323
#include <asm/mipsregs.h>
2424
#include <asm/prefetch.h>
25+
#include <asm/vdso/processor.h>
2526

2627
/*
2728
* System setup and hardware flags..
@@ -385,21 +386,6 @@ unsigned long get_wchan(struct task_struct *p);
385386
#define KSTK_ESP(tsk) (task_pt_regs(tsk)->regs[29])
386387
#define KSTK_STATUS(tsk) (task_pt_regs(tsk)->cp0_status)
387388

388-
#ifdef CONFIG_CPU_LOONGSON64
389-
/*
390-
* Loongson-3's SFB (Store-Fill-Buffer) may buffer writes indefinitely when a
391-
* tight read loop is executed, because reads take priority over writes & the
392-
* hardware (incorrectly) doesn't ensure that writes will eventually occur.
393-
*
394-
* Since spin loops of any kind should have a cpu_relax() in them, force an SFB
395-
* flush from cpu_relax() such that any pending writes will become visible as
396-
* expected.
397-
*/
398-
#define cpu_relax() smp_mb()
399-
#else
400-
#define cpu_relax() barrier()
401-
#endif
402-
403389
/*
404390
* Return_address is a replacement for __builtin_return_address(count)
405391
* which on certain architectures cannot reasonably be implemented in GCC

arch/mips/include/asm/vdso/gettimeofday.h

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -13,12 +13,8 @@
1313

1414
#ifndef __ASSEMBLY__
1515

16-
#include <linux/compiler.h>
17-
#include <linux/time.h>
18-
1916
#include <asm/vdso/vdso.h>
2017
#include <asm/clocksource.h>
21-
#include <asm/io.h>
2218
#include <asm/unistd.h>
2319
#include <asm/vdso.h>
2420

Lines changed: 27 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,27 @@
1+
/* SPDX-License-Identifier: GPL-2.0-only */
2+
/*
3+
* Copyright (C) 2020 ARM Ltd.
4+
*/
5+
#ifndef __ASM_VDSO_PROCESSOR_H
6+
#define __ASM_VDSO_PROCESSOR_H
7+
8+
#ifndef __ASSEMBLY__
9+
10+
#ifdef CONFIG_CPU_LOONGSON64
11+
/*
12+
* Loongson-3's SFB (Store-Fill-Buffer) may buffer writes indefinitely when a
13+
* tight read loop is executed, because reads take priority over writes & the
14+
* hardware (incorrectly) doesn't ensure that writes will eventually occur.
15+
*
16+
* Since spin loops of any kind should have a cpu_relax() in them, force an SFB
17+
* flush from cpu_relax() such that any pending writes will become visible as
18+
* expected.
19+
*/
20+
#define cpu_relax() smp_mb()
21+
#else
22+
#define cpu_relax() barrier()
23+
#endif
24+
25+
#endif /* __ASSEMBLY__ */
26+
27+
#endif /* __ASM_VDSO_PROCESSOR_H */

0 commit comments

Comments
 (0)