|
Packit |
6c4009 |
/* Core image file related definitions, RISC-V version.
|
|
Packit |
6c4009 |
Copyright (C) 1996-2018 Free Software Foundation, Inc.
|
|
Packit |
6c4009 |
This file is part of the GNU C Library.
|
|
Packit |
6c4009 |
|
|
Packit |
6c4009 |
The GNU C Library is free software; you can redistribute it and/or
|
|
Packit |
6c4009 |
modify it under the terms of the GNU Lesser General Public
|
|
Packit |
6c4009 |
License as published by the Free Software Foundation; either
|
|
Packit |
6c4009 |
version 2.1 of the License, or (at your option) any later version.
|
|
Packit |
6c4009 |
|
|
Packit |
6c4009 |
The GNU C Library is distributed in the hope that it will be useful,
|
|
Packit |
6c4009 |
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
Packit |
6c4009 |
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
|
|
Packit |
6c4009 |
Lesser General Public License for more details.
|
|
Packit |
6c4009 |
|
|
Packit |
6c4009 |
You should have received a copy of the GNU Lesser General Public
|
|
Packit |
6c4009 |
License along with the GNU C Library. If not, see
|
|
Packit |
6c4009 |
<http://www.gnu.org/licenses/>. */
|
|
Packit |
6c4009 |
|
|
Packit |
6c4009 |
#ifndef _SYS_PROCFS_H
|
|
Packit |
6c4009 |
#define _SYS_PROCFS_H 1
|
|
Packit |
6c4009 |
|
|
Packit |
6c4009 |
/* This is somehow modelled after the file of the same name on SysVr4
|
|
Packit |
6c4009 |
systems. It provides a definition of the core file format for ELF
|
|
Packit |
6c4009 |
used on Linux. */
|
|
Packit |
6c4009 |
|
|
Packit |
6c4009 |
#include <features.h>
|
|
Packit |
6c4009 |
#include <sys/time.h>
|
|
Packit |
6c4009 |
#include <sys/types.h>
|
|
Packit |
6c4009 |
#include <sys/user.h>
|
|
Packit |
6c4009 |
#include <sys/ucontext.h>
|
|
Packit |
6c4009 |
|
|
Packit |
6c4009 |
/* ELF register definitions */
|
|
Packit |
6c4009 |
#define ELF_NGREG NGREG
|
|
Packit |
6c4009 |
#define ELF_NFPREG NFPREG
|
|
Packit |
6c4009 |
|
|
Packit |
6c4009 |
typedef unsigned long int elf_greg_t;
|
|
Packit |
6c4009 |
typedef unsigned long int elf_gregset_t[32];
|
|
Packit |
6c4009 |
typedef union __riscv_mc_fp_state elf_fpregset_t;
|
|
Packit |
6c4009 |
|
|
Packit |
6c4009 |
__BEGIN_DECLS
|
|
Packit |
6c4009 |
|
|
Packit |
6c4009 |
struct elf_siginfo
|
|
Packit |
6c4009 |
{
|
|
Packit |
6c4009 |
int si_signo; /* Signal number. */
|
|
Packit |
6c4009 |
int si_code; /* Extra code. */
|
|
Packit |
6c4009 |
int si_errno; /* Errno. */
|
|
Packit |
6c4009 |
};
|
|
Packit |
6c4009 |
|
|
Packit |
6c4009 |
|
|
Packit |
6c4009 |
/* Definitions to generate Intel SVR4-like core files. These mostly
|
|
Packit |
6c4009 |
have the same names as the SVR4 types with "elf_" tacked on the
|
|
Packit |
6c4009 |
front to prevent clashes with linux definitions, and the typedef
|
|
Packit |
6c4009 |
forms have been avoided. This is mostly like the SVR4 structure,
|
|
Packit |
6c4009 |
but more Linuxy, with things that Linux does not support and which
|
|
Packit |
6c4009 |
gdb doesn't really use excluded. Fields present but not used are
|
|
Packit |
6c4009 |
marked with "XXX". */
|
|
Packit |
6c4009 |
struct elf_prstatus
|
|
Packit |
6c4009 |
{
|
|
Packit |
6c4009 |
struct elf_siginfo pr_info; /* Info associated with signal. */
|
|
Packit |
6c4009 |
short int pr_cursig; /* Current signal. */
|
|
Packit |
6c4009 |
unsigned long int pr_sigpend; /* Set of pending signals. */
|
|
Packit |
6c4009 |
unsigned long int pr_sighold; /* Set of held signals. */
|
|
Packit |
6c4009 |
__pid_t pr_pid;
|
|
Packit |
6c4009 |
__pid_t pr_ppid;
|
|
Packit |
6c4009 |
__pid_t pr_pgrp;
|
|
Packit |
6c4009 |
__pid_t pr_sid;
|
|
Packit |
6c4009 |
struct timeval pr_utime; /* User time. */
|
|
Packit |
6c4009 |
struct timeval pr_stime; /* System time. */
|
|
Packit |
6c4009 |
struct timeval pr_cutime; /* Cumulative user time. */
|
|
Packit |
6c4009 |
struct timeval pr_cstime; /* Cumulative system time. */
|
|
Packit |
6c4009 |
elf_gregset_t pr_reg; /* GP registers. */
|
|
Packit |
6c4009 |
int pr_fpvalid; /* True if math copro being used. */
|
|
Packit |
6c4009 |
};
|
|
Packit |
6c4009 |
|
|
Packit |
6c4009 |
|
|
Packit |
6c4009 |
#define ELF_PRARGSZ (80) /* Number of chars for args */
|
|
Packit |
6c4009 |
|
|
Packit |
6c4009 |
struct elf_prpsinfo
|
|
Packit |
6c4009 |
{
|
|
Packit |
6c4009 |
char pr_state; /* Numeric process state. */
|
|
Packit |
6c4009 |
char pr_sname; /* Char for pr_state. */
|
|
Packit |
6c4009 |
char pr_zomb; /* Zombie. */
|
|
Packit |
6c4009 |
char pr_nice; /* Nice val. */
|
|
Packit |
6c4009 |
unsigned long int pr_flag; /* Flags. */
|
|
Packit |
6c4009 |
long int pr_uid;
|
|
Packit |
6c4009 |
long int pr_gid;
|
|
Packit |
6c4009 |
int pr_pid, pr_ppid, pr_pgrp, pr_sid;
|
|
Packit |
6c4009 |
/* Lots missing */
|
|
Packit |
6c4009 |
char pr_fname[16]; /* Filename of executable. */
|
|
Packit |
6c4009 |
char pr_psargs[ELF_PRARGSZ]; /* Initial part of arg list. */
|
|
Packit |
6c4009 |
};
|
|
Packit |
6c4009 |
|
|
Packit |
6c4009 |
/* The rest of this file provides the types for emulation of the
|
|
Packit |
6c4009 |
Solaris <proc_service.h> interfaces that should be implemented by
|
|
Packit |
6c4009 |
users of libthread_db. */
|
|
Packit |
6c4009 |
|
|
Packit |
6c4009 |
/* Addresses. */
|
|
Packit |
6c4009 |
typedef void *psaddr_t;
|
|
Packit |
6c4009 |
|
|
Packit |
6c4009 |
/* Register sets. Linux has different names. */
|
|
Packit |
6c4009 |
typedef elf_gregset_t prgregset_t;
|
|
Packit |
6c4009 |
typedef elf_fpregset_t prfpregset_t;
|
|
Packit |
6c4009 |
|
|
Packit |
6c4009 |
/* We don't have any differences between processes and threads,
|
|
Packit |
6c4009 |
therefore habe only ine PID type. */
|
|
Packit |
6c4009 |
typedef __pid_t lwpid_t;
|
|
Packit |
6c4009 |
|
|
Packit |
6c4009 |
/* Process status and info. In the end we do provide typedefs for them. */
|
|
Packit |
6c4009 |
typedef struct elf_prstatus prstatus_t;
|
|
Packit |
6c4009 |
typedef struct elf_prpsinfo prpsinfo_t;
|
|
Packit |
6c4009 |
|
|
Packit |
6c4009 |
__END_DECLS
|
|
Packit |
6c4009 |
|
|
Packit |
6c4009 |
#endif /* sys/procfs.h */
|