Commit 75d4d295 authored by Arnd Bergmann's avatar Arnd Bergmann
Browse files

sh: remove CONFIG_SET_FS support



sh uses set_fs/get_fs only in one file, to handle address
errors in both user and kernel memory.

It already has an abstraction to differentiate between I/O
and memory, so adding a third class for kernel memory fits
into the same scheme and lets us kill off CONFIG_SET_FS.

Reviewed-by: default avatarChristoph Hellwig <hch@lst.de>
Signed-off-by: default avatarArnd Bergmann <arnd@arndb.de>
parent a5ad8378
Loading
Loading
Loading
Loading
+0 −1
Original line number Diff line number Diff line
@@ -65,7 +65,6 @@ config SUPERH
	select PERF_EVENTS
	select PERF_USE_VMALLOC
	select RTC_LIB
	select SET_FS
	select SPARSE_IRQ
	select TRACE_IRQFLAGS_SUPPORT
	help
+0 −1
Original line number Diff line number Diff line
@@ -3,7 +3,6 @@
#define __ASM_SH_PROCESSOR_H

#include <asm/cpu-features.h>
#include <asm/segment.h>
#include <asm/cache.h>

#ifndef __ASSEMBLY__

arch/sh/include/asm/segment.h

deleted100644 → 0
+0 −33
Original line number Diff line number Diff line
/* SPDX-License-Identifier: GPL-2.0 */
#ifndef __ASM_SH_SEGMENT_H
#define __ASM_SH_SEGMENT_H

#ifndef __ASSEMBLY__

typedef struct {
	unsigned long seg;
} mm_segment_t;

#define MAKE_MM_SEG(s)	((mm_segment_t) { (s) })

/*
 * The fs value determines whether argument validity checking should be
 * performed or not.  If get_fs() == USER_DS, checking is performed, with
 * get_fs() == KERNEL_DS, checking is bypassed.
 *
 * For historical reasons, these macros are grossly misnamed.
 */
#define KERNEL_DS	MAKE_MM_SEG(0xFFFFFFFFUL)
#ifdef CONFIG_MMU
#define USER_DS		MAKE_MM_SEG(PAGE_OFFSET)
#else
#define USER_DS		KERNEL_DS
#endif

#define uaccess_kernel() (get_fs().seg == KERNEL_DS.seg)

#define get_fs()	(current_thread_info()->addr_limit)
#define set_fs(x)	(current_thread_info()->addr_limit = (x))

#endif /* __ASSEMBLY__ */
#endif /* __ASM_SH_SEGMENT_H */
+0 −2
Original line number Diff line number Diff line
@@ -30,7 +30,6 @@ struct thread_info {
	__u32			status;		/* thread synchronous flags */
	__u32			cpu;
	int			preempt_count; /* 0 => preemptable, <0 => BUG */
	mm_segment_t		addr_limit;	/* thread address space */
	unsigned long		previous_sp;	/* sp of previous stack in case
						   of nested IRQ stacks */
	__u8			supervisor_stack[0];
@@ -58,7 +57,6 @@ struct thread_info {
	.status		= 0,			\
	.cpu		= 0,			\
	.preempt_count	= INIT_PREEMPT_COUNT,	\
	.addr_limit	= KERNEL_DS,		\
}

/* how to get the current stack pointer from C */
+0 −4
Original line number Diff line number Diff line
@@ -2,11 +2,7 @@
#ifndef __ASM_SH_UACCESS_H
#define __ASM_SH_UACCESS_H

#include <asm/segment.h>
#include <asm/extable.h>

#define user_addr_max()	(current_thread_info()->addr_limit.seg)

#include <asm-generic/access_ok.h>

/*
Loading