Linux Kernel  3.7.1
 All Data Structures Namespaces Files Functions Variables Typedefs Enumerations Enumerator Macros Groups Pages
Data Structures | Macros | Enumerations | Functions | Variables
spufs.h File Reference
#include <linux/kref.h>
#include <linux/mutex.h>
#include <linux/spinlock.h>
#include <linux/fs.h>
#include <linux/cpumask.h>
#include <asm/spu.h>
#include <asm/spu_csa.h>
#include <asm/spu_info.h>

Go to the source code of this file.

Data Structures

struct  switch_log
 
struct  switch_log::switch_log_entry
 
struct  spu_context
 
struct  spu_gang
 
struct  mfc_dma_command
 
struct  spu_context_ops
 
struct  spufs_inode_info
 
struct  spufs_tree_descr
 
struct  spufs_coredump_reader
 

Macros

#define SPUFS_PS_MAP_SIZE   0x20000
 
#define SPUFS_MFC_MAP_SIZE   0x1000
 
#define SPUFS_CNTL_MAP_SIZE   0x1000
 
#define SPUFS_CNTL_MAP_SIZE   0x1000
 
#define SPUFS_SIGNAL_MAP_SIZE   PAGE_SIZE
 
#define SPUFS_MSS_MAP_SIZE   0x1000
 
#define AFF_OFFSETS_SET   1
 
#define AFF_MERGED   2
 
#define SPUFS_I(inode)   container_of(inode, struct spufs_inode_info, vfs_inode)
 
#define spufs_wait(wq, condition)
 

Enumerations

enum  { SPUFS_MAGIC = 0x23c9b64e }
 
enum  { SPU_SCHED_NOTIFY_ACTIVE, SPU_SCHED_WAS_ACTIVE, SPU_SCHED_SPU_RUN }
 
enum  { SWITCH_LOG_BUFSIZE = 4096 }
 
enum  { SWITCH_LOG_START, SWITCH_LOG_STOP, SWITCH_LOG_EXIT }
 

Functions

long spufs_run_spu (struct spu_context *ctx, u32 *npc, u32 *status)
 
long spufs_create (struct path *nd, struct dentry *dentry, unsigned int flags, umode_t mode, struct file *filp)
 
int spufs_coredump_extra_notes_size (void)
 
int spufs_coredump_extra_notes_write (struct file *file, loff_t *foffset)
 
struct spu_gangalloc_spu_gang (void)
 
struct spu_gangget_spu_gang (struct spu_gang *gang)
 
int put_spu_gang (struct spu_gang *gang)
 
void spu_gang_remove_ctx (struct spu_gang *gang, struct spu_context *ctx)
 
void spu_gang_add_ctx (struct spu_gang *gang, struct spu_context *ctx)
 
int spufs_handle_class1 (struct spu_context *ctx)
 
int spufs_handle_class0 (struct spu_context *ctx)
 
struct spu * affinity_check (struct spu_context *ctx)
 
struct spu_contextalloc_spu_context (struct spu_gang *gang)
 
void destroy_spu_context (struct kref *kref)
 
struct spu_contextget_spu_context (struct spu_context *ctx)
 
int put_spu_context (struct spu_context *ctx)
 
void spu_unmap_mappings (struct spu_context *ctx)
 
void spu_forget (struct spu_context *ctx)
 
int __must_check spu_acquire_saved (struct spu_context *ctx)
 
void spu_release_saved (struct spu_context *ctx)
 
int spu_stopped (struct spu_context *ctx, u32 *stat)
 
void spu_del_from_rq (struct spu_context *ctx)
 
int spu_activate (struct spu_context *ctx, unsigned long flags)
 
void spu_deactivate (struct spu_context *ctx)
 
void spu_yield (struct spu_context *ctx)
 
void spu_switch_notify (struct spu *spu, struct spu_context *ctx)
 
void spu_switch_log_notify (struct spu *spu, struct spu_context *ctx, u32 type, u32 val)
 
