diff options
author | Ley Foon Tan <lftan@altera.com> | 2014-11-06 15:20:19 +0800 |
---|---|---|
committer | Ley Foon Tan <lftan@altera.com> | 2014-12-08 12:56:06 +0800 |
commit | 2fc8483fdcde767795402a38a53e647811dc9abf (patch) | |
tree | 01c734b5191c6ddd5c095fb2a08494720b06f817 /arch/nios2/kernel | |
parent | 9cce02ec7146248862ba63a41bf8eb32d9e4fb63 (diff) | |
download | op-kernel-dev-2fc8483fdcde767795402a38a53e647811dc9abf.zip op-kernel-dev-2fc8483fdcde767795402a38a53e647811dc9abf.tar.gz |
nios2: Build infrastructure
This patch adds Makefile and Kconfig files required for building a
nios2 kernel.
Signed-off-by: Ley Foon Tan <lftan@altera.com>
Diffstat (limited to 'arch/nios2/kernel')
-rw-r--r-- | arch/nios2/kernel/Makefile | 24 | ||||
-rw-r--r-- | arch/nios2/kernel/nios2_ksyms.c | 33 | ||||
-rw-r--r-- | arch/nios2/kernel/vmlinux.lds.S | 75 |
3 files changed, 132 insertions, 0 deletions
diff --git a/arch/nios2/kernel/Makefile b/arch/nios2/kernel/Makefile new file mode 100644 index 0000000..8ae7682 --- /dev/null +++ b/arch/nios2/kernel/Makefile @@ -0,0 +1,24 @@ +# +# Makefile for the nios2 linux kernel. +# + +extra-y += head.o +extra-y += vmlinux.lds + +obj-y += cpuinfo.o +obj-y += entry.o +obj-y += insnemu.o +obj-y += irq.o +obj-y += nios2_ksyms.o +obj-y += process.o +obj-y += prom.o +obj-y += ptrace.o +obj-y += setup.o +obj-y += signal.o +obj-y += sys_nios2.o +obj-y += syscall_table.o +obj-y += time.o +obj-y += traps.o + +obj-$(CONFIG_MODULES) += module.o +obj-$(CONFIG_NIOS2_ALIGNMENT_TRAP) += misaligned.o diff --git a/arch/nios2/kernel/nios2_ksyms.c b/arch/nios2/kernel/nios2_ksyms.c new file mode 100644 index 0000000..bf2f55d --- /dev/null +++ b/arch/nios2/kernel/nios2_ksyms.c @@ -0,0 +1,33 @@ +/* + * Copyright (C) 2004 Microtronix Datacom Ltd + * + * This file is subject to the terms and conditions of the GNU General + * Public License. See the file COPYING in the main directory of this + * archive for more details. + */ + +#include <linux/export.h> +#include <linux/string.h> + +/* string functions */ + +EXPORT_SYMBOL(memcpy); +EXPORT_SYMBOL(memset); +EXPORT_SYMBOL(memmove); + +/* + * libgcc functions - functions that are used internally by the + * compiler... (prototypes are not correct though, but that + * doesn't really matter since they're not versioned). + */ +#define DECLARE_EXPORT(name) extern void name(void); EXPORT_SYMBOL(name) + +DECLARE_EXPORT(__gcc_bcmp); +DECLARE_EXPORT(__divsi3); +DECLARE_EXPORT(__moddi3); +DECLARE_EXPORT(__modsi3); +DECLARE_EXPORT(__udivmoddi4); +DECLARE_EXPORT(__udivsi3); +DECLARE_EXPORT(__umoddi3); +DECLARE_EXPORT(__umodsi3); +DECLARE_EXPORT(__muldi3); diff --git a/arch/nios2/kernel/vmlinux.lds.S b/arch/nios2/kernel/vmlinux.lds.S new file mode 100644 index 0000000..326fab4 --- /dev/null +++ b/arch/nios2/kernel/vmlinux.lds.S @@ -0,0 +1,75 @@ +/* + * Copyright (C) 2009 Thomas Chou <thomas@wytron.com.tw> + * + * 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, see <http://www.gnu.org/licenses/>. + * + */ +#include <asm/page.h> +#include <asm-generic/vmlinux.lds.h> +#include <asm/cache.h> +#include <asm/thread_info.h> + +OUTPUT_FORMAT("elf32-littlenios2", "elf32-littlenios2", "elf32-littlenios2") + +OUTPUT_ARCH(nios) +ENTRY(_start) /* Defined in head.S */ + +jiffies = jiffies_64; + +SECTIONS +{ + . = CONFIG_NIOS2_MEM_BASE | CONFIG_NIOS2_KERNEL_REGION_BASE; + + _text = .; + _stext = .; + HEAD_TEXT_SECTION + .text : { + TEXT_TEXT + SCHED_TEXT + LOCK_TEXT + IRQENTRY_TEXT + KPROBES_TEXT + } =0 + _etext = .; + + .got : { + *(.got.plt) + *(.igot.plt) + *(.got) + *(.igot) + } + + EXCEPTION_TABLE(L1_CACHE_BYTES) + + . = ALIGN(PAGE_SIZE); + __init_begin = .; + INIT_TEXT_SECTION(PAGE_SIZE) + INIT_DATA_SECTION(PAGE_SIZE) + PERCPU_SECTION(L1_CACHE_BYTES) + __init_end = .; + + _sdata = .; + RO_DATA_SECTION(PAGE_SIZE) + RW_DATA_SECTION(L1_CACHE_BYTES, PAGE_SIZE, THREAD_SIZE) + _edata = .; + + BSS_SECTION(0, 0, 0) + _end = .; + + STABS_DEBUG + DWARF_DEBUG + NOTES + + DISCARDS +} |