Skip to content
This repository

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
  • 9 commits
  • 14 files changed
  • 0 comments
  • 1 contributor
Aug 24, 2012
Lars-Peter Clausen lm32: Slightly optimize the syscall handling
We can get rid of the null-pointer check in the syscall handler if we make sure
that every syscall table entry is initialized.

Signed-off-by: Lars-Peter Clausen <lars@metafoo.de>
5c2d8db
Lars-Peter Clausen lib: Add a generic sys_call_table
Most of the new architectures use identical sys call tables definitions. This
patch adds a generic sys call table implementation which can be used by these
architectures.

Signed-off-by: Lars-Peter Clausen <lars@metafoo.de>
e55aef4
Lars-Peter Clausen lm32: Use generic sys call table implementation e6dceda
Lars-Peter Clausen lm32: Speedup clearing the bbs section a bit
We currently do two branch, one add and one store instruction per word in the
bss section. Change this to one branch, one add and 8 stores per 8 words.

Signed-off-by: Lars-Peter Clausen <lars@metafoo.de>
8ac8a56
Lars-Peter Clausen lm32: Use generic ftrace.h b8dfe7c
Lars-Peter Clausen asm-generic/mmu.h: Remove unused vmlist field from mm_context_t
Nothing is using the vmlist field in mm_context_t anymore. It has been removed
from the non-generic versions over 3 years ago 8feae13 ("NOMMU: Make VMAs per
MM as for MMU-mode linux").

Signed-off-by: Lars-Peter Clausen <lars@metafoo.de>
dbd629c
Lars-Peter Clausen asm-generic/mmu.h: Add support for FDPIC
No-MMU architectures often have support for FDPIC binaries. FDPIC support
requires two additional fields in the mm_context_t struct. This patch adds these
fields to the generic mm_context_t definition if support for FDPIC binaries is
enabled. This allows to use the generic mmu.h for a few more architectures.

Signed-off-by: Lars-Peter Clausen <lars@metafoo.de>
082b2e2
Lars-Peter Clausen lm32: Use generic mmu.h
Signed-off-by: Lars-Peter Clausen <lars@metafoo.de>
c6976f2
Lars-Peter Clausen lm32: Use generic tlb.h
We do have some custom definitions in our tlb.h, but those are all for
defines/functions which are only used in the MMU case.

Signed-off-by: Lars-Peter Clausen <lars@metafoo.de>
d552780
1  arch/lm32/Kconfig
@@ -6,6 +6,7 @@ config LM32
6 6
 	select GENERIC_HARDIRQS_NO_DEPRECATED
7 7
 	select GENERIC_IRQ_SHOW
8 8
 	select GENERIC_CPU_DEVICES
  9
+	select GENERIC_SYSCALL_TABLE
9 10
 	select ARCH_REQUIRE_GPIOLIB
10 11
 	select OF
11 12
 	select OF_EARLY_FLATTREE
3  arch/lm32/include/asm/Kbuild
@@ -20,6 +20,7 @@ generic-y += errno.h
20 20
 generic-y += exec.h
21 21
 generic-y += fb.h
22 22
 generic-y += fcntl.h
  23
+generic-y += ftrace.h
23 24
 generic-y += futex.h
24 25
 generic-y += hardirq.h
25 26
 generic-y += hw_irq.h
@@ -34,6 +35,7 @@ generic-y += linkage.h
34 35
 generic-y += local.h
35 36
 generic-y += mman.h
36 37
 generic-y += mmu_context.h
  38
+generic-y += mmu.h
37 39
 generic-y += module.h
38 40
 generic-y += msgbuf.h
39 41
 generic-y += param.h
@@ -60,6 +62,7 @@ generic-y += swab.h
60 62
 generic-y += syscalls.h
61 63
 generic-y += termbits.h
62 64
 generic-y += termios.h
  65
+generic-y += tlb.h
63 66
 generic-y += tlbflush.h
64 67
 generic-y += topology.h
65 68
 generic-y += types.h
1  arch/lm32/include/asm/ftrace.h
... ...
@@ -1 +0,0 @@
1  
-/* empty */
37  arch/lm32/include/asm/mmu.h
... ...
@@ -1,37 +0,0 @@
1  
-/*
2  
- * (C) Copyright 2007
3  
- *     Theobroma Systems <www.theobroma-systems.com>
4  
- *
5  
- * See file CREDITS for list of people who contributed to this
6  
- * project.
7  
- *
8  
- * This program is free software; you can redistribute it and/or
9  
- * modify it under the terms of the GNU General Public License as
10  
- * published by the Free Software Foundation; either version 2 of
11  
- * the License, or (at your option) any later version.
12  
- *
13  
- * This program is distributed in the hope that it will be useful,
14  
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
15  
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
16  
- * GNU General Public License for more details.
17  
- *
18  
- * You should have received a copy of the GNU General Public License
19  
- * along with this program; if not, write to the Free Software
20  
- * Foundation, Inc., 59 Temple Place, Suite 330, Boston,
21  
- * MA 02111-1307 USA
22  
- */
23  
-
24  
-#ifndef __LM32_MMU_H
25  
-#define __LM32_MMU_H
26  
-
27  
-typedef struct {
28  
-	struct vm_list_struct	*vmlist;
29  
-	unsigned long		end_brk;
30  
-
31  
-#ifdef CONFIG_BINFMT_ELF_FDPIC
32  
-	unsigned long	exec_fdpic_loadmap;
33  
-	unsigned long	interp_fdpic_loadmap;
34  
-#endif
35  
-} mm_context_t;
36  
-
37  
-#endif 
20  arch/lm32/include/asm/tlb.h
... ...
@@ -1,20 +0,0 @@
1  
-#ifndef _LM32_ASM_TLB_H
2  
-#define _LM32_ASM_TLB_H
3  
-
4  
-/*
5  
- * lm32 doesn't need any special per-pte or
6  
- * per-vma handling..
7  
- */
8  
-#define tlb_start_vma(tlb, vma)	do { } while (0)
9  
-#define tlb_end_vma(tlb, vma)	do { } while (0)
10  
-#define __tlb_remove_tlb_entry(tlb, ptep, address)	do { } while (0)
11  
-
12  
-/*
13  
- * .. because we flush the whole mm when it
14  
- * fills up.
15  
- */
16  
-#define tlb_flush(tlb)		flush_tlb_mm((tlb)->mm)
17  
-
18  
-#include <asm-generic/tlb.h>
19  
-
20  
-#endif /* _LM32_ASM_TLB_H */
4  arch/lm32/include/asm/unistd.h
@@ -10,4 +10,8 @@
10 10
 
11 11
 #undef __NR_mmap
12 12
 
  13
+#define sys_vfork sys_ni_syscall
  14
+#define sys_mmap sys_ni_syscall
  15
+#define sys_mmap2 sys_mmap_pgoff
  16
+
13 17
 #endif /* _ASM_LM32_UNISTD_H */
3  arch/lm32/kernel/Makefile
@@ -6,8 +6,7 @@ extra-y := head.o vmlinux.lds
6 6
 obj-y := \
7 7
 	sys_lm32.o setup.o traps.o signal.o time.o \
8 8
 	ptrace.o irq.o process.o entry.o \
9  
-	flat.o sys_call_table.o cpuinfo.o prom.o \
10  
-	platform.o
  9
+	flat.o cpuinfo.o prom.o platform.o
11 10
 
12 11
 obj-$(CONFIG_MODULES)       += module.o
13 12
 
1  arch/lm32/kernel/entry.S
@@ -112,7 +112,6 @@ ENTRY(system_call)
112 112
 	sli r10, r8, 2 /* TODO: only works with shifter enabled */
113 113
 	add r9, r9, r10 /* add offset of syscall no to address */
114 114
 	lw r9, (r9+0) /* fetch address of syscall function */
115  
-	be r9, r0, .badsyscall
116 115
 	call r9 /* execute syscall */
117 116
 
118 117
 ENTRY(syscall_tail)
13  arch/lm32/kernel/head.S
@@ -22,11 +22,16 @@ ENTRY(_start)
22 22
 	mvhi 	r11, hi(__bss_stop)
23 23
 	ori 	r11, r11, lo(__bss_stop)
24 24
 1:
25  
-	be 	r10, r11, 2f
26 25
 	sw 	(r10+0), r0
27  
-	addi 	r10, r10, 4
28  
-	bi 	1b
29  
-2:
  26
+	sw 	(r10+4), r0
  27
+	sw 	(r10+8), r0
  28
+	sw 	(r10+12), r0
  29
+	sw 	(r10+16), r0
  30
+	sw 	(r10+20), r0
  31
+	sw 	(r10+24), r0
  32
+	sw 	(r10+28), r0
  33
+	addi 	r10, r10, 32
  34
+	bne 	r10, r11, 1b
30 35
 
31 36
 	/*
32 37
 	 * XXX: this will go away, if we have proper fdt support.
2  arch/lm32/kernel/vmlinux.lds.S
@@ -46,7 +46,7 @@ SECTIONS
46 46
 	EXCEPTION_TABLE(256)
47 47
 	NOTES
48 48
 
49  
-	BSS_SECTION(0, 0 ,0)
  49
+	BSS_SECTION(4, 4, 32)
50 50
 	_end = .;
51 51
 
52 52
 	STABS_DEBUG
6  include/asm-generic/mmu.h
@@ -7,8 +7,12 @@
7 7
  */
8 8
 #ifndef __ASSEMBLY__
9 9
 typedef struct {
10  
-	struct vm_list_struct	*vmlist;
11 10
 	unsigned long		end_brk;
  11
+
  12
+#ifdef CONFIG_BINFMT_ELF_FDPIC
  13
+	unsigned long		exec_fdpic_loadmap;
  14
+	unsigned long		interp_fdpic_loadmap;
  15
+#endif
12 16
 } mm_context_t;
13 17
 #endif
14 18
 
3  lib/Kconfig
@@ -39,6 +39,9 @@ config GENERIC_IO
39 39
 	boolean
40 40
 	default n
41 41
 
  42
+config GENERIC_SYSCALL_TABLE
  43
+	bool
  44
+
42 45
 config STMP_DEVICE
43 46
 	bool
44 47
 
2  lib/Makefile
@@ -130,6 +130,8 @@ obj-$(CONFIG_GENERIC_STRNLEN_USER) += strnlen_user.o
130 130
 
131 131
 obj-$(CONFIG_STMP_DEVICE) += stmp_device.o
132 132
 
  133
+obj-$(CONFIG_GENERIC_SYSCALL_TABLE) += sys_call_table.o
  134
+
133 135
 hostprogs-y	:= gen_crc32table
134 136
 clean-files	:= crc32table.h
135 137
 
1  arch/lm32/kernel/sys_call_table.c → lib/sys_call_table.c
@@ -12,5 +12,6 @@
12 12
 #define __SYSCALL(nr, call) [nr] = (call),
13 13
 
14 14
 void *sys_call_table[__NR_syscalls] = {
  15
+	[0 ... __NR_syscalls-1] = sys_ni_syscall,
15 16
 #include <asm/unistd.h>
16 17
 };

No commit comments for this range

Something went wrong with that request. Please try again.