accessors.c File Reference
`#include "spebase.h"`
`#include "create.h"`
`#include <fcntl.h>`
`#include <errno.h>`
`#include <sys/mman.h>`
Include dependency graph for accessors.c:

Go to the source code of this file.

## Functions

void * | _base_spe_ps_area_get (spe_context_ptr_t spe, enum ps_area area)
void * | _base_spe_ls_area_get (spe_context_ptr_t spe)
| __attribute__ ((noinline))
int | __base_spe_event_source_acquire (spe_context_ptr_t spe, enum fd_name fdesc)
void | __base_spe_event_source_release (struct spe_context *spe, enum fd_name fdesc)
int | __base_spe_spe_dir_get (spe_context_ptr_t spe)
int | __base_spe_stop_event_source_get (spe_context_ptr_t spe)
int | __base_spe_stop_event_target_get (spe_context_ptr_t spe)
int | _base_spe_ls_size_get (spe_context_ptr_t spe)

## Function Documentation

__attribute__ | ( | (noinline) | ) |  |

Definition at line 69 of file accessors.c.

{
return;
}

int __base_spe_event_source_acquire | ( | spe_context_ptr_t | spe,
|  | enum fd_name | fdesc
| ) |  |

Definition at line 74 of file accessors.c.

References _base_spe_open_if_closed().

Referenced by _event_spe_event_handler_deregister(), and _event_spe_event_handler_register().

{
return _base_spe_open_if_closed(spe, fdesc, 0);
}

Here is the call graph for this function:

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

Parameters

  spectx | Specifies the SPE context
  fdesc | Specifies the event source

Definition at line 79 of file accessors.c.

References _base_spe_close_if_open().

{
_base_spe_close_if_open(spe, fdesc);
}

Here is the call graph for this function:

int __base_spe_spe_dir_get | ( | spe_context_ptr_t | spe) |  |

Definition at line 84 of file accessors.c.

References spe_context::base_private, and spe_context_base_priv::fd_spe_dir.

{
return spe->base_private->fd_spe_dir;
}

int __base_spe_stop_event_source_get | ( | spe_context_ptr_t | spe) |  |

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.

{
return spe->base_private->ev_pipe[1];
}

int __base_spe_stop_event_target_get | ( | spe_context_ptr_t | spe) |  |

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.

{
return spe->base_private->ev_pipe[0];
}

void* _base_spe_ls_area_get | ( | spe_context_ptr_t | spe) |  |

Definition at line 64 of file accessors.c.

References spe_context::base_private, and spe_context_base_priv::mem_mmap_base.

{
return spe->base_private->mem_mmap_base;
}

int _base_spe_ls_size_get | ( | spe_context_ptr_t | spe) |  |

_base_spe_ls_size_get returns the size of the local store area

Parameters

  spectx | Specifies the SPE context

Definition at line 105 of file accessors.c.

References LS_SIZE.

{
return LS_SIZE;
}

void* _base_spe_ps_area_get | ( | spe_context_ptr_t | spe,
|  | enum ps_area | area
| ) |  |

Definition at line 30 of file accessors.c.

References spe_context::base_private, spe_context_base_priv::cntl_mmap_base, spe_context_base_priv::mfc_mmap_base, spe_context_base_priv::mssync_mmap_base, spe_context_base_priv::signal1_mmap_base, spe_context_base_priv::signal2_mmap_base, SPE_CONTROL_AREA, SPE_MFC_COMMAND_AREA, SPE_MSSYNC_AREA, SPE_SIG_NOTIFY_1_AREA, and SPE_SIG_NOTIFY_2_AREA.

{
void *ptr;
switch (area) {
case SPE_MSSYNC_AREA:
ptr = spe->base_private->mssync_mmap_base;
break;
case SPE_MFC_COMMAND_AREA:
ptr = spe->base_private->mfc_mmap_base;
break;
case SPE_CONTROL_AREA:
ptr = spe->base_private->cntl_mmap_base;
break;
case SPE_SIG_NOTIFY_1_AREA:
ptr = spe->base_private->signal1_mmap_base;
break;
case SPE_SIG_NOTIFY_2_AREA:
ptr = spe->base_private->signal2_mmap_base;
break;
default:
errno = EINVAL;
return NULL;
break;
}
if (ptr == MAP_FAILED) {
errno = EACCES;
return NULL;
}
return ptr;
}