#include <setjmp.h>
#include <stdlib.h>
#include <assert.h>
#include <time.h>
#include <atomic.h>
Go to the source code of this file.
Compounds | |
struct | atexit_s |
struct | cond_s |
union | context_s |
struct | domain_s |
struct | mutex_s |
struct | processor_s |
struct | semaphore_s |
struct | sym_s |
struct | sym_table_s |
struct | thread_s |
struct | thread_table_s |
Defines | |
#define | TRT_MAX_NUM_PROCESSORS_PER_TILE 16 |
#define | TRT_SCHEDULER_STACK_SIZE 128 |
#define | TRT_STACK_OVERFLOW_MAGIC 0x02742312 |
#define | TRT_STATISTICS 1 |
#define | TRT_ISA_MIPS 0 |
#define | TRT_ISA_I386 1 |
#define | TRT_ISA_SPARC 2 |
#define | TRT_ISA_HPPA 3 |
#define | WHERE serial_out("line %d of %s\n", __LINE__, __FILE__); |
#define | get_current_processor() (current_processor) |
#define | set_current_processor(p) (current_processor = (p)) |
#define | SEM_INITIALIZER(c, n) {(c), 0, 0, 0, (n)} |
#define | MUT_INITIALIZER {SEM_INITIALIZER(1, "mut")} |
#define | CND_INITIALIZER {SEM_INITIALIZER(0, "cnd")} |
#define | force_load(var) |
Typedefs | |
typedef thread_s | thread_t |
typedef semaphore_s | semaphore_t |
typedef processor_s | processor_t |
typedef mutex_s | mutex_t |
typedef cond_s | cond_t |
typedef atexit_s | atexit_t |
typedef domain_s | domain_t |
typedef context_s | context_t |
typedef sym_s | sym_t |
typedef sym_table_s | sym_table_t |
typedef thread_table_s | thread_table_t |
Enumerations | |
enum | suspend_modes { SUSPEND_ENABLE = 0, SUSPEND_DISABLE } |
Functions | |
void | trt_init (int *stack_bot, int *stack_top) |
int | trt_num_tiles () |
void | trt_set_scheduling_domain (int processor_index, domain_t *domain) |
domain_t * | trt_scheduling_domain (int processor_index) |
void | thr_migrate_domain (thread_t *thread, domain_t *domain) |
void | trt_init_scheduling_domain (domain_t *domain, int isa) |
int | trt_processor_index () |
int | trt_tile_index () |
void | thr_create (thread_t *new_thread, int(*fun)(int), int arg) |
void | thr_destroy (thread_t *thread) |
void | thr_stack_size (thread_t *thread, int size) |
void | thr_stack_addr (thread_t *thread, void *addr) |
thread_t * | thr_lookup (int id) |
void | thr_set_cache_ddr_domain (thread_t *thread, int cache_domain, int ddr_domain) |
void | thr_exit (int exit_status) |
void | thr_atexit (thread_t *thread, void(*fun)(int), int arg) |
void | thr_atexit_pop (thread_t *thread, int execute) |
void | thr_onblock (thread_t *thread, void(*fun)(void)) |
void | trt_onidle (void(*fun)(void)) |
int | trt_load () |
int | trt_num_procs (int isa) |
int | trt_is_idle () |
void | thr_start (thread_t *thread) |
void | thr_stop (thread_t *thread, int status) |
void | thr_suspend (thread_t *thread) |
void | thr_resume (thread_t *thread) |
void | thr_restart (thread_t *thread, int(*fun)(int), int arg) |
void | thr_suspend_me () |
void | thr_suspend_point () |
int | thr_suspend_mode (thread_t *thread, int mode) |
void | thr_join (thread_t *thread, int *exit_status) |
void | thr_switch () |
void | thr_set_name (thread_t *thread, char *name) |
char * | thr_name (thread_t *thread) |
int | thr_argument (thread_t *thread) |
thread_t * | thr_self () |
int | thr_processor_index (thread_t *thread) |
int | thr_isa (thread_t *thread) |
char * | thr_isa_name (thread_t *thread) |
void | sem_init (semaphore_t *semaphore, int init, char *name) |
int | sem_Pn (semaphore_t *semaphore, int n) |
int | sem_reset (semaphore_t *semaphore) |
void | sem_Vn (semaphore_t *semaphore, int n) |
void | sem_block_me (semaphore_t *semaphore) |
void | sem_unblock_someone (semaphore_t *semaphore) |
void | sem_P (semaphore_t *semaphore) |
void | sem_V (semaphore_t *semaphore) |
void | sem_Pn_nb (semaphore_t *semaphore, int n) |
void | sem_Vn_priv (semaphore_t *semaphore, int n) |
int | sem_tryP (semaphore_t *semaphore) |
int | sem_value (semaphore_t *semaphore) |
void | mut_init (mutex_t *mutex) |
void | mut_lock (mutex_t *mutex) |
void | mut_unlock (mutex_t *mutex) |
void | cnd_init (cond_t *cond) |
void | cnd_wait (cond_t *cond, mutex_t *mutex) |
void | cnd_signal (cond_t *cond) |
void | cnd_broadcast (cond_t *cond) |
void | sym_register (char *name, void *addr) |
void * | sym_query (int isa, char *name, int wait) |
void | sym_dump () |
void | serial_out (char *format,...) |
void | trt_putc (int port, char c) |
int | trt_getc (int port) |
void | trt_panic (char *error_message) |
void | trt_panic_d (char *error_message, int arg) |
void | trt_panic_s (char *error_message, char *arg) |
void | trt_debug_handler (char *name, void(*handler)(char *), char *help) |
void | thr_dump_info (thread_t *thread, int header) |
void * | trt_malloc (unsigned int) |
void | trt_free (void *p) |
Variables | |
int | trt_config_stack_size |
processor_t * | current_processor |
int | trt_tile_idx |
|
|
|
Value: ( \ *(thread_t * volatile *) &(var) \ ) Definition at line 174 of file trt.h. Referenced by select_thread(), sem_unblock_someone(), and sem_Vn(). |
|
Definition at line 162 of file trt.h. Referenced by find_processor(), scale_spin_counts(), schedule_me(), schedule_next_thread(), select_thread(), steal_thread(), thr_self(), thr_suspend_point(), and trt_processor_index(). |
|
|
|
|
|
Definition at line 163 of file trt.h. Referenced by trt_init(). |
|
Definition at line 32 of file trt.h. Referenced by isa_name(). |
|
Definition at line 30 of file trt.h. Referenced by isa_name(). |
|
Definition at line 29 of file trt.h. Referenced by isa_name(). |
|
Definition at line 31 of file trt.h. Referenced by isa_name(). |
|
Definition at line 22 of file trt.h. Referenced by trt_init(). |
|
|
|
Definition at line 25 of file trt.h. Referenced by thr_exit(), thr_stack_addr(), thr_stack_size(), and trt_init(). |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
Definition at line 42 of file trt.h. Referenced by thr_self(). |
|
|
|
|
|
Definition at line 553 of file trt.h. References semaphore_s::count, count(), cond_s::queue, and sem_V(). |
|
Definition at line 526 of file trt.h. References cond_s::queue, and sem_init(). |
|
Definition at line 544 of file trt.h. References semaphore_s::count, cond_s::queue, and sem_V(). |
|
Definition at line 534 of file trt.h. References mutex_s::lock, cond_s::queue, sem_P(), and sem_V(). |
|
Definition at line 502 of file trt.h. References mutex_s::lock, and sem_init(). |
|
Definition at line 510 of file trt.h. References mutex_s::lock, and sem_P(). |
|
Definition at line 518 of file trt.h. References mutex_s::lock, and sem_V(). |
|
Definition at line 1107 of file trt.c. References append, thread_s::block_handler, semaphore_s::blocked_lock, thread_s::blocked_on, context_switch(), and current_thread. Referenced by sem_P(). |
|
SEMAPHORES *************************************************************** Definition at line 1098 of file trt.c. References semaphore_s::blocked_head, semaphore_s::blocked_lock, semaphore_s::blocked_tail, semaphore_s::count, FALSE, init, and semaphore_s::name. Referenced by cnd_init(), mut_init(), thr_create(), thr_suspend(), and trtSemaphore::trtSemaphore(). |
|
Definition at line 441 of file trt.h. References atomic_subi, semaphore_s::count, and sem_block_me(). Referenced by cnd_wait(), mut_lock(), thr_join(), thr_suspend(), and trtSemaphore::wait(). |
|
Definition at line 1157 of file trt.c. References append, atomic_sub_special, thread_s::block_handler, semaphore_s::blocked_lock, thread_s::blocked_on, context_switch(), semaphore_s::count, and current_thread. |
|
Definition at line 459 of file trt.h. References atomic_sub, and semaphore_s::count. |
|
Definition at line 418 of file trt.h. References atomic_seti, and semaphore_s::count. |
|
Definition at line 476 of file trt.h. References atomic_addi, atomic_subi, and semaphore_s::count. |
|
Definition at line 1119 of file trt.c. References acquire_lock, add_to_ready_list(), semaphore_s::blocked_head, semaphore_s::blocked_lock, thread_s::blocked_on, FALSE, FIFO_READY_LIST, force_load, thread_s::next, release_lock, and TRUE. Referenced by sem_V(), and sem_Vn_priv(). |
|
Definition at line 450 of file trt.h. References atomic_addi, semaphore_s::count, and sem_unblock_someone(). Referenced by cnd_broadcast(), cnd_signal(), cnd_wait(), mut_unlock(), trtSemaphore::signal(), and thr_suspend_me(). |
|
Definition at line 491 of file trt.h. References semaphore_s::count. |
|
Definition at line 1181 of file trt.c. References acquire_lock, add_to_ready_list(), atomic_add, semaphore_s::blocked_head, semaphore_s::blocked_lock, thread_s::blocked_on, semaphore_s::count, FALSE, FIFO_READY_LIST, force_load, MIN, thread_s::next, release_lock, and TRUE. Referenced by thr_destroy(), and thr_exit_cont(). |
|
Definition at line 467 of file trt.h. References atomic_add, semaphore_s::count, and sem_unblock_someone(). |
|
Definition at line 1672 of file trt.c. References acquire_lock, formated_out(), release_lock, trt_serial_lock, and TRUE. Referenced by dump_processor_info(), panic(), sym_dump(), sym_query(), thr_dump_info(), trt_panic(), trt_panic_d(), and trt_panic_s(). |
|
Referenced by dump_registry_info_r(), and dump_registry_info_R(). |
|
Definition at line 1420 of file trt.c. References sym_s::addr, count(), sym_s::hash, sym_s::isa, isa_name(), sym_table_s::list, sym_s::name, sym_s::next, serial_out(), sym_hash(), thr_switch(), trt_sym_table, and TRUE. Referenced by sym_register(), and thr_onblock(). |
|
Definition at line 1394 of file trt.c. References acquire_lock, FALSE, sym_table_s::list, sym_table_s::lock, release_lock, sym_hash(), sym_query(), trt_malloc(), trt_sym_table, and TRUE. Referenced by trt_init(). |
|
Definition at line 379 of file trt.h. References thread_s::start_arg. |
|
Definition at line 746 of file trt.c. References atexit_s::arg, thread_s::atexit, atexit_s::count, and atexit_s::fun. |
|
Definition at line 756 of file trt.c. References atexit_s::arg, thread_s::atexit, atexit_s::count, and atexit_s::fun. |
|
Definition at line 561 of file trt.c. References addr2isa(), atomic_add, call_start_function(), context_s::context, thread_s::context, thread_s::exit, find_processor(), thread_s::id, thread_s::name, thread_s::processor, SAVE_CONTEXT, sem_init(), thread_s::start_arg, thread_s::start_fun, thr_onblock(), thr_set_cache_ddr_domain(), thread_table_add(), trt_init(), trt_next_thread_ID, and trt_num_processors. Referenced by trtTask::start(). |
|
Definition at line 725 of file trt.c. References thread_s::atexit, thread_s::exit, atexit_s::free_desc, atexit_s::free_stack, sem_Vn(), thread_s::stack, thread_table_remove(), and trt_free(). Referenced by trtTask::kill(). |
|
Definition at line 1278 of file trt.c. References thread_s::blocked_on, semaphore_s::count, thread_s::exit, processor_s::index, thread_s::name, semaphore_s::name, thread_s::processor, serial_out(), thread_s::stack_magic, and thr_isa_name(). Referenced by dump_thread_info(). |
|
Definition at line 705 of file trt.c. References atexit_s::arg, atexit_s::count, current_thread, empty_handler(), atexit_s::fun, switch_to_scheduler_stack, thr_exit_cont(), thread_table_remove(), trt_panic_s(), and TRT_STACK_OVERFLOW_MAGIC. Referenced by call_start_function(), trtTask::exit(), and thr_stop(). |
|
Definition at line 631 of file trt.c. Referenced by thr_isa_name(). |
|
Definition at line 636 of file trt.c. References isa_name(), and thr_isa(). Referenced by thr_dump_info(). |
|
Definition at line 963 of file trt.c. References thread_s::exit, thread_s::exit_status, and sem_P(). Referenced by trtTask::join(). |
|
Definition at line 587 of file trt.c. References acquire_lock, thread_table_s::head, id(), thread_s::id, thread_table_s::lock, thread_s::next_table, release_lock, trt_thread_table, and TRUE. |
|
Definition at line 997 of file trt.c. References current_thread, processor_s::domain, domain_s::isa, domain_s::num_thread_migrates, thread_s::processor, thr_switch(), trt_num_processors, and trt_processor_table. |
|
Definition at line 371 of file trt.h. References thread_s::name. |
|
Definition at line 764 of file trt.c. References thread_s::block_handler, processor_s::domain, domain_s::isa, thread_s::processor, sym_query(), and TRUE. Referenced by thr_create(). |
|
Definition at line 395 of file trt.h. References processor_s::index, and thread_s::processor. |
|
Definition at line 927 of file trt.c. References add_to_ready_list(), thread_s::blocked_on, call_start_function(), context_s::context, thread_s::context, FALSE, FIFO_READY_LIST, SAVE_CONTEXT, set_sp(), thread_s::stack_init_sp, thread_s::start_arg, and thread_s::start_fun. Referenced by thr_stop(). |
|
Definition at line 892 of file trt.c. References add_to_ready_list(), append, atomic_subi, semaphore_s::blocked_lock, thread_s::blocked_on, semaphore_s::count, FALSE, FIFO_READY_LIST, and release_lock. |
|
Definition at line 387 of file trt.h. References get_current_processor, and thread_t. |
|
Definition at line 1221 of file trt.c. References thread_s::id, and thread_s::task_id. Referenced by thr_create(), and trt_init(). |
|
Definition at line 971 of file trt.c. References thread_s::name. Referenced by trtTask::start(). |
|
Definition at line 672 of file trt.c. References set_sp(), thread_s::stack_init_sp, thread_s::stack_magic, and TRT_STACK_OVERFLOW_MAGIC. |
|
Definition at line 641 of file trt.c. References thread_s::atexit, atexit_s::free_stack, set_sp(), thread_s::stack, thread_s::stack_init_sp, thread_s::stack_magic, trt_config_stack_size, trt_free(), trt_malloc(), TRT_STACK_OVERFLOW_MAGIC, and TRUE. Referenced by trtTask::start(), and thr_start(). |
|
Definition at line 790 of file trt.c. References add_to_ready_list(), FALSE, FIFO_READY_LIST, thread_s::stack, thr_stack_size(), and trt_config_stack_size. Referenced by trtTask::start(). |
|
Definition at line 947 of file trt.c. References thread_s::stack, thr_exit(), and thr_restart(). |
|
Definition at line 848 of file trt.c. References thread_s::blocked_on, context_switch(), current_thread, thread_s::processor, search_blocked_list(), search_ready_list(), sem_init(), sem_P(), SUSPEND_DISABLE, thread_s::suspend_point_sem, thread_s::suspension_mode, thr_switch(), and TRUE. Referenced by trtTask::kill(). |
|
Definition at line 920 of file trt.c. References context_switch(), current_thread, and sem_V(). Referenced by thr_suspend_point(). |
|
Definition at line 911 of file trt.c. References thread_s::suspension_mode. |
|
Definition at line 341 of file trt.h. References get_current_processor, and thr_suspend_me(). |
|
Definition at line 953 of file trt.c. References add_to_ready_list(), context_switch(), current_thread, empty_handler(), lock, and TRUE. Referenced by sym_query(), thr_migrate_domain(), and thr_suspend(). |
|
Definition at line 1304 of file trt.c. References dbg_handler, dbg_handler_s::handler, dbg_handler_s::help, dbg_handler_s::name, and trt_panic_s(). |
|
Definition at line 1375 of file trt.c. Referenced by thr_destroy(), thr_exit_cont(), and thr_stack_size(). |
|
|
|
Definition at line 1044 of file trt.c. References atomic_add, atomic_addi, call_function(), call_start_function(), processor_s::crt0_thread, current_thread, processor_s::domain, empty_handler(), GENERAL, processor_s::index, MAX, num_tile_cols, num_tile_rows, processor_s::purpose, set_current_processor, sym_register(), thr_set_cache_ddr_domain(), thread_table_add(), TRT_MAX_NUM_PROCESSORS_PER_TILE, trt_next_thread_ID, trt_num_processors, trt_processor_table, and TRT_STACK_OVERFLOW_MAGIC. Referenced by thr_create(), and trtOs::trtOs(). |
|
Definition at line 976 of file trt.c. References domain_s::isa, domain_s::num_context_switches, and domain_s::num_thread_migrates. |
|
Definition at line 227 of file trt.c. References FALSE, GENERAL, processor_s::purpose, processor_s::ready_list_head, processor_s::running_thread, processor_s::schedule_me, trt_num_processors, trt_processor_table, and TRUE. Referenced by select_thread(). |
|
MISCELANIOUS STUFF ******************************************************* Definition at line 1470 of file trt.c. References acquire_lock, count(), GENERAL, thread_s::next, processor_s::purpose, processor_s::ready_list_head, processor_s::ready_list_lock, release_lock, processor_s::running_thread, processor_s::schedule_me, trt_num_processors, trt_processor_table, and TRUE. |
|
OUR OWN MALLOC *********************************************************** Definition at line 1365 of file trt.c. References size, and trt_panic(). Referenced by sym_register(), and thr_stack_size(). |
|
Definition at line 1500 of file trt.c. References count(), processor_s::domain, GENERAL, domain_s::isa, processor_s::purpose, trt_num_processors, and trt_processor_table. |
|
Definition at line 1034 of file trt.c. References num_tile_cols, and num_tile_rows. |
|
Definition at line 776 of file trt.c. References processor_s::domain, processor_s::idle_handler, domain_s::isa, trt_num_processors, and trt_processor_table. Referenced by trtOs::trtOs(). |
|
Definition at line 1342 of file trt.c. References panic(), and serial_out(). Referenced by trt_malloc(). |
|
Definition at line 1349 of file trt.c. References panic(), and serial_out(). |
|
Definition at line 1356 of file trt.c. References panic(), and serial_out(). Referenced by find_processor(), thr_exit(), and trt_debug_handler(). |
|
Definition at line 218 of file trt.h. References get_current_processor. Referenced by panic(). |
|
SERIAL OUTPUT ************************************************************ Definition at line 1533 of file trt.c. Referenced by formated_out(), serial_out_hex(), serial_out_str(), and trt_putcn(). |
|
Definition at line 992 of file trt.c. References processor_s::domain, and trt_processor_table. |
|
Definition at line 983 of file trt.c. References processor_s::domain, domain_s::isa, and trt_processor_table. |
|
Definition at line 226 of file trt.h. References trt_tile_idx. |
|
|
|
Definition at line 38 of file trt.h. Referenced by thr_stack_size(), and thr_start(). |
|
Definition at line 165 of file trt.h. Referenced by trt_tile_index(). |