void spu_set_timeslice (struct spu_context *ctx)
 
void spu_update_sched_info (struct spu_context *ctx)
 
void __spu_update_sched_info (struct spu_context *ctx)
 
int __init spu_sched_init (void)
 
void spu_sched_exit (void)
 
size_t spu_wbox_write (struct spu_context *ctx, u32 data)
 
size_t spu_ibox_read (struct spu_context *ctx, u32 *data)
 
void spufs_ibox_callback (struct spu *spu)
 
void spufs_wbox_callback (struct spu *spu)
 
void spufs_stop_callback (struct spu *spu, int irq)
 
void spufs_mfc_callback (struct spu *spu)
 
void spufs_dma_callback (struct spu *spu, int type)
 
int spu_init_csa (struct spu_state *csa)
 
void spu_fini_csa (struct spu_state *csa)
 
int spu_save (struct spu_state *prev, struct spu *spu)
 
int spu_restore (struct spu_state *new, struct spu *spu)
 
int spu_switch (struct spu_state *prev, struct spu_state *new, struct spu *spu)
 
int spu_alloc_lscsa (struct spu_state *csa)
 
void spu_free_lscsa (struct spu_state *csa)
 
void spuctx_switch_state (struct spu_context *ctx, enum spu_utilization_state new_state)
 

Variables

struct spu_context_ops spu_hw_ops
 
struct spu_context_ops spu_backing_ops
 
struct spufs_tree_descr spufs_dir_contents []
 
struct spufs_tree_descr spufs_dir_nosched_contents []
 
struct spufs_tree_descr spufs_dir_debug_contents []
 
struct spufs_calls spufs_calls
 
struct file_operations spufs_context_fops
 
atomic_t nr_spu_contexts
 
charisolated_loader
 
struct spu_coredump_calls spufs_coredump_calls
 
struct spufs_coredump_reader spufs_coredump_read []
 
int spufs_coredump_num_notes
 

Macro Definition Documentation

#define AFF_MERGED   2

Definition at line 174 of file spufs.h.

#define AFF_OFFSETS_SET   1

Definition at line 173 of file spufs.h.

#define SPUFS_CNTL_MAP_SIZE   0x1000

Definition at line 38 of file spufs.h.

#define SPUFS_CNTL_MAP_SIZE   0x1000

Definition at line 38 of file spufs.h.

#define SPUFS_I (   inode)    container_of(inode, struct spufs_inode_info, vfs_inode)

Definition at line 234 of file spufs.h.

#define SPUFS_MFC_MAP_SIZE   0x1000

Definition at line 36 of file spufs.h.

#define SPUFS_MSS_MAP_SIZE   0x1000

Definition at line 40 of file spufs.h.

#define SPUFS_PS_MAP_SIZE   0x20000

Definition at line 35 of file spufs.h.

#define SPUFS_SIGNAL_MAP_SIZE   PAGE_SIZE

Definition at line 39 of file spufs.h.

#define spufs_wait (   wq,
  condition 
)
Value:
({ \
int __ret = 0; \
DEFINE_WAIT(__wait); \
for (;;) { \
prepare_to_wait(&(wq), &__wait, TASK_INTERRUPTIBLE); \
if (condition) \
break; \
spu_release(ctx); \
if (signal_pending(current)) { \
__ret = -ERESTARTSYS; \
break; \
} \
schedule(); \
__ret = spu_acquire(ctx); \
if (__ret) \
break; \
} \
finish_wait(&(wq), &__wait); \
__ret; \
})

Definition at line 321 of file spufs.h.

Enumeration Type Documentation

anonymous enum
Enumerator:
SPUFS_MAGIC 

Definition at line 43 of file spufs.h.

anonymous enum
Enumerator:
SPU_SCHED_NOTIFY_ACTIVE 
SPU_SCHED_WAS_ACTIVE 
SPU_SCHED_SPU_RUN 

Definition at line 51 of file spufs.h.

