/* sim.h */

#define  TBLOCK_SIZE  100

typedef struct  tblock_struct  {
	thread_t  threads[TBLOCK_SIZE];
	struct tblock_struct  *next;
} tblock_t;

typedef struct  tlist_struct  {
	thread_t  *head, *empty;
	tblock_t  *tblock;
	unsigned  count, id;
	aval_t  ld_start;
	struct tlist_struct  *next, *prev;
} tlist_t;

#define  US_NONE   0
#define  US_ADDR   1
#define  US_VAL    2
#define  US_RANGE  4

extern tlist_t  *sim_tlist;
extern int  sim_create_thread(thread_t *th, aval_t addr);
