1/* 2 * binfmt_elf32.c: Support 32-bit PPC ELF binaries on Power3 and followons. 3 * based on the SPARC64 version. 4 * Copyright (C) 1995, 1996, 1997, 1998 David S. Miller (davem@redhat.com) 5 * Copyright (C) 1995, 1996, 1997, 1998 Jakub Jelinek (jj@ultra.linux.cz) 6 * 7 * Copyright (C) 2000,2001 Ken Aaker (kdaaker@rchland.vnet.ibm.com), IBM Corp 8 * Copyright (C) 2001 Anton Blanchard (anton@au.ibm.com), IBM 9 * 10 * This program is free software; you can redistribute it and/or 11 * modify it under the terms of the GNU General Public License 12 * as published by the Free Software Foundation; either version 13 * 2 of the License, or (at your option) any later version. 14 */ 15 16#define ELF_ARCH EM_PPC 17#define ELF_CLASS ELFCLASS32 18#define ELF_DATA ELFDATA2MSB; 19 20#include <asm/processor.h> 21#include <linux/module.h> 22#include <linux/config.h> 23#include <linux/elfcore.h> 24 25struct timeval32 26{ 27 int tv_sec, tv_usec; 28}; 29 30#define elf_prstatus elf_prstatus32 31struct elf_prstatus32 32{ 33 struct elf_siginfo pr_info; /* Info associated with signal */ 34 short pr_cursig; /* Current signal */ 35 unsigned int pr_sigpend; /* Set of pending signals */ 36 unsigned int pr_sighold; /* Set of held signals */ 37 pid_t pr_pid; 38 pid_t pr_ppid; 39 pid_t pr_pgrp; 40 pid_t pr_sid; 41 struct timeval32 pr_utime; /* User time */ 42 struct timeval32 pr_stime; /* System time */ 43 struct timeval32 pr_cutime; /* Cumulative user time */ 44 struct timeval32 pr_cstime; /* Cumulative system time */ 45 elf_gregset_t pr_reg; /* General purpose registers. */ 46 int pr_fpvalid; /* True if math co-processor being used. */ 47}; 48 49#define elf_prpsinfo elf_prpsinfo32 50struct elf_prpsinfo32 51{ 52 char pr_state; /* numeric process state */ 53 char pr_sname; /* char for pr_state */ 54 char pr_zomb; /* zombie */ 55 char pr_nice; /* nice val */ 56 unsigned int pr_flag; /* flags */ 57 u32 pr_uid; 58 u32 pr_gid; 59 pid_t pr_pid, pr_ppid, pr_pgrp, pr_sid; 60 /* Lots missing */ 61 char pr_fname[16]; /* filename of executable */ 62 char pr_psargs[ELF_PRARGSZ]; /* initial part of arg list */ 63}; 64 65extern void start_thread32(struct pt_regs *, unsigned long, unsigned long); 66#undef start_thread 67#define start_thread start_thread32 68#define init_elf_binfmt init_elf32_binfmt 69 70#undef CONFIG_BINFMT_ELF 71#ifdef CONFIG_BINFMT_ELF32 72#define CONFIG_BINFMT_ELF CONFIG_BINFMT_ELF32 73#endif 74#undef CONFIG_BINFMT_ELF_MODULE 75#ifdef CONFIG_BINFMT_ELF32_MODULE 76#define CONFIG_BINFMT_ELF_MODULE CONFIG_BINFMT_ELF32_MODULE 77#endif 78 79#include "../../../fs/binfmt_elf.c" 80