anonymous enum
Enumerator:
SWITCH_LOG_BUFSIZE 

Definition at line 57 of file spufs.h.

anonymous enum
Enumerator:
SWITCH_LOG_START 
SWITCH_LOG_STOP 
SWITCH_LOG_EXIT 

Definition at line 61 of file spufs.h.

Function Documentation

void __spu_update_sched_info ( struct spu_context ctx)

Definition at line 108 of file sched.c.

struct spu* affinity_check ( struct spu_context ctx)
read
struct spu_context* alloc_spu_context ( struct spu_gang gang)
read

Definition at line 36 of file context.c.

struct spu_gang* alloc_spu_gang ( void  )
read

Definition at line 28 of file gang.c.

void destroy_spu_context ( struct kref kref)

Definition at line 82 of file context.c.

struct spu_context* get_spu_context ( struct spu_context ctx)
read

Definition at line 101 of file context.c.

struct spu_gang* get_spu_gang ( struct spu_gang gang)
read

Definition at line 54 of file gang.c.

int put_spu_context ( struct spu_context ctx)

Definition at line 107 of file context.c.

int put_spu_gang ( struct spu_gang gang)

Definition at line 60 of file gang.c.

int __must_check spu_acquire_saved ( struct spu_context ctx)

spu_acquire_saved - lock spu contex and make sure it is in saved state : spu contex to lock

Definition at line 156 of file context.c.

int spu_activate ( struct spu_context ctx,
unsigned long  flags 
)

spu_activate - find a free spu for a context and execute it : spu context to schedule : flags (currently ignored)

Tries to find a free spu to run . If no free spu is available add the context to the runqueue so it gets woken up once an spu is available.

Definition at line 786 of file sched.c.

int spu_alloc_lscsa ( struct spu_state *  csa)

Definition at line 173 of file lscsa_alloc.c.

void spu_deactivate ( struct spu_context ctx)

spu_deactivate - unbind a context from it's physical spu : spu context to unbind

Unbind from the physical spu it is running on and schedule the highest priority context to run on the freed physical spu.

Definition at line 895 of file sched.c.

void spu_del_from_rq ( struct spu_context ctx)

Definition at line 537 of file sched.c.

void spu_fini_csa ( struct spu_state *  csa)

Definition at line 2219 of file switch.c.

void spu_forget ( struct spu_context ctx)

Definition at line 113 of file context.c.

void spu_free_lscsa ( struct spu_state *  csa)

Definition at line 178 of file lscsa_alloc.c.

void spu_gang_add_ctx ( struct spu_gang gang,
struct spu_context ctx 
)

Definition at line 65 of file gang.c.

void spu_gang_remove_ctx ( struct spu_gang gang,
struct spu_context ctx 
)

Definition at line 74 of file gang.c.

size_t spu_ibox_read ( struct spu_context ctx,
u32 data 
)

Definition at line 740 of file file.c.

int spu_init_csa ( struct spu_state *  csa)

spu_alloc_csa - allocate and initialize an SPU context save area.

Allocate and initialize the contents of an SPU context save area. This includes enabling address translation, interrupt masks, etc., as appropriate for the given OS environment.

Note that storage for the 'lscsa' is allocated separately, as it is by far the largest of the context save regions, and may need to be pinned or otherwise specially aligned.

Definition at line 2198 of file switch.c.

void spu_release_saved ( struct spu_context ctx)

spu_release_saved - unlock spu context and return it to the runqueue : context to unlock

Definition at line 178 of file context.c.

int spu_restore ( struct spu_state *  new,
struct spu *  spu 
)

spu_restore - SPU context restore, with harvest and locking. : pointer to SPU context save area, to be restored. : pointer to SPU iomem structure.

Perform harvest + restore, as we may not be coming from a previous successful save operation, and the hardware state is unknown.

Definition at line 2132 of file switch.c.

int spu_save ( struct spu_state *  prev,
struct spu *  spu 
)

spu_save - SPU context save, with locking. : pointer to SPU context save area, to be saved. : pointer to SPU iomem structure.

