summaryrefslogtreecommitdiff
path: root/accel-pptpd/triton/triton_p.h
diff options
context:
space:
mode:
Diffstat (limited to 'accel-pptpd/triton/triton_p.h')
-rw-r--r--accel-pptpd/triton/triton_p.h104
1 files changed, 3 insertions, 101 deletions
diff --git a/accel-pptpd/triton/triton_p.h b/accel-pptpd/triton/triton_p.h
index 0602bfa..fae4848 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