~ [ source navigation ] ~ [ diff markup ] ~ [ identifier search ] ~

TOMOYO Linux Cross Reference
Linux/arch/parisc/kernel/binfmt_elf32.c

Version: ~ [ linux-5.11-rc3 ] ~ [ linux-5.10.7 ] ~ [ linux-5.9.16 ] ~ [ linux-5.8.18 ] ~ [ linux-5.7.19 ] ~ [ linux-5.6.19 ] ~ [ linux-5.5.19 ] ~ [ linux-5.4.89 ] ~ [ linux-5.3.18 ] ~ [ linux-5.2.21 ] ~ [ linux-5.1.21 ] ~ [ linux-5.0.21 ] ~ [ linux-4.20.17 ] ~ [ linux-4.19.167 ] ~ [ linux-4.18.20 ] ~ [ linux-4.17.19 ] ~ [ linux-4.16.18 ] ~ [ linux-4.15.18 ] ~ [ linux-4.14.215 ] ~ [ linux-4.13.16 ] ~ [ linux-4.12.14 ] ~ [ linux-4.11.12 ] ~ [ linux-4.10.17 ] ~ [ linux-4.9.251 ] ~ [ linux-4.8.17 ] ~ [ linux-4.7.10 ] ~ [ linux-4.6.7 ] ~ [ linux-4.5.7 ] ~ [ linux-4.4.251 ] ~ [ linux-4.3.6 ] ~ [ linux-4.2.8 ] ~ [ linux-4.1.52 ] ~ [ linux-4.0.9 ] ~ [ linux-3.19.8 ] ~ [ linux-3.18.140 ] ~ [ linux-3.17.8 ] ~ [ linux-3.16.85 ] ~ [ linux-3.15.10 ] ~ [ linux-3.14.79 ] ~ [ linux-3.13.11 ] ~ [ linux-3.12.74 ] ~ [ linux-3.11.10 ] ~ [ linux-3.10.108 ] ~ [ linux-2.6.32.71 ] ~ [ linux-2.6.0 ] ~ [ linux-2.4.37.11 ] ~ [ unix-v6-master ] ~ [ ccs-tools-1.8.5 ] ~ [ policy-sample ] ~
Architecture: ~ [ i386 ] ~ [ alpha ] ~ [ m68k ] ~ [ mips ] ~ [ ppc ] ~ [ sparc ] ~ [ sparc64 ] ~

  1 // SPDX-License-Identifier: GPL-2.0
  2 /*
  3  * Support for 32-bit Linux/Parisc ELF binaries on 64 bit kernels
  4  *
  5  * Copyright (C) 2000 John Marvin
  6  * Copyright (C) 2000 Hewlett Packard Co.
  7  *
  8  * Heavily inspired from various other efforts to do the same thing
  9  * (ia64,sparc64/mips64)
 10  */
 11 
 12 /* Make sure include/asm-parisc/elf.h does the right thing */
 13 
 14 #define ELF_CLASS       ELFCLASS32
 15 
 16 #define ELF_CORE_COPY_REGS(dst, pt)     \
 17         memset(dst, 0, sizeof(dst));    /* don't leak any "random" bits */ \
 18         {       int i; \
 19                 for (i = 0; i < 32; i++) dst[i] = (elf_greg_t) pt->gr[i]; \
 20                 for (i = 0; i < 8; i++) dst[32 + i] = (elf_greg_t) pt->sr[i]; \
 21         } \
 22         dst[40] = (elf_greg_t) pt->iaoq[0]; dst[41] = (elf_greg_t) pt->iaoq[1]; \
 23         dst[42] = (elf_greg_t) pt->iasq[0]; dst[43] = (elf_greg_t) pt->iasq[1]; \
 24         dst[44] = (elf_greg_t) pt->sar;   dst[45] = (elf_greg_t) pt->iir; \
 25         dst[46] = (elf_greg_t) pt->isr;   dst[47] = (elf_greg_t) pt->ior; \
 26         dst[48] = (elf_greg_t) mfctl(22); dst[49] = (elf_greg_t) mfctl(0); \
 27         dst[50] = (elf_greg_t) mfctl(24); dst[51] = (elf_greg_t) mfctl(25); \
 28         dst[52] = (elf_greg_t) mfctl(26); dst[53] = (elf_greg_t) mfctl(27); \
 29         dst[54] = (elf_greg_t) mfctl(28); dst[55] = (elf_greg_t) mfctl(29); \
 30         dst[56] = (elf_greg_t) mfctl(30); dst[57] = (elf_greg_t) mfctl(31); \
 31         dst[58] = (elf_greg_t) mfctl( 8); dst[59] = (elf_greg_t) mfctl( 9); \
 32         dst[60] = (elf_greg_t) mfctl(12); dst[61] = (elf_greg_t) mfctl(13); \
 33         dst[62] = (elf_greg_t) mfctl(10); dst[63] = (elf_greg_t) mfctl(15);
 34 
 35 
 36 typedef unsigned int elf_greg_t;
 37 
 38 #include <linux/spinlock.h>
 39 #include <asm/processor.h>
 40 #include <linux/module.h>
 41 #include <linux/elfcore.h>
 42 #include <linux/compat.h>               /* struct compat_timeval */
 43 
 44 #define elf_prstatus elf_prstatus32
 45 struct elf_prstatus32
 46 {
 47         struct elf_siginfo pr_info;     /* Info associated with signal */
 48         short   pr_cursig;              /* Current signal */
 49         unsigned int pr_sigpend;        /* Set of pending signals */
 50         unsigned int pr_sighold;        /* Set of held signals */
 51         pid_t   pr_pid;
 52         pid_t   pr_ppid;
 53         pid_t   pr_pgrp;
 54         pid_t   pr_sid;
 55         struct compat_timeval pr_utime;         /* User time */
 56         struct compat_timeval pr_stime;         /* System time */
 57         struct compat_timeval pr_cutime;        /* Cumulative user time */
 58         struct compat_timeval pr_cstime;        /* Cumulative system time */
 59         elf_gregset_t pr_reg;   /* GP registers */
 60         int pr_fpvalid;         /* True if math co-processor being used.  */
 61 };
 62 
 63 #define elf_prpsinfo elf_prpsinfo32
 64 struct elf_prpsinfo32
 65 {
 66         char    pr_state;       /* numeric process state */
 67         char    pr_sname;       /* char for pr_state */
 68         char    pr_zomb;        /* zombie */
 69         char    pr_nice;        /* nice val */
 70         unsigned int pr_flag;   /* flags */
 71         u16     pr_uid;
 72         u16     pr_gid;
 73         pid_t   pr_pid, pr_ppid, pr_pgrp, pr_sid;
 74         /* Lots missing */
 75         char    pr_fname[16];   /* filename of executable */
 76         char    pr_psargs[ELF_PRARGSZ]; /* initial part of arg list */
 77 };
 78 
 79 #define init_elf_binfmt init_elf32_binfmt
 80 
 81 #define ELF_PLATFORM  ("PARISC32\0")
 82 
 83 /*
 84  * We should probably use this macro to set a flag somewhere to indicate
 85  * this is a 32 on 64 process. We could use PER_LINUX_32BIT, or we
 86  * could set a processor dependent flag in the thread_struct.
 87  */
 88 
 89 #undef SET_PERSONALITY
 90 #define SET_PERSONALITY(ex) \
 91         set_thread_flag(TIF_32BIT); \
 92         current->thread.map_base = DEFAULT_MAP_BASE32; \
 93         current->thread.task_size = DEFAULT_TASK_SIZE32 \
 94 
 95 #undef ns_to_timeval
 96 #define ns_to_timeval ns_to_compat_timeval
 97 
 98 #include "../../../fs/binfmt_elf.c"
 99 

~ [ source navigation ] ~ [ diff markup ] ~ [ identifier search ] ~

kernel.org | git.kernel.org | LWN.net | Project Home | Wiki (Japanese) | Wiki (English) | SVN repository | Mail admin

Linux® is a registered trademark of Linus Torvalds in the United States and other countries.
TOMOYO® is a registered trademark of NTT DATA CORPORATION.

osdn.jp