Projectname
large_stringclasses
15 values
Filepath
large_stringlengths
4
106
Function
large_stringlengths
11
3.45k
Label
list
Linux Kernel
arch/powerpc/platforms/8xx/m8xx_setup.c
void mpc8xx_get_rtc_time(struct rtc_time *tm) { unsigned long data; sit8xx_t __iomem *sys_tmr = immr_map(im_sit); data = in_be32(&sys_tmr->sit_rtc); rtc_time64_to_tm(data, tm); immr_unmap(sys_tmr); return; }
[ 0, 0 ]
Linux Kernel
arch/powerpc/platforms/8xx/mpc86xads_setup.c
static int __init declare_of_platform_devices(void) { of_platform_bus_probe(NULL, of_bus_ids, NULL); return 0; }
[ 0, 0 ]
Linux Kernel
arch/powerpc/platforms/8xx/pic.c
static void mpc8xx_end_irq(struct irq_data *d) { mpc8xx_cached_irq_mask |= mpc8xx_irqd_to_bit(d); out_be32(&siu_reg->sc_simask, mpc8xx_cached_irq_mask); }
[ 0, 0 ]
Linux Kernel
arch/powerpc/platforms/8xx/pic.c
static int mpc8xx_pic_host_map(struct irq_domain *h, unsigned int virq, irq_hw_number_t hw) { pr_debug("mpc8xx_pic_host_map(%d, 0x%lx)\n", virq, hw); irq_set_chip_and_handler(virq, &mpc8xx_pic, handle_level_irq); return 0; }
[ 0, 0 ]
Linux Kernel
arch/powerpc/platforms/8xx/pic.c
void __init mpc8xx_pic_init(void) { struct resource res; struct device_node *np; int ret; np = of_find_compatible_node(NULL, NULL, "fsl,pq1-pic"); if (np == NULL) np = of_find_node_by_type(NULL, "mpc8xx-pic"); if (np == NULL) { printk(KERN_ERR "Could not find fsl,pq1-pic node\n"); return; } ...
[ 0, 0 ]
Linux Kernel
arch/powerpc/platforms/8xx/pic.h
static inline uint mk_int_int_mask(uint mask) { return (1 << (7 - (mask / 2))); } #endif
[ 0, 0 ]
Linux Kernel
arch/powerpc/platforms/8xx/tqm8xx_setup.c
static void __init tqm8xx_setup_arch(void) { cpm_reset(); init_ioports(); }
[ 0, 0 ]
Linux Kernel
arch/powerpc/platforms/amigaone/setup.c
static void __init amigaone_discover_phbs(void) { struct device_node *np; int phb = -ENODEV; for_each_compatible_node(np, "pci", "mai-logic,articia-s") phb = amigaone_add_bridge(np); BUG_ON(phb != 0); }
[ 0, 0 ]
Linux Kernel
arch/powerpc/platforms/amigaone/setup.c
static int __init amigaone_probe(void) { if (of_machine_is_compatible("eyetech,amigaone")) { cur_cpu_spec->cpu_features &= ~CPU_FTR_NEED_COHERENT; DMA_MODE_READ = 0x44; DMA_MODE_WRITE = 0x48; return 1; } return 0; }
[ 1, 0 ]
Linux Kernel
arch/powerpc/platforms/book3s/vas-api.c
static int do_fail_paste(void) { struct pt_regs *regs = current->thread.regs; u32 instword; if (WARN_ON_ONCE(!regs)) return -EINVAL; if (WARN_ON_ONCE(!user_mode(regs))) return -EINVAL; if (get_user(instword, (u32 __user *)(regs->nip))) return -EAGAIN; /* * Not a paste instruction, driver ...
[ 1, 0 ]
Linux Kernel
arch/powerpc/platforms/book3s/vas-api.c
static long coproc_ioctl(struct file *fp, unsigned int cmd, unsigned long arg) { switch (cmd) { case VAS_TX_WIN_OPEN: return coproc_ioc_tx_win_open(fp, arg); default: return -EINVAL; } }
[ 0, 0 ]
Linux Kernel
arch/powerpc/platforms/book3s/vas-api.c
int vas_register_coproc_api(struct module *mod, enum vas_cop_type cop_type, const char *name, const struct vas_user_win_ops *vops) { int rc = -EINVAL; dev_t devno; rc = alloc_chrdev_region(&coproc_device.devt, 1, 1, name); if (rc) { pr_err("Unable to ...
[ 1, 0 ]
Linux Kernel
arch/powerpc/platforms/book3s/vas-api.c
void vas_unregister_coproc_api(void) { dev_t devno; cdev_del(&coproc_device.cdev); devno = MKDEV(MAJOR(coproc_device.devt), 0); device_destroy(coproc_device.class, devno); class_destroy(coproc_device.class); unregister_chrdev_region(coproc_device.devt, 1); }
[ 0, 0 ]
Linux Kernel
arch/powerpc/platforms/cell/axon_msi.c
static inline void axon_msi_debug_setup(struct device_node *dn, struct axon_msic *msic) {} #endif
[ 0, 0 ]
Linux Kernel
arch/powerpc/platforms/cell/axon_msi.c
static void axon_msi_cascade(struct irq_desc *desc) { struct irq_chip *chip = irq_desc_get_chip(desc); struct axon_msic *msic = irq_desc_get_handler_data(desc); u32 write_offset, msi; int idx; int retry = 0; write_offset = dcr_read(msic->dcr_host, MSIC_WRITE_OFFSET_REG); pr_devel("axon_msi: original writ...
[ 1, 0 ]
Linux Kernel
arch/powerpc/platforms/cell/axon_msi.c
static void axon_msi_shutdown(struct platform_device *device) { struct axon_msic *msic = dev_get_drvdata(&device->dev); u32 tmp; pr_devel("axon_msi: disabling %pOF\n", irq_domain_get_of_node(msic->irq_domain)); tmp = dcr_read(msic->dcr_host, MSIC_CTRL_REG); tmp &= ~MSIC_CTRL_ENABLE & ~MSIC_CTRL_I...
[ 0, 0 ]
Linux Kernel
arch/powerpc/platforms/cell/axon_msi.c
static int __init axon_msi_init(void) { return platform_driver_register(&axon_msi_driver); }
[ 0, 0 ]
Linux Kernel
arch/powerpc/platforms/cell/axon_msi.c
static int msic_set(void *data, u64 val) { struct axon_msic *msic = data; out_le32(msic->trigger, val); return 0; }
[ 0, 0 ]
Linux Kernel
arch/powerpc/platforms/cell/axon_msi.c
static int msic_get(void *data, u64 *val) { *val = 0; return 0; }
[ 0, 0 ]
Linux Kernel
arch/powerpc/platforms/cell/axon_msi.c
void axon_msi_debug_setup(struct device_node *dn, struct axon_msic *msic) { char name[8]; u64 addr; addr = of_translate_address(dn, of_get_property(dn, "reg", NULL)); if (addr == OF_BAD_ADDR) { pr_devel("axon_msi: couldn't translate reg property\n"); return; } msic->trigger = ioremap(addr, 0x4); ...
[ 1, 0 ]
Linux Kernel
arch/powerpc/platforms/cell/cbe_powerbutton.c
static void cbe_powerbutton_handle_pmi(pmi_message_t pmi_msg) { BUG_ON(pmi_msg.type != PMI_TYPE_POWER_BUTTON); input_report_key(button_dev, KEY_POWER, 1); input_sync(button_dev); input_report_key(button_dev, KEY_POWER, 0); input_sync(button_dev); }
[ 0, 0 ]
Linux Kernel
arch/powerpc/platforms/cell/cbe_regs.c
static struct cbe_regs_map *cbe_find_map(struct device_node *np) { int i; struct device_node *tmp_np; if (!of_node_is_type(np, "spe")) { for (i = 0; i < cbe_regs_map_count; i++) if (cbe_regs_maps[i].cpu_node == np || cbe_regs_maps[i].be_node == np) return &cbe_regs_maps[i]; return NULL; }...
[ 0, 0 ]
Linux Kernel
arch/powerpc/platforms/cell/cbe_regs.c
u32 cbe_get_hw_thread_id(int cpu) { return cbe_thread_map[cpu].thread_id; }
[ 0, 0 ]
Linux Kernel
arch/powerpc/platforms/cell/cbe_regs.c
u32 cbe_cpu_to_node(int cpu) { return cbe_thread_map[cpu].cbe_id; }
[ 0, 0 ]
Linux Kernel
arch/powerpc/platforms/cell/cbe_regs.c
u32 cbe_node_to_cpu(int node) { return cpumask_first(&cbe_local_mask[node]); }
[ 0, 0 ]
Linux Kernel
arch/powerpc/platforms/cell/cbe_regs.c
void __init cbe_regs_init(void) { int i; unsigned int thread_id; struct device_node *cpu; for_each_possible_cpu(i) { cbe_thread_map[i].cpu_node = of_get_cpu_node(i, &thread_id); cbe_thread_map[i].be_node = cbe_get_be_node(i); cbe_thread_map[i].thread_id = thread_id; } /* Find maps for each dev...
[ 0, 0 ]
Linux Kernel
arch/powerpc/platforms/cell/cbe_thermal.c
static struct cbe_pmd_regs __iomem *get_pmd_regs(struct device *dev) { struct spu *spu; spu = container_of(dev, struct spu, dev); return cbe_get_pmd_regs(spu_devnode(spu)); }
[ 0, 0 ]
Linux Kernel
arch/powerpc/platforms/cell/cbe_thermal.c
static ssize_t store_throttle(struct cbe_pmd_regs __iomem *pmd_regs, const char *buf, size_t size, int pos) { u64 reg_value; unsigned int temp; u64 new_value; int ret; ret = sscanf(buf, "%u", &temp); if (ret != 1 || temp < TEMP_MIN || temp > TEMP_MAX) return -EINVAL; n...
[ 1, 0 ]
Linux Kernel
arch/powerpc/platforms/cell/cbe_thermal.c
static ssize_t spu_show_throttle_end(struct device *dev, struct device_attribute *attr, char *buf) { return show_throttle(get_pmd_regs(dev), buf, 0); }
[ 0, 0 ]
Linux Kernel
arch/powerpc/platforms/cell/cbe_thermal.c
static ssize_t spu_store_throttle_begin(struct device *dev, struct device_attribute *attr, const char *buf, size_t size) { return store_throttle(get_pmd_regs(dev), buf, size, 8); }
[ 0, 0 ]
Linux Kernel
arch/powerpc/platforms/cell/cbe_thermal.c
static ssize_t ppe_show_temp(struct device *dev, char *buf, int pos) { struct cbe_pmd_regs __iomem *pmd_regs; u64 value; pmd_regs = cbe_get_cpu_pmd_regs(dev->id); value = in_be64(&pmd_regs->ts_ctsr2); value = (value >> pos) & 0x3f; return sprintf(buf, "%d\n", reg_to_temp(value)); }
[ 1, 0 ]
Linux Kernel
arch/powerpc/platforms/cell/cbe_thermal.c
static ssize_t ppe_show_throttle_full_stop(struct device *dev, struct device_attribute *attr, char *buf) { return show_throttle(cbe_get_cpu_pmd_regs(dev->id), buf, 48); }
[ 0, 0 ]
Linux Kernel
arch/powerpc/platforms/cell/cbe_thermal.c
static ssize_t ppe_store_throttle_end(struct device *dev, struct device_attribute *attr, const char *buf, size_t size) { return store_throttle(cbe_get_cpu_pmd_regs(dev->id), buf, size, 32); }
[ 0, 0 ]
Linux Kernel
arch/powerpc/platforms/cell/cpufreq_spudemand.c
static void spu_gov_init_work(struct spu_gov_info_struct *info) { int delay = usecs_to_jiffies(info->poll_int); INIT_DEFERRABLE_WORK(&info->work, spu_gov_work); schedule_delayed_work_on(info->policy->cpu, &info->work, delay); }
[ 0, 0 ]
Linux Kernel
arch/powerpc/platforms/cell/cpufreq_spudemand.c
static void spu_gov_cancel_work(struct spu_gov_info_struct *info) { cancel_delayed_work_sync(&info->work); }
[ 0, 0 ]
Linux Kernel
arch/powerpc/platforms/cell/interrupt.c
void iic_setup_cpu(void) { out_be64(&this_cpu_ptr(&cpu_iic)->regs->prio, 0xff); }
[ 0, 0 ]
Linux Kernel
arch/powerpc/platforms/cell/interrupt.c
void __init iic_init_IRQ(void) { iic_host = irq_domain_add_linear(NULL, IIC_SOURCE_COUNT, &iic_host_ops, NULL); BUG_ON(iic_host == NULL); irq_set_default_host(iic_host); /* Discover and initialize iics */ if (setup_iic() < 0) panic("IIC: Failed to initialize !\n"); /* Set master interrupt handling fu...
[ 0, 0 ]
Linux Kernel
arch/powerpc/platforms/cell/iommu.c
static int tce_build_cell(struct iommu_table *tbl, long index, long npages, unsigned long uaddr, enum dma_data_direction direction, unsigned long attrs) { int i; unsigned long *io_pte, base_pte; struct iommu_window *window = container_o...
[ 1, 0 ]
Linux Kernel
arch/powerpc/platforms/cell/iommu.c
static void tce_free_cell(struct iommu_table *tbl, long index, long npages) { int i; unsigned long *io_pte, pte; struct iommu_window *window = container_of(tbl, struct iommu_window, table); pr_debug("tce_free_cell(index=%lx,n=%lx)\n", index, npages); #ifdef CELL_IOMMU_REAL_UNMAP pte = 0; #else pte = CBE...
[ 1, 0 ]
Linux Kernel
arch/powerpc/platforms/cell/iommu.c
static irqreturn_t ioc_interrupt(int irq, void *data) { unsigned long stat, spf; struct cbe_iommu *iommu = data; stat = in_be64(iommu->xlate_regs + IOC_IO_ExcpStat); spf = stat & IOC_IO_ExcpStat_SPF_Mask; printk(KERN_ERR "iommu: DMA exception 0x%016lx\n", stat); printk(KERN_ERR " V=%d, SPF=[%c%c], RW=%s,...
[ 0, 0 ]
Linux Kernel
arch/powerpc/platforms/cell/iommu.c
static int __init cell_iommu_find_ioc(int nid, unsigned long *base) { struct device_node *np; struct resource r; *base = 0; for_each_node_by_name(np, "ioc") { if (of_node_to_nid(np) != nid) continue; if (of_address_to_resource(np, 0, &r)) { printk(KERN_ERR "iommu: can't get address for %pO...
[ 1, 0 ]
Linux Kernel
arch/powerpc/platforms/cell/iommu.c
static void __init cell_iommu_setup_stab(struct cbe_iommu *iommu, unsigned long dbase, unsigned long dsize, unsigned long fbase, unsigned long fsize) { st...
[ 1, 0 ]
Linux Kernel
arch/powerpc/platforms/cell/iommu.c
static void __init cell_iommu_setup_hardware(struct cbe_iommu *iommu, unsigned long base, unsigned long size) { cell_iommu_setup_stab(iommu, base, size, 0, 0); iommu->ptab = cell_iommu_alloc_ptab(iommu, base, size, 0, 0,...
[ 1, 1 ]
Linux Kernel
arch/powerpc/platforms/cell/iommu.c
static void cell_dma_dev_setup(struct device *dev) { if (cell_iommu_enabled) { u64 addr = cell_iommu_get_fixed_address(dev); if (addr != OF_BAD_ADDR) dev->archdata.dma_offset = addr + dma_iommu_fixed_base; set_iommu_table_base(dev, cell_get_iommu_table(dev)); } else { dev->archdata.dma_offse...
[ 0, 0 ]
Linux Kernel
arch/powerpc/platforms/cell/iommu.c
static struct cbe_iommu *__init cell_iommu_alloc(struct device_node *np) { struct cbe_iommu *iommu; int nid, i; nid = of_node_to_nid(np); if (nid < 0) { printk(KERN_ERR "iommu: failed to get node for %pOF\n", np); return NULL; } pr_debug("iommu: setting up iommu for node %d (%pOF)\n", nid, np); ...
[ 1, 1 ]
Linux Kernel
arch/powerpc/platforms/cell/iommu.c
static int __init setup_iommu_fixed(char *str) { struct device_node *pciep; if (strcmp(str, "off") == 0) iommu_fixed_disabled = 1; pciep = of_find_node_by_type(NULL, "pcie-endpoint"); if (strcmp(str, "weak") == 0 || (pciep && strcmp(str, "strong") != 0)) iommu_fixed_is_weak = true; of_node_put(pci...
[ 0, 0 ]
Linux Kernel
arch/powerpc/platforms/cell/pervasive.c
static int cbe_system_reset_exception(struct pt_regs *regs) { switch (regs->msr & SRR1_WAKEMASK) { case SRR1_WAKEDEC: set_dec(1); break; case SRR1_WAKEEE: break; case SRR1_WAKEMT: return cbe_sysreset_hack(); #ifdef CONFIG_CBE_RAS case SRR1_WAKESYSERR: cbe_system_error_exception(regs); ...
[ 0, 0 ]
Linux Kernel
arch/powerpc/platforms/cell/pmu.c
void cbe_write_ctr(u32 cpu, u32 ctr, u32 val) { u32 phys_ctr; u32 phys_val; phys_ctr = ctr & (NR_PHYS_CTRS - 1); if (cbe_get_ctr_size(cpu, phys_ctr) == 16) { phys_val = cbe_read_phys_ctr(cpu, phys_ctr); if (ctr < NR_PHYS_CTRS) val = (val << 16) | (phys_val & 0xffff); else val = (val ...
[ 0, 0 ]
Linux Kernel
arch/powerpc/platforms/cell/pmu.c
void cbe_enable_pm(u32 cpu) { struct cbe_pmd_shadow_regs *shadow_regs; u32 pm_ctrl; shadow_regs = cbe_get_cpu_pmd_shadow_regs(cpu); shadow_regs->counter_value_in_latch = 0; pm_ctrl = cbe_read_pm(cpu, pm_control) | CBE_PM_ENABLE_PERF_MON; cbe_write_pm(cpu, pm_control, pm_ctrl); }
[ 0, 0 ]
Linux Kernel
arch/powerpc/platforms/cell/pmu.c
void cbe_sync_irq(int node) { unsigned int irq; irq = irq_find_mapping(NULL, IIC_IRQ_IOEX_PMI | (node << IIC_IRQ_NODE_SHIFT)); if (!irq) { printk(KERN_WARNING "ERROR, unable to get existing irq %d " "for node %d\n", irq, node); return; } synchronize_irq(irq); }
[ 0, 0 ]
Linux Kernel
arch/powerpc/platforms/cell/setup.c
static void cell_fixup_pcie_rootcomplex(struct pci_dev *dev) { struct pci_controller *hose; const char *s; int i; if (!machine_is(cell)) return; if (dev->bus->self != NULL || dev->devfn != 0) return; hose = pci_bus_to_host(dev->bus); if (hose == NULL) return; /* Only on PCIE */ if (!of...
[ 1, 0 ]
Linux Kernel
arch/powerpc/platforms/cell/setup.c
static int cell_setup_phb(struct pci_controller *phb) { const char *model; struct device_node *np; int rc = rtas_setup_phb(phb); if (rc) return rc; phb->controller_ops = cell_pci_controller_ops; np = phb->dn; model = of_get_property(np, "model", NULL); if (model == NULL || !of_node_name_eq(np, "p...
[ 0, 0 ]
Linux Kernel
arch/powerpc/platforms/cell/setup.c
static void __init mpic_init_IRQ(void) { struct device_node *dn; struct mpic *mpic; for_each_node_by_name(dn, "interrupt-controller") { if (!of_device_is_compatible(dn, "CBEA,platform-open-pic")) continue; mpic = mpic_alloc(dn, 0, MPIC_SECONDARY | MPIC_NO_RESET, 0, 0, " MPIC "); if...
[ 0, 0 ]
Linux Kernel
arch/powerpc/platforms/cell/setup.c
static void __init cell_init_irq(void) { iic_init_IRQ(); spider_init_IRQ(); mpic_init_IRQ(); }
[ 0, 0 ]
Linux Kernel
arch/powerpc/platforms/cell/smp.c
static int smp_cell_kick_cpu(int nr) { if (nr < 0 || nr >= nr_cpu_ids) return -EINVAL; if (!smp_startup_cpu(nr)) return -ENOENT; paca_ptrs[nr]->cpu_start = 1; return 0; }
[ 1, 0 ]
Linux Kernel
arch/powerpc/platforms/cell/spider-pci.c
static void spiderpci_memcpy_fromio(void *dest, const PCI_IO_ADDR src, unsigned long n) { __do_memcpy_fromio(dest, src, n); spiderpci_io_flush(iowa_mem_find_bus(src)); }
[ 0, 0 ]
Linux Kernel
arch/powerpc/platforms/cell/spider-pic.c
static void spider_ack_irq(struct irq_data *d) { struct spider_pic *pic = spider_irq_data_to_pic(d); unsigned int src = irqd_to_hwirq(d); if (irqd_is_level_type(d)) return; /* Only interrupts 47 to 50 can be set to edge */ if (src < 47 || src > 50) return; /* Perform the clear of the edge logic *...
[ 1, 0 ]
Linux Kernel
arch/powerpc/platforms/cell/spider-pic.c
static int spider_set_irq_type(struct irq_data *d, unsigned int type) { unsigned int sense = type & IRQ_TYPE_SENSE_MASK; struct spider_pic *pic = spider_irq_data_to_pic(d); unsigned int hw = irqd_to_hwirq(d); void __iomem *cfg = spider_get_irq_config(pic, hw); u32 old_mask; u32 ic; if (sense != IRQ_TYPE_...
[ 1, 1 ]
Linux Kernel
arch/powerpc/platforms/cell/spufs/backing_ops.c
static __poll_t spu_backing_mbox_stat_poll(struct spu_context *ctx, __poll_t events) { __poll_t ret; u32 stat; ret = 0; spin_lock_irq(&ctx->csa.register_lock); stat = ctx->csa.prob.mb_stat_R; if (events & (EPOLLIN | EPOLLRDNORM)) { if (stat & 0xff0000) ...
[ 0, 0 ]
Linux Kernel
arch/powerpc/platforms/cell/spufs/backing_ops.c
static u32 spu_backing_signal2_read(struct spu_context *ctx) { return ctx->csa.spu_chnldata_RW[4]; }
[ 0, 0 ]
Linux Kernel
arch/powerpc/platforms/cell/spufs/backing_ops.c
static u32 spu_backing_status_read(struct spu_context *ctx) { return ctx->csa.prob.spu_status_R; }
[ 0, 0 ]
Linux Kernel
arch/powerpc/platforms/cell/spufs/backing_ops.c
static u32 spu_backing_runcntl_read(struct spu_context *ctx) { return ctx->csa.prob.spu_runcntl_RW; }
[ 0, 0 ]
Linux Kernel
arch/powerpc/platforms/cell/spufs/context.c
struct spu_context *alloc_spu_context(struct spu_gang *gang) { struct spu_context *ctx; ctx = kzalloc(sizeof *ctx, GFP_KERNEL); if (!ctx) goto out; if (spu_init_csa(&ctx->csa)) goto out_free; spin_lock_init(&ctx->mmio_lock); mutex_init(&ctx->mapping_lock); kref_init(&ctx->kref); mutex_init(&ct...
[ 0, 0 ]
Linux Kernel
arch/powerpc/platforms/cell/spufs/context.c
void destroy_spu_context(struct kref *kref) { struct spu_context *ctx; ctx = container_of(kref, struct spu_context, kref); spu_context_nospu_trace(destroy_spu_context__enter, ctx); mutex_lock(&ctx->state_mutex); spu_deactivate(ctx); mutex_unlock(&ctx->state_mutex); spu_fini_csa(&ctx->csa); if (ctx->gan...
[ 0, 0 ]
Linux Kernel
arch/powerpc/platforms/cell/spufs/context.c
struct spu_context *get_spu_context(struct spu_context *ctx) { kref_get(&ctx->kref); return ctx; }
[ 0, 0 ]
Linux Kernel
arch/powerpc/platforms/cell/spufs/context.c
int put_spu_context(struct spu_context *ctx) { return kref_put(&ctx->kref, &destroy_spu_context); }
[ 0, 0 ]
Linux Kernel
arch/powerpc/platforms/cell/spufs/context.c
void spu_forget(struct spu_context *ctx) { struct mm_struct *mm; mutex_lock(&ctx->state_mutex); if (ctx->state != SPU_STATE_SAVED) spu_deactivate(ctx); mm = ctx->owner; ctx->owner = NULL; mmput(mm); spu_release(ctx); }
[ 0, 0 ]
Linux Kernel
arch/powerpc/platforms/cell/spufs/coredump.c
int spufs_coredump_extra_notes_size(void) { struct spu_context *ctx; int size = 0, rc, fd; fd = 0; while ((ctx = coredump_next_context(&fd)) != NULL) { rc = spu_acquire_saved(ctx); if (rc) { put_spu_context(ctx); break; } rc = spufs_ctx_note_size(ctx, fd); spu_release_saved(ctx...
[ 0, 0 ]
Linux Kernel
arch/powerpc/platforms/cell/spufs/file.c
static int spufs_mem_release(struct inode *inode, struct file *file) { struct spufs_inode_info *i = SPUFS_I(inode); struct spu_context *ctx = i->i_ctx; mutex_lock(&ctx->mapping_lock); if (!--i->i_openers) ctx->local_store = NULL; mutex_unlock(&ctx->mapping_lock); return 0; }
[ 1, 0 ]
Linux Kernel
arch/powerpc/platforms/cell/spufs/file.c
static int spufs_mem_mmap(struct file *file, struct vm_area_struct *vma) { if (!(vma->vm_flags & VM_SHARED)) return -EINVAL; vma->vm_flags |= VM_IO | VM_PFNMAP; vma->vm_page_prot = pgprot_noncached_wc(vma->vm_page_prot); vma->vm_ops = &spufs_mem_mmap_vmops; return 0; }
[ 0, 0 ]
Linux Kernel
arch/powerpc/platforms/cell/spufs/file.c
static ssize_t spufs_regs_write(struct file *file, const char __user *buffer, size_t size, loff_t *pos) { struct spu_context *ctx = file->private_data; struct spu_lscsa *lscsa = ctx->csa.lscsa; int ret; if (*pos >= sizeof(lscsa->gprs)) return -EFBIG; ret = spu_acquire_sa...
[ 1, 0 ]
Linux Kernel
arch/powerpc/platforms/cell/spufs/file.c
void spufs_ibox_callback(struct spu *spu) { struct spu_context *ctx = spu->ctx; if (ctx) wake_up_all(&ctx->ibox_wq); }
[ 0, 0 ]
Linux Kernel
arch/powerpc/platforms/cell/spufs/file.c
static ssize_t spufs_ibox_read(struct file *file, char __user *buf, size_t len, loff_t *pos) { struct spu_context *ctx = file->private_data; u32 ibox_data, __user *udata = (void __user *)buf; ssize_t count; if (len < 4) return -EINVAL; count = spu_acquire(ctx); if (count...
[ 1, 0 ]
Linux Kernel
arch/powerpc/platforms/cell/spufs/file.c
static __poll_t spufs_ibox_poll(struct file *file, poll_table *wait) { struct spu_context *ctx = file->private_data; __poll_t mask; poll_wait(file, &ctx->ibox_wq, wait); mutex_lock(&ctx->state_mutex); mask = ctx->ops->mbox_stat_poll(ctx, EPOLLIN | EPOLLRDNORM); spu_release(ctx); return mask; }
[ 0, 0 ]
Linux Kernel
arch/powerpc/platforms/cell/spufs/file.c
size_t spu_wbox_write(struct spu_context *ctx, u32 data) { return ctx->ops->wbox_write(ctx, data); }
[ 0, 0 ]
Linux Kernel
arch/powerpc/platforms/cell/spufs/file.c
static __poll_t spufs_wbox_poll(struct file *file, poll_table *wait) { struct spu_context *ctx = file->private_data; __poll_t mask; poll_wait(file, &ctx->wbox_wq, wait); mutex_lock(&ctx->state_mutex); mask = ctx->ops->mbox_stat_poll(ctx, EPOLLOUT | EPOLLWRNORM); spu_release(ctx); return mask; }
[ 0, 0 ]
Linux Kernel
arch/powerpc/platforms/cell/spufs/file.c
static int spufs_signal1_release(struct inode *inode, struct file *file) { struct spufs_inode_info *i = SPUFS_I(inode); struct spu_context *ctx = i->i_ctx; mutex_lock(&ctx->mapping_lock); if (!--i->i_openers) ctx->signal1 = NULL; mutex_unlock(&ctx->mapping_lock); return 0; }
[ 1, 0 ]
Linux Kernel
arch/powerpc/platforms/cell/spufs/file.c
static ssize_t spufs_signal1_read(struct file *file, char __user *buf, size_t len, loff_t *pos) { int ret; struct spu_context *ctx = file->private_data; ret = spu_acquire_saved(ctx); if (ret) return ret; ret = __spufs_signal1_read(ctx, buf, len); spu_release_saved(ctx...
[ 0, 0 ]
Linux Kernel
arch/powerpc/platforms/cell/spufs/file.c
static ssize_t spufs_signal1_write(struct file *file, const char __user *buf, size_t len, loff_t *pos) { struct spu_context *ctx; ssize_t ret; u32 data; ctx = file->private_data; if (len < 4) return -EINVAL; if (copy_from_user(&data, buf, 4)) return -EFAULT; ...
[ 0, 0 ]
Linux Kernel
arch/powerpc/platforms/cell/spufs/file.c
static int spufs_signal2_release(struct inode *inode, struct file *file) { struct spufs_inode_info *i = SPUFS_I(inode); struct spu_context *ctx = i->i_ctx; mutex_lock(&ctx->mapping_lock); if (!--i->i_openers) ctx->signal2 = NULL; mutex_unlock(&ctx->mapping_lock); return 0; }
[ 1, 0 ]
Linux Kernel
arch/powerpc/platforms/cell/spufs/file.c
static ssize_t __spufs_signal2_read(struct spu_context *ctx, char __user *buf, size_t len) { if (len < sizeof(ctx->csa.spu_chnldata_RW[4])) return -EINVAL; if (!ctx->csa.spu_chnlcnt_RW[4]) return 0; if (copy_to_user(buf, &ctx->csa.spu_chnldata_RW[4], ...
[ 1, 0 ]
Linux Kernel
arch/powerpc/platforms/cell/spufs/file.c
static vm_fault_t spufs_signal2_mmap_fault(struct vm_fault *vmf) { #if SPUFS_SIGNAL_MAP_SIZE == 0x1000 return spufs_ps_fault(vmf, 0x1c000, SPUFS_SIGNAL_MAP_SIZE); #elif SPUFS_SIGNAL_MAP_SIZE == 0x10000 return spufs_ps_fault(vmf, 0x10000, SPUFS_SIGNAL_MAP_SIZE); #else #error unsupported page size #endif }
[ 0, 0 ]
Linux Kernel
arch/powerpc/platforms/cell/spufs/file.c
static int spufs_signal1_type_set(void *data, u64 val) { struct spu_context *ctx = data; int ret; ret = spu_acquire(ctx); if (ret) return ret; ctx->ops->signal1_type_set(ctx, val); spu_release(ctx); return 0; }
[ 0, 0 ]
Linux Kernel
arch/powerpc/platforms/cell/spufs/file.c
static int spufs_signal2_type_set(void *data, u64 val) { struct spu_context *ctx = data; int ret; ret = spu_acquire(ctx); if (ret) return ret; ctx->ops->signal2_type_set(ctx, val); spu_release(ctx); return 0; }
[ 0, 0 ]
Linux Kernel
arch/powerpc/platforms/cell/spufs/file.c
static int spufs_mss_open(struct inode *inode, struct file *file) { struct spufs_inode_info *i = SPUFS_I(inode); struct spu_context *ctx = i->i_ctx; file->private_data = i->i_ctx; mutex_lock(&ctx->mapping_lock); if (!i->i_openers++) ctx->mss = inode->i_mapping; mutex_unlock(&ctx->mapping_lock); ret...
[ 0, 0 ]
Linux Kernel
arch/powerpc/platforms/cell/spufs/file.c
static int spufs_psmap_release(struct inode *inode, struct file *file) { struct spufs_inode_info *i = SPUFS_I(inode); struct spu_context *ctx = i->i_ctx; mutex_lock(&ctx->mapping_lock); if (!--i->i_openers) ctx->psmap = NULL; mutex_unlock(&ctx->mapping_lock); return 0; }
[ 1, 0 ]
Linux Kernel
arch/powerpc/platforms/cell/spufs/file.c
static int spufs_mfc_mmap(struct file *file, struct vm_area_struct *vma) { if (!(vma->vm_flags & VM_SHARED)) return -EINVAL; vma->vm_flags |= VM_IO | VM_PFNMAP; vma->vm_page_prot = pgprot_noncached(vma->vm_page_prot); vma->vm_ops = &spufs_mfc_mmap_vmops; return 0; }
[ 0, 0 ]
Linux Kernel
arch/powerpc/platforms/cell/spufs/file.c
static int spufs_mfc_open(struct inode *inode, struct file *file) { struct spufs_inode_info *i = SPUFS_I(inode); struct spu_context *ctx = i->i_ctx; if (ctx->owner != current->mm) return -EINVAL; if (atomic_read(&inode->i_count) != 1) return -EBUSY; mutex_lock(&ctx->mapping_lock); file->private_d...
[ 0, 0 ]
Linux Kernel
arch/powerpc/platforms/cell/spufs/file.c
static int spufs_mfc_release(struct inode *inode, struct file *file) { struct spufs_inode_info *i = SPUFS_I(inode); struct spu_context *ctx = i->i_ctx; mutex_lock(&ctx->mapping_lock); if (!--i->i_openers) ctx->mfc = NULL; mutex_unlock(&ctx->mapping_lock); return 0; }
[ 1, 0 ]
Linux Kernel
arch/powerpc/platforms/cell/spufs/file.c
void spufs_mfc_callback(struct spu *spu) { struct spu_context *ctx = spu->ctx; if (ctx) wake_up_all(&ctx->mfc_wq); }
[ 0, 0 ]
Linux Kernel
arch/powerpc/platforms/cell/spufs/file.c
static ssize_t spufs_mfc_read(struct file *file, char __user *buffer, size_t size, loff_t *pos) { struct spu_context *ctx = file->private_data; int ret = -EINVAL; u32 status; if (size != 4) goto out; ret = spu_acquire(ctx); if (ret) return ret; ret = -EINVAL; if ...
[ 0, 0 ]
Linux Kernel
arch/powerpc/platforms/cell/spufs/file.c
static int spu_send_mfc_command(struct spu_context *ctx, struct mfc_dma_command cmd, int *error) { *error = ctx->ops->send_mfc_command(ctx, &cmd); if (*error == -EAGAIN) { ctx->ops->set_mfc_query(ctx, ctx->tagwait, 1); /* try again, because the queue might be empty ag...
[ 0, 0 ]
Linux Kernel
arch/powerpc/platforms/cell/spufs/file.c
static int spufs_decr_set(void *data, u64 val) { struct spu_context *ctx = data; struct spu_lscsa *lscsa = ctx->csa.lscsa; int ret; ret = spu_acquire_saved(ctx); if (ret) return ret; lscsa->decr.slot[0] = (u32)val; spu_release_saved(ctx); return 0; }
[ 0, 0 ]
Linux Kernel
arch/powerpc/platforms/cell/spufs/file.c
static u64 spufs_event_mask_get(struct spu_context *ctx) { struct spu_lscsa *lscsa = ctx->csa.lscsa; return lscsa->event_mask.slot[0]; }
[ 0, 0 ]
Linux Kernel
arch/powerpc/platforms/cell/spufs/file.c
static int spufs_srr0_set(void *data, u64 val) { struct spu_context *ctx = data; struct spu_lscsa *lscsa = ctx->csa.lscsa; int ret; ret = spu_acquire_saved(ctx); if (ret) return ret; lscsa->srr0.slot[0] = (u32)val; spu_release_saved(ctx); return 0; }
[ 0, 0 ]
Linux Kernel
arch/powerpc/platforms/cell/spufs/file.c
static u64 spufs_srr0_get(struct spu_context *ctx) { struct spu_lscsa *lscsa = ctx->csa.lscsa; return lscsa->srr0.slot[0]; }
[ 0, 0 ]
Linux Kernel
arch/powerpc/platforms/cell/spufs/file.c
static u64 spufs_id_get(struct spu_context *ctx) { u64 num; if (ctx->state == SPU_STATE_RUNNABLE) num = ctx->spu->number; else num = (unsigned int)-1; return num; }
[ 0, 0 ]
Linux Kernel
arch/powerpc/platforms/cell/spufs/file.c
static u64 spufs_lslr_get(struct spu_context *ctx) { return ctx->csa.priv2.spu_lslr_RW; }
[ 0, 0 ]
Linux Kernel
arch/powerpc/platforms/cell/spufs/file.c
static int spufs_info_open(struct inode *inode, struct file *file) { struct spufs_inode_info *i = SPUFS_I(inode); struct spu_context *ctx = i->i_ctx; file->private_data = ctx; return 0; }
[ 0, 0 ]
Linux Kernel
arch/powerpc/platforms/cell/spufs/file.c
static int spufs_caps_open(struct inode *inode, struct file *file) { return single_open(file, spufs_caps_show, SPUFS_I(inode)->i_ctx); }
[ 0, 0 ]