Skip to content

Commit

Permalink
[SPARC64]: Make use of the new fs/compat_binfmt_elf.c
Browse files Browse the repository at this point in the history
Signed-off-by: David S. Miller <davem@davemloft.net>
  • Loading branch information
David S. Miller committed Feb 8, 2008
1 parent 2ba85f3 commit 48c946a
Show file tree
Hide file tree
Showing 4 changed files with 52 additions and 152 deletions.
8 changes: 1 addition & 7 deletions arch/sparc64/Kconfig
Original file line number Diff line number Diff line change
Expand Up @@ -380,13 +380,7 @@ config COMPAT
bool
depends on SPARC32_COMPAT
default y

config BINFMT_ELF32
bool "Kernel support for 32-bit ELF binaries"
depends on SPARC32_COMPAT
help
This allows you to run 32-bit Linux/ELF binaries on your Ultra.
Everybody wants this; say Y.
select COMPAT_BINFMT_ELF

config BINFMT_AOUT32
bool "Kernel support for 32-bit (ie. SunOS) a.out binaries"
Expand Down
1 change: 0 additions & 1 deletion arch/sparc64/kernel/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,6 @@ obj-$(CONFIG_PCI) += ebus.o isa.o pci_common.o \
obj-$(CONFIG_PCI_MSI) += pci_msi.o
obj-$(CONFIG_SMP) += smp.o trampoline.o hvtramp.o
obj-$(CONFIG_SPARC32_COMPAT) += sys32.o sys_sparc32.o signal32.o
obj-$(CONFIG_BINFMT_ELF32) += binfmt_elf32.o
obj-$(CONFIG_BINFMT_AOUT32) += binfmt_aout32.o
obj-$(CONFIG_MODULES) += module.o
obj-$(CONFIG_US3_FREQ) += us3_cpufreq.o
Expand Down
136 changes: 0 additions & 136 deletions arch/sparc64/kernel/binfmt_elf32.c

This file was deleted.

59 changes: 51 additions & 8 deletions include/asm-sparc64/elf.h
Original file line number Diff line number Diff line change
Expand Up @@ -75,7 +75,6 @@
/*
* These are used to set parameters in the core dumps.
*/
#ifndef ELF_ARCH
#define ELF_ARCH EM_SPARCV9
#define ELF_CLASS ELFCLASS64
#define ELF_DATA ELFDATA2MSB
Expand All @@ -100,14 +99,59 @@ typedef struct {
unsigned long pr_gsr;
unsigned long pr_fprs;
} elf_fpregset_t;
#endif

/* Format of 32-bit elf_gregset_t is:
* G0 --> G7
* O0 --> O7
* L0 --> L7
* I0 --> I7
* PSR, PC, nPC, Y, WIM, TBR
*/
typedef unsigned int compat_elf_greg_t;
#define COMPAT_ELF_NGREG 38
typedef compat_elf_greg_t compat_elf_gregset_t[COMPAT_ELF_NGREG];

typedef struct {
union {
unsigned int pr_regs[32];
unsigned long pr_dregs[16];
} pr_fr;
unsigned int __unused;
unsigned int pr_fsr;
unsigned char pr_qcnt;
unsigned char pr_q_entrysize;
unsigned char pr_en;
unsigned int pr_q[64];
} compat_elf_fpregset_t;

/* UltraSparc extensions. Still unused, but will be eventually. */
typedef struct {
unsigned int pr_type;
unsigned int pr_align;
union {
struct {
union {
unsigned int pr_regs[32];
unsigned long pr_dregs[16];
long double pr_qregs[8];
} pr_xfr;
} pr_v8p;
unsigned int pr_xfsr;
unsigned int pr_fprs;
unsigned int pr_xg[8];
unsigned int pr_xo[8];
unsigned long pr_tstate;
unsigned int pr_filler[8];
} pr_un;
} elf_xregset_t;

/*
* This is used to ensure we don't load something for the wrong architecture.
*/
#ifndef elf_check_arch
#define elf_check_arch(x) ((x)->e_machine == ELF_ARCH) /* Might be EM_SPARCV9 or EM_SPARC */
#endif
#define elf_check_arch(x) ((x)->e_machine == ELF_ARCH)
#define compat_elf_check_arch(x) ((x)->e_machine == EM_SPARC || \
(x)->e_machine == EM_SPARC32PLUS)
#define compat_start_thread start_thread32

#define USE_ELF_CORE_DUMP
#define ELF_EXEC_PAGESIZE PAGE_SIZE
Expand All @@ -117,9 +161,8 @@ typedef struct {
the loader. We need to make sure that it is out of the way of the program
that it will "exec", and that there is sufficient room for the brk. */

#ifndef ELF_ET_DYN_BASE
#define ELF_ET_DYN_BASE 0x0000010000000000UL
#endif
#define ELF_ET_DYN_BASE 0x0000010000000000UL
#define COMPAT_ELF_ET_DYN_BASE 0x0000000070000000UL


/* This yields a mask that user programs can use to figure out what
Expand Down

0 comments on commit 48c946a

Please sign in to comment.