#include "copyright.h"#include <assert.h>#include <stdarg.h>#include <stdio.h>#include "b.h"#include "qt.h"#include "stp.h"

Go to the source code of this file.
Classes | |
| struct | thread_t |
| struct | foo_t |
Defines | |
| #define | ROUND(v, a) (((v) + (a) - 1) & ~((a)-1)) |
| #define | TEST07_N (4) |
| #define | TEST08_N (4) |
Typedefs | |
| typedef unsigned long | iaddr_t |
Functions | |
| void | exit (int status) |
| int | atoi (char const *s) |
| int | fprintf (FILE *out, char const *fmt,...) |
| int | fputs (char const *s, FILE *fp) |
| void | free (void *sto) |
| void * | malloc (unsigned nbytes) |
| void | perror (char const *s) |
| void | usage (void) |
| void | tracer (void) |
| static thread_t * | t_alloc (void) |
| static thread_t * | t_create (qt_only_t *starter, void *p0, qt_userf_t *f) |
| static void | t_free (thread_t *t) |
| static void * | t_null (qt_t *old, void *p1, void *p2) |
| static void * | t_splat (qt_t *old, void *oldp, void *null) |
| static void | test01 (int n) |
| static void | test02_aux1 (void *pu, void *pt, qt_userf_t *f) |
| static void * | test02_aux2 (qt_t *old, void *farg1, void *farg2) |
| static void | test02 (int n) |
| static void * | test03_aux0 (qt_t *old_is_garbage, void *farg1, void *farg2) |
| static void * | test03_aux1 (qt_t *old, void *farg1, void *farg2) |
| static void | test03_aux2 (void *pu, void *pt, qt_userf_t *f) |
| static void | test03 (int n) |
| static void | test04 (int n) |
| static void | test05_aux (void *null) |
| static void | test05 (int n) |
| static void | test06_aux2 (void *null0a, void *null1b, void *null2b, qt_userf_t *null) |
| static void * | test06_aux3 (qt_t *sp, void *null0c, void *null1c) |
| static void | test06 (int n) |
| static void | test07_aux2 (void *null0, void *mep, void *nxtp, qt_userf_t *null) |
| static void | test07_aux3 (void *np, void *mep, void *nxtp, qt_userf_t *null) |
| static void | test07 (int n) |
| static void | test08_aux2 (void *null0, void *mep, void *nxtp, qt_userf_t *null) |
| static void | test08_aux3 (void *np, void *mep, void *nxtp, qt_userf_t *null) |
| static void | test08 (int n) |
| thread_t * | test09_create (qt_startup_t *start, qt_vuserf_t *f, qt_cleanup_t *cleanup, int nbytes,...) |
| static void | test09_cleanup (void *pt, void *vuserf_retval) |
| static void | test09_start (void *pt) |
| static void * | test09_user0 (void) |
| static void * | test09_user2 (int one, int two) |
| static void * | test09_user10 (int one, int two, int three, int four, int five, int six, int seven, int eight, int nine, int ten) |
| void | test09 (int n) |
| static void | test10_startup (void *pt) |
| static void * | test10_run (int arg0,...) |
| void | test10_cleanup (void *pt, void *vuserf_retval) |
| void | test10_init (thread_t *new, thread_t *next, int nbytes,...) |
| void | test10 (int n) |
| void | test11 (int n) |
| void | test12 (int n) |
| void | test13 (int n) |
| void | test14 (int n) |
| void | test15 (int n) |
| void | test16 (int n) |
| void | test17 (int n) |
| void | test18 (int n) |
| void | test19 (int n) |
| void | test20 (int n) |
| void | test21 (int n) |
| void | tracer2 (void *val) |
| void | describe () |
| void | args (int *which, int *n, int argc, char **argv) |
| int | main (int argc, char **argv) |
Variables | |
| static char const | test01_msg [] |
| static char const * | test01_descr [] |
| static char const | test02_msg [] = "QT_BLOCKI (0, 0, test02_aux, t->qt)" |
| static qt_t * | rootthread |
| static char const | test03_msg [] = "QT_BLOCKI (...) test vals are right." |
| static char const | test04_msg [] = "stp_start w/ no threads." |
| static char const | test05_msg [] = "stp w/ 2 yielding thread." |
| static char const | test06_msg [] = "*QT_ARGS(...), QT_BLOCKI one thread" |
| static char const * | test06_descr [] |
| static qt_t * | test06_sp |
| static char | test07_msg [] = "*cswap between threads" |
| static char const * | test07_descr [] |
| static qt_t * | test07_heavy |
| static char | test08_msg [] = "Floating-point cswap between threads" |
| static char const * | test08_descr [] |
| static qt_t * | test08_heavy |
| char const | test09_msg [] = { "Start and run threads using varargs." } |
| thread_t * | test09_t0 |
| thread_t * | test09_t1 |
| thread_t * | test09_t2 |
| thread_t * | test09_main |
| char const | test10_msg [] = { "*Test varargs init & startup w/ 0 args." } |
| char const * | test10_descr [] |
| char const | test11_msg [] = { "*Test varargs init & startup w/ 2 args." } |
| char const * | test11_descr [] |
| char const | test12_msg [] = { "*Test varargs init & startup w/ 4 args." } |
| char const * | test12_descr [] |
| char const | test13_msg [] = { "*Test varargs init & startup w/ 8 args." } |
| char const * | test13_descr [] |
| char const | test14_msg [] = { "*Test varargs initialization w/ 0 args." } |
| char const * | test14_descr [] |
| char const | test15_msg [] = { "*Test varargs initialization w/ 2 args." } |
| char const * | test15_descr [] |
| char const | test16_msg [] = { "*Test varargs initialization w/ 4 args." } |
| char const * | test16_descr [] |
| char const | test17_msg [] = { "*Test varargs initialization w/ 8 args." } |
| char const * | test17_descr [] |
| char const | test18_msg [] = { "*Call register indirect." } |
| char const * | test18_descr [] = { NULL } |
| char const | test19_msg [] = { "*Call immediate." } |
| char const * | test19_descr [] = { NULL } |
| char const | test20_msg [] = { "*Add register-to-register." } |
| char const * | test20_descr [] = { NULL } |
| char const | test21_msg [] = { "*Load memory to a register." } |
| char const * | test21_descr [] = { NULL } |
| static foo_t | foo [] |
| static int | tv = 0 |
| int atoi | ( | char const * | s | ) |
| void exit | ( | int | status | ) |
| int fprintf | ( | FILE * | out, | |
| char const * | fmt, | |||
| ... | ||||
| ) |
| int fputs | ( | char const * | s, | |
| FILE * | fp | |||
| ) |
| void free | ( | void * | sto | ) |
| void* malloc | ( | unsigned | nbytes | ) |
| void perror | ( | char const * | s | ) |
| static thread_t* t_create | ( | qt_only_t * | starter, | |
| void * | p0, | |||
| qt_userf_t * | f | |||
| ) | [static] |
| static void* t_null | ( | qt_t * | old, | |
| void * | p1, | |||
| void * | p2 | |||
| ) | [static] |
| static void* t_splat | ( | qt_t * | old, | |
| void * | oldp, | |||
| void * | null | |||
| ) | [static] |
| static void test02_aux1 | ( | void * | pu, | |
| void * | pt, | |||
| qt_userf_t * | f | |||
| ) | [static] |
| static void* test02_aux2 | ( | qt_t * | old, | |
| void * | farg1, | |||
| void * | farg2 | |||
| ) | [static] |
| static void* test03_aux0 | ( | qt_t * | old_is_garbage, | |
| void * | farg1, | |||
| void * | farg2 | |||
| ) | [static] |
| static void* test03_aux1 | ( | qt_t * | old, | |
| void * | farg1, | |||
| void * | farg2 | |||
| ) | [static] |
| static void test03_aux2 | ( | void * | pu, | |
| void * | pt, | |||
| qt_userf_t * | f | |||
| ) | [static] |
| static void test06_aux2 | ( | void * | null0a, | |
| void * | null1b, | |||
| void * | null2b, | |||
| qt_userf_t * | null | |||
| ) | [static] |
| static void* test06_aux3 | ( | qt_t * | sp, | |
| void * | null0c, | |||
| void * | null1c | |||
| ) | [static] |
| static void test07_aux2 | ( | void * | null0, | |
| void * | mep, | |||
| void * | nxtp, | |||
| qt_userf_t * | null | |||
| ) | [static] |
| static void test07_aux3 | ( | void * | np, | |
| void * | mep, | |||
| void * | nxtp, | |||
| qt_userf_t * | null | |||
| ) | [static] |
| static void test08_aux2 | ( | void * | null0, | |
| void * | mep, | |||
| void * | nxtp, | |||
| qt_userf_t * | null | |||
| ) | [static] |
| static void test08_aux3 | ( | void * | np, | |
| void * | mep, | |||
| void * | nxtp, | |||
| qt_userf_t * | null | |||
| ) | [static] |
| static void test09_cleanup | ( | void * | pt, | |
| void * | vuserf_retval | |||
| ) | [static] |
| thread_t* test09_create | ( | qt_startup_t * | start, | |
| qt_vuserf_t * | f, | |||
| qt_cleanup_t * | cleanup, | |||
| int | nbytes, | |||
| ... | ||||
| ) |
| static void* test09_user10 | ( | int | one, | |
| int | two, | |||
| int | three, | |||
| int | four, | |||
| int | five, | |||
| int | six, | |||
| int | seven, | |||
| int | eight, | |||
| int | nine, | |||
| int | ten | |||
| ) | [static] |
Initial value:
{
{ "Usage:\n", NULL, (void(*)(int n))usage },
{ test01_msg, test01_descr, test01 },
{ test02_msg, NULL, test02 },
{ test03_msg, NULL, test03 },
{ test04_msg, NULL, test04 },
{ test05_msg, NULL, test05 },
{ test06_msg, test06_descr, test06 },
{ test07_msg, test07_descr, test07 },
{ test08_msg, test08_descr, test08 },
{ test09_msg, NULL, test09 },
{ test10_msg, test10_descr, test10 },
{ test11_msg, test11_descr, test11 },
{ test12_msg, test12_descr, test12 },
{ test13_msg, test13_descr, test13 },
{ test14_msg, test14_descr, test14 },
{ test15_msg, test15_descr, test15 },
{ test16_msg, test16_descr, test16 },
{ test17_msg, test17_descr, test17 },
{ test18_msg, test18_descr, test18 },
{ test19_msg, test19_descr, test19 },
{ test20_msg, test20_descr, test20 },
{ test21_msg, test21_descr, test21 },
{ 0, 0 }
}
qt_t* rootthread [static] |
char const* test01_descr[] [static] |
char const test01_msg[] [static] |
char const test02_msg[] = "QT_BLOCKI (0, 0, test02_aux, t->qt)" [static] |
char const test03_msg[] = "QT_BLOCKI (...) test vals are right." [static] |
char const test04_msg[] = "stp_start w/ no threads." [static] |
char const test05_msg[] = "stp w/ 2 yielding thread." [static] |
char const* test06_descr[] [static] |
Initial value:
{
"Does a QT_ARGS, QT_BLOCKI to a helper function that saves the",
"stack pointer of the main thread, calls an `only' function that",
"saves aborts the thread, calling a null helper function.",
":: start/stop = QT_ARGS + QT_BLOCKI + QT_ABORT + 3 procedure calls.",
NULL
}
char const test06_msg[] = "*QT_ARGS(...), QT_BLOCKI one thread" [static] |
char const* test07_descr[] [static] |
Initial value:
{
"Build a chain of threads where each thread has a fixed successor.",
"There is no scheduling performed. Each thread but one is a loop",
"that simply blocks with QT_BLOCKI, calling a helper that saves the",
"current stack pointer. The last thread decrements a count, and,",
"if zero, aborts back to the main thread. Else it continues with",
"the blocking chain. The count is divided by the number of threads",
"in the chain, so `n' is the number of integer block operations.",
":: integer cswap = QT_BLOCKI + a procedure call.",
NULL
}
qt_t* test07_heavy [static] |
char test07_msg[] = "*cswap between threads" [static] |
char const* test08_descr[] [static] |
qt_t* test08_heavy [static] |
char test08_msg[] = "Floating-point cswap between threads" [static] |
| char const test09_msg[] = { "Start and run threads using varargs." } |
| char const* test10_descr[] |
Initial value:
{
"Start and stop threads that use variant argument lists (varargs).",
"Each thread is initialized by calling a routine that calls",
"QT_VARARGS. Then runs the thread by calling QT_BLOCKI to hald the",
"main thread, a helper that saves the main thread's stack pointer,",
"a null startup function, a null user function, a cleanup function",
"that calls QT_ABORT and restarts the main thread. Copies no user",
"parameters.",
":: varargs start/stop = QT_BLOCKI + QT_ABORT + 6 function calls.",
NULL
}
| char const test10_msg[] = { "*Test varargs init & startup w/ 0 args." } |
| char const* test11_descr[] |
| char const test11_msg[] = { "*Test varargs init & startup w/ 2 args." } |
| char const* test12_descr[] |
| char const test12_msg[] = { "*Test varargs init & startup w/ 4 args." } |
| char const* test13_descr[] |
| char const test13_msg[] = { "*Test varargs init & startup w/ 8 args." } |
| char const* test14_descr[] |
| char const test14_msg[] = { "*Test varargs initialization w/ 0 args." } |
| char const* test15_descr[] |
| char const test15_msg[] = { "*Test varargs initialization w/ 2 args." } |
| char const* test16_descr[] |
| char const test16_msg[] = { "*Test varargs initialization w/ 4 args." } |
| char const* test17_descr[] |
| char const test17_msg[] = { "*Test varargs initialization w/ 8 args." } |
| char const* test18_descr[] = { NULL } |
| char const test18_msg[] = { "*Call register indirect." } |
| char const* test19_descr[] = { NULL } |
| char const test19_msg[] = { "*Call immediate." } |
| char const* test20_descr[] = { NULL } |
| char const test20_msg[] = { "*Add register-to-register." } |
| char const* test21_descr[] = { NULL } |
| char const test21_msg[] = { "*Load memory to a register." } |
1.5.5