libspe2
0.9a
|
Go to the source code of this file.
Data Structures | |
struct | spe_context_base_priv |
struct | spe_gang_context_base_priv |
Macros | |
#define | __PRINTF(fmt, args...) { fprintf(stderr,fmt , ## args); } |
#define | DEBUG_PRINTF(fmt, args...) |
#define | LS_SIZE 0x40000 /* 256K (in bytes) */ |
#define | PSMAP_SIZE 0x20000 /* 128K (in bytes) */ |
#define | MFC_SIZE 0x1000 |
#define | MSS_SIZE 0x1000 |
#define | CNTL_SIZE 0x1000 |
#define | SIGNAL_SIZE 0x1000 |
#define | MSSYNC_OFFSET 0x00000 |
#define | MFC_OFFSET 0x03000 |
#define | CNTL_OFFSET 0x04000 |
#define | SIGNAL1_OFFSET 0x14000 |
#define | SIGNAL2_OFFSET 0x1c000 |
#define | SPE_EMULATE_PARAM_BUFFER 0x3e000 |
#define | SPE_PROGRAM_NORMAL_END 0x2000 |
#define | SPE_PROGRAM_LIBRARY_CALL 0x2100 |
#define | SPE_PROGRAM_ISOLATED_STOP 0x2200 |
#define | SPE_PROGRAM_ISO_LOAD_COMPLETE 0x2206 |
Enumerations | |
enum | fd_name { FD_MBOX, FD_MBOX_STAT, FD_IBOX, FD_IBOX_NB, FD_IBOX_STAT, FD_WBOX, FD_WBOX_NB, FD_WBOX_STAT, FD_SIG1, FD_SIG2, FD_MFC, FD_MSS, NUM_MBOX_FDS } |
Functions | |
spe_context_ptr_t | _base_spe_context_create (unsigned int flags, spe_gang_context_ptr_t gctx, spe_context_ptr_t aff_spe) |
spe_gang_context_ptr_t | _base_spe_gang_context_create (unsigned int flags) |
int | _base_spe_program_load (spe_context_ptr_t spectx, spe_program_handle_t *program) |
void | _base_spe_program_load_complete (spe_context_ptr_t spectx) |
int | _base_spe_emulated_loader_present (void) |
int | _base_spe_context_destroy (spe_context_ptr_t spectx) |
int | _base_spe_gang_context_destroy (spe_gang_context_ptr_t gctx) |
int | _base_spe_context_run (spe_context_ptr_t spe, unsigned int *entry, unsigned int runflags, void *argp, void *envp, spe_stop_info_t *stopinfo) |
int | _base_spe_image_close (spe_program_handle_t *handle) |
spe_program_handle_t * | _base_spe_image_open (const char *filename) |
int | _base_spe_mfcio_put (spe_context_ptr_t spectx, unsigned int ls, void *ea, unsigned int size, unsigned int tag, unsigned int tid, unsigned int rid) |
int | _base_spe_mfcio_putb (spe_context_ptr_t spectx, unsigned int ls, void *ea, unsigned int size, unsigned int tag, unsigned int tid, unsigned int rid) |
int | _base_spe_mfcio_putf (spe_context_ptr_t spectx, unsigned int ls, void *ea, unsigned int size, unsigned int tag, unsigned int tid, unsigned int rid) |
int | _base_spe_mfcio_get (spe_context_ptr_t spectx, unsigned int ls, void *ea, unsigned int size, unsigned int tag, unsigned int tid, unsigned int rid) |
int | _base_spe_mfcio_getb (spe_context_ptr_t spectx, unsigned int ls, void *ea, unsigned int size, unsigned int tag, unsigned int tid, unsigned int rid) |
int | _base_spe_mfcio_getf (spe_context_ptr_t spectx, unsigned int ls, void *ea, unsigned int size, unsigned int tag, unsigned int tid, unsigned int rid) |
int | _base_spe_out_mbox_read (spe_context_ptr_t spectx, unsigned int mbox_data[], int count) |
int | _base_spe_in_mbox_write (spe_context_ptr_t spectx, unsigned int mbox_data[], int count, int behavior_flag) |
int | _base_spe_in_mbox_status (spe_context_ptr_t spectx) |
int | _base_spe_out_mbox_status (spe_context_ptr_t spectx) |
int | _base_spe_out_intr_mbox_status (spe_context_ptr_t spectx) |
int | _base_spe_out_intr_mbox_read (spe_context_ptr_t spectx, unsigned int mbox_data[], int count, int behavior_flag) |
int | _base_spe_signal_write (spe_context_ptr_t spectx, unsigned int signal_reg, unsigned int data) |
int | _base_spe_callback_handler_register (void *handler, unsigned int callnum, unsigned int mode) |
int | _base_spe_callback_handler_deregister (unsigned int callnum) |
void * | _base_spe_callback_handler_query (unsigned int callnum) |
int | _base_spe_stop_reason_get (spe_context_ptr_t spectx) |
int | _base_spe_mfcio_tag_status_read (spe_context_ptr_t spectx, unsigned int mask, unsigned int behavior, unsigned int *tag_status) |
int | __base_spe_stop_event_source_get (spe_context_ptr_t spectx) |
int | __base_spe_stop_event_target_get (spe_context_ptr_t spectx) |
int | _base_spe_stop_status_get (spe_context_ptr_t spectx) |
int | __base_spe_event_source_acquire (struct spe_context *spectx, enum fd_name fdesc) |
void | __base_spe_event_source_release (struct spe_context *spectx, enum fd_name fdesc) |
void * | _base_spe_ps_area_get (struct spe_context *spectx, enum ps_area area) |
int | __base_spe_spe_dir_get (struct spe_context *spectx) |
void * | _base_spe_ls_area_get (struct spe_context *spectx) |
int | _base_spe_ls_size_get (spe_context_ptr_t spe) |
void | _base_spe_context_lock (spe_context_ptr_t spe, enum fd_name fd) |
void | _base_spe_context_unlock (spe_context_ptr_t spe, enum fd_name fd) |
int | _base_spe_cpu_info_get (int info_requested, int cpu_node) |
void | __spe_context_update_event (void) |
int | _base_spe_mssync_start (spe_context_ptr_t spectx) |
int | _base_spe_mssync_status (spe_context_ptr_t spectx) |
#define __PRINTF | ( | fmt, | |
args... | |||
) | { fprintf(stderr,fmt , ## args); } |
#define CNTL_OFFSET 0x04000 |
Definition at line 124 of file spebase.h.
Referenced by _base_spe_context_create().
#define CNTL_SIZE 0x1000 |
Definition at line 119 of file spebase.h.
Referenced by _base_spe_context_create().
#define MFC_OFFSET 0x03000 |
Definition at line 123 of file spebase.h.
Referenced by _base_spe_context_create().
#define MFC_SIZE 0x1000 |
Definition at line 117 of file spebase.h.
Referenced by _base_spe_context_create().
#define MSS_SIZE 0x1000 |
Definition at line 118 of file spebase.h.
Referenced by _base_spe_context_create().
#define MSSYNC_OFFSET 0x00000 |
Definition at line 122 of file spebase.h.
Referenced by _base_spe_context_create().
#define PSMAP_SIZE 0x20000 /* 128K (in bytes) */ |
Definition at line 116 of file spebase.h.
Referenced by _base_spe_context_create().
#define SIGNAL1_OFFSET 0x14000 |
Definition at line 125 of file spebase.h.
Referenced by _base_spe_context_create().
#define SIGNAL2_OFFSET 0x1c000 |
Definition at line 126 of file spebase.h.
Referenced by _base_spe_context_create().
#define SIGNAL_SIZE 0x1000 |
Definition at line 120 of file spebase.h.
Referenced by _base_spe_context_create().
#define SPE_EMULATE_PARAM_BUFFER 0x3e000 |
Location of the PPE-assisted library call buffer for emulated isolation contexts.
Definition at line 132 of file spebase.h.
Referenced by _base_spe_handle_library_callback().
#define SPE_PROGRAM_ISO_LOAD_COMPLETE 0x2206 |
Definition at line 143 of file spebase.h.
Referenced by _base_spe_context_run().
#define SPE_PROGRAM_ISOLATED_STOP 0x2200 |
Isolated exit codes: 0x220x
Definition at line 142 of file spebase.h.
Referenced by _base_spe_context_run().
#define SPE_PROGRAM_LIBRARY_CALL 0x2100 |
Definition at line 137 of file spebase.h.
Referenced by _base_spe_context_run().
#define SPE_PROGRAM_NORMAL_END 0x2000 |
Definition at line 136 of file spebase.h.
Referenced by _base_spe_context_run().
enum fd_name |
NOTE: NUM_MBOX_FDS must always be the last element in the enumeration
Enumerator | |
---|---|
FD_MBOX | |
FD_MBOX_STAT | |
FD_IBOX | |
FD_IBOX_NB | |
FD_IBOX_STAT | |
FD_WBOX | |
FD_WBOX_NB | |
FD_WBOX_STAT | |
FD_SIG1 | |
FD_SIG2 | |
FD_MFC | |
FD_MSS | |
NUM_MBOX_FDS |
Definition at line 42 of file spebase.h.
int __base_spe_event_source_acquire | ( | struct spe_context * | spectx, |
enum fd_name | fdesc | ||
) |
__base_spe_event_source_acquire opens a file descriptor to the specified event source
spectx | Specifies the SPE context |
fdesc | Specifies the event source |
void __base_spe_event_source_release | ( | struct spe_context * | spectx, |
enum fd_name | fdesc | ||
) |
__base_spe_event_source_release releases the file descriptor to the specified event source
spectx | Specifies the SPE context |
fdesc | Specifies the event source |
Definition at line 79 of file accessors.c.
References _base_spe_close_if_open().
int __base_spe_spe_dir_get | ( | struct spe_context * | spectx | ) |
__base_spe_spe_dir_get return the file descriptor of the SPE directory in spufs
spectx | Specifies the SPE context |
int __base_spe_stop_event_source_get | ( | spe_context_ptr_t | spe | ) |
__base_spe_stop_event_source_get
spectx | Specifies the SPE context |
speevent users read from this end
Definition at line 92 of file accessors.c.
References spe_context::base_private, and spe_context_base_priv::ev_pipe.
int __base_spe_stop_event_target_get | ( | spe_context_ptr_t | spe | ) |
__base_spe_stop_event_target_get
spectx | Specifies the SPE context |
speevent writes to this end
Definition at line 100 of file accessors.c.
References spe_context::base_private, and spe_context_base_priv::ev_pipe.
void __spe_context_update_event | ( | void | ) |
__spe_context_update_event internal function for gdb notification.
Referenced by _base_spe_context_destroy(), and _base_spe_program_load_complete().
int _base_spe_callback_handler_deregister | ( | unsigned int | callnum | ) |
unregister a handler function for the specified number NOTE: unregistering a handler from call zero and one is ignored.
Definition at line 78 of file lib_builtin.c.
References MAX_CALLNUM, and RESERVED.
void* _base_spe_callback_handler_query | ( | unsigned int | callnum | ) |
query a handler function for the specified number
Definition at line 98 of file lib_builtin.c.
References MAX_CALLNUM.
int _base_spe_callback_handler_register | ( | void * | handler, |
unsigned int | callnum, | ||
unsigned int | mode | ||
) |
register a handler function for the specified number NOTE: registering a handler to call zero and one is ignored.
Definition at line 40 of file lib_builtin.c.
References MAX_CALLNUM, RESERVED, SPE_CALLBACK_NEW, and SPE_CALLBACK_UPDATE.
spe_context_ptr_t _base_spe_context_create | ( | unsigned int | flags, |
spe_gang_context_ptr_t | gctx, | ||
spe_context_ptr_t | aff_spe | ||
) |
_base_spe_context_create creates a single SPE context, i.e., the corresponding directory is created in SPUFS either as a subdirectory of a gang or individually (maybe this is best considered a gang of one)
flags | |
gctx | specify NULL if not belonging to a gang |
aff_spe | specify NULL to skip affinity information |
Definition at line 183 of file create.c.
References _base_spe_emulated_loader_present(), spe_context::base_private, spe_gang_context::base_private, spe_context_base_priv::cntl_mmap_base, CNTL_OFFSET, CNTL_SIZE, DEBUG_PRINTF, spe_context_base_priv::fd_lock, spe_context_base_priv::fd_spe_dir, spe_context_base_priv::flags, spe_gang_context_base_priv::gangname, spe_context_base_priv::loaded_program, LS_SIZE, spe_context_base_priv::mem_mmap_base, spe_context_base_priv::mfc_mmap_base, MFC_OFFSET, MFC_SIZE, MSS_SIZE, spe_context_base_priv::mssync_mmap_base, MSSYNC_OFFSET, NUM_MBOX_FDS, spe_context_base_priv::psmap_mmap_base, PSMAP_SIZE, spe_context_base_priv::signal1_mmap_base, SIGNAL1_OFFSET, spe_context_base_priv::signal2_mmap_base, SIGNAL2_OFFSET, SIGNAL_SIZE, SPE_AFFINITY_MEMORY, SPE_CFG_SIGNOTIFY1_OR, SPE_CFG_SIGNOTIFY2_OR, SPE_EVENTS_ENABLE, spe_context_base_priv::spe_fds_array, SPE_ISOLATE, SPE_ISOLATE_EMULATE, and SPE_MAP_PS.
int _base_spe_context_destroy | ( | spe_context_ptr_t | spectx | ) |
_base_spe_context_destroy cleans up what is left when an SPE executable has exited. Closes open file handles and unmaps memory areas.
spectx | Specifies the SPE context |
Definition at line 418 of file create.c.
References __spe_context_update_event().
void _base_spe_context_lock | ( | spe_context_ptr_t | spe, |
enum fd_name | fd | ||
) |
_base_spe_context_lock locks members of the SPE context
spectx | Specifies the SPE context |
fd | Specifies the file |
Definition at line 91 of file create.c.
References spe_context::base_private, and spe_context_base_priv::fd_lock.
Referenced by _base_spe_close_if_open(), and _base_spe_open_if_closed().
int _base_spe_context_run | ( | spe_context_ptr_t | spe, |
unsigned int * | entry, | ||
unsigned int | runflags, | ||
void * | argp, | ||
void * | envp, | ||
spe_stop_info_t * | stopinfo | ||
) |
_base_spe_context_run starts execution of an SPE context with a loaded image
spectx | Specifies the SPE context |
entry | entry point for the SPE programm. If set to 0, entry point is determined by the ELF loader. |
runflags | valid values are: SPE_RUN_USER_REGS Specifies that the SPE setup registers r3, r4, and r5 are initialized with the 48 bytes pointed to by argp. SPE_NO_CALLBACKS do not use built in library functions. |
argp | An (optional) pointer to application specific data, and is passed as the second parameter to the SPE program. |
envp | An (optional) pointer to environment specific data, and is passed as the third parameter to the SPE program. |
Definition at line 99 of file run.c.
References __spe_current_active_context, _base_spe_handle_library_callback(), _base_spe_program_load_complete(), spe_context::base_private, DEBUG_PRINTF, spe_context_base_priv::emulated_entry, spe_context_base_priv::entry, spe_context_base_priv::fd_spe_dir, spe_context_base_priv::flags, LS_SIZE, spe_context_base_priv::mem_mmap_base, spe_context_info::npc, spe_context_info::prev, spe_stop_info::result, spe_stop_info::spe_callback_error, SPE_CALLBACK_ERROR, SPE_DEFAULT_ENTRY, SPE_EVENTS_ENABLE, SPE_EXIT, spe_stop_info::spe_exit_code, spe_context_info::spe_id, SPE_ISOLATE, SPE_ISOLATE_EMULATE, spe_stop_info::spe_isolation_error, SPE_ISOLATION_ERROR, SPE_NO_CALLBACKS, SPE_PROGRAM_ISO_LOAD_COMPLETE, SPE_PROGRAM_ISOLATED_STOP, SPE_PROGRAM_LIBRARY_CALL, SPE_PROGRAM_NORMAL_END, SPE_RUN_USER_REGS, spe_stop_info::spe_runtime_error, SPE_RUNTIME_ERROR, spe_stop_info::spe_runtime_exception, SPE_RUNTIME_EXCEPTION, spe_stop_info::spe_runtime_fatal, SPE_RUNTIME_FATAL, spe_stop_info::spe_signal_code, SPE_SPU_HALT, SPE_SPU_INVALID_CHANNEL, SPE_SPU_INVALID_INSTR, SPE_SPU_STOPPED_BY_STOP, SPE_SPU_WAITING_ON_CHANNEL, SPE_STOP_AND_SIGNAL, spe_stop_info::spu_status, spe_context_info::status, spe_stop_info::stop_reason, addr64::ui, and addr64::ull.
Referenced by _event_spe_context_run().
void _base_spe_context_unlock | ( | spe_context_ptr_t | spe, |
enum fd_name | fd | ||
) |
_base_spe_context_unlock unlocks members of the SPE context
spectx | Specifies the SPE context |
fd | Specifies the file |
Definition at line 96 of file create.c.
References spe_context::base_private, and spe_context_base_priv::fd_lock.
Referenced by _base_spe_close_if_open(), and _base_spe_open_if_closed().
int _base_spe_cpu_info_get | ( | int | info_requested, |
int | cpu_node | ||
) |
_base_spe_info_get
Definition at line 105 of file info.c.
References _base_spe_count_physical_cpus(), _base_spe_count_physical_spes(), _base_spe_count_usable_spes(), SPE_COUNT_PHYSICAL_CPU_NODES, SPE_COUNT_PHYSICAL_SPES, and SPE_COUNT_USABLE_SPES.
int _base_spe_emulated_loader_present | ( | void | ) |
Check if the emulated loader is present in the filesystem
Definition at line 159 of file load.c.
References _base_spe_verify_spe_elf_image().
Referenced by _base_spe_context_create().
spe_gang_context_ptr_t _base_spe_gang_context_create | ( | unsigned int | flags | ) |
creates the directory in SPUFS that will contain all SPEs that are considered a gang Note: I would like to generalize this to a "group" or "set" Additional attributes maintained at the group level should be used to define scheduling constraints such "temporal" (e.g., scheduled all at the same time, i.e., a gang) "topology" (e.g., "closeness" of SPEs for optimal communication)
Definition at line 376 of file create.c.
References spe_gang_context::base_private, DEBUG_PRINTF, and spe_gang_context_base_priv::gangname.
int _base_spe_gang_context_destroy | ( | spe_gang_context_ptr_t | gctx | ) |
int _base_spe_image_close | ( | spe_program_handle_t * | handle | ) |
_base_spe_image_close unmaps an SPE ELF object that was previously mapped using spe_open_image.
handle | handle to open file |
0 | On success, spe_close_image returns 0. |
-1 | On failure, -1 is returned and errno is set appropriately. Possible values for errno: EINVAL From spe_close_image, this indicates that the file, specified by filename, was not previously mapped by a call to spe_open_image. |
Definition at line 96 of file image.c.
References spe_program_handle::elf_image, image_handle::map_size, image_handle::speh, and spe_program_handle::toe_shadow.
spe_program_handle_t* _base_spe_image_open | ( | const char * | filename | ) |
_base_spe_image_open maps an SPE ELF executable indicated by filename into system memory and returns the mapped address appropriate for use by the spe_create_thread API. It is often more convenient/appropriate to use the loading methodologies where SPE ELF objects are converted to PPE static or shared libraries with symbols which point to the SPE ELF objects after these special libraries are loaded. These libraries are then linked with the associated PPE code to provide a direct symbol reference to the SPE ELF object. The symbols in this scheme are equivalent to the address returned from the spe_open_image function. SPE ELF objects loaded using this function are not shared with other processes, but SPE ELF objects loaded using the other scheme, mentioned above, can be shared if so desired.
filename | Specifies the filename of an SPE ELF executable to be loaded and mapped into system memory. |
A number of other errno values could be returned by the open(2), fstat(2), mmap(2), munmap(2), or close(2) system calls which may be utilized by the spe_open_image or spe_close_image functions.
Definition at line 37 of file image.c.
References _base_spe_toe_ear(), _base_spe_verify_spe_elf_image(), spe_program_handle::elf_image, spe_program_handle::handle_size, image_handle::map_size, image_handle::speh, and spe_program_handle::toe_shadow.
int _base_spe_in_mbox_status | ( | spe_context_ptr_t | spectx | ) |
The _base_spe_in_mbox_status function fetches the status of the SPU inbound mailbox for the SPE thread specified by the speid parameter. A 0 value is return if the mailbox is full. A non-zero value specifies the number of available (32-bit) mailbox entries.
spectx | Specifies the SPE context whose mailbox status is to be read. |
Definition at line 202 of file mbox.c.
References _base_spe_open_if_closed(), spe_context::base_private, spe_context_base_priv::cntl_mmap_base, FD_WBOX_STAT, spe_context_base_priv::flags, SPE_MAP_PS, and spe_spu_control_area::SPU_Mbox_Stat.
int _base_spe_in_mbox_write | ( | spe_context_ptr_t | spectx, |
unsigned int | mbox_data[], | ||
int | count, | ||
int | behavior_flag | ||
) |
The _base_spe_in_mbox_write function writes mbox_data to the SPE inbound mailbox for the SPE thread speid.
If the behavior flag indicates ALL_BLOCKING the call will try to write exactly count mailbox entries and block until the write request is satisfied, i.e., exactly count mailbox entries have been written. If the behavior flag indicates ANY_BLOCKING the call will try to write up to count mailbox entries, and block until the write request is satisfied, i.e., at least 1 mailbox entry has been written. If the behavior flag indicates ANY_NON_BLOCKING the call will not block until the write request is satisfied, but instead write whatever is immediately possible and return the number of mailbox entries written. spe_stat_in_mbox can be called to ensure that data can be written prior to calling the function.
spectx | Specifies the SPE thread whose outbound mailbox is to be read. |
mbox_data | |
count | |
behavior_flag | ALL_BLOCKING ANY_BLOCKING ANY_NON_BLOCKING |
>=0 | the number of 32-bit mailbox messages written |
-1 | error condition and errno is set Possible values for errno: EINVAL spectx is invalid Exxxx what else do we need here?? |
void* _base_spe_ls_area_get | ( | struct spe_context * | spectx | ) |
_base_spe_ls_area_get returns a pointer to the start of the memory mapped local store area
spectx | Specifies the SPE context |
int _base_spe_ls_size_get | ( | spe_context_ptr_t | spe | ) |
_base_spe_ls_size_get returns the size of the local store area
spectx | Specifies the SPE context |
Definition at line 105 of file accessors.c.
References LS_SIZE.
int _base_spe_mfcio_get | ( | spe_context_ptr_t | spectx, |
unsigned int | ls, | ||
void * | ea, | ||
unsigned int | size, | ||
unsigned int | tag, | ||
unsigned int | tid, | ||
unsigned int | rid | ||
) |
The _base_spe_mfcio_get function places a get DMA command on the proxy command queue of the SPE thread specified by speid. The get command transfers size bytes of data starting at the effective address specified by ea to the local store address specified by ls. The DMA is identified by the tag id specified by tag and performed according to the transfer class and replacement class specified by tid and rid respectively.
spectx | Specifies the SPE context |
ls | Specifies the starting local store destination address. |
ea | Specifies the starting effective address source address. |
size | Specifies the size, in bytes, to be transferred. |
tag | Specifies the tag id used to identify the DMA command. |
tid | Specifies the transfer class identifier of the DMA command. |
rid | Specifies the replacement class identifier of the DMA command. |
Definition at line 160 of file dma.c.
References MFC_CMD_GET.
int _base_spe_mfcio_getb | ( | spe_context_ptr_t | spectx, |
unsigned int | ls, | ||
void * | ea, | ||
unsigned int | size, | ||
unsigned int | tag, | ||
unsigned int | tid, | ||
unsigned int | rid | ||
) |
The _base_spe_mfcio_getb function is identical to _base_spe_mfcio_get except that it places a getb (get with barrier) DMA command on the proxy command queue. The barrier form ensures that this command and all sequence commands with the same tag identifier as this command are locally ordered with respect to all previously issued commands with the same tag group and command queue.
spectx | Specifies the SPE context |
ls | Specifies the starting local store destination address. |
ea | Specifies the starting effective address source address. |
size | Specifies the size, in bytes, to be transferred. |
tag | Specifies the tag id used to identify the DMA command. |
tid | Specifies the transfer class identifier of the DMA command. |
rid | Specifies the replacement class identifier of the DMA command. |
Definition at line 171 of file dma.c.
References MFC_CMD_GETB.
int _base_spe_mfcio_getf | ( | spe_context_ptr_t | spectx, |
unsigned int | ls, | ||
void * | ea, | ||
unsigned int | size, | ||
unsigned int | tag, | ||
unsigned int | tid, | ||
unsigned int | rid | ||
) |
The _base_spe_mfcio_getf function is identical to _base_spe_mfcio_get except that it places a getf (get with fence) DMA command on the proxy command queue. The fence form ensure that this command is locally ordered with respect to all previously issued commands with the same tag group and command queue.
spectx | Specifies the SPE context |
ls | Specifies the starting local store destination address. |
ea | Specifies the starting effective address source address. |
size | Specifies the size, in bytes, to be transferred. |
tag | Specifies the tag id used to identify the DMA command. |
tid | Specifies the transfer class identifier of the DMA command. |
rid | Specifies the replacement class identifier of the DMA command. |
Definition at line 182 of file dma.c.
References MFC_CMD_GETF.
int _base_spe_mfcio_put | ( | spe_context_ptr_t | spectx, |
unsigned int | ls, | ||
void * | ea, | ||
unsigned int | size, | ||
unsigned int | tag, | ||
unsigned int | tid, | ||
unsigned int | rid | ||
) |
The _base_spe_mfcio_put function places a put DMA command on the proxy command queue of the SPE thread specified by speid. The put command transfers size bytes of data starting at the local store address specified by ls to the effective address specified by ea. The DMA is identified by the tag id specified by tag and performed according transfer class and replacement class specified by tid and rid respectively.
spectx | Specifies the SPE context |
ls | Specifies the starting local store destination address. |
ea | Specifies the starting effective address source address. |
size | Specifies the size, in bytes, to be transferred. |
tag | Specifies the tag id used to identify the DMA command. |
tid | Specifies the transfer class identifier of the DMA command. |
rid | Specifies the replacement class identifier of the DMA command. |
Definition at line 126 of file dma.c.
References MFC_CMD_PUT.
int _base_spe_mfcio_putb | ( | spe_context_ptr_t | spectx, |
unsigned int | ls, | ||
void * | ea, | ||
unsigned int | size, | ||
unsigned int | tag, | ||
unsigned int | tid, | ||
unsigned int | rid | ||
) |
The _base_spe_mfcio_putb function is identical to _base_spe_mfcio_put except that it places a putb (put with barrier) DMA command on the proxy command queue. The barrier form ensures that this command and all sequence commands with the same tag identifier as this command are locally ordered with respect to all previously i ssued commands with the same tag group and command queue.
spectx | Specifies the SPE context |
ls | Specifies the starting local store destination address. |
ea | Specifies the starting effective address source address. |
size | Specifies the size, in bytes, to be transferred. |
tag | Specifies the tag id used to identify the DMA command. |
tid | Specifies the transfer class identifier of the DMA command. |
rid | Specifies the replacement class identifier of the DMA command. |
Definition at line 137 of file dma.c.
References MFC_CMD_PUTB.
int _base_spe_mfcio_putf | ( | spe_context_ptr_t | spectx, |
unsigned int | ls, | ||
void * | ea, | ||
unsigned int | size, | ||
unsigned int | tag, | ||
unsigned int | tid, | ||
unsigned int | rid | ||
) |
The _base_spe_mfcio_putf function is identical to _base_spe_mfcio_put except that it places a putf (put with fence) DMA command on the proxy command queue. The fence form ensures that this command is locally ordered with respect to all previously issued commands with the same tag group and command queue.
spectx | Specifies the SPE context |
ls | Specifies the starting local store destination address. |
ea | Specifies the starting effective address source address. |
size | Specifies the size, in bytes, to be transferred. |
tag | Specifies the tag id used to identify the DMA command. |
tid | Specifies the transfer class identifier of the DMA command. |
rid | Specifies the replacement class identifier of the DMA command. |
Definition at line 148 of file dma.c.
References MFC_CMD_PUTF.
int _base_spe_mfcio_tag_status_read | ( | spe_context_ptr_t | spectx, |
unsigned int | mask, | ||
unsigned int | behavior, | ||
unsigned int * | tag_status | ||
) |
_base_spe_mfcio_tag_status_read
No Idea
Definition at line 307 of file dma.c.
References spe_context_base_priv::active_tagmask, spe_context::base_private, spe_context_base_priv::flags, SPE_MAP_PS, SPE_TAG_ALL, SPE_TAG_ANY, and SPE_TAG_IMMEDIATE.
int _base_spe_mssync_start | ( | spe_context_ptr_t | spectx | ) |
_base_spe_mssync_start starts Multisource Synchronisation
spectx | Specifies the SPE context |
Definition at line 335 of file dma.c.
References _base_spe_open_if_closed(), spe_context::base_private, FD_MSS, spe_context_base_priv::flags, spe_mssync_area::MFC_MSSync, spe_context_base_priv::mssync_mmap_base, and SPE_MAP_PS.
int _base_spe_mssync_status | ( | spe_context_ptr_t | spectx | ) |
_base_spe_mssync_status retrieves status of Multisource Synchronisation
spectx | Specifies the SPE context |
Definition at line 359 of file dma.c.
References _base_spe_open_if_closed(), spe_context::base_private, FD_MSS, spe_context_base_priv::flags, spe_mssync_area::MFC_MSSync, spe_context_base_priv::mssync_mmap_base, and SPE_MAP_PS.
int _base_spe_out_intr_mbox_read | ( | spe_context_ptr_t | spectx, |
unsigned int | mbox_data[], | ||
int | count, | ||
int | behavior_flag | ||
) |
The _base_spe_out_intr_mbox_read function reads the contents of the SPE outbound interrupting mailbox for the SPE context.
Definition at line 255 of file mbox.c.
References _base_spe_open_if_closed(), FD_IBOX, FD_IBOX_NB, SPE_MBOX_ALL_BLOCKING, SPE_MBOX_ANY_BLOCKING, and SPE_MBOX_ANY_NONBLOCKING.
int _base_spe_out_intr_mbox_status | ( | spe_context_ptr_t | spectx | ) |
The _base_spe_out_intr_mbox_status function fetches the status of the SPU outbound interrupt mailbox for the SPE thread specified by the speid parameter. A 0 value is return if the mailbox is empty. A non-zero value specifies the number of 32-bit unread mailbox entries.
spectx | Specifies the SPE context whose mailbox status is to be read. |
Definition at line 238 of file mbox.c.
References _base_spe_open_if_closed(), spe_context::base_private, spe_context_base_priv::cntl_mmap_base, FD_IBOX_STAT, spe_context_base_priv::flags, SPE_MAP_PS, and spe_spu_control_area::SPU_Mbox_Stat.
int _base_spe_out_mbox_read | ( | spe_context_ptr_t | spectx, |
unsigned int | mbox_data[], | ||
int | count | ||
) |
The _base_spe_out_mbox_read function reads the contents of the SPE outbound interrupting mailbox for the SPE thread speid.
The call will not block until the read request is satisfied, but instead return up to count currently available mailbox entries.
spe_stat_out_intr_mbox can be called to ensure that data is available prior to reading the outbound interrupting mailbox.
spectx | Specifies the SPE thread whose outbound mailbox is to be read. |
mbox_data | |
count |
>0 | the number of 32-bit mailbox messages read |
=0 | no data available |
-1 | error condition and errno is set Possible values for errno: EINVAL speid is invalid Exxxx what else do we need here?? |
Definition at line 58 of file mbox.c.
References _base_spe_open_if_closed(), spe_context::base_private, DEBUG_PRINTF, FD_MBOX, spe_context_base_priv::flags, and SPE_MAP_PS.
int _base_spe_out_mbox_status | ( | spe_context_ptr_t | spectx | ) |
The _base_spe_out_mbox_status function fetches the status of the SPU outbound mailbox for the SPE thread specified by the speid parameter. A 0 value is return if the mailbox is empty. A non-zero value specifies the number of 32-bit unread mailbox entries.
spectx | Specifies the SPE context whose mailbox status is to be read. |
Definition at line 220 of file mbox.c.
References _base_spe_open_if_closed(), spe_context::base_private, spe_context_base_priv::cntl_mmap_base, FD_MBOX_STAT, spe_context_base_priv::flags, SPE_MAP_PS, and spe_spu_control_area::SPU_Mbox_Stat.
int _base_spe_program_load | ( | spe_context_ptr_t | spectx, |
spe_program_handle_t * | program | ||
) |
_base_spe_program_load loads an ELF image into a context
spectx | Specifies the SPE context |
program | handle to the ELF image |
Definition at line 203 of file load.c.
References _base_spe_load_spe_elf(), _base_spe_program_load_complete(), spe_context::base_private, DEBUG_PRINTF, spe_context_base_priv::emulated_entry, spe_ld_info::entry, spe_context_base_priv::entry, spe_context_base_priv::flags, spe_context_base_priv::loaded_program, spe_context_base_priv::mem_mmap_base, SPE_ISOLATE, and SPE_ISOLATE_EMULATE.
void _base_spe_program_load_complete | ( | spe_context_ptr_t | spectx | ) |
Signal that the program load has completed. For normal apps, this is called directly in the load path. For (emulated) isolated apps, the load is asynchronous, so this needs to be called when we know that the load has completed
spectx | The spe context that has been loaded. |
Register the SPE program's start address with the oprofile and gdb, by writing to the object-id file.
Definition at line 38 of file load.c.
References __spe_context_update_event(), spe_context::base_private, DEBUG_PRINTF, spe_program_handle::elf_image, spe_context_base_priv::fd_spe_dir, and spe_context_base_priv::loaded_program.
Referenced by _base_spe_context_run(), and _base_spe_program_load().
void* _base_spe_ps_area_get | ( | struct spe_context * | spectx, |
enum ps_area | area | ||
) |
_base_spe_ps_area_get returns a pointer to the start of memory mapped problem state area
spectx | Specifies the SPE context |
area | specifes the area to map |
int _base_spe_signal_write | ( | spe_context_ptr_t | spectx, |
unsigned int | signal_reg, | ||
unsigned int | data | ||
) |
The _base_spe_signal_write function writes data to the signal notification register specified by signal_reg for the SPE thread specified by the speid parameter.
spectx | Specifies the SPE context whose signal register is to be written to. |
signal_reg | Specified the signal notification register to be written. Valid signal notification registers are: SPE_SIG_NOTIFY_REG_1 SPE signal notification register 1 SPE_SIG_NOTIFY_REG_2 SPE signal notification register 2 |
data | The 32-bit data to be written to the specified signal notification register. |
Definition at line 307 of file mbox.c.
References _base_spe_close_if_open(), _base_spe_open_if_closed(), spe_context::base_private, FD_SIG1, FD_SIG2, spe_context_base_priv::flags, spe_context_base_priv::signal1_mmap_base, spe_context_base_priv::signal2_mmap_base, SPE_MAP_PS, SPE_SIG_NOTIFY_REG_1, SPE_SIG_NOTIFY_REG_2, spe_sig_notify_1_area::SPU_Sig_Notify_1, and spe_sig_notify_2_area::SPU_Sig_Notify_2.
int _base_spe_stop_reason_get | ( | spe_context_ptr_t | spectx | ) |
_base_spe_stop_reason_get
spectx | one thread for which to check why it was stopped |
0 | success - eventid and eventdata set appropriately |
1 | spe has not stopped after checking last, so no data was written to event |
-1 | an error has happened, event was not touched, errno gets set Possible vales for errno: EINVAL speid is invalid Exxxx what else do we need here?? |
int _base_spe_stop_status_get | ( | spe_context_ptr_t | spectx | ) |
_base_spe_stop_status_get
spectx | Specifies the SPE context |