Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP

We’re showing branches in this repository, but you can also compare across forks.

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

No commit comments for this range

Something went wrong with that request. Please try again.