UbixOS  2.0
trap.h
Go to the documentation of this file.
1 /*-
2  * Copyright (c) 2002-2018 The UbixOS Project.
3  * All rights reserved.
4  *
5  * This was developed by Christopher W. Olsen for the UbixOS Project.
6  *
7  * Redistribution and use in source and binary forms, with or without modification, are permitted
8  * provided that the following conditions are met:
9  *
10  * 1) Redistributions of source code must retain the above copyright notice, this list of
11  * conditions, the following disclaimer and the list of authors.
12  * 2) Redistributions in binary form must reproduce the above copyright notice, this list of
13  * conditions, the following disclaimer and the list of authors in the documentation and/or
14  * other materials provided with the distribution.
15  * 3) Neither the name of the UbixOS Project nor the names of its contributors may be used to
16  * endorse or promote products derived from this software without specific prior written
17  * permission.
18  *
19  * THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED
20  * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS
21  * FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS
22  * BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
23  * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA,
24  * OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
25  * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT
26  * OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
27  */
28 
29 #ifndef _SYS_TRAP_H
30 #define _SYS_TRAP_H
31 
32 #include <i386/cpu.h>
33 
34 struct trapframe {
35  int tf_gs;
36  int tf_fs;
37  int tf_es;
38  int tf_ds;
39  int tf_edi;
40  int tf_esi;
41  int tf_ebp;
42  int tf_isp;
43  int tf_ebx;
44  int tf_edx;
45  int tf_ecx;
46  int tf_eax;
47  int tf_trapno;
48  /* below portion defined in 386 hardware */
49  int tf_err;
50  int tf_eip;
51  int tf_cs;
52  int tf_eflags;
53  /* below only when crossing rings (e.g. user to kernel) */
54  int tf_esp;
55  int tf_ss;
56 };
57 
58 void die_if_kernel(char *str, struct trapframe *regs, long err);
59 void trap( struct trapframe * );
60 
61 #endif /* END _SYS_TRAP_H */
die_if_kernel
void die_if_kernel(char *str, struct trapframe *regs, long err)
Definition: trap.c:59
trap
void trap(struct trapframe *)
Definition: trap.c:101
trapframe::tf_gs
int tf_gs
Definition: trap.h:35
trapframe::tf_ds
int tf_ds
Definition: trap.h:38
trapframe::tf_eip
int tf_eip
Definition: trap.h:50
trapframe::tf_esi
int tf_esi
Definition: trap.h:40
trapframe::tf_ebp
int tf_ebp
Definition: trap.h:41
trapframe::tf_eflags
int tf_eflags
Definition: trap.h:52
trapframe::tf_trapno
int tf_trapno
Definition: trap.h:47
trapframe::tf_es
int tf_es
Definition: trap.h:37
trapframe::tf_err
int tf_err
Definition: trap.h:49
trapframe::tf_eax
int tf_eax
Definition: trap.h:46
cpu.h
trapframe::tf_fs
int tf_fs
Definition: trap.h:36
trapframe::tf_ecx
int tf_ecx
Definition: trap.h:45
trapframe
Definition: trap.h:34
trapframe::tf_ss
int tf_ss
Definition: trap.h:55
trapframe::tf_esp
int tf_esp
Definition: trap.h:54
trapframe::tf_edx
int tf_edx
Definition: trap.h:44
trapframe::tf_edi
int tf_edi
Definition: trap.h:39
trapframe::tf_isp
int tf_isp
Definition: trap.h:42
trapframe::tf_cs
int tf_cs
Definition: trap.h:51
trapframe::tf_ebx
int tf_ebx
Definition: trap.h:43