00001 /* 00002 ** core_tcb.h for lseos in lseos-core/kernel/core 00003 ** 00004 ** Copyright(c)2004 IONIS group, Vianney Rancurel - Paris 00005 ** Login <vianney@epita.fr> 00006 ** 00007 ** Started on Fri May 28 14:21:32 2004 Vianney Rancurel 00008 ** Last update Thu Feb 17 18:19:49 2005 Olivier Dembour 00009 */ 00010 #ifndef __LSEOS_CORE_TCB_H__ 00011 #define __LSEOS_CORE_TCB_H__ 1 00012 #include <core.h> 00013 00014 struct vm86_regs 00015 { 00016 u_int32_t eip; 00017 u_int32_t eflags; 00018 u_int32_t eax; 00019 u_int32_t ecx; 00020 u_int32_t edx; 00021 u_int32_t ebx; 00022 u_int32_t esp; 00023 u_int32_t ebp; 00024 u_int32_t esi; 00025 u_int32_t edi; 00026 u_int16_t es; 00027 u_int16_t cs; 00028 u_int16_t ss; 00029 u_int16_t ds; 00030 u_int16_t fs; 00031 u_int16_t gs; 00032 }; 00033 00034 struct vm86 00035 { 00036 struct vm86_regs regs; 00037 }; 00038 00039 00040 /* PROTO core_tcb.c */ 00041 #ifdef __KERNEL__ 00042 /* core_tcb.c */ 00043 void tcb_init(void); 00044 union descriptor *gdt_get(int idxsel); 00045 struct s_tcb_full *get_tcb_from_idxsel(u_int idxsel, int type, int *err); 00046 struct s_tcb_full *get_tcb_from_pid1(pid_t pid); 00047 struct s_tcb_full *get_tcb_from_pid2(pid_t pid); 00048 void sys_tcbsizepg(struct s_tcb_full *caller); 00049 void sys_tcbreg(struct s_tcb_full *caller); 00050 void sys_lname(struct s_tcb_full *caller); 00051 void sys_lclass(struct s_tcb_full *caller); 00052 void usig_reset(struct s_tcb_full *tcb); 00053 void asop_i(struct s_tcb_full *tcb, struct s_as_full *ref_as, u_int32_t mode); 00054 void sys_asop(struct s_tcb_full *caller); 00055 void tcb_run(struct s_tcb_full *tcb); 00056 void tcb_sleep(struct s_tcb_full *tcb); 00057 void tcb_stop(struct s_tcb_full *tcb); 00058 void tcb_dead(struct s_tcb_full *tcb, char *s); 00059 void tcb_zombie(struct s_tcb_full *tcb); 00060 void sys_lstatus(struct s_tcb_full *caller); 00061 void sys_ltrace(struct s_tcb_full *caller); 00062 void sys_lep(struct s_tcb_full *caller); 00063 void sys_ltss(struct s_tcb_full *caller); 00064 void sys_sgdt(struct s_tcb_full *caller); 00065 void sys_lidt(struct s_tcb_full *caller); 00066 void sys_sidt(struct s_tcb_full *caller); 00067 void sys_stcb(struct s_tcb_full *caller); 00068 void sys_stcb2(struct s_tcb_full *caller); 00069 void sys___sfulltcb2(struct s_tcb_full *caller); 00070 void sys_ssig(struct s_tcb_full *caller); 00071 void sys_slink(struct s_tcb_full *caller); 00072 void sys___sfulllink(struct s_tcb_full *caller); 00073 void sys_llinkret(struct s_tcb_full *caller); 00074 void sys_ioacquire(struct s_tcb_full *caller); 00075 void sys_iorele(struct s_tcb_full *caller); 00076 int gdtrsv(int nb_sels); 00077 void sys_rcr3(struct s_tcb_full *caller); 00078 void runqs_init(void); 00079 void runq_print(int cpu); 00080 void sys_setrunq(struct s_tcb_full *caller); 00081 void sys_setrunq2(struct s_tcb_full *caller); 00082 void sys_remrunq(struct s_tcb_full *caller); 00083 void sys_remrunq2(struct s_tcb_full *caller); 00084 int asq(struct s_as_full *as); 00085 int asdeq(struct s_as_full *as); 00086 int tcbq(struct s_tcb_full *tcb); 00087 int tcbdeq(struct s_tcb_full *tcb); 00088 void sys_runq(struct s_tcb_full *caller); 00089 void sys_setpgid(struct s_tcb_full *caller); 00090 void sys_reparent(struct s_tcb_full *caller); 00091 void sys_clearbsy(struct s_tcb_full *caller); 00092 void sys_setbsy(struct s_tcb_full *caller); 00093 void sys_exit(struct s_tcb_full *caller); 00094 void sys_sclass(struct s_tcb_full *caller); 00095 void sys_spid(struct s_tcb_full *caller); 00096 void sys_sppid(struct s_tcb_full *caller); 00097 void sys_sppid2(struct s_tcb_full *caller); 00098 void sys_spgid(struct s_tcb_full *caller); 00099 void sys_spgid2(struct s_tcb_full *caller); 00100 void sys_getsel(struct s_tcb_full *caller); 00101 void sys_sasid(struct s_tcb_full *caller); 00102 void sys_sinfo(struct s_tcb_full *caller); 00103 void sys_procdef(struct s_tcb_full *caller); 00104 void sys_tcbunreg(struct s_tcb_full *caller); 00105 void sys_ptrace(struct s_tcb_full *caller); 00106 void sys_notify(struct s_tcb_full *caller); 00107 void sys_lfpu(struct s_tcb_full *caller); 00108 void sys_sfpu(struct s_tcb_full *caller); 00109 void sys_sq_gate(struct s_tcb_full *caller); 00110 void sys_nicepid(struct s_tcb_full *caller); 00111 void sys_vm86(struct s_tcb_full *caller); 00112 void tcb_check(char *s); 00113 void runq_check(char *s); 00114 #endif /* __KERNEL__ */ 00115 #endif