00001 #ifndef MOC_INTERNAL_CORE_PPU_H_ 00002 #define MOC_INTERNAL_CORE_PPU_H_ 00003 00004 00005 #include <stdint.h> 00006 #include <libspe2.h> 00007 #include <pthread.h> 00008 00009 #include "../imoc_core.h" 00010 #include "../../ppu/moc.h" 00011 00012 00013 00014 /** 00015 * \addtogroup internal_core 00016 **/ 00017 //@{ 00018 /** 00019 * @name PPU only 00020 **/ 00021 //@{ 00022 00023 /** 00024 * Node-handle structure. 00025 * 00026 * \note PPU only 00027 * 00028 * Information each node knowns about himself and the world. 00029 **/ 00030 typedef struct moc_node_handle_ppu_struct 00031 { 00032 uint8_t rank; /**< rank of node */ 00033 uint8_t comm_size; /**< number of overall processes */ 00034 uint8_t queue_size; /**< Size of a message-queue */ 00035 volatile moc_message_envelope_t* message_queue_base; /**< base-address of own message-queues */ 00036 volatile moc_message_status_t* status_array_base; /**< base-address of own message-status-array */ 00037 void* buffer_base; /**< base-address of own buffer */ 00038 uint32_t buffer_size; /**< size of own buffer */ 00039 volatile uint32_t* signal_area; /**< address of own signal-area */ 00040 volatile moc_process_t* moc_process_list; /**< list of all other MOC-processes 00041 (index is rank of process) */ 00042 } moc_node_handle_ppu_t; /**< typedef of \ref moc_node_handle_ppu_struct */ 00043 00044 00045 00046 /** 00047 * Information each node knowns about himself and the world. 00048 * 00049 * \note PPU only 00050 * 00051 **/ 00052 moc_node_handle_ppu_t node_handle; 00053 00054 //@} 00055 //@} 00056 00057 00058 00059 /** 00060 * \addtogroup internal_spu_thread SPU-Thread Management 00061 * 00062 * \note PPU only 00063 **/ 00064 //@{ 00065 00066 /** 00067 * SPU-Thread structure. 00068 * 00069 * \note PPU only 00070 * 00071 * Stores information about the SPU-Threads the managing PPU-Process 00072 * needs to know. 00073 **/ 00074 typedef struct moc_spu_thread_struct 00075 { 00076 uint8_t rank; /**< rank of SPU-thread */ 00077 pthread_t pthread; /**< PThread-handle <*/ 00078 spe_context_ptr_t speid; /**< SPE-Context */ 00079 spe_stop_info_t stop_info; /**< Error-Information */ 00080 uint32_t spe_entry_adress; /**< Spe-entry-address */ 00081 void *argp; /**< effective address of user-defined information 00082 in main-memory */ 00083 void *envp; /**< Pointer to environment information */ 00084 void* buffer_base; /**< base-address of the SPU-Thread's buffer */ 00085 uint32_t buffer_size; /**< size of the SPU-Thread's buffer */ 00086 uint64_t ls_base; /**< Effective Basis-Address of SPU's local-storage */ 00087 uint32_t queue_base_in_ls; /**< Address of message-queue in SPU's local-storage */ 00088 uint32_t status_base_in_ls; /**< Address of status-array in SPU's local-storage */ 00089 } moc_spu_thread_t; /**< typedef of \ref moc_spu_thread_struct */ 00090 00091 00092 00093 /** 00094 * actual number of SPU-Threads. 00095 * 00096 * \note PPU only 00097 **/ 00098 uint8_t moc_spu_thread_count; 00099 00100 00101 /** 00102 * actual number of PPU-Threads. 00103 * 00104 * \note PPU only 00105 **/ 00106 uint8_t moc_ppu_thread_count; 00107 00108 /** 00109 * init buffer size 00110 **/ 00111 uint32_t moc_spu_buffer_size; 00112 00113 /** 00114 * init message-queue size 00115 **/ 00116 uint8_t moc_spu_queue_size; 00117 00118 /** 00119 * array of SPU-Threads. 00120 * 00121 * \note PPU only 00122 **/ 00123 moc_spu_thread_t moc_spu_thread_list[MOC_SPU_THREAD_MAX]; 00124 00125 /** 00126 * PThread-function for creating SPU-Threads 00127 **/ 00128 void* moc_spe_pthread_func(void *arg); 00129 00130 00131 //@} 00132 #endif /*MOC_INTERNAL_CORE_PPU_H_*/
1.5.6