MN10300: Add the MN10300 architecture to Linux kernel [try #4]
Subsystems (14)
cover MN10300: Add the MN10300 architecture to Linux kernel [try #4]
These patches add the MEI/Panasonic MN10300/AM33 architecture to the Linux kernel.
The first patch suppresses A.OUT support in the kernel if CONFIG_BINFMT_AOUT=n and CONFIG_IA32_AOUT=n and CONFIG_BINFMT_AOUT32=n. MN10300 does not support the AOUT binfmt, so the ELF binfmt should not be permitted to go looking for AOUT libraries to load, nor should random bits of the kernel depend on asm/a.out.h.
The fifth patch adds the architecture itself, to be selected by ARCH=mn10300 on the make command line.
The patches can also be downloaded from:
http://people.redhat.com/~dhowells/mn10300/mn10300-arch.tar.bz2
A suitable toolchain can be downloaded from:
ftp://ftp.redhat.com/pub/redhat/gnupro/AM33/
The latest is currently:
am33-04r2-5/tools/i686-pc-linux-gnulibc2.3-x-am33_2.0-linux-gnu.tar.bz2
Changes:
(*) Split out the JEDEC chip addition, the net2280 namespace clash fix, the
UART type ID allocation and the ASB2303 flash handler into separate patches.
(*) Don't use #ifdef __mn10300__ when CONFIG_MN10300 is available.
(*) Juggled the kprobe headers a bit.
(*) Moved the Kbuild patch hunks from the main patch to the A.OUT suppression
patch as they relate to {asm,linux}/a.out.h.
(*) Reworked the A.OUT suppression patch to not have conditionally exported
symbols, depending on module configuration. aout_dump_thread() is inlined instead.
David
PATCH 1/6 Suppress A.OUT library support if !CONFIG_BINFMT_AOUT [try #4]
Suppress A.OUT library support if CONFIG_BINFMT_AOUT is not set.
Not all architectures support the A.OUT binfmt, so the ELF binfmt should not be permitted to go looking for A.OUT libraries to load in such a case. Not only that, but under such conditions A.OUT core dumps are not produced either.
To make this work, this patch also does the following:
(1) Makes the existence of the contents of linux/a.out.h more or less
contingent on one of: CONFIG_BINFMT_AOUT=[ym] CONFIG_IA32_AOUT=[ym] CONFIG_BINFMT_AOUT32=[ym]
(2) Moves STACK_TOP[_MAX] out of asm/a.out.h and into asm/processor.h as they're required whether or not A.OUT format is available.
(3) Renames dump_thread() to aout_dump_thread() as it's only called by A.OUT core dumping code.
(4) Moves aout_dump_thread() into asm/a.out-core.h and makes it inline. This is then included only where needed. This means that this bit of arch code will be stored in the appropriate A.OUT binfmt module rather than the core kernel.
(5) Removes a lot of now obsolete {linux,asm}/a.out.h inclusions.
(6) Drops A.OUT support for Blackfin (according to Mike Frysinger it's not needed).
---
arch/alpha/kernel/osf_sys.c | 1 arch/alpha/kernel/process.c | 63 --------------------------- arch/alpha/kernel/setup.c | 1 arch/arm/kernel/process.c | 30 ------------- arch/blackfin/kernel/bfin_ksyms.c | 1 arch/blackfin/kernel/process.c | 46 -------------------- arch/m68k/kernel/process.c | 48 --------------------- arch/m68k/kernel/traps.c | 1 arch/sparc/kernel/process.c | 33 -------------- arch/sparc/kernel/setup.c | 1 arch/sparc/kernel/sparc_ksyms.c | 3 - arch/sparc/mm/loadmmu.c | 1 arch/sparc/mm/srmmu.c | 1 arch/sparc64/kernel/binfmt_aout32.c | 3 + arch/sparc64/kernel/binfmt_elf32.c | 2 - arch/sparc64/kernel/process.c | 12 ----- arch/sparc64/kernel/setup.c | 1 arch/sparc64/kernel/sparc64_ksyms.c | 1 arch/sparc64/kernel/sys_sparc.c | 1 arch/sparc64/kernel/sys_sparc32.c | 1 arch/um/kernel/ksyms.c | 2 - arch/um/kernel/process.c | 5 -- arch/x86/kernel/process_32.c | 44 ------------------- arch/x86/kernel/process_64.c | 1 arch/x86/kernel/setup_64.c | 1 fs/binfmt_aout.c | 3 + fs/binfmt_elf.c | 30 ++++++++++--- fs/exec.c | 3 - fs/proc/kcore.c | 1 include/asm-alpha/a.out-core.h | 81 +++++++++++++++++++++++++++++++++++ include/asm-alpha/a.out.h | 8 --- include/asm-alpha/processor.h | 5 ++ include/asm-arm/a.out-core.h | 49 +++++++++++++++++++++ include/asm-arm/a.out.h | 6 --- include/asm-arm/processor.h | 6 +++ include/asm-avr32/a.out.h | 7 --- include/asm-avr32/processor.h | 5 ++ include/asm-blackfin/a.out.h | 6 --- include/asm-blackfin/processor.h | 4 ++ include/asm-cris/a.out.h | 6 --- include/asm-cris/processor.h | 3 + include/asm-generic/Kbuild.asm | 3 + include/asm-h8300/a.out.h | 7 --- include/asm-h8300/processor.h | 5 ++ include/asm-ia64/a.out.h | 3 - include/asm-m32r/a.out.h | 7 --- include/asm-m32r/processor.h | 5 ++ include/asm-m68k/a.out-core.h | 67 +++++++++++++++++++++++++++++ include/asm-m68k/a.out.h | 7 --- include/asm-m68k/processor.h | 5 ++ include/asm-mips/a.out.h | 13 ------ include/asm-mips/processor.h | 7 +++ include/asm-parisc/a.out.h | 10 ---- include/asm-parisc/processor.h | 10 ++++ include/asm-powerpc/a.out.h | 19 -------- include/asm-powerpc/processor.h | 19 ++++++++ include/asm-s390/a.out.h | 7 --- include/asm-s390/processor.h | 7 +++ include/asm-sh/a.out.h | 7 --- include/asm-sh/processor.h | 7 +++ include/asm-sh64/a.out.h | 7 --- include/asm-sparc/a.out-core.h | 52 ++++++++++++++++++++++ include/asm-sparc/a.out.h | 9 ---- include/asm-sparc/processor.h | 4 ++ include/asm-sparc/uaccess.h | 1 include/asm-sparc64/a.out-core.h | 31 +++++++++++++ include/asm-sparc64/a.out.h | 12 ----- include/asm-sparc64/processor.h | 13 +++++- include/asm-sparc64/uaccess.h | 1 include/asm-sparc64/user.h | 2 - include/asm-um/a.out-core.h | 27 ++++++++++++ include/asm-um/a.out.h | 13 ------ include/asm-um/processor-generic.h | 8 +++ include/asm-x86/a.out-core.h | 65 ++++++++++++++++++++++++++++ include/asm-x86/a.out.h | 10 ---- include/asm-x86/processor_32.h | 2 + include/asm-x86/processor_64.h | 2 + include/asm-xtensa/a.out.h | 5 -- include/asm-xtensa/processor.h | 2 + include/linux/Kbuild | 3 + include/linux/a.out.h | 17 +++++++ include/linux/kernel.h | 2 - 82 files changed, 542 insertions(+), 488 deletions(-)
arch/alpha/kernel/osf_sys.c +0 -1
@@ -22,7 +22,6 @@#include <linux/ptrace.h> #include <linux/slab.h> #include <linux/user.h> -#include <linux/a.out.h> #include <linux/utsname.h> #include <linux/time.h> #include <linux/timex.h>
arch/alpha/kernel/process.c +0 -63
75 lines not on this page · raw message
arch/alpha/kernel/setup.c +0 -1
@@ -18,7 +18,6 @@#include <linux/ptrace.h> #include <linux/slab.h> #include <linux/user.h> -#include <linux/a.out.h> #include <linux/screen_info.h> #include <linux/delay.h> #include <linux/mc146818rtc.h>
arch/arm/kernel/process.c +0 -30
@@ -18,7 +18,6 @@#include <linux/unistd.h> #include <linux/slab.h> #include <linux/user.h> -#include <linux/a.out.h> #include <linux/delay.h> #include <linux/reboot.h> #include <linux/interrupt.h>
@@ -368,35 +367,6 @@ int dump_fpu (struct pt_regs *regs, struct user_fp *fp)EXPORT_SYMBOL (dump_fpu);/* -* fill in the user structure for a core dump.. -*/ -void dump_thread (struct pt_regs * regs,struct user * dump) -{ -struct task_struct *tsk = current; - - dump->magic =CMAGIC ; - dump->start_code = tsk->mm->start_code; - dump->start_stack = regs->ARM_sp & ~(PAGE_SIZE -1 ); - - dump->u_tsize = (tsk->mm->end_code - tsk->mm->start_code) >>PAGE_SHIFT ; - dump->u_dsize = (tsk->mm->brk - tsk->mm->start_data +PAGE_SIZE -1 ) >>PAGE_SHIFT ; - dump->u_ssize =0 ; - - dump->u_debugreg[0 ] = tsk->thread.debug.bp[0 ].address; - dump->u_debugreg[1 ] = tsk->thread.debug.bp[1 ].address; - dump->u_debugreg[2 ] = tsk->thread.debug.bp[0 ].insn.arm; - dump->u_debugreg[3 ] = tsk->thread.debug.bp[1 ].insn.arm; - dump->u_debugreg[4 ] = tsk->thread.debug.nsaved; - -if (dump->start_stack <0x04000000 ) - dump->u_ssize = (0x04000000 - dump->start_stack) >>PAGE_SHIFT ; - - dump->regs = *regs; - dump->u_fpvalid =dump_fpu (regs, &dump->u_fp); -} -EXPORT_SYMBOL (dump_thread); - -/* * Shuffle the argument into the correct register before calling the * thread function. r1 is the thread argument, r2 is the pointer to * the thread function, and r3 points to the exit function.
arch/blackfin/kernel/bfin_ksyms.c +0 -1
@@ -39,7 +39,6 @@EXPORT_SYMBOL (__ioremap);EXPORT_SYMBOL (strcmp);EXPORT_SYMBOL (strncmp); -EXPORT_SYMBOL (dump_thread);EXPORT_SYMBOL (ip_fast_csum);
arch/blackfin/kernel/process.c +0 -46
58 lines not on this page · raw message
arch/m68k/kernel/process.c +0 -48
60 lines not on this page · raw message
arch/m68k/kernel/traps.c +0 -1
@@ -23,7 +23,6 @@#include <linux/kernel.h> #include <linux/mm.h> #include <linux/module.h> -#include <linux/a.out.h> #include <linux/user.h> #include <linux/string.h> #include <linux/linkage.h>
arch/sparc/kernel/process.c +0 -33
@@ -20,7 +20,6 @@#include <linux/ptrace.h> #include <linux/slab.h> #include <linux/user.h> -#include <linux/a.out.h> #include <linux/smp.h> #include <linux/reboot.h> #include <linux/delay.h>
@@ -567,38 +566,6 @@ int copy_thread(int nr, unsigned long clone_flags, unsigned long sp, }/* -* fill in the user structure for a core dump.. -*/ -void dump_thread (struct pt_regs * regs,struct user * dump) -{ -unsigned long first_stack_page; - - dump->magic =SUNOS_CORE_MAGIC ; - dump->len =sizeof (struct user ); - dump->regs.psr = regs->psr; - dump->regs.pc = regs->pc; - dump->regs.npc = regs->npc; - dump->regs.y = regs->y; -/* fuck me plenty */ -memcpy (&dump->regs.regs[0 ], ®s->u_regs[1 ], (sizeof (unsigned long ) *15 )); - dump->uexec = current->thread.core_exec; - dump->u_tsize = (((unsigned long ) current->mm->end_code) - - ((unsigned long ) current->mm->start_code)) & ~(PAGE_SIZE -1 ); - dump->u_dsize = ((unsigned long ) (current->mm->brk + (PAGE_SIZE -1 ))); - dump->u_dsize -= dump->u_tsize; - dump->u_dsize &= ~(PAGE_SIZE -1 ); - first_stack_page = (regs->u_regs[UREG_FP ] & ~(PAGE_SIZE -1 )); - dump->u_ssize = (TASK_SIZE - first_stack_page) & ~(PAGE_SIZE -1 ); -memcpy (&dump->fpu.fpstatus.fregs.regs[0 ], ¤t->thread.float_regs[0 ], (sizeof (unsigned long ) *32 )); - dump->fpu.fpstatus.fsr = current->thread.fsr; - dump->fpu.fpstatus.flags = dump->fpu.fpstatus.extra =0 ; - dump->fpu.fpstatus.fpq_count = current->thread.fpqdepth; -memcpy (&dump->fpu.fpstatus.fpq[0 ], ¤t->thread.fpqueue[0 ], - ((sizeof (unsigned long ) *2 ) *16 )); - dump->sigcode =0 ; -} - -/* * fill in the fpu structure for a core dump. */ int dump_fpu (struct pt_regs * regs,elf_fpregset_t * fpregs)
arch/sparc/kernel/setup.c +0 -1
@@ -16,7 +16,6 @@#include <linux/initrd.h> #include <asm/smp.h> #include <linux/user.h> -#include <linux/a.out.h> #include <linux/screen_info.h> #include <linux/delay.h> #include <linux/fs.h>
arch/sparc/kernel/sparc_ksyms.c +0 -3
@@ -51,7 +51,6 @@#ifdef CONFIG_PCI #include <asm/ebus.h> #endif -#include <asm/a.out.h> #include <asm/io-unit.h> #include <asm/bug.h>
@@ -214,8 +213,6 @@ EXPORT_SYMBOL(kunmap_atomic);EXPORT_SYMBOL (svr4_setcontext);EXPORT_SYMBOL (svr4_getcontext); -EXPORT_SYMBOL (dump_thread); -/* prom symbols */ EXPORT_SYMBOL (idprom);EXPORT_SYMBOL (prom_root_node);
arch/sparc/mm/loadmmu.c +0 -1
@@ -14,7 +14,6 @@#include <asm/system.h> #include <asm/page.h> #include <asm/pgtable.h> -#include <asm/a.out.h> #include <asm/mmu_context.h> #include <asm/oplib.h>
arch/sparc/mm/srmmu.c +0 -1
@@ -34,7 +34,6 @@#include <asm/sbus.h> #include <asm/asi.h> #include <asm/msi.h> -#include <asm/a.out.h> #include <asm/mmu_context.h> #include <asm/io-unit.h> #include <asm/cacheflush.h>
arch/sparc64/kernel/binfmt_aout32.c +2 -1
@@ -32,6 +32,7 @@#include <asm/uaccess.h> #include <asm/pgalloc.h> #include <asm/mmu_context.h> +#include <asm/a.out-core.h> static int load_aout32_binary (struct linux_binprm *,struct pt_regs * regs);static int load_aout32_library (struct file *);
@@ -101,7 +102,7 @@ static int aout32_core_dump(long signr, struct pt_regs *regs, struct file *file, current->flags |=PF_DUMPCORE ;strncpy (dump.u_comm, current->comm,sizeof (dump.u_comm)); dump.signal = signr; -dump_thread (regs, &dump); +aout_dump_thread (regs, &dump);/* If the size of the dump file exceeds the rlimit, then see what would happen if we wrote the stack, but not the data area. */
arch/sparc64/kernel/binfmt_elf32.c +0 -2
@@ -151,8 +151,6 @@ MODULE_AUTHOR("Eric Youngdale, David S. Miller, Jakub Jelinek");#undef MODULE_DESCRIPTION#undef MODULE_AUTHOR -#include <asm/a.out.h> -#undef TASK_SIZE#define TASK_SIZE STACK_TOP32
arch/sparc64/kernel/process.c +0 -12
@@ -24,7 +24,6 @@#include <linux/ptrace.h> #include <linux/slab.h> #include <linux/user.h> -#include <linux/a.out.h> #include <linux/reboot.h> #include <linux/delay.h> #include <linux/compat.h>
@@ -725,17 +724,6 @@ pid_t kernel_thread(int (*fn)(void *), void * arg, unsigned long flags)return retval; } -/* -* fill in the user structure for a core dump.. -*/ -void dump_thread (struct pt_regs * regs,struct user * dump) -{ -/* Only should be used for SunOS and ancient a.out -* SparcLinux binaries... Not worth implementing. -*/ -memset (dump,0 ,sizeof (struct user )); -} - typedef struct { union { unsigned int pr_regs[32];
arch/sparc64/kernel/setup.c +0 -1
@@ -15,7 +15,6 @@#include <linux/slab.h> #include <asm/smp.h> #include <linux/user.h> -#include <linux/a.out.h> #include <linux/screen_info.h> #include <linux/delay.h> #include <linux/fs.h>
arch/sparc64/kernel/sparc64_ksyms.c +0 -1
@@ -53,7 +53,6 @@#include <asm/ebus.h> #include <asm/isa.h> #endif -#include <asm/a.out.h> #include <asm/ns87303.h> #include <asm/timer.h> #include <asm/cpudata.h>
arch/sparc64/kernel/sys_sparc.c +0 -1
@@ -28,7 +28,6 @@#include <asm/uaccess.h> #include <asm/utrap.h> #include <asm/perfctr.h> -#include <asm/a.out.h> #include <asm/unistd.h> /* #define DEBUG_UNIMP_SYSCALL */
arch/sparc64/kernel/sys_sparc32.c +0 -1
@@ -58,7 +58,6 @@#include <asm/fpumacro.h> #include <asm/semaphore.h> #include <asm/mmu_context.h> -#include <asm/a.out.h> #include <asm/compat_signal.h> asmlinkage long sys32_chown16 (const char __user * filename,u16 user,u16 group)
arch/um/kernel/ksyms.c +0 -2
@@ -5,7 +5,6 @@#include "linux/module.h" #include "linux/syscalls.h" -#include "asm/a.out.h" #include "asm/tlbflush.h" #include "asm/uaccess.h" #include "as-layout.h"
@@ -65,7 +64,6 @@ EXPORT_SYMBOL(os_accept_connection);EXPORT_SYMBOL (os_rcv_fd);EXPORT_SYMBOL (run_helper);EXPORT_SYMBOL (start_thread); -EXPORT_SYMBOL (dump_thread);#ifdef CONFIG_SMP
arch/um/kernel/process.c +1 -4
@@ -4,6 +4,7 @@* Licensed under the GPL */ +#include "linux/module.h" #include "linux/stddef.h" #include "linux/err.h" #include "linux/hardirq.h"
@@ -303,10 +304,6 @@ char *current_cmd(void)#endif } -void dump_thread (struct pt_regs *regs,struct user *u) -{ -} -int __cant_sleep (void ) {return in_atomic () ||irqs_disabled () ||in_interrupt ();/* Is in_interrupt() really needed? */
arch/x86/kernel/process_32.c +0 -44
56 lines not on this page · raw message
arch/x86/kernel/process_64.c +0 -1
@@ -27,7 +27,6 @@#include <linux/slab.h> #include <linux/user.h> #include <linux/module.h> -#include <linux/a.out.h> #include <linux/interrupt.h> #include <linux/delay.h> #include <linux/ptrace.h>
arch/x86/kernel/setup_64.c +0 -1
@@ -15,7 +15,6 @@#include <linux/ptrace.h> #include <linux/slab.h> #include <linux/user.h> -#include <linux/a.out.h> #include <linux/screen_info.h> #include <linux/ioport.h> #include <linux/delay.h>
fs/binfmt_aout.c +2 -1
@@ -28,6 +28,7 @@#include <asm/system.h> #include <asm/uaccess.h> #include <asm/cacheflush.h> +#include <asm/a.out-core.h> static int load_aout_binary (struct linux_binprm *,struct pt_regs * regs);static int load_aout_library (struct file *);
@@ -118,7 +119,7 @@ static int aout_core_dump(long signr, struct pt_regs *regs, struct file *file, u dump.u_ar0 = (void *)(((unsigned long )(&dump.regs)) - ((unsigned long )(&dump)));#endif dump.signal = signr; -dump_thread (regs, &dump); +aout_dump_thread (regs, &dump);/* If the size of the dump file exceeds the rlimit, then see what would happen if we wrote the stack, but not the data area. */
fs/binfmt_elf.c +22 -8
@@ -464,6 +464,7 @@ out:return error; } +#ifdef CONFIG_BINFMT_AOUT static unsigned long load_aout_interp (struct exec *interp_ex,struct file *interpreter) {
@@ -509,6 +510,10 @@ static unsigned long load_aout_interp(struct exec *interp_ex, out: return elf_entry; } +#else +extern unsigned long load_aout_interp (struct exec *interp_ex, +struct file *interpreter); +#endif /* * These are the functions used to load ELF style executables and shared
@@ -516,9 +521,15 @@ out:*/ #define INTERPRETER_NONE 0 -#define INTERPRETER_AOUT 1#define INTERPRETER_ELF 2 +#ifdef CONFIG_BINFMT_AOUT +#define INTERPRETER_AOUT 1 +#define IS_AOUT_INTERP (x) ((x) == INTERPRETER_AOUT) +#else +#define IS_AOUT_INTERP (x) (0) +#endif +#ifndef STACK_RND_MASK #define STACK_RND_MASK (0x7ff >> (PAGE_SHIFT - 12))/* 8MB of VA */ #endif
@@ -734,6 +745,7 @@ static int load_elf_binary(struct linux_binprm *bprm, struct pt_regs *regs)/* Some simple consistency checks for the interpreter */ if (elf_interpreter) {static int warn; +#ifdef CONFIG_BINFMT_AOUT interpreter_type =INTERPRETER_ELF |INTERPRETER_AOUT ;/* Now figure out which format our binary is */
@@ -741,11 +753,13 @@ static int load_elf_binary(struct linux_binprm *bprm, struct pt_regs *regs) (N_MAGIC(loc->interp_ex) != ZMAGIC) && (N_MAGIC(loc->interp_ex) != QMAGIC)) interpreter_type =INTERPRETER_ELF ; - +#else + interpreter_type =INTERPRETER_ELF ; +#endif if (memcmp (loc->interp_elf_ex.e_ident,ELFMAG ,SELFMAG ) !=0 ) interpreter_type &= ~INTERPRETER_ELF ; -if (interpreter_type ==INTERPRETER_AOUT && warn <10 ) { +if (IS_AOUT_INTERP (interpreter_type) && warn <10 ) {printk (KERN_WARNING "a.out ELF interpreter %s is " "deprecated and will not be supported " "after Linux 2.6.25\n" , elf_interpreter);
@@ -774,7 +788,7 @@ static int load_elf_binary(struct linux_binprm *bprm, struct pt_regs *regs)/* OK, we are done with that, now set up the arg stuff, and then start this sucker up */ -if ((!bprm->sh_bang) && (interpreter_type ==INTERPRETER_AOUT )) { +if (IS_AOUT_INTERP (interpreter_type) && !bprm->sh_bang) {char *passed_p = passed_fileno;sprintf (passed_fileno,"%d" , elf_exec_fileno);
@@ -961,7 +975,7 @@ static int load_elf_binary(struct linux_binprm *bprm, struct pt_regs *regs) }if (elf_interpreter) { -if (interpreter_type ==INTERPRETER_AOUT ) +if (IS_AOUT_INTERP (interpreter_type)) elf_entry =load_aout_interp (&loc->interp_ex, interpreter);else
@@ -990,7 +1004,7 @@ static int load_elf_binary(struct linux_binprm *bprm, struct pt_regs *regs)kfree (elf_phdata); -if (interpreter_type !=INTERPRETER_AOUT ) +if (!IS_AOUT_INTERP (interpreter_type))sys_close (elf_exec_fileno);set_binfmt (&elf_format);
@@ -1006,14 +1020,14 @@ static int load_elf_binary(struct linux_binprm *bprm, struct pt_regs *regs)compute_creds (bprm); current->flags &= ~PF_FORKNOEXEC ; retval =create_elf_tables (bprm, &loc->elf_ex, - (interpreter_type ==INTERPRETER_AOUT ), +IS_AOUT_INTERP (interpreter_type), load_addr, interp_load_addr);if (retval <0 ) {send_sig (SIGKILL , current,0 ); goto out; }/* N.B. passed_fileno might not be initialized? */ -if (interpreter_type ==INTERPRETER_AOUT ) +if (IS_AOUT_INTERP (interpreter_type)) current->mm->arg_start +=strlen (passed_fileno) +1 ; current->mm->end_code = end_code; current->mm->start_code = start_code;
fs/exec.c +1 -2
@@ -25,7 +25,6 @@#include <linux/slab.h> #include <linux/file.h> #include <linux/mman.h> -#include <linux/a.out.h> #include <linux/stat.h> #include <linux/fcntl.h> #include <linux/smp_lock.h>
@@ -1188,7 +1187,7 @@ int search_binary_handler(struct linux_binprm *bprm,struct pt_regs *regs) {int try,retval;struct linux_binfmt *fmt; -#ifdef __alpha__ +#if defined(__alpha__) && defined(CONFIG_BINFMT_AOUT )/* handle /sbin/loader.. */ {struct exec * eh = (struct exec *) bprm->buf;
fs/proc/kcore.c +0 -1
@@ -12,7 +12,6 @@#include <linux/mm.h> #include <linux/proc_fs.h> #include <linux/user.h> -#include <linux/a.out.h> #include <linux/capability.h> #include <linux/elf.h> #include <linux/elfcore.h>
include/asm-alpha/a.out-core.h new file +81 -0
81 lines not on this page · raw message
include/asm-alpha/a.out.h +1 -7
@@ -98,11 +98,5 @@ struct execset_personality (((BFPM ->sh_bang ||EX .ah.entry <0x100000000L \ ? ADDR_LIMIT_32BIT : 0) | PER_OSF4)) -#define STACK_TOP \ - (current->personality & ADDR_LIMIT_32BIT ? 0x80000000 : 0x00120000000UL) - -#define STACK_TOP_MAX 0x00120000000UL - -#endif - +#endif /* __KERNEL__ */ #endif /* __A_OUT_GNU_H__ */
include/asm-alpha/processor.h +5 -0
@@ -20,6 +20,11 @@*/ #define TASK_SIZE (0x40000000000UL) +#define STACK_TOP \ + (current->personality & ADDR_LIMIT_32BIT ? 0x80000000 : 0x00120000000UL) + +#define STACK_TOP_MAX 0x00120000000UL +/* This decides where the kernel will search for a free chunk of vm * space during mmap's. */
include/asm-arm/a.out-core.h new file +49 -0
49 lines not on this page · raw message
include/asm-arm/a.out.h +0 -6
@@ -27,12 +27,6 @@ struct exec#define M_ARM 103 -#ifdef __KERNEL__ -#define STACK_TOP ((current->personality == PER_LINUX_32BIT) ? \ - TASK_SIZE : TASK_SIZE_26) -#define STACK_TOP_MAX TASK_SIZE -#endif -#ifndef LIBRARY_START_TEXT #define LIBRARY_START_TEXT (0x00c00000)#endif
include/asm-arm/processor.h +6 -0
@@ -22,6 +22,12 @@#include <asm/ptrace.h> #include <asm/types.h> +#ifdef __KERNEL__ +#define STACK_TOP ((current->personality == PER_LINUX_32BIT) ? \ + TASK_SIZE : TASK_SIZE_26) +#define STACK_TOP_MAX TASK_SIZE +#endif +union debug_insn {u32 arm;u16 thumb;
include/asm-avr32/a.out.h +0 -7
@@ -17,11 +17,4 @@ struct exec#define N_DRSIZE (a) ((a).a_drsize)#define N_SYMSIZE (a) ((a).a_syms) -#ifdef __KERNEL__ - -#define STACK_TOP TASK_SIZE -#define STACK_TOP_MAX STACK_TOP - -#endif -#endif /* __ASM_AVR32_A_OUT_H */
include/asm-avr32/processor.h +5 -0
@@ -13,6 +13,11 @@#define TASK_SIZE 0x80000000 +#ifdef __KERNEL__ +#define STACK_TOP TASK_SIZE +#define STACK_TOP_MAX STACK_TOP +#endif +#ifndef __ASSEMBLY__static inline void *current_text_addr (void )
include/asm-blackfin/a.out.h +0 -6
@@ -16,10 +16,4 @@ struct exec {#define N_DRSIZE (a) ((a).a_drsize)#define N_SYMSIZE (a) ((a).a_syms) -#ifdef __KERNEL__ - -#define STACK_TOP TASK_SIZE - -#endif -#endif /* __BFIN_A_OUT_H__ */
include/asm-blackfin/processor.h +4 -0
@@ -30,6 +30,10 @@ static inline void wrusp(unsigned long usp)extern unsigned long memory_end;#define TASK_SIZE (memory_end) +#ifdef __KERNEL__ +#define STACK_TOP TASK_SIZE +#endif +#define TASK_UNMAPPED_BASE 0struct thread_struct {
include/asm-cris/a.out.h +0 -6
@@ -6,11 +6,6 @@* wants to know about a.out even if there is no interpreter available... */ -/* grabbed from the intel stuff */ -#define STACK_TOP TASK_SIZE -#define STACK_TOP_MAX STACK_TOP - -struct exec {unsigned long a_info;/* Use macros N_MAGIC, etc for access */
@@ -28,5 +23,4 @@ struct exec#define N_DRSIZE (a) ((a).a_drsize)#define N_SYMSIZE (a) ((a).a_syms) -#endif
include/asm-cris/processor.h +3 -0
@@ -17,6 +17,9 @@struct task_struct ; +#define STACK_TOP TASK_SIZE +#define STACK_TOP_MAX STACK_TOP +/* This decides where the kernel will search for a free chunk of vm * space during mmap's. */
include/asm-generic/Kbuild.asm +3 -0
@@ -1,4 +1,7 @@ +# -*- makefile -*- +ifeq ($(wildcard include/asm-$(SRCARCH)/a.out.h),include/asm-$(SRCARCH)/a.out.h) unifdef-y += a.out.h +endif unifdef-y += auxvec.h unifdef-y += byteorder.h unifdef-y += errno.h
include/asm-h8300/a.out.h +0 -7
@@ -17,11 +17,4 @@ struct exec#define N_DRSIZE (a) ((a).a_drsize)#define N_SYMSIZE (a) ((a).a_syms) -#ifdef __KERNEL__ - -#define STACK_TOP TASK_SIZE -#define STACK_TOP_MAX STACK_TOP - -#endif -#endif /* __H8300_A_OUT_H__ */
include/asm-h8300/processor.h +5 -0
@@ -39,6 +39,11 @@ static inline void wrusp(unsigned long usp) {*/ #define TASK_SIZE (0xFFFFFFFFUL) +#ifdef __KERNEL__ +#define STACK_TOP TASK_SIZE +#define STACK_TOP_MAX STACK_TOP +#endif +/* * This decides where the kernel will search for a free chunk of vm * space during mmap's. We won't be using it
include/asm-ia64/a.out.h +0 -3
@@ -29,7 +29,4 @@ struct exec {#define N_SYMSIZE (x) 0#define N_TXTOFF (x) 0 -#ifdef __KERNEL__ -#include <asm/ustack.h> -#endif #endif /* _ASM_IA64_A_OUT_H */
include/asm-m32r/a.out.h +0 -7
@@ -17,11 +17,4 @@ struct exec#define N_DRSIZE (a) ((a).a_drsize)#define N_SYMSIZE (a) ((a).a_syms) -#ifdef __KERNEL__ - -#define STACK_TOP TASK_SIZE -#define STACK_TOP_MAX STACK_TOP - -#endif -#endif /* _ASM_M32R_A_OUT_H */
include/asm-m32r/processor.h +5 -0
@@ -60,6 +60,11 @@ extern struct cpuinfo_m32r cpu_data[];#define TASK_SIZE (0x00400000UL)#endif +#ifdef __KERNEL__ +#define STACK_TOP TASK_SIZE +#define STACK_TOP_MAX STACK_TOP +#endif +/* This decides where the kernel will search for a free chunk of vm * space during mmap's. */
include/asm-m68k/a.out-core.h new file +67 -0
67 lines not on this page · raw message
include/asm-m68k/a.out.h +0 -7
@@ -17,11 +17,4 @@ struct exec#define N_DRSIZE (a) ((a).a_drsize)#define N_SYMSIZE (a) ((a).a_syms) -#ifdef __KERNEL__ - -#define STACK_TOP TASK_SIZE -#define STACK_TOP_MAX STACK_TOP - -#endif -#endif /* __M68K_A_OUT_H__ */
include/asm-m68k/processor.h +5 -0
@@ -41,6 +41,11 @@ static inline void wrusp(unsigned long usp)#define TASK_SIZE (0x0E000000UL)#endif +#ifdef __KERNEL__ +#define STACK_TOP TASK_SIZE +#define STACK_TOP_MAX STACK_TOP +#endif +/* This decides where the kernel will search for a free chunk of vm * space during mmap's. */
include/asm-mips/a.out.h +0 -13
@@ -32,17 +32,4 @@ struct exec#define N_DRSIZE (a) ((a).a_drsize)#define N_SYMSIZE (a) ((a).a_syms) -#ifdef __KERNEL__ - -#ifdef CONFIG_32BIT -#define STACK_TOP TASK_SIZE -#endif -#ifdef CONFIG_64BIT -#define STACK_TOP \ - (test_thread_flag(TIF_32BIT_ADDR) ? TASK_SIZE32 : TASK_SIZE) -#endif -#define STACK_TOP_MAX TASK_SIZE - -#endif -#endif /* _ASM_A_OUT_H */
include/asm-mips/processor.h +7 -0
@@ -39,6 +39,7 @@ extern unsigned int vced_count, vcei_count;* so don't change it unless you know what you are doing. */ #define TASK_SIZE 0x7fff8000UL +#define STACK_TOP TASK_SIZE/* * This decides where the kernel will search for a free chunk of vm
@@ -57,6 +58,8 @@ extern unsigned int vced_count, vcei_count;*/ #define TASK_SIZE32 0x7fff8000UL#define TASK_SIZE 0x10000000000UL +#define STACK_TOP \ + (test_thread_flag(TIF_32BIT_ADDR) ? TASK_SIZE32 : TASK_SIZE)/* * This decides where the kernel will search for a free chunk of vm
@@ -67,6 +70,10 @@ extern unsigned int vced_count, vcei_count; PAGE_ALIGN(TASK_SIZE32 / 3) : PAGE_ALIGN(TASK_SIZE / 3))#endif +#ifdef __KERNEL__ +#define STACK_TOP_MAX TASK_SIZE +#endif +#define NUM_FPU_REGS 32typedef __u64 fpureg_t ;
include/asm-parisc/a.out.h +0 -10
@@ -17,14 +17,4 @@ struct exec#define N_DRSIZE (a) ((a).a_drsize)#define N_SYMSIZE (a) ((a).a_syms) -#ifdef __KERNEL__ - -/* XXX: STACK_TOP actually should be STACK_BOTTOM for parisc. -* prumpf */ - -#define STACK_TOP TASK_SIZE -#define STACK_TOP_MAX DEFAULT_TASK_SIZE - -#endif -#endif /* __A_OUT_GNU_H__ */
include/asm-parisc/processor.h +10 -0
@@ -46,6 +46,16 @@#define DEFAULT_MAP_BASE DEFAULT_MAP_BASE32#endif +#ifdef __KERNEL__ + +/* XXX: STACK_TOP actually should be STACK_BOTTOM for parisc. +* prumpf */ + +#define STACK_TOP TASK_SIZE +#define STACK_TOP_MAX DEFAULT_TASK_SIZE + +#endif +#ifndef __ASSEMBLY__/*
include/asm-powerpc/a.out.h +0 -19
@@ -17,23 +17,4 @@ struct exec#define N_DRSIZE (a) ((a).a_drsize)#define N_SYMSIZE (a) ((a).a_syms) -#ifdef __KERNEL__ -#ifdef __powerpc64__ - -#define STACK_TOP_USER64 TASK_SIZE_USER64 -#define STACK_TOP_USER32 TASK_SIZE_USER32 - -#define STACK_TOP (test_thread_flag(TIF_32BIT) ? \ - STACK_TOP_USER32 : STACK_TOP_USER64) - -#define STACK_TOP_MAX STACK_TOP_USER64 - -#else /* __powerpc64__ */ - -#define STACK_TOP TASK_SIZE -#define STACK_TOP_MAX STACK_TOP - -#endif /* __powerpc64__ */ -#endif /* __KERNEL__ */ -#endif /* _ASM_POWERPC_A_OUT_H */
include/asm-powerpc/processor.h +19 -0
@@ -112,6 +112,25 @@ extern struct task_struct *last_task_used_spe; TASK_UNMAPPED_BASE_USER32 : TASK_UNMAPPED_BASE_USER64 )#endif +#ifdef __KERNEL__ +#ifdef __powerpc64__ + +#define STACK_TOP_USER64 TASK_SIZE_USER64 +#define STACK_TOP_USER32 TASK_SIZE_USER32 + +#define STACK_TOP (test_thread_flag(TIF_32BIT) ? \ + STACK_TOP_USER32 : STACK_TOP_USER64) + +#define STACK_TOP_MAX STACK_TOP_USER64 + +#else /* __powerpc64__ */ + +#define STACK_TOP TASK_SIZE +#define STACK_TOP_MAX STACK_TOP + +#endif /* __powerpc64__ */ +#endif /* __KERNEL__ */ +typedef struct {unsigned long seg; }mm_segment_t ;
include/asm-s390/a.out.h +0 -7
@@ -29,11 +29,4 @@ struct exec#define N_DRSIZE (a) ((a).a_drsize)#define N_SYMSIZE (a) ((a).a_syms) -#ifdef __KERNEL__ - -#define STACK_TOP TASK_SIZE -#define STACK_TOP_MAX DEFAULT_TASK_SIZE - -#endif -#endif /* __A_OUT_GNU_H__ */
include/asm-s390/processor.h +7 -0
@@ -80,6 +80,13 @@ extern struct task_struct *last_task_used_math;#endif /* __s390x__ */ +#ifdef __KERNEL__ + +#define STACK_TOP TASK_SIZE +#define STACK_TOP_MAX DEFAULT_TASK_SIZE + +#endif +#define HAVE_ARCH_PICK_MMAP_LAYOUT typedef struct {
include/asm-sh/a.out.h +0 -7
@@ -17,11 +17,4 @@ struct exec#define N_DRSIZE (a) ((a).a_drsize)#define N_SYMSIZE (a) ((a).a_syms) -#ifdef __KERNEL__ - -#define STACK_TOP TASK_SIZE -#define STACK_TOP_MAX STACK_TOP - -#endif -#endif /* __ASM_SH_A_OUT_H */
include/asm-sh/processor.h +7 -0
@@ -85,6 +85,13 @@ extern struct sh_cpuinfo cpu_data[];*/ #define TASK_SIZE 0x7c000000UL +#ifdef __KERNEL__ + +#define STACK_TOP TASK_SIZE +#define STACK_TOP_MAX STACK_TOP + +#endif +/* This decides where the kernel will search for a free chunk of vm * space during mmap's. */
include/asm-sh64/a.out.h +0 -7
@@ -28,11 +28,4 @@ struct exec#define N_DRSIZE (a) ((a).a_drsize)#define N_SYMSIZE (a) ((a).a_syms) -#ifdef __KERNEL__ - -#define STACK_TOP TASK_SIZE -#define STACK_TOP_MAX STACK_TOP - -#endif -#endif /* __ASM_SH64_A_OUT_H */
include/asm-sparc/a.out-core.h new file +52 -0
52 lines not on this page · raw message
include/asm-sparc/a.out.h +0 -9
@@ -87,13 +87,4 @@ struct relocation_info /* used when header.a_machtype == M_SPARC */#define N_RELOCATION_INFO_DECLARED 1 -#ifdef __KERNEL__ - -#include <asm/page.h> - -#define STACK_TOP (PAGE_OFFSET - PAGE_SIZE) -#define STACK_TOP_MAX STACK_TOP - -#endif /* __KERNEL__ */ -#endif /* __SPARC_A_OUT_H__ */
include/asm-sparc/processor.h +4 -0
@@ -33,6 +33,10 @@* we can make our access_ok test faster */ #define TASK_SIZE PAGE_OFFSET +#ifdef __KERNEL__ +#define STACK_TOP (PAGE_OFFSET - PAGE_SIZE) +#define STACK_TOP_MAX STACK_TOP +#endif /* __KERNEL__ */ struct task_struct ;
include/asm-sparc/uaccess.h +0 -1
@@ -13,7 +13,6 @@#include <linux/string.h> #include <linux/errno.h> #include <asm/vac-ops.h> -#include <asm/a.out.h> #endif #ifndef __ASSEMBLY__
include/asm-sparc64/a.out-core.h new file +31 -0
@@ -0,0 +1,31 @@ +/* a.out coredump register dumper +* +* Copyright (C) 2007 Red Hat, Inc. All Rights Reserved. +* Written by David Howells ([email protected]) +* +* This program is free software; you can redistribute it and/or +* modify it under the terms of the GNU General Public Licence +* as published by the Free Software Foundation; either version +* 2 of the Licence, or (at your option) any later version. +*/ + +#ifndef _ASM_A_OUT_CORE_H +#define _ASM_A_OUT_CORE_H + +#ifdef __KERNEL__ + +#include <linux/user.h> + +/* +* fill in the user structure for an a.out core dump +*/ +static inline void aout_dump_thread (struct pt_regs *regs,struct user *dump) +{ +/* Only should be used for SunOS and ancient a.out +* SparcLinux binaries... Not worth implementing. +*/ +memset (dump,0 ,sizeof (struct user )); +} + +#endif /* __KERNEL__ */ +#endif /* _ASM_A_OUT_CORE_H */
include/asm-sparc64/a.out.h +0 -12
@@ -93,18 +93,6 @@ struct relocation_info /* used when header.a_machtype == M_SPARC */#define N_RELOCATION_INFO_DECLARED 1 -#ifdef __KERNEL__ - -#define STACK_TOP32 ((1UL << 32UL) - PAGE_SIZE) -#define STACK_TOP64 (0x0000080000000000UL - (1UL << 32UL)) - -#define STACK_TOP (test_thread_flag(TIF_32BIT) ? \ - STACK_TOP32 : STACK_TOP64) - -#define STACK_TOP_MAX STACK_TOP64 - -#endif -#endif /* !(__ASSEMBLY__) */ #endif /* !(__SPARC64_A_OUT_H__) */
include/asm-sparc64/processor.h +12 -1
@@ -14,7 +14,6 @@#define current_text_addr () ({ void *pc; __asm__("rd %%pc, %0" : "=r" (pc)); pc; })#include <asm/asi.h> -#include <asm/a.out.h> #include <asm/pstate.h> #include <asm/ptrace.h> #include <asm/page.h>
@@ -36,7 +35,19 @@#else #define VPTE_SIZE (1 << (VA_BITS - PAGE_SHIFT + 3))#endif +#define TASK_SIZE ((unsigned long)-VPTE_SIZE) +#ifdef __KERNEL__ + +#define STACK_TOP32 ((1UL << 32UL) - PAGE_SIZE) +#define STACK_TOP64 (0x0000080000000000UL - (1UL << 32UL)) + +#define STACK_TOP (test_thread_flag(TIF_32BIT) ? \ + STACK_TOP32 : STACK_TOP64) + +#define STACK_TOP_MAX STACK_TOP64 + +#endif #ifndef __ASSEMBLY__
include/asm-sparc64/uaccess.h +0 -1
@@ -10,7 +10,6 @@#include <linux/compiler.h> #include <linux/sched.h> #include <linux/string.h> -#include <asm/a.out.h> #include <asm/asi.h> #include <asm/system.h> #include <asm/spitfire.h>
include/asm-sparc64/user.h +1 -1
@@ -8,7 +8,7 @@ #ifndef _SPARC64_USER_H #define _SPARC64_USER_H -#include <asm/a.out.h> +#include <linux/a.out.h> struct sunos_regs { unsigned int psr, pc, npc, y; unsigned int regs[15];
include/asm-um/a.out-core.h new file +27 -0
@@ -0,0 +1,27 @@ +/* a.out coredump register dumper +* +* Copyright (C) 2007 Red Hat, Inc. All Rights Reserved. +* Written by David Howells ([email protected]) +* +* This program is free software; you can redistribute it and/or +* modify it under the terms of the GNU General Public Licence +* as published by the Free Software Foundation; either version +* 2 of the Licence, or (at your option) any later version. +*/ + +#ifndef __UM_A_OUT_CORE_H +#define __UM_A_OUT_CORE_H + +#ifdef __KERNEL__ + +#include <linux/user.h> + +/* +* fill in the user structure for an a.out core dump +*/ +static inline void aout_dump_thread (struct pt_regs *regs,struct user *u) +{ +} + +#endif /* __KERNEL__ */ +#endif /* __UM_A_OUT_CORE_H */
include/asm-um/a.out.h +0 -13
@@ -8,17 +8,4 @@#include "asm/arch/a.out.h" -#undef STACK_TOP -#undef STACK_TOP_MAX - -extern unsigned long stacksizelim; - -extern unsigned long host_task_size; - -#define STACK_ROOM (stacksizelim) - -#define STACK_TOP task_size - -#define STACK_TOP_MAX STACK_TOP -#endif
include/asm-um/processor-generic.h +8 -0
@@ -98,9 +98,17 @@ static inline void mm_copy_segments(struct mm_struct *from_mm,* User space process size: 3GB (default). */ extern unsigned long task_size; +extern unsigned long stacksizelim; +extern unsigned long host_task_size;#define TASK_SIZE (task_size) +#undef STACK_TOP +#undef STACK_TOP_MAX +#define STACK_TOP TASK_SIZE +#define STACK_TOP_MAX STACK_TOP +#define STACK_ROOM (stacksizelim) +/* This decides where the kernel will search for a free chunk of vm * space during mmap's. */
include/asm-x86/a.out-core.h new file +65 -0
65 lines not on this page · raw message
include/asm-x86/a.out.h +0 -10
@@ -17,14 +17,4 @@ struct exec#define N_DRSIZE (a) ((a).a_drsize)#define N_SYMSIZE (a) ((a).a_syms) -#ifdef __KERNEL__ -# include <linux/thread_info.h> -# define STACK_TOP TASK_SIZE -# ifdef CONFIG_X86_32 -# define STACK_TOP_MAX STACK_TOP -# else -# define STACK_TOP_MAX TASK_SIZE64 -# endif -#endif -#endif /* _ASM_X86_A_OUT_H */
include/asm-x86/processor_32.h +2 -0
@@ -214,6 +214,8 @@ extern int bootloader_type;* User space process size: 3GB (default). */ #define TASK_SIZE (PAGE_OFFSET) +#define STACK_TOP TASK_SIZE +#define STACK_TOP_MAX STACK_TOP/* This decides where the kernel will search for a free chunk of vm * space during mmap's.
include/asm-x86/processor_64.h +2 -0
@@ -148,6 +148,8 @@ static inline void clear_in_cr4 (unsigned long mask)#define TASK_SIZE_OF (child) ((test_tsk_thread_flag(child, TIF_IA32)) ? IA32_PAGE_OFFSET : TASK_SIZE64)#define TASK_UNMAPPED_BASE PAGE_ALIGN(TASK_SIZE/3) +#define STACK_TOP TASK_SIZE +#define STACK_TOP_MAX TASK_SIZE64/* * Size of io_bitmap.
include/asm-xtensa/a.out.h +0 -5
@@ -14,11 +14,6 @@ #ifndef _XTENSA_A_OUT_H #define _XTENSA_A_OUT_H -/* Note: the kernel needs the a.out definitions, even if only ELF is used. */ - -#define STACK_TOP TASK_SIZE -#define STACK_TOP_MAX STACK_TOP - struct exec { unsigned long a_info;
include/asm-xtensa/processor.h +2 -0
@@ -34,6 +34,8 @@*/ #define TASK_SIZE __XTENSA_UL_CONST(0x40000000) +#define STACK_TOP TASK_SIZE +#define STACK_TOP_MAX STACK_TOP/* * General exception cause assigned to debug exceptions. Debug exceptions go
include/linux/Kbuild +3 -0
@@ -1,3 +1,4 @@ +# -*- makefile -*- header-y += byteorder/ header-y += dvb/ header-y += hdlc/
@@ -17,7 +18,9 @@ header-y += usb/ header-y += affs_hardblocks.h header-y += aio_abi.h +ifeq ($(wildcard include/asm-$(SRCARCH)/a.out.h),include/asm-$(SRCARCH)/a.out.h) header-y += a.out.h +endif header-y += arcfb.h header-y += atmapi.h header-y += atmbr2684.h
include/linux/a.out.h +16 -1
@@ -1,6 +1,13 @@#ifndef __A_OUT_GNU_H__#define __A_OUT_GNU_H__ +#if defined(CONFIG_BINFMT_AOUT ) || \ + defined(CONFIG_BINFMT_AOUT_MODULE ) || \ + defined(CONFIG_IA32_AOUT ) || \ + defined(CONFIG_IA32_AOUT_MODULE ) ||\ + defined(CONFIG_BINFMT_AOUT32 ) || \ + defined(CONFIG_BINFMT_AOUT32_MODULE ) +#define __GNU_EXEC_MACROS__#ifndef __STRUCT_EXEC_OVERRIDE__
@@ -9,6 +16,8 @@#endif /* __STRUCT_EXEC_OVERRIDE__ */ +#ifndef __ASSEMBLY__ + /* these go in the N_MACHTYPE field */ enum machine_type { #if defined (M_OLDSUN2)
@@ -264,5 +273,11 @@ struct relocation_info };#endif /* no N_RELOCATION_INFO_DECLARED. */ - +#endif /*__ASSEMBLY__ */ +#else /* CONFIG_BINFMT_AOUT||CONFIG_IA32_AOUT */ +#ifndef __ASSEMBLY__ +struct exec { +}; +#endif +#endif /* CONFIG_BINFMT_AOUT||CONFIG_IA32_AOUT */ #endif /* __A_OUT_GNU_H__ */
include/linux/kernel.h +0 -2
@@ -172,8 +172,6 @@ extern int kernel_text_address(unsigned long addr);struct pid ;extern struct pid *session_of_pgrp (struct pid *pgrp); -extern void dump_thread (struct pt_regs *regs,struct user *dump); -#ifdef CONFIG_PRINTK asmlinkage int vprintk(const char *fmt, va_list args) __attribute__ ((format (printf,1 ,0 )));
PATCH 2/6 MTD: Add support for the SST 39VF1601 flash chip [try #4]
In reply to David HowellsAdd support for the SST 39VF1601 flash chip.
---
drivers/mtd/chips/jedec_probe.c | 15 +++++++++++++++ 1 files changed, 15 insertions(+), 0 deletions(-)
drivers/mtd/chips/jedec_probe.c +15 -0
@@ -1527,6 +1527,21 @@ static const struct amd_flash_info jedec_table[] = {ERASEINFO (0x1000 ,256 ), ERASEINFO(0x1000,256) } + }, { + .mfr_id = MANUFACTURER_SST, /* should be CFI */ + .dev_id = SST39VF1601, + .name = "SST 39VF1601", + .uaddr = { + [0] = MTD_UADDR_0x5555_0x2AAA, /* x8 */ + [1 ] = MTD_UADDR_0x5555_0x2AAA/* x16 */ + }, + .DevSize = SIZE_2MiB, + .CmdSet = P_ID_AMD_STD, + .NumEraseRegions= 2, + .regions = { +ERASEINFO (0x1000 ,256 ), + ERASEINFO(0x1000,256) + } }, { .mfr_id = MANUFACTURER_ST,
PATCH 3/6 USB: net2280 can't have a function called show_registers() [try #4]
In reply to David Howellsnet2280 can't have a function called show_registers() because this can produce a namespace clash with an arch function of the same name.
All this driver's functions and variables should really be prefixed with "net2280_" to avoid such a problem in future.
---
drivers/usb/gadget/net2280.c | 4 ++-- 1 files changed, 2 insertions(+), 2 deletions(-)
drivers/usb/gadget/net2280.c +2 -2
@@ -1419,7 +1419,7 @@ show_function (struct device *_dev, struct device_attribute *attr, char *buf) static DEVICE_ATTR (function, S_IRUGO, show_function, NULL);static ssize_t -show_registers (struct device *_dev,struct device_attribute *attr,char *buf) +net2280_show_registers (struct device *_dev,struct device_attribute *attr,char *buf) {struct net2280 *dev;char *next;
@@ -1571,7 +1571,7 @@ show_registers (struct device *_dev, struct device_attribute *attr, char *buf)return PAGE_SIZE - size; } -static DEVICE_ATTR (registers, S_IRUGO, show_registers, NULL); +static DEVICE_ATTR (registers, S_IRUGO, net2280_show_registers, NULL);static ssize_t show_queues (struct device *_dev,struct device_attribute *attr,char *buf)
PATCH 4/6 MN10300: Allocate serial port UART IDs for on-chip serial ports [try #4]
In reply to David HowellsAllocate serial port UART type IDs for the MN10300 on-chip serial ports.
---
include/linux/serial_core.h | 3 +++ 1 files changed, 3 insertions(+), 0 deletions(-)
include/linux/serial_core.h +3 -0
@@ -149,6 +149,9 @@/* Freescale ColdFire */ #define PORT_MCF 78 +/* MN10300 on-chip UART numbers */ +#define PORT_MN10300 79 +#define PORT_MN10300_CTS 80#ifdef __KERNEL__
PATCH 6/6 MN10300: Add MTD flash support for the ASB2303 board [try #4]
In reply to David HowellsAdd MTD flash support for the ASB2303 board.
---
arch/mn10300/configs/asb2303_defconfig | 1 drivers/mtd/chips/jedec_probe.c | 2 drivers/mtd/maps/Kconfig | 8 + drivers/mtd/maps/Makefile | 1 drivers/mtd/maps/asb2303-flash.c | 184 ++++++++++++++++++++++++++++++++ 5 files changed, 196 insertions(+), 0 deletions(-)
arch/mn10300/configs/asb2303_defconfig +1 -0
@@ -282,6 +282,7 @@ CONFIG_MTD_CFI_UTIL=y # CONFIG_MTD_COMPLEX_MAPPINGS is not set # CONFIG_MTD_PHYSMAP is not set # CONFIG_MTD_PLATRAM is not set +CONFIG_MTD_ASB2303=y # # Self-contained MTD device drivers
drivers/mtd/chips/jedec_probe.c +2 -0
@@ -1883,11 +1883,13 @@ static inline __u8 finfo_uaddr(const struct amd_flash_info *finfo, int device_ty uaddr = finfo->uaddr[uaddr_idx]; +#ifndef CONFIG_MN10300_UNIT_ASB2303 if (uaddr !=MTD_UADDR_NOT_SUPPORTED ) {/* ASSERT("The unlock addresses for non-8-bit mode are bollocks. We don't really need an array."); */ uaddr = finfo->uaddr[0 ]; } +#endif uaddr_done:return uaddr;
drivers/mtd/maps/Kconfig +8 -0
@@ -597,5 +597,13 @@ config MTD_PLATRAM This selection automatically selects the map_ram driver. +config MTD_ASB2303 + tristate "CFI Flash device mapped on MEI ASB2303" + depends on MTD_CFI && MN10300_UNIT_ASB2303 && MTD_PARTITIONS + help + This enables access to the flash chips on the ASB2303 board with + the MN10300 processor. + Say 'Y' if you have this board. + endmenu
drivers/mtd/maps/Makefile +1 -0
@@ -69,3 +69,4 @@ obj-$(CONFIG_MTD_PLATRAM) += plat-ram.o obj-$(CONFIG_MTD_OMAP_NOR) += omap_nor.o obj-$(CONFIG_MTD_MTX1) += mtx-1_flash.o obj-$(CONFIG_MTD_INTEL_VR_NOR) += intel_vr_nor.o +obj-$(CONFIG_MTD_ASB2303) += asb2303-flash.o
drivers/mtd/maps/asb2303-flash.c new file +184 -0
184 lines not on this page · raw message
Hi David.
A few comments to patch #5.
I only looked at the kbuild related stuff - and I have seen stuff much worse than this.
Yet I have a few comments:
arch/mn10300/Makefile:
1) Use KBUILD_CFLAGS & KBUILD_AFLAGS & KBUILD_CPPFLAGS - they have replaced the former xFLAGS.
2) Consider using unit-y as replacement for UNIT.
This enable you to do:
unit-$(CONFIG_MN10300_UNIT_ASB2303) += asb2303
3) Same for PROCESSOR => processor-y
4) Drop the symlinks - they are evil...
Use a structure like:include/asm-mn10300/asb2303/proc/*.h
Then you adjust -I include/asm-mn10300/asb2303
and no symlinks needed.
And if you change processor kbuild will notice
and recompile everything.
No-one else does it this way but mn10300 could show how to do it.
5)
+zImage: vmlinux
+ $(Q)$(MAKE) $(build)=$(boot) $(KBUILD_IMAGE)
+
+all: zImage
+
+Image: vmlinux
+ $(Q)$(MAKE) $(build)=arch/mn10300/boot $@
This could be done as:
+Image zImage: vmlinux
+ $(Q)$(MAKE) $(build)=$(boot) $(boot)/$@
And then modify boot/Makefile accordingly
6) archdep is long gone - delete the following
+archdep: scripts/mkdep symlinks
+ $(Q)$(MAKE) -C arch/mn10300/boot dep
7) Please set KBUILD_DEFCONFIG := asb2303_defconfig This enable build monkeys(1) to do "make ARCH=mn10300 defconfig"
(1) such as me
arch/mn10300/boot/Makefile:
1) You can safely remove the copyright of Linus..
Same goes for other places where his copyright are kept but filecontent is new.
2) The Image target is missing (as defined in arch/mn10300/Makefile Can you just kill it?
arch/mn10300/boot/compressed/Makefile:
1) Is -tarditional really needed. We try to kill it all over (slowly)
2) Please name the linker script *.lds
arch/mn10300/kernel/Makefile:
+# This next line shouldn't be necessary, but it is. +CPPFLAGS += $(CPPFLAGS_$(@F)) +CPPFLAGS_asm-offsets.s = -D__ASM_OFFSETS_H__
Please explain why...
arch/mn10300/oprofile/Makefile:
+profdrvr-y := op_model_null.o
+
+oprofile-y := $(DRIVER_OBJS) $(profdrvr-y)
The variable profdrvr seems useless.
arch/mn10300/unit-asb2303/Makefile:
Please drop this wrong comment:
+# Note! Dependencies are done automagically by 'make dep', which also +# removes any old dependencies. DON'T put your own dependencies here +# unless it's something special (ie not a .c file).
+#
+# Note 2! The CFLAGS definitions are now in the main makefile... +
Seen in other places where they are equally wrong/outdated.
Sam
Quoted 5 lines · Sam Ravnborg
arch/mn10300/Makefile:1) Use
KBUILD_CFLAGS&KBUILD_AFLAGS&KBUILD_CPPFLAGS- they have replaced the former xFLAGS.
Done. What about ASFLAGS and LDFLAGS?
Quoted 5 lines
2) Consider using unit-y as replacement for UNIT.
This enable you to do:
unit-$(CONFIG_MN10300_UNIT_ASB2303) += asb23033) Same for PROCESSOR => processor-y
That makes sense if I'm not calculating UNIT or PROCESSOR anyway. However, see below.
Quoted 3 lines
4) Drop the symlinks - they are evil...
Use a structure like:include/asm-mn10300/asb2303/proc/*.h
No. I think all the arch headers should really appear to be #included under asm/. That means that the structure would have to be:
include/asm-mn10300/asb2303/asm/proc/*.h
That then puts all these header files several levels further down, which isn't that good.
Quoted 4 lines
Then you adjust -I
include/asm-mn10300/asb2303
and no symlinks needed.
And if you change processor kbuild will notice
and recompile everything.
That's the only plus, but it's a smaller plus than not interpolating several levels of almost empty directory into the paths for the proc- and unit-specific headers.
Quoted 1 line
No-one else does it this way but mn10300 could show how to do it.
I could. Or I could do what everyone else does.
Actually, what you perhaps ought to do for a start is to move the individual include/asm-$ARCH dirs to arch/$ARCH/asm and then you can avoid that symlink too.
Review
Quoted 12 lines
5)
(quoted diff) +7
-0+zImage: vmlinux + $(Q)$(MAKE) $(build)=$(boot) $(KBUILD_IMAGE) + +all: zImage + +Image: vmlinux + $(Q)$(MAKE) $(build)=arch/mn10300/boot $@This could be done as:
(quoted diff) +2
-0+Image zImage: vmlinux + $(Q)$(MAKE) $(build)=$(boot) $(boot)/$@
Done.
Quoted 1 line
And then modify boot/Makefile accordingly
I don't see why it needs modification. $(KBUILD_IMAGE) == $(boot)/zImage for the zImage target.
Quoted 1 line
6) archdep is long gone - delete the following
Done.
Quoted 2 lines
7) Please set
KBUILD_DEFCONFIG:=asb2303_defconfigThis enable build monkeys(1) to do "make ARCH=mn10300 defconfig"
Done.
Quoted 5 lines
arch/mn10300/boot/Makefile:1) You can safely remove the copyright of Linus..
Same goes for other places where his copyright are kept but filecontent is new.
The copyright assignment on some of these files was made by MEI. I'm not sure I can change them.
Quoted 2 lines
2) The Image target is missing (as defined in
arch/mn10300/MakefileCan you just kill it?
Yes. Done.
Quoted 2 lines
arch/mn10300/boot/compressed/Makefile:
1) Is -tarditional really needed. We try to kill it all over (slowly)
Apparently not. Consider it gone.
Quoted 1 line
2) Please name the linker script *.lds
Done.
Quoted 6 lines
arch/mn10300/kernel/Makefile:(quoted diff) +3
-0+# This next line shouldn't be necessary, but it is. +CPPFLAGS += $(CPPFLAGS_$(@F)) +CPPFLAGS_asm-offsets.s = -D__ASM_OFFSETS_H__Please explain why...
I don't remember why. It doesn't seem to be necessary now, however, so it's now gone.
Quoted 6 lines
arch/mn10300/oprofile/Makefile:(quoted diff) +3
-0+profdrvr-y := op_model_null.o + +oprofile-y := $(DRIVER_OBJS) $(profdrvr-y)The variable profdrvr seems useless.
Gone.
Quoted 11 lines
arch/mn10300/unit-asb2303/Makefile:Please drop this wrong comment:
(quoted diff) +6
-0+# Note! Dependencies are done automagically by 'make dep', which also +# removes any old dependencies. DON'T put your own dependencies here +# unless it's something special (ie not a .c file). +# +# Note 2! The CFLAGS definitions are now in the main makefile... +Seen in other places where they are equally wrong/outdated.
Gone.
David
Hi David.
Quoted 6 lines
Quoted 4 lines
arch/mn10300/Makefile:1) Use
KBUILD_CFLAGS&KBUILD_AFLAGS&KBUILD_CPPFLAGS- they have replaced the former xFLAGS.Done. What about ASFLAGS and LDFLAGS?
kbuild does not know anything about ASFLAGS.
In the whole kernel tree I only see frv assign them but the value is never used.
LDFLAGS has not been changed - it was not such an easy cut. And we anyway use the linker in much more ways so when to use it and when not...
Quoted 11 lines
Quoted 3 lines
4) Drop the symlinks - they are evil...
Use a structure like:include/asm-mn10300/asb2303/proc/*.hNo. I think all the arch headers should really appear to be #included under asm/. That means that the structure would have to be:
include/asm-mn10300/asb2303/asm/proc/*.hThat then puts all these header files several levels further down, which isn't that good.
I would prefer that any day as replacement for the symlinks.
But as everyone else seems so happy with the symlinks do whatever you prefer.
Quoted 9 lines
Quoted 4 lines
Then you adjust -I
include/asm-mn10300/asb2303
and no symlinks needed.
And if you change processor kbuild will notice
and recompile everything.That's the only plus, but it's a smaller plus than not interpolating several levels of almost empty directory into the paths for the proc- and unit-specific headers.
Quoted 7 lines
Quoted 1 line
No-one else does it this way but mn10300 could show how to do it.
I could. Or I could do what everyone else does.
Actually, what you perhaps ought to do for a start is to move the individual
include/asm-$ARCHdirs toarch/$ARCH/asmand then you can avoid that symlink too.
It will wait until we save ARCH so we can detect
ARCH changes.
Quoted 16 lines
Review
Quoted 13 lines
5)
(quoted diff) +7
-0+zImage: vmlinux + $(Q)$(MAKE) $(build)=$(boot) $(KBUILD_IMAGE) + +all: zImage + +Image: vmlinux + $(Q)$(MAKE) $(build)=arch/mn10300/boot $@This could be done as:
(quoted diff) +2
-0+Image zImage: vmlinux + $(Q)$(MAKE) $(build)=$(boot) $(boot)/$@Done.
Quoted 4 lines
Quoted 1 line
And then modify boot/Makefile accordingly
I don't see why it needs modification. $(KBUILD_IMAGE) == $(boot)/zImage for the zImage target.
For the Image target it is Image without $(boot)/ but that target was never supported anyway.
Quoted 6 lines
Quoted 3 lines
1) You can safely remove the copyright of Linus..
Same goes for other places where his copyright are kept but filecontent is new.The copyright assignment on some of these files was made by MEI. I'm not sure I can change them.
It just seemed stupid that someone having copyright on a file where the person only had contributed the copyright linei (for said file).
Sam
Quoted 3 lines · Sam Ravnborg
kbuild does not know anything about ASFLAGS.
In the whole kernel tree I only see frv assign them but the value is never used.
Hmmm... I think it used to be. No matter, I'll drop it from MN10300.
Quoted 2 lines
It just seemed stupid that someone having copyright on a file where the person only had contributed the copyright linei (for said file).
I'll consult MEI as to what boilerplate copyright messages I should plaster on such files.
David
A message that is not in the archive (sent off-list or not yet received): [email protected]
Re: [PATCH 5/6] MN10300: Add the MN10300/AM33 architecture to the kernel [try #4]
For those who've asked, if patch 5/6 didn't reach them because it's too big, it can be obtained from here instead:
http://people.redhat.com/~dhowells/mn10300/mn10300-arch.tar.bz2
David