static int test_crash(void) { sched_add(NEW_THREAD(unaligned_load, NULL)); sched_add(NEW_THREAD(unaligned_store, NULL)); sched_add(NEW_THREAD(unmapped_load, NULL)); sched_add(NEW_THREAD(unmapped_store, NULL)); sched_run(); return KTEST_FAILURE; }
int main(int argc, char *argv[]) { int i; for (i = 0; i < ARRAY_SIZE(thread_index); i++) NEW_THREAD(run, &thread_index[i]); AWALYS_LOOPS(); return 0; }
int add(int x, int y) { int z, v; z = x + y; #if 0 /* Test pfork() */ v = pfork(); if (v == 0) { printf("child\n"); } else { /* Watch out for %08x here, because the "x" is interpreted as a * variable name. Funny, but dangerous. The correct fix is a * real C grammar parser, that can distinguish "x" occurring in * a string from x as a real variable reference. */ printf("parent, child thread = %08X\n", v); } NEW_THREAD(spurious); NEW_THREAD(spurious); NEW_THREAD(spurious); #endif CSW; return z; }