UbixOS V2 2.0

Macros | Functions
trap.c File Reference
`#include <i386/signal.h>`
`#include <sys/trap.h>`
`#include <sys/gdt.h>`
`#include <ubixos/sched.h>`
`#include <lib/kprintf.h>`
`#include <vmm/vmm.h>`
`#include <ubixos/endtask.h>`
Include dependency graph for trap.c:

Go to the source code of this file.

## Macros
#define | FIRST_TSS_ENTRY 6
#define | get_seg_byte(seg, addr)
#define | get_seg_long(seg, addr)
#define | store_TR(n)
#define | VM_MASK 0x00020000

## Functions
void | die_if_kernel (char *str, struct trapframe *regs, long err)
void | trap (struct trapframe *frame)

## Macro Definition Documentation

## ◆ FIRST_TSS_ENTRY

#define FIRST_TSS_ENTRY 6

Definition at line 37 of file trap.c.

## ◆ get_seg_byte

#define get_seg_byte | ( |  | seg,
|  |  | addr
| ) |  |

Value:
({ \
register char __res; \
__asm__("push %%fs;mov %%ax,%%fs;movb %%fs:%2,%%al;pop %%fs" \
:"=a" (__res):"0" (seg),"m" (*(addr))); \
__res;})

Definition at line 53 of file trap.c.

## ◆ get_seg_long

#define get_seg_long | ( |  | seg,
|  |  | addr
| ) |  |

Value:
({ \
register unsigned long __res; \
__asm__("push %%fs;mov %%ax,%%fs;movl %%fs:%2,%%eax;pop %%fs" \
:"=a" (__res):"0" (seg),"m" (*(addr))); \
__res;})

Definition at line 47 of file trap.c.

## ◆ store_TR

#define store_TR | ( |  | n | ) |

Value:
__asm__("str %%ax\n\t" \
"subl %2,%%eax\n\t" \
"shrl $4,%%eax" \
:"=a" (n) \
:"0" (0),"i" (FIRST_TSS_ENTRY<<3))

Definition at line 40 of file trap.c.

## ◆ VM_MASK

#define VM_MASK 0x00020000

Definition at line 38 of file trap.c.

## Function Documentation

## ◆ die_if_kernel()

void die_if_kernel | ( | char * | str,
|  | struct trapframe * | regs,
|  | long | err
| ) |  |

Definition at line 59 of file trap.c.

References kprintf(), trapframe::tf_cs, trapframe::tf_ds, trapframe::tf_eax, trapframe::tf_ebp, trapframe::tf_ebx, trapframe::tf_ecx, trapframe::tf_edi, trapframe::tf_edx, trapframe::tf_eflags, trapframe::tf_eip, trapframe::tf_err, trapframe::tf_es, trapframe::tf_esi, trapframe::tf_esp, trapframe::tf_fs, trapframe::tf_gs, trapframe::tf_ss, and trapframe::tf_trapno.

Referenced by __alignmentCheck(), __debug(), __divideError(), __doubleFault(), __floatingPoint(), __machineCheck(), __nmi(), __security(), __simd(), __virtualization(), _intNull(), sys_call(), and sys_call_posix().

Here is the call graph for this function:

## ◆ trap()

void trap | ( | struct trapframe * | frame | ) |

Definition at line 101 of file trap.c.

References trapframe::tf_trapno.

FIRST_TSS_ENTRY
#define FIRST_TSS_ENTRY
Definition: trap.c:37