boot2

Playing with the boostrap
git clone https://git.ryansepassi.com/git/boot2.git
Log | Files | Refs | README

signal.h (2272B)


      1 /* -*-comment-start: "//";comment-end:""-*-
      2  * GNU Mes --- Maxwell Equations of Software
      3  * Copyright © 2017 Jan (janneke) Nieuwenhuizen <janneke@gnu.org>
      4  *
      5  * This file is part of GNU Mes.
      6  *
      7  * GNU Mes is free software; you can redistribute it and/or modify it
      8  * under the terms of the GNU General Public License as published by
      9  * the Free Software Foundation; either version 3 of the License, or (at
     10  * your option) any later version.
     11  *
     12  * GNU Mes is distributed in the hope that it will be useful, but
     13  * WITHOUT ANY WARRANTY; without even the implied warranty of
     14  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
     15  * GNU General Public License for more details.
     16  *
     17  * You should have received a copy of the GNU General Public License
     18  * along with GNU Mes.  If not, see <http://www.gnu.org/licenses/>.
     19  */
     20 #define EBX 0
     21 #define ECX 1
     22 #define EDX 2
     23 #define ESI 3
     24 #define EDI 4
     25 #define EBP 5
     26 #define EAX 6
     27 #define DS 7
     28 #define ES 8
     29 #define FS 9
     30 #define GS 10
     31 #define ORIG_EAX 11
     32 #define EIP 12
     33 #define CS  13
     34 #define EFL 14
     35 #define UESP 15
     36 #define SS   16
     37 #define FRAME_SIZE 17
     38 
     39 /* Type for general register.  */
     40 typedef int greg_t;
     41 
     42 /* Number of general registers.  */
     43 #define NGREG        19
     44 
     45 /* Container for all general registers.  */
     46 typedef greg_t gregset_t[NGREG];
     47 
     48 /* Definitions taken from the kernel headers.  */
     49 struct _libc_fpreg
     50 {
     51   unsigned short int significand[4];
     52   unsigned short int exponent;
     53 };
     54 
     55 struct _libc_fpstate
     56 {
     57   unsigned long int cw;
     58   unsigned long int sw;
     59   unsigned long int tag;
     60   unsigned long int ipoff;
     61   unsigned long int cssel;
     62   unsigned long int dataoff;
     63   unsigned long int datasel;
     64   struct _libc_fpreg _st[8];
     65   unsigned long int status;
     66 };
     67 
     68 /* Structure to describe FPU registers.  */
     69 typedef struct _libc_fpstate *fpregset_t;
     70 
     71 typedef struct
     72 {
     73   gregset_t gregs;
     74   /* Due to Linux's history we have to use a pointer here.  The SysV/i386
     75      ABI requires a struct with the values.  */
     76   fpregset_t fpregs;
     77   unsigned long int oldmask;
     78   unsigned long int cr2;
     79 } mcontext_t;
     80 
     81 /* Userlevel context.  */
     82 typedef struct ucontext
     83 {
     84   unsigned long int uc_flags;
     85   struct ucontext *uc_link;
     86   stack_t uc_stack;
     87   mcontext_t uc_mcontext;
     88   sigset_t uc_sigmask;
     89   struct _libc_fpstate __fpregs_mem;
     90 } ucontext_t;