Linux Kernel  3.7.1
 All Data Structures Namespaces Files Functions Variables Typedefs Enumerations Enumerator Macros Groups Pages
Macros | Functions
switch.c File Reference
#include <linux/export.h>
#include <linux/errno.h>
#include <linux/hardirq.h>
#include <linux/sched.h>
#include <linux/kernel.h>
#include <linux/mm.h>
#include <linux/vmalloc.h>
#include <linux/smp.h>
#include <linux/stddef.h>
#include <linux/unistd.h>
#include <asm/io.h>
#include <asm/spu.h>
#include <asm/spu_priv1.h>
#include <asm/spu_csa.h>
#include <asm/mmu_context.h>
#include "spufs.h"
#include "spu_save_dump.h"
#include "spu_restore_dump.h"

Go to the source code of this file.


#define RELAX_SPIN_COUNT   1000
#define POLL_WHILE_TRUE(_c)


int spu_save (struct spu_state *prev, struct spu *spu)
int spu_restore (struct spu_state *new, struct spu *spu)
 EXPORT_SYMBOL_GPL (spu_restore)
int spu_init_csa (struct spu_state *csa)
void spu_fini_csa (struct spu_state *csa)

Macro Definition Documentation

#define POLL_WHILE_FALSE (   _c)    POLL_WHILE_TRUE(!(_c))

Definition at line 76 of file switch.c.

#define POLL_WHILE_TRUE (   _c)
{ \
do { \
int _i; \
for (_i=0; _i<RELAX_SPIN_COUNT && (_c); _i++) { \
cpu_relax(); \
} \
if (unlikely(_c)) yield(); \
else break; \
} while (_c); \

Definition at line 64 of file switch.c.

#define RELAX_SPIN_COUNT   1000

Definition at line 63 of file switch.c.

Function Documentation

EXPORT_SYMBOL_GPL ( spu_save  )
EXPORT_SYMBOL_GPL ( spu_restore  )
void spu_fini_csa ( struct spu_state *  csa)

Definition at line 2219 of file switch.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.

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.