4 * $DragonFly: src/test/sysperf/quicksw1.c,v 1.1 2003/08/12 02:29:44 dillon Exp $
9 void qswitch(int **oldsw, int *newsw);
10 void qstart(int *newsw);
11 int *qinit(void *topstk, void *func, void *arg);
13 static void do_task1(void *arg);
14 static void do_task2(void *arg);
23 main(int ac, char **av)
26 printf("userthread switching test (nonfp) using pushal/popal\n");
28 printf("userthread switching test (nonfp) using pushl (call-save only)\n");
30 printf("userthread switching test (nonfp) using subl $N,%%esp;movl (call-save only)\n");
32 #error "The switch method wasn't defined with -D"
35 task1 = qinit(stk1 + sizeof(stk1), do_task1, NULL);
36 task2 = qinit(stk2 + sizeof(stk2), do_task2, NULL);
45 qswitch(&task1, task2);
46 if (++count > 10000000) {
47 stop_timing(count, "uthread_switch");
58 qswitch(&task2, task1);