Acquire locks, perform the save operation then return.

Definition at line 2108 of file switch.c.

void spu_sched_exit ( void  )

Definition at line 1155 of file sched.c.

int __init spu_sched_init ( void  )

Definition at line 1113 of file sched.c.

void spu_set_timeslice ( struct spu_context ctx)

Definition at line 97 of file sched.c.

int spu_stopped ( struct spu_context ctx,
u32 stat 
)

Definition at line 48 of file run.c.

int spu_switch ( struct spu_state *  prev,
struct spu_state *  new,
struct spu *  spu 
)
void spu_switch_log_notify ( struct spu *  spu,
struct spu_context ctx,
u32  type,
u32  val 
)

Log a context switch event to a switch log reader.

Must be called with ctx->state_mutex held.

Definition at line 2607 of file file.c.

void spu_switch_notify ( struct spu *  spu,
struct spu_context ctx 
)

Definition at line 31 of file spu_notify.c.

void spu_unmap_mappings ( struct spu_context ctx)

Definition at line 132 of file context.c.

void spu_update_sched_info ( struct spu_context ctx)

Definition at line 149 of file sched.c.

size_t spu_wbox_write ( struct spu_context ctx,
u32  data 
)

Definition at line 889 of file file.c.

void spu_yield ( struct spu_context ctx)

spu_yield - yield a physical spu if others are waiting : spu context to yield

Check if there is a higher priority context waiting and if yes unbind from the physical spu and schedule the highest priority context to run on the freed physical spu instead.

Definition at line 909 of file sched.c.

void spuctx_switch_state ( struct spu_context ctx,
enum spu_utilization_state  new_state 
)

Definition at line 1037 of file sched.c.

int spufs_coredump_extra_notes_size ( void  )

Definition at line 143 of file coredump.c.

int spufs_coredump_extra_notes_write ( struct file file,
loff_t *  foffset 
)

Definition at line 224 of file coredump.c.

long spufs_create ( struct path nd,
struct dentry dentry,
unsigned int  flags,
umode_t  mode,
struct file filp 
)

Definition at line 582 of file inode.c.

void spufs_dma_callback ( struct spu *  spu,
int  type 
)
int spufs_handle_class0 ( struct spu_context ctx)

Definition at line 77 of file fault.c.

int spufs_handle_class1 ( struct spu_context ctx)

Definition at line 110 of file fault.c.

void spufs_ibox_callback ( struct spu *  spu)

Definition at line 753 of file file.c.

void spufs_mfc_callback ( struct spu *  spu)

Definition at line 1578 of file file.c.

long spufs_run_spu ( struct spu_context ctx,
u32 npc,
u32 status 
)

Definition at line 352 of file run.c.

void spufs_stop_callback ( struct spu *  spu,
int  irq 
)

Definition at line 14 of file run.c.

void spufs_wbox_callback ( struct spu *  spu)

Definition at line 905 of file file.c.

Variable Documentation

char* isolated_loader

Definition at line 50 of file inode.c.

atomic_t nr_spu_contexts

Definition at line 34 of file context.c.

struct spu_context_ops spu_backing_ops

Definition at line 384 of file backing_ops.c.

struct spu_context_ops spu_hw_ops

Definition at line 322 of file hw_ops.c.

struct spufs_calls spufs_calls

Definition at line 79 of file syscalls.c.

struct file_operations spufs_context_fops

Definition at line 254 of file inode.c.

struct spu_coredump_calls spufs_coredump_calls
int spufs_coredump_num_notes
struct spufs_coredump_reader spufs_coredump_read[]

Definition at line 2753 of file file.c.

struct spufs_tree_descr spufs_dir_contents[]

Definition at line 2682 of file file.c.

struct spufs_tree_descr spufs_dir_debug_contents[]

Definition at line 2748 of file file.c.

struct spufs_tree_descr spufs_dir_nosched_contents[]

Definition at line 2723 of file file.c.