Projectname
large_stringclasses
15 values
Filepath
large_stringlengths
4
106
Function
large_stringlengths
11
3.45k
Label
list
Linux Kernel
arch/powerpc/platforms/cell/spufs/file.c
static ssize_t spufs_mbox_info_dump(struct spu_context *ctx, struct coredump_params *cprm) { if (!(ctx->csa.prob.mb_stat_R & 0x0000ff)) return 0; return spufs_dump_emit(cprm, &ctx->csa.prob.pu_mb_R, sizeof(ctx->csa.prob.pu_mb_R)); }
[ 1, 0 ]
Linux Kernel
arch/powerpc/platforms/cell/spufs/file.c
static ssize_t spufs_ibox_info_dump(struct spu_context *ctx, struct coredump_params *cprm) { if (!(ctx->csa.prob.mb_stat_R & 0xff0000)) return 0; return spufs_dump_emit(cprm, &ctx->csa.priv2.puint_mb_R, sizeof(ctx->csa.priv2.puint_mb_R)); }
[ 1, 0 ]
Linux Kernel
arch/powerpc/platforms/cell/spufs/file.c
static ssize_t spufs_ibox_info_read(struct file *file, char __user *buf, size_t len, loff_t *pos) { struct spu_context *ctx = file->private_data; u32 stat, data; int ret; ret = spu_acquire_saved(ctx); if (ret) return ret; spin_lock(&ctx->csa.register_lock); stat = ...
[ 1, 0 ]
Linux Kernel
arch/powerpc/platforms/cell/spufs/file.c
static void spufs_get_proxydma_info(struct spu_context *ctx, struct spu_proxydma_info *info) { int i; info->proxydma_info_type = ctx->csa.prob.dma_querytype_RW; info->proxydma_info_mask = ctx->csa.prob.dma_querymask_RW; info->proxydma_info_status = ctx->csa.prob.dma_tagstat...
[ 0, 0 ]
Linux Kernel
arch/powerpc/platforms/cell/spufs/file.c
static int spufs_tid_open(struct inode *inode, struct file *file) { return single_open(file, spufs_show_tid, SPUFS_I(inode)->i_ctx); }
[ 0, 0 ]
Linux Kernel
arch/powerpc/platforms/cell/spufs/file.c
static unsigned long long spufs_class2_intrs(struct spu_context *ctx) { unsigned long long class2_intrs = ctx->stats.class2_intr; if (ctx->state == SPU_STATE_RUNNABLE) { class2_intrs += (ctx->spu->stats.class2_intr - ctx->stats.class2_intr_base); } return class2_intrs; }
[ 1, 0 ]
Linux Kernel
arch/powerpc/platforms/cell/spufs/file.c
static int spufs_stat_open(struct inode *inode, struct file *file) { return single_open(file, spufs_show_stat, SPUFS_I(inode)->i_ctx); }
[ 0, 0 ]
Linux Kernel
arch/powerpc/platforms/cell/spufs/file.c
static inline int spufs_switch_log_used(struct spu_context *ctx) { return (ctx->switch_log->head - ctx->switch_log->tail) % SWITCH_LOG_BUFSIZE; }
[ 1, 0 ]
Linux Kernel
arch/powerpc/platforms/cell/spufs/file.c
static int spufs_ctx_open(struct inode *inode, struct file *file) { return single_open(file, spufs_show_ctx, SPUFS_I(inode)->i_ctx); }
[ 0, 0 ]
Linux Kernel
arch/powerpc/platforms/cell/spufs/gang.c
void spu_gang_remove_ctx(struct spu_gang *gang, struct spu_context *ctx) { mutex_lock(&gang->mutex); WARN_ON(ctx->gang != gang); if (!list_empty(&ctx->aff_list)) { list_del_init(&ctx->aff_list); gang->aff_flags &= ~AFF_OFFSETS_SET; } list_del_init(&ctx->gang_list); gang->contexts--; mutex_unlock(...
[ 0, 0 ]
Linux Kernel
arch/powerpc/platforms/cell/spufs/hw_ops.c
static int spu_hw_mbox_read(struct spu_context *ctx, u32 *data) { struct spu *spu = ctx->spu; struct spu_problem __iomem *prob = spu->problem; u32 mbox_stat; int ret = 0; spin_lock_irq(&spu->register_lock); mbox_stat = in_be32(&prob->mb_stat_R); if (mbox_stat & 0x0000ff) { *data = in_be32(&prob->pu_...
[ 0, 0 ]
Linux Kernel
arch/powerpc/platforms/cell/spufs/hw_ops.c
static u64 spu_hw_signal1_type_get(struct spu_context *ctx) { return ((in_be64(&ctx->spu->priv2->spu_cfg_RW) & 1) != 0); }
[ 0, 0 ]
Linux Kernel
arch/powerpc/platforms/cell/spufs/hw_ops.c
static void spu_hw_signal2_type_set(struct spu_context *ctx, u64 val) { struct spu *spu = ctx->spu; struct spu_priv2 __iomem *priv2 = spu->priv2; u64 tmp; spin_lock_irq(&spu->register_lock); tmp = in_be64(&priv2->spu_cfg_RW); if (val) tmp |= 2; else tmp &= ~2; out_be64(&priv2->spu_cfg_RW, tmp)...
[ 0, 0 ]
Linux Kernel
arch/powerpc/platforms/cell/spufs/hw_ops.c
static u64 spu_hw_signal2_type_get(struct spu_context *ctx) { return ((in_be64(&ctx->spu->priv2->spu_cfg_RW) & 2) != 0); }
[ 0, 0 ]
Linux Kernel
arch/powerpc/platforms/cell/spufs/hw_ops.c
static char *spu_hw_get_ls(struct spu_context *ctx) { return ctx->spu->local_store; }
[ 0, 0 ]
Linux Kernel
arch/powerpc/platforms/cell/spufs/hw_ops.c
static void spu_hw_master_stop(struct spu_context *ctx) { struct spu *spu = ctx->spu; u64 sr1; spin_lock_irq(&spu->register_lock); sr1 = spu_mfc_sr1_get(spu) & ~MFC_STATE1_MASTER_RUN_CONTROL_MASK; spu_mfc_sr1_set(spu, sr1); spin_unlock_irq(&spu->register_lock); }
[ 0, 0 ]
Linux Kernel
arch/powerpc/platforms/cell/spufs/hw_ops.c
static void spu_hw_restart_dma(struct spu_context *ctx) { struct spu_priv2 __iomem *priv2 = ctx->spu->priv2; if (!test_bit(SPU_CONTEXT_SWITCH_PENDING, &ctx->spu->flags)) out_be64(&priv2->mfc_control_RW, MFC_CNTL_RESTART_DMA_COMMAND); }
[ 1, 0 ]
Linux Kernel
arch/powerpc/platforms/cell/spufs/inode.c
static void spufs_prune_dir(struct dentry *dir) { struct dentry *dentry, *tmp; inode_lock(d_inode(dir)); list_for_each_entry_safe(dentry, tmp, &dir->d_subdirs, d_child) { spin_lock(&dentry->d_lock); if (simple_positive(dentry)) { dget_dlock(dentry); __d_drop(dentry); spin_unlock(&dentry...
[ 0, 1 ]
Linux Kernel
arch/powerpc/platforms/cell/spufs/inode.c
static int spufs_mkdir(struct inode *dir, struct dentry *dentry, unsigned int flags, umode_t mode) { int ret; struct inode *inode; struct spu_context *ctx; inode = spufs_new_inode(dir->i_sb, mode | S_IFDIR); if (!inode) return -ENOSPC; inode_init_owner(&init_user_ns, inode, dir,...
[ 1, 1 ]
Linux Kernel
arch/powerpc/platforms/cell/spufs/inode.c
static int spufs_show_options(struct seq_file *m, struct dentry *root) { struct spufs_sb_info *sbi = spufs_get_sb_info(root->d_sb); struct inode *inode = root->d_inode; if (!uid_eq(inode->i_uid, GLOBAL_ROOT_UID)) seq_printf(m, ",uid=%u", from_kuid_munged(&init_user_ns, inode->i_uid)); if (!gid_eq(inode->i...
[ 1, 0 ]
Linux Kernel
arch/powerpc/platforms/cell/spufs/inode.c
static void spufs_exit_isolated_loader(void) { free_pages((unsigned long)isolated_loader, get_order(isolated_loader_size)); }
[ 0, 0 ]
Linux Kernel
arch/powerpc/platforms/cell/spufs/run.c
void spufs_stop_callback(struct spu *spu, int irq) { struct spu_context *ctx = spu->ctx; if (ctx) { /* Copy exception arguments into module specific structure */ switch (irq) { case 0: ctx->csa.class_0_pending = spu->class_0_pending; ctx->csa.class_0_dar = spu->class_0_dar; break; ...
[ 1, 0 ]
Linux Kernel
arch/powerpc/platforms/cell/spufs/run.c
static int spu_handle_restartsys(struct spu_context *ctx, long *spu_ret, unsigned int *npc) { int ret; switch (*spu_ret) { case -ERESTARTSYS: case -ERESTARTNOINTR: *npc -= 8; ret = -ERESTARTSYS; break; case -ERESTARTNOHAND: case -ERESTART_RESTARTBLOCK: /* ...
[ 0, 0 ]
Linux Kernel
arch/powerpc/platforms/cell/spufs/sched.c
void spu_update_sched_info(struct spu_context *ctx) { int node; if (ctx->state == SPU_STATE_RUNNABLE) { node = ctx->spu->node; mutex_lock(&cbe_spu_info[node].list_mutex); __spu_update_sched_info(ctx); mutex_unlock(&cbe_spu_info[node].list_mutex); } else { __spu_update_sched_info(ctx); } }
[ 0, 0 ]
Linux Kernel
arch/powerpc/platforms/cell/spufs/sched.c
static int __node_allowed(struct spu_context *ctx, int node) { if (nr_cpus_node(node)) { const struct cpumask *mask = cpumask_of_node(node); if (cpumask_intersects(mask, &ctx->cpus_allowed)) return 1; } return 0; }
[ 0, 0 ]
Linux Kernel
arch/powerpc/platforms/cell/spufs/sched.c
static struct spu *aff_ref_location(struct spu_context *ctx, int mem_aff, int group_size, int lowest_offset) { struct spu *spu; int node, n; /* * TODO: A better algorithm could be used to find a good spu to be * used as reference location for the ctxs chain. */ ...
[ 1, 1 ]
Linux Kernel
arch/powerpc/platforms/cell/spufs/sched.c
static void aff_set_ref_point_location(struct spu_gang *gang) { int mem_aff, gs, lowest_offset; struct spu_context *tmp, *ctx; mem_aff = gang->aff_ref_ctx->flags & SPU_CREATE_AFFINITY_MEM; lowest_offset = 0; gs = 0; list_for_each_entry(tmp, &gang->aff_list_head, aff_list) gs++; list_for_each_entry_rev...
[ 1, 0 ]
Linux Kernel
arch/powerpc/platforms/cell/spufs/sched.c
static void __spu_add_to_rq(struct spu_context *ctx) { /* * Unfortunately this code path can be called from multiple threads * on behalf of a single context due to the way the problem state * mmap support works. * * Fortunately we need to wake up all these threads at the same time * and can simply s...
[ 0, 1 ]
Linux Kernel
arch/powerpc/platforms/cell/spufs/sched.c
static void __spu_del_from_rq(struct spu_context *ctx) { int prio = ctx->prio; if (!list_empty(&ctx->rq)) { if (!--spu_prio->nr_waiting) del_timer(&spusched_timer); list_del_init(&ctx->rq); if (list_empty(&spu_prio->runq[prio])) clear_bit(prio, spu_prio->bitmap); } }
[ 1, 0 ]
Linux Kernel
arch/powerpc/platforms/cell/spufs/sched.c
void spu_del_from_rq(struct spu_context *ctx) { spin_lock(&spu_prio->runq_lock); __spu_del_from_rq(ctx); spin_unlock(&spu_prio->runq_lock); }
[ 0, 0 ]
Linux Kernel
arch/powerpc/platforms/cell/spufs/sched.c
static void __spu_schedule(struct spu *spu, struct spu_context *ctx) { int node = spu->node; int success = 0; spu_set_timeslice(ctx); mutex_lock(&cbe_spu_info[node].list_mutex); if (spu->ctx == NULL) { spu_bind_context(spu, ctx); cbe_spu_info[node].nr_active++; spu->alloc_state = SPU_USED; ...
[ 0, 0 ]
Linux Kernel
arch/powerpc/platforms/cell/spufs/sched.c
static void spu_schedule(struct spu *spu, struct spu_context *ctx) { mutex_lock(&ctx->state_mutex); if (ctx->state == SPU_STATE_SAVED) __spu_schedule(spu, ctx); spu_release(ctx); }
[ 0, 0 ]
Linux Kernel
arch/powerpc/platforms/cell/spufs/sched.c
int spu_activate(struct spu_context *ctx, unsigned long flags) { struct spu *spu; if (ctx->spu) return 0; spu_activate_top: if (signal_pending(current)) return -ERESTARTSYS; spu = spu_get_idle(ctx); /* * If this is a realtime thread we try to get it running by * preempting a lower priority th...
[ 1, 0 ]
Linux Kernel
arch/powerpc/platforms/cell/spufs/sched.c
static struct spu_context *grab_runnable_context(int prio, int node) { struct spu_context *ctx; int best; spin_lock(&spu_prio->runq_lock); best = find_first_bit(spu_prio->bitmap, prio); while (best < prio) { struct list_head *rq = &spu_prio->runq[best]; list_for_each_entry(ctx, rq, rq) { if (...
[ 0, 0 ]
Linux Kernel
arch/powerpc/platforms/cell/spufs/sched.c
static int spusched_thread(void *unused) { struct spu *spu; int node; while (!kthread_should_stop()) { set_current_state(TASK_INTERRUPTIBLE); schedule(); for (node = 0; node < MAX_NUMNODES; node++) { struct mutex *mtx = &cbe_spu_info[node].list_mutex; mutex_lock(mtx); list_for_eac...
[ 0, 0 ]
Linux Kernel
arch/powerpc/platforms/cell/spufs/sched.c
void spuctx_switch_state(struct spu_context *ctx, enum spu_utilization_state new_state) { unsigned long long curtime; signed long long delta; struct spu *spu; enum spu_utilization_state old_state; int node; curtime = ktime_get_ns(); delta = curtime - ctx->stats.tstamp; WARN_ON...
[ 0, 0 ]
Linux Kernel
arch/powerpc/platforms/cell/spufs/sched.c
static int show_spu_loadavg(struct seq_file *s, void *private) { int a, b, c; a = spu_avenrun[0] + (FIXED_1 / 200); b = spu_avenrun[1] + (FIXED_1 / 200); c = spu_avenrun[2] + (FIXED_1 / 200); seq_printf(s, "%d.%02d %d.%02d %d.%02d %ld/%d %d\n", LOAD_INT(a), LOAD_FRAC(a), LOAD_INT(b), LOAD_FRAC(...
[ 0, 0 ]
Linux Kernel
arch/powerpc/platforms/cell/spufs/spufs.h
static inline void spu_release(struct spu_context *ctx) { mutex_unlock(&ctx->state_mutex); }
[ 0, 0 ]
Linux Kernel
arch/powerpc/platforms/cell/spufs/spu_restore.c
static inline void fetch_regs_from_mem(addr64 lscsa_ea) { unsigned int ls = (unsigned int)&regs_spill[0]; unsigned int size = sizeof(regs_spill); unsigned int tag_id = 0; unsigned int cmd = 0x40; spu_writech(MFC_LSA, ls); spu_writech(MFC_EAH, lscsa_ea.ui[0]); spu_writech(MFC_EAL, lscsa_ea.ui[1]); spu_w...
[ 1, 0 ]
Linux Kernel
arch/powerpc/platforms/cell/spufs/spu_restore.c
static inline void write_ppu_mb(void) { unsigned int offset; unsigned int data; offset = LSCSA_QW_OFFSET(ppu_mb); data = regs_spill[offset].slot[0]; spu_writech(SPU_WrOutMbox, data); }
[ 0, 0 ]
Linux Kernel
arch/powerpc/platforms/cell/spufs/spu_restore.c
static inline void write_ppuint_mb(void) { unsigned int offset; unsigned int data; offset = LSCSA_QW_OFFSET(ppuint_mb); data = regs_spill[offset].slot[0]; spu_writech(SPU_WrOutIntrMbox, data); }
[ 0, 0 ]
Linux Kernel
arch/powerpc/platforms/cell/spufs/spu_restore.c
static inline void restore_fpcr(void) { unsigned int offset; vector unsigned int fpcr; offset = LSCSA_QW_OFFSET(fpcr); fpcr = regs_spill[offset].v; spu_mtfpscr(fpcr); }
[ 0, 0 ]
Linux Kernel
arch/powerpc/platforms/cell/spufs/spu_restore.c
static inline void restore_srr0(void) { unsigned int offset; unsigned int srr0; offset = LSCSA_QW_OFFSET(srr0); srr0 = regs_spill[offset].slot[0]; spu_writech(SPU_WrSRR0, srr0); }
[ 0, 0 ]
Linux Kernel
arch/powerpc/platforms/cell/spufs/spu_save.c
static inline void save_event_mask(void) { unsigned int offset; offset = LSCSA_QW_OFFSET(event_mask); regs_spill[offset].slot[0] = spu_readch(SPU_RdEventMask); }
[ 0, 0 ]
Linux Kernel
arch/powerpc/platforms/cell/spufs/spu_save.c
static inline void save_upper_240kb(addr64 lscsa_ea) { unsigned int ls = 16384; unsigned int list = (unsigned int)&dma_list[0]; unsigned int size = sizeof(dma_list); unsigned int tag_id = 0; unsigned int cmd = 0x24; /* Save, Step 7: * Enqueue the PUTL command (tag 0) to the MFC SPU command * qu...
[ 1, 0 ]
Linux Kernel
arch/powerpc/platforms/cell/spufs/spu_save.c
static inline void enqueue_sync(addr64 lscsa_ea) { unsigned int tag_id = 0; unsigned int cmd = 0xCC; spu_writech(MFC_TagID, tag_id); spu_writech(MFC_Cmd, cmd); }
[ 1, 0 ]
Linux Kernel
arch/powerpc/platforms/cell/spufs/spu_save.c
int main() { addr64 lscsa_ea; lscsa_ea.ui[0] = spu_readch(SPU_RdSigNotify1); lscsa_ea.ui[1] = spu_readch(SPU_RdSigNotify2); save_event_mask(); /* Step 2. */ save_tag_mask(); /* Step 3. */ set_event_mask(); /* Step 4. */ set_tag_mask(); /* Step 5. */ build_...
[ 0, 0 ]
Linux Kernel
arch/powerpc/platforms/cell/spufs/spu_utils.h
static inline void set_tag_update(void) { unsigned int update_any = 1; spu_writech(MFC_WrTagUpdate, update_any); }
[ 1, 0 ]
Linux Kernel
arch/powerpc/platforms/cell/spufs/switch.c
static inline void set_watchdog_timer(struct spu_state *csa, struct spu *spu) {}
[ 0, 0 ]
Linux Kernel
arch/powerpc/platforms/cell/spufs/switch.c
static inline void save_spu_runcntl(struct spu_state *csa, struct spu *spu) { struct spu_problem __iomem *prob = spu->problem; csa->prob.spu_runcntl_RW = in_be32(&prob->spu_runcntl_RW); }
[ 0, 0 ]
Linux Kernel
arch/powerpc/platforms/cell/spufs/switch.c
static inline void handle_pending_interrupts(struct spu_state *csa, struct spu *spu) {}
[ 0, 0 ]
Linux Kernel
arch/powerpc/platforms/cell/spufs/switch.c
static inline void save_ppu_tagstatus(struct spu_state *csa, struct spu *spu) { struct spu_problem __iomem *prob = spu->problem; csa->prob.dma_tagstatus_R = in_be32(&prob->dma_tagstatus_R); }
[ 0, 0 ]
Linux Kernel
arch/powerpc/platforms/cell/spufs/switch.c
static inline void save_mfc_csr_cmd(struct spu_state *csa, struct spu *spu) { struct spu_priv2 __iomem *priv2 = spu->priv2; csa->priv2.spu_cmd_buf1_RW = in_be64(&priv2->spu_cmd_buf1_RW); csa->priv2.spu_cmd_buf2_RW = in_be64(&priv2->spu_cmd_buf2_RW); }
[ 0, 0 ]
Linux Kernel
arch/powerpc/platforms/cell/spufs/switch.c
static inline void reset_spu_privcntl(struct spu_state *csa, struct spu *spu) { struct spu_priv2 __iomem *priv2 = spu->priv2; out_be64(&priv2->spu_privcntl_RW, 0UL); eieio(); }
[ 0, 0 ]
Linux Kernel
arch/powerpc/platforms/cell/spufs/switch.c
static inline void reset_spu_lslr(struct spu_state *csa, struct spu *spu) { struct spu_priv2 __iomem *priv2 = spu->priv2; out_be64(&priv2->spu_lslr_RW, LS_ADDR_MASK); eieio(); }
[ 0, 0 ]
Linux Kernel
arch/powerpc/platforms/cell/spufs/switch.c
static inline void resume_mfc_queue(struct spu_state *csa, struct spu *spu) { struct spu_priv2 __iomem *priv2 = spu->priv2; out_be64(&priv2->mfc_control_RW, MFC_CNTL_RESUME_DMA_QUEUE); }
[ 0, 0 ]
Linux Kernel
arch/powerpc/platforms/cell/spufs/switch.c
static inline void set_switch_active(struct spu_state *csa, struct spu *spu) { if (test_bit(SPU_CONTEXT_FAULT_PENDING, &spu->flags)) csa->priv2.mfc_control_RW |= MFC_CNTL_RESTART_DMA_COMMAND; clear_bit(SPU_CONTEXT_SWITCH_PENDING, &spu->flags); mb(); }
[ 0, 0 ]
Linux Kernel
arch/powerpc/platforms/cell/spufs/switch.c
static inline void enable_interrupts(struct spu_state *csa, struct spu *spu) { unsigned long class1_mask = CLASS1_ENABLE_SEGMENT_FAULT_INTR | CLASS1_ENABLE_STORAGE_FAULT_INTR; spin_lock_irq(&spu->register_lock); spu_int_stat_clear(spu, 0, CLASS0_INTR_MASK); spu_int_stat_clear(spu, 1, CLASS1_INTR_MASK); ...
[ 1, 0 ]
Linux Kernel
arch/powerpc/platforms/cell/spufs/switch.c
static inline void set_signot1(struct spu_state *csa, struct spu *spu) { struct spu_problem __iomem *prob = spu->problem; union { u64 ull; u32 ui[2]; } addr64; addr64.ull = (u64)csa->lscsa; out_be32(&prob->signal_notify1, addr64.ui[0]); eieio(); }
[ 0, 0 ]
Linux Kernel
arch/powerpc/platforms/cell/spufs/switch.c
static inline void set_signot2(struct spu_state *csa, struct spu *spu) { struct spu_problem __iomem *prob = spu->problem; union { u64 ull; u32 ui[2]; } addr64; addr64.ull = (u64)csa->lscsa; out_be32(&prob->signal_notify2, addr64.ui[1]); eieio(); }
[ 0, 0 ]
Linux Kernel
arch/powerpc/platforms/cell/spufs/switch.c
static inline void send_save_code(struct spu_state *csa, struct spu *spu) { unsigned long addr = (unsigned long)&spu_save_code[0]; unsigned int ls_offset = 0x0; unsigned int size = sizeof(spu_save_code); unsigned int tag = 0; unsigned int rclass = 0; unsigned int cmd = MFC_GETFS_CMD; send_mfc_dma(spu, ad...
[ 1, 0 ]
Linux Kernel
arch/powerpc/platforms/cell/spufs/switch.c
static inline void wait_tag_complete(struct spu_state *csa, struct spu *spu) { struct spu_problem __iomem *prob = spu->problem; u32 mask = MFC_TAGID_TO_TAGMASK(0); unsigned long flags; POLL_WHILE_FALSE(in_be32(&prob->dma_tagstatus_R) & mask); local_irq_save(flags); spu_int_stat_clear(spu, 0, CLASS0_INTR_M...
[ 0, 0 ]
Linux Kernel
arch/powerpc/platforms/cell/spufs/switch.c
static inline int check_save_status(struct spu_state *csa, struct spu *spu) { struct spu_problem __iomem *prob = spu->problem; u32 complete; complete = ((SPU_SAVE_COMPLETE << SPU_STOP_STATUS_SHIFT) | SPU_STATUS_STOPPED_BY_STOP); return (in_be32(&prob->spu_status_R) != complete) ? 1 : 0; }
[ 0, 0 ]
Linux Kernel
arch/powerpc/platforms/cell/spufs/switch.c
static inline void terminate_spu_app(struct spu_state *csa, struct spu *spu) {}
[ 0, 0 ]
Linux Kernel
arch/powerpc/platforms/cell/spufs/switch.c
static inline void suspend_mfc_and_halt_decr(struct spu_state *csa, struct spu *spu) { struct spu_priv2 __iomem *priv2 = spu->priv2; out_be64(&priv2->mfc_control_RW, MFC_CNTL_SUSPEND_DMA_QUEUE | MFC_CNTL_DECREMENTER_HALTED); eieio(); }
[ 0, 0 ]
Linux Kernel
arch/powerpc/platforms/cell/spufs/switch.c
static inline void wait_suspend_mfc_complete(struct spu_state *csa, struct spu *spu) { struct spu_priv2 __iomem *priv2 = spu->priv2; POLL_WHILE_FALSE( (in_be64(&priv2->mfc_control_RW) & MFC_CNTL_SUSPEND_DMA_STATUS_MASK) == MFC_CNTL_SUSPEND_COMPLETE); }
[ 0, 0 ]
Linux Kernel
arch/powerpc/platforms/cell/spufs/switch.c
static inline void setup_decr(struct spu_state *csa, struct spu *spu) { if (csa->priv2.mfc_control_RW & MFC_CNTL_DECREMENTER_RUNNING) { cycles_t resume_time = get_cycles(); cycles_t delta_time = resume_time - csa->suspend_time; csa->lscsa->decr_status.slot[0] = SPU_DECR_STATUS_RUNNING; if (csa->lscs...
[ 1, 0 ]
Linux Kernel
arch/powerpc/platforms/cell/spufs/switch.c
static inline void setup_ppu_mb(struct spu_state *csa, struct spu *spu) { csa->lscsa->ppu_mb.slot[0] = csa->prob.pu_mb_R; }
[ 0, 0 ]
Linux Kernel
arch/powerpc/platforms/cell/spufs/switch.c
static inline void setup_ppuint_mb(struct spu_state *csa, struct spu *spu) { csa->lscsa->ppuint_mb.slot[0] = csa->priv2.puint_mb_R; }
[ 0, 0 ]
Linux Kernel
arch/powerpc/platforms/cell/spufs/switch.c
static inline int check_restore_status(struct spu_state *csa, struct spu *spu) { struct spu_problem __iomem *prob = spu->problem; u32 complete; complete = ((SPU_RESTORE_COMPLETE << SPU_STOP_STATUS_SHIFT) | SPU_STATUS_STOPPED_BY_STOP); return (in_be32(&prob->spu_status_R) != complete) ? 1 : 0; }
[ 0, 0 ]
Linux Kernel
arch/powerpc/platforms/cell/spufs/switch.c
static inline void restore_ppu_querymask(struct spu_state *csa, struct spu *spu) { struct spu_problem __iomem *prob = spu->problem; out_be32(&prob->dma_querymask_RW, csa->prob.dma_querymask_RW); eieio(); }
[ 0, 0 ]
Linux Kernel
arch/powerpc/platforms/cell/spufs/switch.c
static inline void restore_decr_wrapped(struct spu_state *csa, struct spu *spu) { if (!(csa->lscsa->decr_status.slot[0] & SPU_DECR_STATUS_WRAPPED)) return; if ((csa->spu_chnlcnt_RW[0] == 0) && (csa->spu_chnldata_RW[1] & 0x20) && !(csa->spu_chnldata_RW[0] & 0x20)) ...
[ 1, 0 ]
Linux Kernel
arch/powerpc/platforms/cell/spufs/switch.c
static inline void restore_ch_part1(struct spu_state *csa, struct spu *spu) { struct spu_priv2 __iomem *priv2 = spu->priv2; u64 idx, ch_indices[] = {0UL, 3UL, 4UL, 24UL, 25UL, 27UL}; int i; for (i = 0; i < ARRAY_SIZE(ch_indices); i++) { idx = ch_indices[i]; out_be64(&priv2->spu_chnlcntptr_RW, idx); ...
[ 0, 0 ]
Linux Kernel
arch/powerpc/platforms/cell/spufs/switch.c
static inline void restore_spu_lslr(struct spu_state *csa, struct spu *spu) { struct spu_priv2 __iomem *priv2 = spu->priv2; out_be64(&priv2->spu_lslr_RW, csa->priv2.spu_lslr_RW); eieio(); }
[ 0, 0 ]
Linux Kernel
arch/powerpc/platforms/cell/spufs/switch.c
static inline void restore_spu_cfg(struct spu_state *csa, struct spu *spu) { struct spu_priv2 __iomem *priv2 = spu->priv2; out_be64(&priv2->spu_cfg_RW, csa->priv2.spu_cfg_RW); eieio(); }
[ 0, 0 ]
Linux Kernel
arch/powerpc/platforms/cell/spufs/switch.c
static inline void restore_spu_npc(struct spu_state *csa, struct spu *spu) { struct spu_problem __iomem *prob = spu->problem; out_be32(&prob->spu_npc_RW, csa->prob.spu_npc_RW); eieio(); }
[ 0, 0 ]
Linux Kernel
arch/powerpc/platforms/cell/spufs/switch.c
static inline void reset_switch_active(struct spu_state *csa, struct spu *spu) { }
[ 0, 0 ]
Linux Kernel
arch/powerpc/platforms/cell/spufs/switch.c
static int quiece_spu(struct spu_state *prev, struct spu *spu) { if (check_spu_isolate(prev, spu)) { /* Step 2. */ return 2; } disable_interrupts(prev, spu); /* Step 3. */ set_watchdog_timer(prev, spu); /* Step 4. */ inhibit_user_access(prev, spu); /* Step 5. */ if (check_spu_isolate(prev...
[ 0, 0 ]
Linux Kernel
arch/powerpc/platforms/cell/spufs/switch.c
static void stop_spu_isolate(struct spu *spu) { struct spu_problem __iomem *prob = spu->problem; if (in_be32(&prob->spu_status_R) & SPU_STATUS_ISOLATED_STATE) { force_spu_isolate_exit(spu); } }
[ 0, 0 ]
Linux Kernel
arch/powerpc/platforms/cell/spufs/switch.c
static void harvest(struct spu_state *prev, struct spu *spu) { disable_interrupts(prev, spu); /* Step 2. */ inhibit_user_access(prev, spu); /* Step 3. */ terminate_spu_app(prev, spu); /* Step 4. */ set_switch_pending(prev, spu); /* Step 5. */ stop_spu_isolate(spu); ...
[ 1, 0 ]
Linux Kernel
arch/powerpc/platforms/cell/spufs/switch.c
static void restore_lscsa(struct spu_state *next, struct spu *spu) { set_watchdog_timer(next, spu); /* Step 26. */ setup_spu_status_part1(next, spu); /* Step 27. */ setup_spu_status_part2(next, spu); /* Step 28. */ restore_mfc_rag(next, spu); /* Step 29. */ /* Step 30. */ setup_mfc_slbs(next, sp...
[ 1, 0 ]
Linux Kernel
arch/powerpc/platforms/cell/spufs/switch.c
static void init_prob(struct spu_state *csa) { csa->spu_chnlcnt_RW[9] = 1; csa->spu_chnlcnt_RW[21] = 16; csa->spu_chnlcnt_RW[23] = 1; csa->spu_chnlcnt_RW[28] = 1; csa->spu_chnlcnt_RW[30] = 1; csa->prob.spu_runcntl_RW = SPU_RUNCNTL_STOP; csa->prob.mb_stat_R = 0x000400; }
[ 1, 0 ]
Linux Kernel
arch/powerpc/platforms/cell/spufs/switch.c
void spu_fini_csa(struct spu_state *csa) { spu_free_lscsa(csa); }
[ 0, 0 ]
Linux Kernel
arch/powerpc/platforms/cell/spufs/syscalls.c
static long do_spu_create(const char __user *pathname, unsigned int flags, umode_t mode, struct file *neighbor) { struct path path; struct dentry *dentry; int ret; dentry = user_path_create(AT_FDCWD, pathname, &path, LOOKUP_DIRECTORY); ret = PTR_ERR(dentry); if (!IS_ERR(dentry)) ...
[ 0, 0 ]
Linux Kernel
arch/powerpc/platforms/cell/spu_base.c
void spu_invalidate_slbs(struct spu *spu) { struct spu_priv2 __iomem *priv2 = spu->priv2; unsigned long flags; spin_lock_irqsave(&spu->register_lock, flags); if (spu_mfc_sr1_get(spu) & MFC_STATE1_RELOCATE_MASK) out_be64(&priv2->slb_invalidate_all_W, 0UL); spin_unlock_irqrestore(&spu->register_lock, flag...
[ 0, 0 ]
Linux Kernel
arch/powerpc/platforms/cell/spu_base.c
void spu_flush_all_slbs(struct mm_struct *mm) { struct spu *spu; unsigned long flags; spin_lock_irqsave(&spu_full_list_lock, flags); list_for_each_entry(spu, &spu_full_list, full_list) { if (spu->mm == mm) spu_invalidate_slbs(spu); } spin_unlock_irqrestore(&spu_full_list_lock, flags); }
[ 0, 0 ]
Linux Kernel
arch/powerpc/platforms/cell/spu_base.c
void spu_setup_kernel_slbs(struct spu *spu, struct spu_lscsa *lscsa, void *code, int code_size) { struct copro_slb slbs[4]; int i, nr_slbs = 0; void *addrs[] = {lscsa, (void *)lscsa + sizeof(*lscsa) - 1, code, code + code_size - 1}; /* check the set of addresses, ...
[ 1, 0 ]
Linux Kernel
arch/powerpc/platforms/cell/spu_base.c
static int __init spu_request_irqs(struct spu *spu) { int ret = 0; if (spu->irqs[0]) { snprintf(spu->irq_c0, sizeof(spu->irq_c0), "spe%02d.0", spu->number); ret = request_irq(spu->irqs[0], spu_irq_class_0, 0, spu->irq_c0, spu); if (ret) goto bail0; } if (spu->irqs[1]) { snprintf(spu->irq...
[ 1, 0 ]
Linux Kernel
arch/powerpc/platforms/cell/spu_base.c
static void spu_free_irqs(struct spu *spu) { if (spu->irqs[0]) free_irq(spu->irqs[0], spu); if (spu->irqs[1]) free_irq(spu->irqs[1], spu); if (spu->irqs[2]) free_irq(spu->irqs[2], spu); }
[ 0, 0 ]
Linux Kernel
arch/powerpc/platforms/cell/spu_base.c
int spu_add_dev_attr_group(const struct attribute_group *attrs) { struct spu *spu; int rc = 0; mutex_lock(&spu_full_list_mutex); list_for_each_entry(spu, &spu_full_list, full_list) { rc = sysfs_create_group(&spu->dev.kobj, attrs); if (rc) { printk(KERN_ERR "%s: can't create sysfs group '%s'\n", ...
[ 0, 0 ]
Linux Kernel
arch/powerpc/platforms/cell/spu_base.c
static int __init spu_create_dev(struct spu *spu) { int ret; spu->dev.id = spu->number; spu->dev.bus = &spu_subsys; ret = device_register(&spu->dev); if (ret) { printk(KERN_ERR "Can't register SPU %d with sysfs\n", spu->number); return ret; } sysfs_add_device_to_node(&spu->dev, spu->node); r...
[ 0, 0 ]
Linux Kernel
arch/powerpc/platforms/cell/spu_base.c
static ssize_t spu_stat_show(struct device *dev, struct device_attribute *attr, char *buf) { struct spu *spu = container_of(dev, struct spu, dev); return sprintf( buf, "%s %llu %llu %llu %llu " "%llu %llu %llu %llu %llu %llu %llu %llu\n", spu_state_names[spu->...
[ 1, 0 ]
Linux Kernel
arch/powerpc/platforms/cell/spu_base.c
static void crash_kexec_stop_spus(void) { struct spu *spu; int i; u64 tmp; for (i = 0; i < CRASH_NUM_SPUS; i++) { if (!crash_spu_info[i].spu) continue; spu = crash_spu_info[i].spu; crash_spu_info[i].saved_spu_runcntl_RW = in_be32(&spu->problem->spu_runcntl_RW); crash_spu_info[i...
[ 0, 0 ]
Linux Kernel
arch/powerpc/platforms/cell/spu_base.c
static void __init crash_register_spus(struct list_head *list) { struct spu *spu; int ret; list_for_each_entry(spu, list, full_list) { if (WARN_ON(spu->number >= CRASH_NUM_SPUS)) continue; crash_spu_info[spu->number].spu = spu; } ret = crash_shutdown_register(&crash_kexec_stop_spus); if (r...
[ 0, 0 ]
Linux Kernel
arch/powerpc/platforms/cell/spu_base.c
static void spu_shutdown(void) { struct spu *spu; mutex_lock(&spu_full_list_mutex); list_for_each_entry(spu, &spu_full_list, full_list) { spu_free_irqs(spu); spu_destroy_spu(spu); } mutex_unlock(&spu_full_list_mutex); }
[ 0, 0 ]
Linux Kernel
arch/powerpc/platforms/cell/spu_manage.c
struct device_node *spu_devnode(struct spu *spu) { return spu->devnode; }
[ 0, 0 ]
Linux Kernel
arch/powerpc/platforms/cell/spu_manage.c
static void spu_unmap(struct spu *spu) { if (!firmware_has_feature(FW_FEATURE_LPAR)) iounmap(spu->priv1); iounmap(spu->priv2); iounmap(spu->problem); iounmap((__force u8 __iomem *)spu->local_store); }
[ 0, 0 ]
Linux Kernel
arch/powerpc/platforms/cell/spu_manage.c
static int __init spu_map_resource(struct spu *spu, int nr, void __iomem **virt, unsigned long *phys) { struct device_node *np = spu->devnode; struct resource resource = {}; unsigned long len; int ret; ret = of_address_to_resource(np, nr, &resource); if (ret) return ...
[ 0, 0 ]
Linux Kernel
arch/powerpc/platforms/cell/spu_manage.c
static void enable_spu_by_master_run(struct spu_context *ctx) { ctx->ops->master_start(ctx); }
[ 0, 0 ]
Linux Kernel
arch/powerpc/platforms/cell/spu_manage.c
static void disable_spu_by_master_run(struct spu_context *ctx) { ctx->ops->master_stop(ctx); } #define QS20_SPES_PER_BE 8
[ 0, 0 ]