diff options
author | Kozlov Dmitry <dima@server> | 2010-08-25 19:50:32 +0400 |
---|---|---|
committer | Kozlov Dmitry <dima@server> | 2010-08-25 19:50:32 +0400 |
commit | 14763d00a0777b7a27eb49eb5f91ac802c05ecb5 (patch) | |
tree | df01692c930c8fe5d981e7931e41df19f234dc7e /accel-pptpd/triton/triton_p.h | |
parent | 6f071c1e1ffeea801374416e38a9d14ee393ae13 (diff) | |
download | accel-ppp-14763d00a0777b7a27eb49eb5f91ac802c05ecb5.tar.gz accel-ppp-14763d00a0777b7a27eb49eb5f91ac802c05ecb5.zip |
rewriting triton library...
Diffstat (limited to 'accel-pptpd/triton/triton_p.h')
-rw-r--r-- | accel-pptpd/triton/triton_p.h | 104 |
1 files changed, 3 insertions, 101 deletions
diff --git a/accel-pptpd/triton/triton_p.h b/accel-pptpd/triton/triton_p.h index 0602bfa0..fae48487 100644 --- a/accel-pptpd/triton/triton_p.h +++ b/accel-pptpd/triton/triton_p.h @@ -5,7 +5,6 @@ #include "list.h" #include <stdarg.h> -#include <ucontext.h> #define MAX_ARGS 32 @@ -17,20 +16,6 @@ struct option_t char *val; }; -struct md_handler_t -{ - struct list_head entry; - - int fd; - int del; - int timeout; - int volatile in_handler; - - struct coroutine_t *coro; - - struct triton_md_handler_t *handler; -}; - struct timer_t { struct list_head entry; @@ -48,93 +33,10 @@ struct timer_single_shot_t triton_ss_func ss_func; }; -struct event_handler_t -{ - struct list_head entry; - - int arg_cnt; - void *args; - triton_event_func event_func; -}; -struct event_t -{ - struct list_head entry; - - int ev_id; - struct list_head handlers; -}; - -struct coroutine_t -{ - struct list_head entry; - ucontext_t uc; - struct timeval timeout; - struct timeval time; -}; - - -extern struct list_head components; extern void md_run(); extern void md_terminate(); -extern int timer_prepare(struct timeval *tv); -extern void timer_check(struct timeval *tv); -extern int coroutine_get_timeout(struct timeval *tv); -extern void coroutine_check_timeout(struct timeval *tv); -extern void event_init(); -extern struct coroutine_t *current_coro; -void schedule(void); - -//#define BROKEN_GCC - -#ifdef BROKEN_GCC -#define dyn_call(func,arg_cnt,args)\ -{\ - switch(arg_cnt)\ - {\ - case 0: \ - {\ - typedef void (*func0)(void);\ - ((func0)func)();\ - break;\ - }\ - case 1: \ - {\ - typedef void (*func0)(long);\ - ((func0)func)(*((long*)args+0));\ - break;\ - }\ - case 2: \ - {\ - typedef void (*func0)(long,long);\ - ((func0)func)(*((long*)args+0),*((long*)args+1));\ - break;\ - }\ - case 3: \ - {\ - typedef void (*func0)(long,long,long);\ - ((func0)func)(*((long*)args+0),*((long*)args+1),*((long*)args+2));\ - break;\ - }\ - case 4: \ - {\ - typedef void (*func0)(long,long,long,long);\ - ((func0)func)(*((long*)args+0),*((long*)args+1),*((long*)args+2),*((long*)args+3));\ - break;\ - }\ - }\ -} -#else -#define dyn_call(func,arg_cnt,args)\ -{\ - int aaa=arg_cnt*sizeof(long);\ - asm("subl %2,%%esp; \n\ - movl %%esp,%%edi;\n\ - movl %0,%%esi;\n\ - cld;\n\ - rep movsl;\n\ - call *%1;\n\ - addl %2,%%esp\n"::"m" (args),"m" (func),"g" (aaa),"c"(arg_cnt):"%edi","%esi","%esp");\ -} -#endif +extern void timer_run(); +extern void timer_terminate(); +extern struct triton_ctx_t *default_ctx; #endif |