Esempio n. 1
0
}

static bool trace_eq(const struct trace *t1, const struct trace *t2)
{
	return t1->condstr == t2->condstr
		&& t1->file == t2->file
		&& t1->line == t2->line
		&& t1->expect == t2->expect;
}

/* struct thash */
HTABLE_DEFINE_TYPE(struct trace, (const struct trace *), hash_trace, trace_eq,
		   thash);

static struct thash htable
= { HTABLE_INITIALIZER(htable.raw, thash_hash, NULL) };

static void init_trace(struct trace *trace,
		       const char *condstr, const char *file, unsigned int line,
		       bool expect)
{
	trace->condstr = condstr;
	trace->file = file;
	trace->line = line;
	trace->expect = expect;
	trace->count = trace->right = 0;
}

static struct trace *add_trace(const struct trace *t)
{
	struct trace *trace = malloc(sizeof(*trace));
Esempio n. 2
0
/* command-line options (passed in the forkserv module's cmdline field). */
struct cmd_opt {
	char *value;
	char key[];		/* has internal null. value = &key[nullpos + 1]. */
};


typedef Suite *(*suite_ctor)(void);


static size_t hash_forkserv_page(const void *key, void *priv);


static L4_ThreadId_t forkserv_pager, forkserv_tid;
static L4_Fpage_t forkserv_utcb_area;
static struct htable forkserv_pages = HTABLE_INITIALIZER(forkserv_pages,
	&hash_forkserv_page, NULL);
static L4_Word_t forkserv_start, forkserv_end;


/* runtime bits (TODO: move into a library?) */

void abort(void)
{
	printf("testbench abort() called!\n");
	L4_ThreadId_t dummy;
	for(;;) {
		L4_Ipc(L4_nilthread, L4_nilthread, L4_Timeouts(L4_Never, L4_Never),
			&dummy);
	}
}