From 18d14704d66f651395a68c8a70c86f0a22bccb31 Mon Sep 17 00:00:00 2001 From: Mark Salter Date: Tue, 1 May 2012 20:37:49 -0400 Subject: [PATCH 1/3] C6X: change main arch kbuild symbol Currently the c6x architecture uses CONFIG_TMS320C6X as the main architecture symbol. Most architectures use a more intuitive name based on the architecture directory name. There are no current users of TMS320C6X so this patch simply changes CONFIG_TMS320C6X to the more intuitive CONFIG_C6X. Signed-off-by: Mark Salter Acked-by: Mike Frysinger --- arch/c6x/Kconfig | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/arch/c6x/Kconfig b/arch/c6x/Kconfig index 1c3ccd416d50a..3fc28fbb1cc4a 100644 --- a/arch/c6x/Kconfig +++ b/arch/c6x/Kconfig @@ -3,7 +3,7 @@ # see Documentation/kbuild/kconfig-language.txt. # -config TMS320C6X +config C6X def_bool y select CLKDEV_LOOKUP select GENERIC_IRQ_SHOW From fce244762775f662f5a278a05a6e494b6e4f2774 Mon Sep 17 00:00:00 2001 From: Mark Salter Date: Mon, 23 Apr 2012 10:02:08 -0400 Subject: [PATCH 2/3] C6X: add support to build with BINFMT_ELF_FDPIC C6x userspace supports a shared library mechanism called DSBT for systems with no MMU. DSBT is similar to FDPIC in allowing shared text segments and private copies of data segments without an MMU. Both methods access data using a base register and offset. With FDPIC, the caller of an external function sets up the base register for the callee. With DSBT, the called function sets up its own base register. Other details differ but both userspaces need the same thing from the kernel loader: a map of where each ELF segment was loaded. The FDPIC loader already provides this, so DSBT just uses it. This patch enables BINFMT_ELF_FDPIC by default for C6X and provides the necessary architecture hooks for the generic loader. Signed-off-by: Mark Salter --- arch/c6x/include/asm/elf.h | 14 +++++++++++++- arch/c6x/include/asm/mmu.h | 4 ++++ arch/c6x/include/asm/ptrace.h | 5 +++++ fs/Kconfig.binfmt | 2 +- 4 files changed, 23 insertions(+), 2 deletions(-) diff --git a/arch/c6x/include/asm/elf.h b/arch/c6x/include/asm/elf.h index d57865ba2c442..f4552db20b4a6 100644 --- a/arch/c6x/include/asm/elf.h +++ b/arch/c6x/include/asm/elf.h @@ -30,7 +30,19 @@ typedef elf_fpreg_t elf_fpregset_t[ELF_NFPREG]; */ #define elf_check_arch(x) ((x)->e_machine == EM_TI_C6000) -#define elf_check_const_displacement(x) (1) +#define elf_check_fdpic(x) (1) +#define elf_check_const_displacement(x) (0) + +#define ELF_FDPIC_PLAT_INIT(_regs, _exec_map, _interp_map, _dynamic_addr) \ +do { \ + _regs->b4 = (_exec_map); \ + _regs->a6 = (_interp_map); \ + _regs->b6 = (_dynamic_addr); \ +} while (0) + +#define ELF_FDPIC_CORE_EFLAGS 0 + +#define ELF_CORE_COPY_FPREGS(...) 0 /* No FPU regs to copy */ /* * These are used to set parameters in the core dumps. diff --git a/arch/c6x/include/asm/mmu.h b/arch/c6x/include/asm/mmu.h index 41592bf160676..4467e770a1ce4 100644 --- a/arch/c6x/include/asm/mmu.h +++ b/arch/c6x/include/asm/mmu.h @@ -13,6 +13,10 @@ typedef struct { unsigned long end_brk; +#ifdef CONFIG_BINFMT_ELF_FDPIC + unsigned long exec_fdpic_loadmap; + unsigned long interp_fdpic_loadmap; +#endif } mm_context_t; #endif /* _ASM_C6X_MMU_H */ diff --git a/arch/c6x/include/asm/ptrace.h b/arch/c6x/include/asm/ptrace.h index 21e8d7931fe7c..b04ff5964258b 100644 --- a/arch/c6x/include/asm/ptrace.h +++ b/arch/c6x/include/asm/ptrace.h @@ -97,6 +97,11 @@ #define PT_DP PT_B14 /* Data Segment Pointer (B14) */ #define PT_SP PT_B15 /* Stack Pointer (B15) */ +#define PTRACE_GETFDPIC 31 /* get the ELF fdpic loadmap address */ + +#define PTRACE_GETFDPIC_EXEC 0 /* [addr] request the executable loadmap */ +#define PTRACE_GETFDPIC_INTERP 1 /* [addr] request the interpreter loadmap */ + #ifndef __ASSEMBLY__ #ifdef _BIG_ENDIAN diff --git a/fs/Kconfig.binfmt b/fs/Kconfig.binfmt index e95d1b64082ca..0225742027496 100644 --- a/fs/Kconfig.binfmt +++ b/fs/Kconfig.binfmt @@ -33,7 +33,7 @@ config ARCH_BINFMT_ELF_RANDOMIZE_PIE config BINFMT_ELF_FDPIC bool "Kernel support for FDPIC ELF binaries" default y - depends on (FRV || BLACKFIN || (SUPERH32 && !MMU)) + depends on (FRV || BLACKFIN || (SUPERH32 && !MMU) || C6X) help ELF FDPIC binaries are based on ELF, but allow the individual load segments of a binary to be located in memory independently of each From 8ff98b9c993d59d6b396a42266c6d323c8f28cec Mon Sep 17 00:00:00 2001 From: Mark Salter Date: Tue, 15 May 2012 10:14:19 -0400 Subject: [PATCH 3/3] C6X: remove unused config items Signed-off-by: Mark Salter --- arch/c6x/Kconfig | 12 ------------ 1 file changed, 12 deletions(-) diff --git a/arch/c6x/Kconfig b/arch/c6x/Kconfig index 3fc28fbb1cc4a..1f15b88b537fb 100644 --- a/arch/c6x/Kconfig +++ b/arch/c6x/Kconfig @@ -19,24 +19,12 @@ config C6X config MMU def_bool n -config ZONE_DMA - def_bool y - config FPU def_bool n -config HIGHMEM - def_bool n - -config NUMA - def_bool n - config RWSEM_GENERIC_SPINLOCK def_bool y -config RWSEM_XCHGADD_ALGORITHM - def_bool n - config GENERIC_CALIBRATE_DELAY def_bool y