gates.h

Go to the documentation of this file.
00001 /*
00002 ** gates.h for lseos in lseos-lib/libc/machdep
00003 ** 
00004 ** Copyright (c)2004 Vianney Rancurel
00005 ** Login   <vianney@epita.fr>
00006 ** 
00007 ** Started on  Thu Jan 22 12:06:12 2004 Vianney Rancurel
00008 ** Last update Mon Dec  6 12:28:12 2004 Vianney Rancurel
00009 */
00010 #ifndef __MACHDEP_GATES_H__
00011 #define __MACHDEP_GATES_H__     1
00012 #include <libc.h>
00013 
00014 #define TASKGATE_ENTER \
00015   u_int __fake_bp;\
00016   __asm __volatile ("movl %%esp, %0" : "=m" (__fake_bp));\
00017   __entry_point:
00018  
00019 #define TASKGATE_LEAVE \
00020  __asm __volatile ("movl %0, %%esp" : : "m" (__fake_bp));\
00021  __asm __volatile ("iret");\
00022  goto __entry_point;
00023 
00024 /* PROTO gates.c */
00025 /* gates.c */
00026 void handle_nmi(int n);
00027 void setgate2(struct gate_descriptor *gd, void *func, int args, int type, int dpl, int xx);
00028 void setgate(struct gate_descriptor *gd, void *func, int args, int type, int dpl);
00029 void setsegment2(struct segment_descriptor *sd, void *base, size_t limit, int type, int dpl, int def32, int gran, int xx);
00030 void setsegment(struct segment_descriptor *sd, void *base, size_t limit, int type, int dpl, int def32, int gran);
00031 void settaskgate2(struct gate_descriptor *gd, u_int selector, int args, int type, int dpl, int xx);
00032 void settaskgate(struct gate_descriptor *gd, u_int selector, int args, int type, int dpl);
00033 void gdt_dump(t_printf_fn printf_fn, char *s, union descriptor *base, int slot);
00034 void idt_dump(t_printf_fn printf_fn, char *s, union descriptor *base, int slot);
00035 void tss_dump(t_printf_fn printf_fn, char *s, t_tss *tss);
00036 #endif

Generated on Wed May 24 23:04:17 2006 for LSE/OS by  doxygen 1.4.6