Projectname
large_stringclasses
15 values
Filepath
large_stringlengths
4
106
⌀
Function
large_stringlengths
11
3.45k
Label
list
Linux Kernel
arch/sparc/kernel/ldc.c
static int rx_seq_ok(struct ldc_channel *lp, u32 seqid) { return lp->rcv_nxt + 1 == seqid; }
[ 0, 0 ]
Linux Kernel
arch/sparc/kernel/ldc.c
static int process_rdx(struct ldc_channel *lp, struct ldc_packet *p) { ldcdbg(HS, "GOT RDX stype[%x] seqid[%x] env[%x] ackid[%x]\n", p->stype, p->seqid, p->env, p->u.r.ackid); if (p->stype != LDC_INFO || !(rx_seq_ok(lp, p->seqid))) return LDC_ABORT(lp); lp->rcv_nxt = p->seqid; lp->hs_state = LD...
[ 1, 0 ]
Linux Kernel
arch/sparc/kernel/ldc.c
static int alloc_queue(const char *name, unsigned long num_entries, struct ldc_packet **base, unsigned long *ra) { unsigned long size, order; void *q; size = num_entries * LDC_PACKET_SIZE; order = get_order(size); q = (void *)__get_free_pages(GFP_KERNEL, order); if (!q) { print...
[ 1, 0 ]
Linux Kernel
arch/sparc/kernel/ldc.c
static void free_queue(unsigned long num_entries, struct ldc_packet *q) { unsigned long size, order; if (!q) return; size = num_entries * LDC_PACKET_SIZE; order = get_order(size); free_pages((unsigned long)q, order); }
[ 0, 0 ]
Linux Kernel
arch/sparc/kernel/ldc.c
static void ldc_iommu_release(struct ldc_channel *lp) { struct ldc_iommu *ldc_iommu = &lp->iommu; struct iommu_map_table *iommu = &ldc_iommu->iommu_map_table; unsigned long num_tsb_entries, tsbsize, order; (void)sun4v_ldc_set_map_table(lp->id, 0, 0); num_tsb_entries = iommu->poolsize * iommu->nr_pools; t...
[ 1, 0 ]
Linux Kernel
arch/sparc/kernel/ldc.c
void ldc_unbind(struct ldc_channel *lp) { if (lp->flags & LDC_FLAG_REGISTERED_IRQS) { free_irq(lp->cfg.rx_irq, lp); free_irq(lp->cfg.tx_irq, lp); lp->flags &= ~LDC_FLAG_REGISTERED_IRQS; } if (lp->flags & LDC_FLAG_REGISTERED_QUEUES) { sun4v_ldc_tx_qconf(lp->id, 0, 0); sun4v_ldc_rx_qconf(lp->i...
[ 0, 0 ]
Linux Kernel
arch/sparc/kernel/ldc.c
int ldc_connect(struct ldc_channel *lp) { unsigned long flags; int err; if (lp->cfg.mode == LDC_MODE_RAW) return -EINVAL; spin_lock_irqsave(&lp->lock, flags); if (!(lp->flags & LDC_FLAG_ALLOCED_QUEUES) || !(lp->flags & LDC_FLAG_REGISTERED_QUEUES) || lp->hs_state != LDC_HS_OPEN) err = ((lp->h...
[ 0, 0 ]
Linux Kernel
arch/sparc/kernel/ldc.c
int ldc_disconnect(struct ldc_channel *lp) { unsigned long hv_err, flags; int err; if (lp->cfg.mode == LDC_MODE_RAW) return -EINVAL; if (!(lp->flags & LDC_FLAG_ALLOCED_QUEUES) || !(lp->flags & LDC_FLAG_REGISTERED_QUEUES)) return -EINVAL; spin_lock_irqsave(&lp->lock, flags); err = -ENODEV;...
[ 0, 0 ]
Linux Kernel
arch/sparc/kernel/ldc.c
void ldc_set_state(struct ldc_channel *lp, u8 state) { ldcdbg(STATE, "STATE (%s) --> (%s)\n", state_to_str(lp->state), state_to_str(state)); lp->state = state; }
[ 1, 0 ]
Linux Kernel
arch/sparc/kernel/ldc.c
int ldc_mode(struct ldc_channel *lp) { return lp->cfg.mode; }
[ 0, 0 ]
Linux Kernel
arch/sparc/kernel/ldc.c
static int write_raw(struct ldc_channel *lp, const void *buf, unsigned int size) { struct ldc_packet *p; unsigned long new_tail, hv_err; int err; hv_err = sun4v_ldc_tx_get_state(lp->id, &lp->tx_head, &lp->tx_tail, &lp->chan_state); if (unlikely(hv_err))...
[ 1, 0 ]
Linux Kernel
arch/sparc/kernel/ldc.c
static int write_stream(struct ldc_channel *lp, const void *buf, unsigned int size) { if (size > lp->cfg.mtu) size = lp->cfg.mtu; return write_nonraw(lp, buf, size); }
[ 0, 0 ]
Linux Kernel
arch/sparc/kernel/ldc.c
static u64 pagesize_code(void) { switch (PAGE_SIZE) { default: case (8ULL * 1024ULL): return 0; case (64ULL * 1024ULL): return 1; case (512ULL * 1024ULL): return 2; case (4ULL * 1024ULL * 1024ULL): return 3; case (32ULL * 1024ULL * 1024ULL): return 4; case (256ULL * 1024ULL * 1024UL...
[ 0, 0 ]
Linux Kernel
arch/sparc/kernel/ldc.c
static struct ldc_mtable_entry *alloc_npages(struct ldc_iommu *iommu, unsigned long npages) { long entry; entry = iommu_tbl_range_alloc(NULL, &iommu->iommu_map_table, npages, NULL, (unsigned long)-1, 0); if (unlikely(entry == IOMMU_ER...
[ 0, 0 ]
Linux Kernel
arch/sparc/kernel/ldc.c
int ldc_map_single(struct ldc_channel *lp, void *buf, unsigned int len, struct ldc_trans_cookie *cookies, int ncookies, unsigned int map_perm) { unsigned long npages, pa; struct ldc_mtable_entry *base; struct cookie_state state; struct ldc_iommu *iommu; if ((map_perm & ...
[ 0, 0 ]
Linux Kernel
arch/sparc/kernel/led.c
static inline void led_toggle(void) { unsigned char val = get_auxio(); unsigned char on, off; if (val & AUXIO_LED) { on = 0; off = AUXIO_LED; } else { on = AUXIO_LED; off = 0; } set_auxio(on, off); }
[ 1, 0 ]
Linux Kernel
arch/sparc/kernel/leon_kernel.c
static void leon_eirq_setup(unsigned int eirq) { unsigned long mask, oldmask; unsigned int veirq; if (eirq < 1 || eirq > 0xf) { printk(KERN_ERR "LEON EXT IRQ NUMBER BAD: %d\n", eirq); return; } veirq = leon_build_device_irq(eirq, leon_handle_ext_irq, "extirq", 0); irq_link(veirq); mask = 1 << e...
[ 1, 0 ]
Linux Kernel
arch/sparc/kernel/leon_kernel.c
static void leon_unmask_irq(struct irq_data *data) { unsigned long mask, oldmask, flags; int cpu; mask = (unsigned long)data->chip_data; cpu = irq_choose_cpu(irq_data_get_affinity_mask(data)); spin_lock_irqsave(&leon_irq_lock, flags); oldmask = LEON3_BYPASS_LOAD_PA(LEON_IMASK(cpu)); LEON3_BYPASS_STORE_P...
[ 0, 0 ]
Linux Kernel
arch/sparc/kernel/leon_kernel.c
static unsigned int _leon_build_device_irq(struct platform_device *op, unsigned int real_irq) { return leon_build_device_irq(real_irq, handle_simple_irq, "edge", 0); }
[ 0, 0 ]
Linux Kernel
arch/sparc/kernel/leon_pci.c
void leon_pci_init(struct platform_device *ofdev, struct leon_pci_info *info) { LIST_HEAD(resources); struct pci_bus *root_bus; struct pci_host_bridge *bridge; int ret; bridge = pci_alloc_host_bridge(0); if (!bridge) return; pci_add_resource_offset(&resources, &info->io_space, ...
[ 0, 0 ]
Linux Kernel
arch/sparc/kernel/leon_pci_grpci1.c
static int grpci1_cfg_r32(struct grpci1_priv *priv, unsigned int bus, unsigned int devfn, int where, u32 *val) { u32 *pci_conf, tmp, cfg; if (where & 0x3) return -EINVAL; if (bus == 0) { devfn += (0x8 * 6); } else if (bus == TGT) { bus = 0; devfn = 0; /* special case:...
[ 1, 0 ]
Linux Kernel
arch/sparc/kernel/leon_pci_grpci1.c
static int grpci1_cfg_r16(struct grpci1_priv *priv, unsigned int bus, unsigned int devfn, int where, u32 *val) { u32 v; int ret; if (where & 0x1) return -EINVAL; ret = grpci1_cfg_r32(priv, bus, devfn, where & ~0x3, &v); *val = 0xffff & (v >> (8 * (where & 0x3))); return ret; ...
[ 0, 0 ]
Linux Kernel
arch/sparc/kernel/leon_pci_grpci1.c
static int grpci1_cfg_r8(struct grpci1_priv *priv, unsigned int bus, unsigned int devfn, int where, u32 *val) { u32 v; int ret; ret = grpci1_cfg_r32(priv, bus, devfn, where & ~0x3, &v); *val = 0xff & (v >> (8 * (where & 3))); return ret; }
[ 0, 0 ]
Linux Kernel
arch/sparc/kernel/leon_pci_grpci1.c
static unsigned int grpci1_build_device_irq(unsigned int irq) { unsigned int virq = 0, pil; pil = 1 << 8; virq = irq_alloc(irq, pil); if (virq == 0) goto out; irq_set_chip_and_handler_name(virq, &grpci1_irq, handle_simple_irq, "pcilvl"); irq_set_chip_data(virq, (void *)irq); out: return virq; }
[ 1, 0 ]
Linux Kernel
arch/sparc/kernel/leon_pci_grpci1.c
static irqreturn_t grpci1_jump_interrupt(int irq, void *arg) { struct grpci1_priv *priv = arg; dev_err(priv->dev, "Jump IRQ happened\n"); return IRQ_NONE; }
[ 0, 0 ]
Linux Kernel
arch/sparc/kernel/leon_pci_grpci2.c
static int grpci2_map_irq(const struct pci_dev *dev, u8 slot, u8 pin) { struct grpci2_priv *priv = dev->bus->sysdata; int irq_group; irq_group = slot & 0x3; pin = ((pin - 1) + irq_group) & 0x3; return priv->irq_map[pin]; }
[ 1, 0 ]
Linux Kernel
arch/sparc/kernel/leon_pci_grpci2.c
static int grpci2_cfg_r32(struct grpci2_priv *priv, unsigned int bus, unsigned int devfn, int where, u32 *val) { unsigned int *pci_conf; unsigned long flags; u32 tmp; if (where & 0x3) return -EINVAL; if (bus == 0) { devfn += (0x8 * 6); } else if (bus == TGT) { bus = 0...
[ 1, 0 ]
Linux Kernel
arch/sparc/kernel/leon_pci_grpci2.c
static int grpci2_cfg_r16(struct grpci2_priv *priv, unsigned int bus, unsigned int devfn, int where, u32 *val) { u32 v; int ret; if (where & 0x1) return -EINVAL; ret = grpci2_cfg_r32(priv, bus, devfn, where & ~0x3, &v); *val = 0xffff & (v >> (8 * (where & 0x3))); return ret; ...
[ 0, 0 ]
Linux Kernel
arch/sparc/kernel/leon_pci_grpci2.c
static int grpci2_cfg_w8(struct grpci2_priv *priv, unsigned int bus, unsigned int devfn, int where, u32 val) { int ret; u32 v; ret = grpci2_cfg_r32(priv, bus, devfn, where & ~0x3, &v); if (ret != 0) return ret; v = (v & ~(0xff << (8 * (where & 0x3)))) | ((0xff & val) << (8...
[ 0, 0 ]
Linux Kernel
arch/sparc/kernel/leon_pci_grpci2.c
static int grpci2_read_config(struct pci_bus *bus, unsigned int devfn, int where, int size, u32 *val) { struct grpci2_priv *priv = grpci2priv; unsigned int busno = bus->number; int ret; if (PCI_SLOT(devfn) > 15 || busno > 255) { *val = ~0; return 0; } switch (size) { ...
[ 1, 0 ]
Linux Kernel
arch/sparc/kernel/leon_pci_grpci2.c
static void grpci2_mask_irq(struct irq_data *data) { unsigned long flags; unsigned int irqidx; struct grpci2_priv *priv = grpci2priv; irqidx = (unsigned int)data->chip_data - 1; if (irqidx > 3) return; spin_lock_irqsave(&grpci2_dev_lock, flags); REGSTORE(priv->regs->ctrl, REGLOAD(priv->regs->ctrl) &...
[ 0, 0 ]
Linux Kernel
arch/sparc/kernel/leon_pmc.c
static int pmc_leon_need_fixup(void) { unsigned int systemid = amba_system_id >> 16; unsigned int *id; id = &pmc_leon_fixup_ids[0]; while (*id != 0) { if (*id == systemid) return 1; id++; } return 0; }
[ 1, 0 ]
Linux Kernel
arch/sparc/kernel/leon_smp.c
void leon_cpu_pre_starting(void *arg) { leon_configure_cache_smp(); }
[ 0, 0 ]
Linux Kernel
arch/sparc/kernel/leon_smp.c
void leon_cpu_pre_online(void *arg) { int cpuid = hard_smp_processor_id(); do_swap(&cpu_callin_map[cpuid], 1); local_ops->cache_all(); local_ops->tlb_all(); /* Fix idle thread fields. */ __asm__ __volatile__("ld [%0], %%g6\n\t" : : "r"(&current_set[cpuid]) ...
[ 0, 0 ]
Linux Kernel
arch/sparc/kernel/leon_smp.c
void leon_configure_cache_smp(void) { unsigned long cfg = sparc_leon3_get_dcachecfg(); int me = smp_processor_id(); if (ASI_LEON3_SYSCTRL_CFG_SSIZE(cfg) > 4) { printk(KERN_INFO "Note: SMP with snooping only works on 4k cache, found " "%dk(0x%x) on cpu %d, disabling caches\n", ...
[ 1, 0 ]
Linux Kernel
arch/sparc/kernel/leon_smp.c
static void leon_send_ipi(int cpu, int level) { unsigned long mask; mask = leon_get_irqmask(level); LEON3_BYPASS_STORE_PA(&leon3_irqctrl_regs->force[cpu], mask); }
[ 0, 0 ]
Linux Kernel
arch/sparc/kernel/mdesc.c
static void mdesc_handle_init(struct mdesc_handle *hp, unsigned int handle_size, void *base) { BUG_ON(((unsigned long)&hp->mdesc) & (16UL - 1)); memset(hp, 0, handle_size); INIT_LIST_HEAD(&hp->list); hp->self_base = base; refcount_set(&hp->refcnt, 1); hp->handle_size = handle...
[ 1, 0 ]
Linux Kernel
arch/sparc/kernel/mdesc.c
static struct mdesc_handle *__init mdesc_memblock_alloc(unsigned int mdesc_size) { unsigned int handle_size, alloc_size; struct mdesc_handle *hp; unsigned long paddr; handle_size = (sizeof(struct mdesc_handle) - sizeof(struct mdesc_hdr) + mdesc_size); alloc_size = PAGE_ALIGN(handle_size); paddr = m...
[ 1, 0 ]
Linux Kernel
arch/sparc/kernel/mdesc.c
struct mdesc_handle *mdesc_grab(void) { struct mdesc_handle *hp; unsigned long flags; spin_lock_irqsave(&mdesc_lock, flags); hp = cur_mdesc; if (hp) refcount_inc(&hp->refcnt); spin_unlock_irqrestore(&mdesc_lock, flags); return hp; }
[ 0, 0 ]
Linux Kernel
arch/sparc/kernel/mdesc.c
void mdesc_register_notifier(struct mdesc_notifier_client *client) { bool supported = false; u64 node; int i; mutex_lock(&mdesc_mutex); for (i = 0; md_node_ops_table[i].name != NULL; i++) { if (strcmp(md_node_ops_table[i].name, client->node_name) == 0) { supported = true; break; } } ...
[ 0, 0 ]
Linux Kernel
arch/sparc/kernel/mdesc.c
static void rel_vdev_port_node_info(union md_node_info *node_info) { if (node_info && node_info->vdev_port.name) { kfree_const(node_info->vdev_port.name); node_info->vdev_port.name = NULL; } }
[ 1, 0 ]
Linux Kernel
arch/sparc/kernel/mdesc.c
static bool ds_port_node_match(union md_node_info *a_node_info, union md_node_info *b_node_info) { if (a_node_info->ds_port.id != b_node_info->ds_port.id) return false; return true; }
[ 0, 0 ]
Linux Kernel
arch/sparc/kernel/mdesc.c
static void invoke_on_missing(const char *name, struct mdesc_handle *a, struct mdesc_handle *b, void (*func)(struct mdesc_handle *, u64, const char *node_name)) { mdesc_node_info_get_f get_info_func; mdesc_node_in...
[ 0, 0 ]
Linux Kernel
arch/sparc/kernel/mdesc.c
u64 mdesc_get_node(struct mdesc_handle *hp, const char *node_name, union md_node_info *node_info) { mdesc_node_info_get_f get_info_func; mdesc_node_info_rel_f rel_info_func; mdesc_node_match_f node_match_func; union md_node_info hp_node_info; u64 hp_node; int rv; if (hp == NULL || node...
[ 1, 0 ]
Linux Kernel
arch/sparc/kernel/mdesc.c
static struct mdesc_elem *node_block(struct mdesc_hdr *mdesc) { return (struct mdesc_elem *)mdesc->data; }
[ 0, 0 ]
Linux Kernel
arch/sparc/kernel/mdesc.c
const void *mdesc_get_property(struct mdesc_handle *hp, u64 node, const char *name, int *lenp) { const char *names = name_block(&hp->mdesc); u64 last_node = hp->mdesc.node_sz / 16; void *data = data_block(&hp->mdesc); struct mdesc_elem *ep; if (node == MDESC_NODE_NULL || node ...
[ 0, 0 ]
Linux Kernel
arch/sparc/kernel/mdesc.c
static void fill_in_one_cache(cpuinfo_sparc *c, struct mdesc_handle *hp, u64 mp) { const u64 *level = mdesc_get_property(hp, mp, "level", NULL); const u64 *size = mdesc_get_property(hp, mp, "size", NULL); const u64 *line_size = mdesc_get_property(hp, mp, "line-size", NULL); const ...
[ 0, 0 ]
Linux Kernel
arch/sparc/kernel/mdesc.c
static void __mark_core_id(struct mdesc_handle *hp, u64 node, int core_id) { const u64 *id = mdesc_get_property(hp, node, "id", NULL); if (*id < num_possible_cpus()) cpu_data(*id).core_id = core_id; }
[ 0, 0 ]
Linux Kernel
arch/sparc/kernel/mdesc.c
static void set_sock_ids(struct mdesc_handle *hp) { u64 mp; if (!set_max_cache_ids_by_cache(hp, 3)) set_max_cache_ids_by_cache(hp, 2); /* If machine description exposes sockets data use it.*/ mp = mdesc_node_by_name(hp, MDESC_NODE_NULL, "sockets"); if (mp != MDESC_NODE_NULL) set_sock_ids_by_socket(h...
[ 0, 0 ]
Linux Kernel
arch/sparc/kernel/mdesc.c
static void get_one_mondo_bits(const u64 *p, unsigned int *mask, unsigned long def, unsigned long max) { u64 val; if (!p) goto use_default; val = *p; if (!val || val >= 64) goto use_default; if (val > max) val = max; *mask = ((1U << val) * 64U) - 1U; return;...
[ 1, 0 ]
Linux Kernel
arch/sparc/kernel/mdesc.c
static void get_mondo_data(struct mdesc_handle *hp, u64 mp, struct trap_per_cpu *tb) { static int printed; const u64 *val; val = mdesc_get_property(hp, mp, "q-cpu-mondo-#bits", NULL); get_one_mondo_bits(val, &tb->cpu_mondo_qmask, 7, ilog2(max_cpus * 2)); val = mdesc_get_property(...
[ 0, 0 ]
Linux Kernel
arch/sparc/kernel/mdesc.c
static loff_t mdesc_llseek(struct file *file, loff_t offset, int whence) { struct mdesc_handle *hp = file->private_data; return no_seek_end_llseek_size(file, offset, whence, hp->handle_size); }
[ 0, 0 ]
Linux Kernel
arch/sparc/kernel/mdesc.c
void __init sun4v_mdesc_init(void) { struct mdesc_handle *hp; unsigned long len, real_len, status; (void)sun4v_mach_desc(0UL, 0UL, &len); printk("MDESC: Size is %lu bytes.\n", len); hp = mdesc_alloc(len, &memblock_mdesc_ops); if (hp == NULL) { prom_printf("MDESC: alloc of %lu bytes failed.\n", len);...
[ 1, 0 ]
Linux Kernel
arch/sparc/kernel/module.c
static void *module_map(unsigned long size) { if (PAGE_ALIGN(size) > MODULES_LEN) return NULL; return __vmalloc_node_range(size, 1, MODULES_VADDR, MODULES_END, GFP_KERNEL, PAGE_KERNEL, 0, NUMA_NO_NODE, __builtin_return_address(0)); }
[ 0, 0 ]
Linux Kernel
arch/sparc/kernel/module.c
static void do_patch_sections(const Elf_Ehdr *hdr, const Elf_Shdr *sechdrs) { const Elf_Shdr *s, *sun4v_1insn = NULL, *sun4v_2insn = NULL; char *secstrings = (void *)hdr + sechdrs[hdr->e_shstrndx].sh_offset; for (s = sechdrs; s < sechdrs + hdr->e_shnum; s++) { if (!strcmp(".sun4v_1insn_patch", secstrings + s...
[ 1, 0 ]
Linux Kernel
arch/sparc/kernel/nmi.c
static __init void nmi_cpu_busy(void *data) { while (endflag == 0) mb(); }
[ 0, 0 ]
Linux Kernel
arch/sparc/kernel/nmi.c
void stop_nmi_watchdog(void *unused) { if (!__this_cpu_read(wd_enabled)) return; pcr_ops->write_pcr(0, pcr_ops->pcr_nmi_disable); __this_cpu_write(wd_enabled, 0); atomic_dec(&nmi_active); }
[ 0, 0 ]
Linux Kernel
arch/sparc/kernel/nmi.c
static void nmi_adjust_hz_one(void *unused) { if (!__this_cpu_read(wd_enabled)) return; pcr_ops->write_pcr(0, pcr_ops->pcr_nmi_disable); pcr_ops->write_pic(0, pcr_ops->nmi_picl_value(nmi_hz)); pcr_ops->write_pcr(0, pcr_ops->pcr_nmi_enable); }
[ 0, 0 ]
Linux Kernel
arch/sparc/kernel/nmi.c
int watchdog_nmi_enable(unsigned int cpu) { if (atomic_read(&nmi_active) == -1) { pr_warn("NMI watchdog cannot be enabled or disabled\n"); return -1; } if (!nmi_init_done) return 0; smp_call_function_single(cpu, start_nmi_watchdog, NULL, 1); return 0; }
[ 0, 0 ]
Linux Kernel
arch/sparc/kernel/of_device_32.c
static int of_bus_pci_match(struct device_node *np) { if (of_node_is_type(np, "pci") || of_node_is_type(np, "pciex")) { if (!of_find_property(np, "ranges", NULL)) return 0; return 1; } return 0; }
[ 0, 0 ]
Linux Kernel
arch/sparc/kernel/of_device_32.c
static int of_bus_pci_map(u32 *addr, const u32 *range, int na, int ns, int pna) { u32 result[OF_MAX_ADDR_CELLS]; int i; if ((addr[0] ^ range[0]) & 0x03000000) return -EINVAL; if (of_out_of_range(addr + 1, range + 1, range + na + pna, na - 1, ns)) return -EINVAL; /* Start w...
[ 1, 0 ]
Linux Kernel
arch/sparc/kernel/of_device_32.c
*AMBAPP bus specific translator * / static int of_bus_ambapp_match(struct device_node *np) { return of_node_is_type(np, "ambapp"); }
[ 0, 0 ]
Linux Kernel
arch/sparc/kernel/of_device_64.c
void __iomem *of_ioremap(struct resource *res, unsigned long offset, unsigned long size, char *name) { unsigned long ret = res->start + offset; struct resource *r; if (res->flags & IORESOURCE_MEM) r = request_mem_region(ret, size, name); else r = request_region(ret, size, name...
[ 1, 0 ]
Linux Kernel
arch/sparc/kernel/of_device_64.c
static int of_bus_pci_match(struct device_node *np) { if (of_node_name_eq(np, "pci")) { const char *model = of_get_property(np, "model", NULL); if (model && !strcmp(model, "SUNW,simba")) return 0; if (!of_find_property(np, "ranges", NULL)) return 0; return 1; } return 0; }
[ 0, 0 ]
Linux Kernel
arch/sparc/kernel/of_device_64.c
static int of_bus_simba_match(struct device_node *np) { const char *model = of_get_property(np, "model", NULL); if (model && !strcmp(model, "SUNW,simba")) return 1; if (of_node_name_eq(np, "pci")) { if (!of_find_property(np, "ranges", NULL)) return 1; } return 0; }
[ 0, 0 ]
Linux Kernel
arch/sparc/kernel/of_device_64.c
static struct of_bus *of_match_bus(struct device_node *np) { int i; for (i = 0; i < ARRAY_SIZE(of_busses); i++) if (!of_busses[i].match || of_busses[i].match(np)) return &of_busses[i]; BUG(); return NULL; }
[ 0, 0 ]
Linux Kernel
arch/sparc/kernel/of_device_64.c
static int __init build_one_resource(struct device_node *parent, struct of_bus *bus, struct of_bus *pbus, u32 *addr, int na, int ns, int pna) { const u32 *ranges; int rone, rlen; ranges = of_get_property(parent, "ranges", &rlen); if (ran...
[ 1, 0 ]
Linux Kernel
arch/sparc/kernel/of_device_64.c
static struct platform_device *__init scan_one_device(struct device_node *dp, struct device *parent) { struct platform_device *op = kzalloc(sizeof(*op), GFP_KERNEL); const unsigned int *irq; struct dev_archdata *sd; int len, i; if (!op) return NULL; ...
[ 1, 0 ]
Linux Kernel
arch/sparc/kernel/of_device_64.c
static void __init scan_tree(struct device_node *dp, struct device *parent) { while (dp) { struct platform_device *op = scan_one_device(dp, parent); if (op) scan_tree(dp->child, &op->dev); dp = dp->sibling; } }
[ 0, 0 ]
Linux Kernel
arch/sparc/kernel/of_device_64.c
static int __init scan_of_devices(void) { struct device_node *root = of_find_node_by_path("/"); struct platform_device *parent; parent = scan_one_device(root, NULL); if (!parent) return 0; scan_tree(root->child, &parent->dev); return 0; }
[ 0, 0 ]
Linux Kernel
arch/sparc/kernel/of_device_common.c
int of_address_to_resource(struct device_node *node, int index, struct resource *r) { struct platform_device *op = of_find_device_by_node(node); if (!op || index >= op->num_resources) return -EINVAL; memcpy(r, &op->archdata.resource[index], sizeof(*r)); return 0; }
[ 1, 0 ]
Linux Kernel
arch/sparc/kernel/of_device_common.c
void __iomem *of_iomap(struct device_node *node, int index) { struct platform_device *op = of_find_device_by_node(node); struct resource *r; if (!op || index >= op->num_resources) return NULL; r = &op->archdata.resource[index]; return of_ioremap(r, 0, resource_size(r), (char *)r->name); }
[ 1, 0 ]
Linux Kernel
arch/sparc/kernel/of_device_common.c
static void get_cells(struct device_node *dp, int *addrc, int *sizec) { if (addrc) *addrc = of_n_addr_cells(dp); if (sizec) *sizec = of_n_size_cells(dp); }
[ 0, 0 ]
Linux Kernel
arch/sparc/kernel/pci.c
void pci_config_write16(u16 *addr, u16 val) { unsigned long flags; spin_lock_irqsave(&pci_poke_lock, flags); pci_poke_cpu = smp_processor_id(); pci_poke_in_progress = 1; pci_poke_faulted = 0; __asm__ __volatile__("membar #Sync\n\t" "stha %0, [%1] %2\n\t" "memba...
[ 0, 0 ]
Linux Kernel
arch/sparc/kernel/pci.c
static void pci_bus_register_of_sysfs(struct pci_bus *bus) { struct pci_dev *dev; struct pci_bus *child_bus; int err; list_for_each_entry(dev, &bus->devices, bus_list) { err = sysfs_create_file(&dev->dev.kobj, &dev_attr_obppath.attr); (void)err; } list_for_each_entry(child_bus, &bus->children, nod...
[ 0, 0 ]
Linux Kernel
arch/sparc/kernel/pci.c
static void pci_claim_legacy_resources(struct pci_dev *dev) { struct pci_bus_region region; struct resource *p, *root, *conflict; if ((dev->class >> 8) != PCI_CLASS_DISPLAY_VGA) return; p = kzalloc(sizeof(*p), GFP_KERNEL); if (!p) return; p->name = "Video RAM area"; p->flags = IORESOURCE_MEM |...
[ 1, 0 ]
Linux Kernel
arch/sparc/kernel/pci.c
int pcibus_to_node(struct pci_bus *pbus) { struct pci_pbm_info *pbm = pbus->sysdata; return pbm->numa_node; }
[ 0, 0 ]
Linux Kernel
arch/sparc/kernel/pci.c
int pci_domain_nr(struct pci_bus *pbus) { struct pci_pbm_info *pbm = pbus->sysdata; int ret; if (!pbm) { ret = -ENXIO; } else { ret = pbm->index; } return ret; }
[ 0, 0 ]
Linux Kernel
arch/sparc/kernel/pci.c
void arch_teardown_msi_irq(unsigned int irq) { struct msi_desc *entry = irq_get_msi_desc(irq); struct pci_dev *pdev = msi_desc_to_pci_dev(entry); struct pci_pbm_info *pbm = pdev->dev.archdata.host_controller; if (pbm->teardown_msi_irq) pbm->teardown_msi_irq(irq, pdev); }
[ 0, 0 ]
Linux Kernel
arch/sparc/kernel/pci.c
void pci_resource_to_user(const struct pci_dev *pdev, int bar, const struct resource *rp, resource_size_t *start, resource_size_t *end) { struct pci_bus_region region; pcibios_resource_to_bus(pdev->bus, &region, (struct resource *)rp); *start = region.start; ...
[ 0, 0 ]
Linux Kernel
arch/sparc/kernel/pci.c
int pcibios_device_add(struct pci_dev *dev) { struct pci_dev *pdev; if (dev->is_virtfn) { struct dev_archdata *psd; pdev = dev->physfn; psd = &pdev->dev.archdata; pci_init_dev_archdata(&dev->dev.archdata, psd->iommu, psd->stc, psd->host_controller, NULL, psd->numa_node); ...
[ 0, 0 ]
Linux Kernel
arch/sparc/kernel/pci.c
static int __init pcibios_init(void) { pci_dfl_cache_line_size = 64 >> 2; return 0; }
[ 0, 0 ]
Linux Kernel
arch/sparc/kernel/pcic.c
static int pcic_read_config_dword(unsigned int busno, unsigned int devfn, int where, u32 *value) { struct linux_pcic *pcic; unsigned long flags; pcic = &pcic0; local_irq_save(flags); #if 0 pcic_speculative = 1; pcic_trapped = 0; #endif writel(CONFIG_CMD(busno, devfn, whe...
[ 0, 0 ]
Linux Kernel
arch/sparc/kernel/pcic.c
static int pcic_write_config_dword(unsigned int busno, unsigned int devfn, int where, u32 value) { struct linux_pcic *pcic; unsigned long flags; pcic = &pcic0; local_irq_save(flags); writel(CONFIG_CMD(busno, devfn, where), pcic->pcic_config_space_addr); writel(value, pc...
[ 0, 0 ]
Linux Kernel
arch/sparc/kernel/pcic.c
static void __init pcic_pbm_scan_bus(struct linux_pcic *pcic) { struct linux_pbm_info *pbm = &pcic->pbm; pbm->pci_bus = pci_scan_bus(pbm->pci_first_busno, &pcic_ops, pbm); if (!pbm->pci_bus) return; #if 0 pci_fill_in_pbm_cookies(pbm->pci_bus, pbm, pbm->prom_node); pci_record_assignments(pbm, pbm->pci_bus...
[ 0, 0 ]
Linux Kernel
arch/sparc/kernel/pcic.c
static unsigned int pcic_cycles_offset(void) { u32 value, count; value = readl(pcic0.pcic_regs + PCI_SYS_COUNTER); count = value & ~PCI_SYS_COUNTER_OVERFLOW; if (value & PCI_SYS_COUNTER_OVERFLOW) count += TICK_TIMER_LIMIT; count = ((count / HZ) * USECS_PER_JIFFY) / (TICK_TIMER_LIMIT / HZ); /* Coordi...
[ 0, 0 ]
Linux Kernel
arch/sparc/kernel/pcic.c
void __init pci_time_init(void) { struct linux_pcic *pcic = &pcic0; unsigned long v; int timer_irq, irq; int err; #ifndef CONFIG_SMP sparc_config.clock_rate = SBUS_CLOCK_RATE / HZ; sparc_config.features |= FEAT_L10_CLOCKEVENT; #endif sparc_config.features |= FEAT_L10_CLOCKSOURCE; sparc_config.get_cycl...
[ 0, 0 ]
Linux Kernel
arch/sparc/kernel/pcic.c
void pcic_nmi(unsigned int pend, struct pt_regs *regs) { pend = swab32(pend); if (!pcic_speculative || (pend & PCI_SYS_INT_PENDING_PIO) == 0) { /* * XXX On CP-1200 PCI #SERR may happen, we do not know * what to do about it yet. */ printk("Aiee, NMI pend 0x%x pc 0x%x spec %d, hanging\n", pend...
[ 1, 1 ]
Linux Kernel
arch/sparc/kernel/pcic.c
static void pcic_unmask_irq(struct irq_data *data) { unsigned long mask, flags; mask = (unsigned long)data->chip_data; local_irq_save(flags); writel(mask, pcic0.pcic_regs + PCI_SYS_INT_TARGET_MASK_CLEAR); local_irq_restore(flags); }
[ 0, 0 ]
Linux Kernel
arch/sparc/kernel/pci_common.c
static int config_out_of_range(struct pci_pbm_info *pbm, unsigned long bus, unsigned long devfn, unsigned long reg) { if (bus < pbm->pci_first_busno || bus > pbm->pci_last_busno) return 1; return 0; }
[ 0, 0 ]
Linux Kernel
arch/sparc/kernel/pci_common.c
static void *sun4u_config_mkaddr(struct pci_pbm_info *pbm, unsigned long bus, unsigned long devfn, unsigned long reg) { unsigned long rbits = pbm->config_space_reg_bits; if (config_out_of_range(pbm, bus, devfn, reg)) return NULL; reg = (reg & ((1 << rbits) - 1)); devfn <<...
[ 1, 0 ]
Linux Kernel
arch/sparc/kernel/pci_common.c
static int sun4u_read_pci_cfg_host(struct pci_pbm_info *pbm, unsigned char bus, unsigned int devfn, int where, int size, u32 *value) { u32 tmp32, *addr; u16 tmp16; u8 tmp8; addr = sun4u_config_mkaddr(pbm, bus, devfn, where); if (!addr) ...
[ 1, 0 ]
Linux Kernel
arch/sparc/kernel/pci_common.c
static void pci_register_iommu_region(struct pci_pbm_info *pbm) { const u32 *vdma = of_get_property(pbm->op->dev.of_node, "virtual-dma", NULL); if (vdma) { struct resource *rp = kzalloc(sizeof(*rp), GFP_KERNEL); if (!rp) { pr_info("%s: Cannot allocate IOMMU resource.\n", pbm->name); return; ...
[ 1, 0 ]
Linux Kernel
arch/sparc/kernel/pci_common.c
void pci_scan_for_target_abort(struct pci_pbm_info *pbm, struct pci_bus *pbus) { struct pci_dev *pdev; struct pci_bus *bus; list_for_each_entry(pdev, &pbus->devices, bus_list) { u16 status, error_bits; pci_read_config_word(pdev, PCI_STATUS, &status); error_bits = (status & (PCI_STATUS_SIG_TA...
[ 0, 0 ]
Linux Kernel
arch/sparc/kernel/pci_common.c
void pci_scan_for_master_abort(struct pci_pbm_info *pbm, struct pci_bus *pbus) { struct pci_dev *pdev; struct pci_bus *bus; list_for_each_entry(pdev, &pbus->devices, bus_list) { u16 status, error_bits; pci_read_config_word(pdev, PCI_STATUS, &status); error_bits = (status & (PCI_STATUS_REC_MASTER_AB...
[ 0, 0 ]
Linux Kernel
arch/sparc/kernel/pci_fire.c
static int pci_fire_pbm_iommu_init(struct pci_pbm_info *pbm) { struct iommu *iommu = pbm->iommu; u32 vdma[2], dma_mask; u64 control; int tsbsize, err; vdma[0] = 0xc0000000; /* base */ vdma[1] = 0x40000000; /* size */ dma_mask = 0xffffffff; tsbsize = 128; /* Register addresses. */ iommu->iommu_cont...
[ 1, 0 ]
Linux Kernel
arch/sparc/kernel/pci_fire.c
static void pci_fire_msiq_free(struct pci_pbm_info *pbm) { unsigned long pages, order; order = get_order(512 * 1024); pages = (unsigned long)pbm->msi_queues; free_pages(pages, order); pbm->msi_queues = NULL; }
[ 0, 0 ]
Linux Kernel
arch/sparc/kernel/pci_fire.c
static int pci_fire_msiq_build_irq(struct pci_pbm_info *pbm, unsigned long msiqid, unsigned long devino) { unsigned long cregs = (unsigned long)pbm->pbm_regs; unsigned long imap_reg, iclr_reg, int_ctrlr; unsigned int irq; int fixup; u64 val; imap_reg = cregs + (0x001000UL...
[ 1, 1 ]
Linux Kernel
arch/sparc/kernel/pci_fire.c
static int pci_fire_pbm_init(struct pci_pbm_info *pbm, struct platform_device *op, u32 portid) { const struct linux_prom64_registers *regs; struct device_node *dp = op->dev.of_node; int err; pbm->numa_node = NUMA_NO_NODE; pbm->pci_ops = &sun4u_pci_ops; pbm->config_space_reg_bi...
[ 1, 1 ]
Linux Kernel
arch/sparc/kernel/pci_fire.c
static int fire_probe(struct platform_device *op) { struct device_node *dp = op->dev.of_node; struct pci_pbm_info *pbm; struct iommu *iommu; u32 portid; int err; portid = of_getintprop_default(dp, "portid", 0xff); err = -ENOMEM; pbm = kzalloc(sizeof(*pbm), GFP_KERNEL); if (!pbm) { printk(KERN_E...
[ 0, 0 ]