Projectname large_stringclasses 15
values | Filepath large_stringlengths 4 106 ⌀ | Function large_stringlengths 11 3.45k | Label list |
|---|---|---|---|
Linux Kernel | arch/sparc/kernel/vio.c |
static ssize_t show_pciobppath_attr(struct device *dev,
struct device_attribute *attr, char *buf) {
struct vio_dev *vdev;
struct device_node *dp;
vdev = to_vio_dev(dev);
dp = vdev->dp;
return scnprintf(buf, PAGE_SIZE, "%pOF\n", dp);
} | [
0,
0
] |
Linux Kernel | arch/sparc/kernel/vio.c |
static void vio_add(struct mdesc_handle *hp, u64 node, const char *node_name) {
(void)vio_create_one(hp, node, node_name, &root_vdev->dev);
} | [
0,
0
] |
Linux Kernel | arch/sparc/kernel/vio.c |
static void vio_remove(struct mdesc_handle *hp, u64 node,
const char *node_name) {
struct vio_remove_node_data node_data;
struct device *dev;
node_data.hp = hp;
node_data.node = node;
dev =
device_find_child(&root_vdev->dev, (void *)&node_data, vio_md_node_match);
if (dev) {
... | [
0,
0
] |
Linux Kernel | arch/sparc/kernel/vio.c | static void vio_add_ds(struct mdesc_handle *hp, u64 node,
const char *node_name) {
int found;
u64 a;
found = 0;
mdesc_for_each_arc(a, hp, node, MDESC_ARC_TYPE_BACK) {
u64 target = mdesc_arc_target(hp, a);
const char *name = mdesc_node_name(hp, target);
if (!strcmp(name, "dom... | [
0,
0
] |
Linux Kernel | arch/sparc/kernel/viohs.c |
int vio_ldc_send(struct vio_driver_state *vio, void *data, int len) {
int err, limit = 1000;
err = -EINVAL;
while (limit-- > 0) {
err = ldc_write(vio->lp, data, len);
if (!err || (err != -EAGAIN))
break;
udelay(1);
}
return err;
} | [
1,
0
] |
Linux Kernel | arch/sparc/kernel/viohs.c |
static int send_ctrl(struct vio_driver_state *vio, struct vio_msg_tag *tag,
int len) {
tag->sid = vio_send_sid(vio);
return vio_ldc_send(vio, tag, len);
} | [
0,
0
] |
Linux Kernel | arch/sparc/kernel/viohs.c |
static int send_version(struct vio_driver_state *vio, u16 major, u16 minor) {
struct vio_ver_info pkt;
vio->_local_sid = (u32)sched_clock();
memset(&pkt, 0, sizeof(pkt));
init_tag(&pkt.tag, VIO_TYPE_CTRL, VIO_SUBTYPE_INFO, VIO_VER_INFO);
pkt.major = major;
pkt.minor = minor;
pkt.dev_class = vio->dev_cl... | [
1,
0
] |
Linux Kernel | arch/sparc/kernel/viohs.c | static int handshake_failure(struct vio_driver_state *vio) {
struct vio_dring_state *dr;
/* XXX Put policy here... Perhaps start a timer to fire
* XXX in 100 ms, which will bring the link up and retry
* XXX the handshake.
*/
viodbg(HS, "HANDSHAKE FAILURE\n");
vio->dr_state &= ~(VIO_DR_STATE_TXREG |... | [
1,
1
] |
Linux Kernel | arch/sparc/kernel/viohs.c |
static int send_rdx(struct vio_driver_state *vio) {
struct vio_rdx pkt;
memset(&pkt, 0, sizeof(pkt));
init_tag(&pkt.tag, VIO_TYPE_CTRL, VIO_SUBTYPE_INFO, VIO_RDX);
viodbg(HS, "SEND RDX INFO\n");
return send_ctrl(vio, &pkt.tag, sizeof(pkt));
} | [
1,
0
] |
Linux Kernel | arch/sparc/kernel/viohs.c |
static int all_drings_registered(struct vio_driver_state *vio) {
int need_rx, need_tx;
need_rx = (vio->dr_state & VIO_DR_STATE_RXREQ);
need_tx = (vio->dr_state & VIO_DR_STATE_TXREQ);
if (need_rx && !(vio->dr_state & VIO_DR_STATE_RXREG))
return 0;
if (need_tx && !(vio->dr_state & VIO_DR_STATE_TXREG))
... | [
0,
0
] |
Linux Kernel | arch/sparc/kernel/viohs.c |
static int process_dreg_nack(struct vio_driver_state *vio,
struct vio_dring_register *pkt) {
viodbg(HS,
"GOT DRING_REG NACK ident[%llx] "
"ndesc[%u] dsz[%u] opt[0x%x] ncookies[%u]\n",
(unsigned long long)pkt->dring_ident, pkt->num_descr, pkt->descr_size,
... | [
0,
0
] |
Linux Kernel | arch/sparc/kernel/viohs.c |
static int process_dreg(struct vio_driver_state *vio,
struct vio_dring_register *pkt) {
if (!(vio->hs_state & VIO_HS_GOTVERS))
return handshake_failure(vio);
switch (pkt->tag.stype) {
case VIO_SUBTYPE_INFO:
return process_dreg_info(vio, pkt);
case VIO_SUBTYPE_ACK:
return p... | [
0,
0
] |
Linux Kernel | arch/sparc/kernel/viohs.c |
int vio_control_pkt_engine(struct vio_driver_state *vio, void *pkt) {
struct vio_msg_tag *tag = pkt;
u8 prev_state = vio->hs_state;
int err;
switch (tag->stype_env) {
case VIO_VER_INFO:
err = process_ver(vio, pkt);
break;
case VIO_ATTR_INFO:
err = process_attr(vio, pkt);
break;
case VI... | [
1,
0
] |
Linux Kernel | arch/sparc/kernel/viohs.c |
u32 vio_send_sid(struct vio_driver_state *vio) {
switch (vio->dev_class) {
case VDEV_NETWORK:
case VDEV_NETWORK_SWITCH:
case VDEV_DISK:
default:
return vio->_local_sid;
case VDEV_DISK_SERVER:
return vio->_peer_sid;
}
} | [
0,
0
] |
Linux Kernel | arch/sparc/kernel/viohs.c |
int vio_ldc_alloc(struct vio_driver_state *vio,
struct ldc_channel_config *base_cfg, void *event_arg) {
struct ldc_channel_config cfg = *base_cfg;
struct ldc_channel *lp;
cfg.tx_irq = vio->vdev->tx_irq;
cfg.rx_irq = vio->vdev->rx_irq;
lp = ldc_alloc(vio->vdev->channel_id, &cfg, event_arg,... | [
0,
0
] |
Linux Kernel | arch/sparc/kernel/viohs.c |
void vio_ldc_free(struct vio_driver_state *vio) {
ldc_free(vio->lp);
vio->lp = NULL;
kfree(vio->desc_buf);
vio->desc_buf = NULL;
vio->desc_buf_len = 0;
} | [
0,
0
] |
Linux Kernel | arch/sparc/kernel/viohs.c |
int vio_driver_init(struct vio_driver_state *vio, struct vio_dev *vdev,
u8 dev_class, struct vio_version *ver_table,
int ver_table_size, struct vio_driver_ops *ops,
char *name) {
switch (dev_class) {
case VDEV_NETWORK:
case VDEV_NETWORK_SWITCH:
case V... | [
1,
0
] |
Linux Kernel | arch/sparc/kernel/visemul.c |
static void store_reg(struct pt_regs *regs, unsigned long val,
unsigned long rd) {
if (rd < 16) {
unsigned long *rd_kern = __fetch_reg_addr_kern(rd, regs);
*rd_kern = val;
} else {
unsigned long __user *rd_user = __fetch_reg_addr_user(rd, regs);
if (!test_thread_64bit_stack(... | [
1,
0
] |
Linux Kernel | arch/sparc/kernel/visemul.c |
static inline unsigned long *fpd_regaddr(struct fpustate *f,
unsigned int insn_regnum) {
insn_regnum = (((insn_regnum & 1) << 5) | (insn_regnum & 0x1e));
return (unsigned long *)&f->regs[insn_regnum];
} | [
1,
0
] |
Linux Kernel | arch/sparc/kernel/visemul.c |
static void bshuffle(struct pt_regs *regs, unsigned int insn) {
struct fpustate *f = FPUSTATE;
unsigned long rs1, rs2, rd_val;
unsigned long bmask, i;
bmask = current_thread_info()->gsr[0] >> 32UL;
rs1 = fpd_regval(f, RS1(insn));
rs2 = fpd_regval(f, RS2(insn));
rd_val = 0UL;
for (i = 0; i < 8; i++) ... | [
1,
0
] |
Linux Kernel | arch/sparc/lib/atomic32.c |
int arch_atomic_fetch_add_unless(atomic_t *v, int a, int u) {
int ret;
unsigned long flags;
spin_lock_irqsave(ATOMIC_HASH(v), flags);
ret = v->counter;
if (ret != u)
v->counter += a;
spin_unlock_irqrestore(ATOMIC_HASH(v), flags);
return ret;
} | [
0,
0
] |
Linux Kernel | arch/sparc/lib/atomic32.c | void arch_atomic_set(atomic_t *v, int i) {
unsigned long flags;
spin_lock_irqsave(ATOMIC_HASH(v), flags);
v->counter = i;
spin_unlock_irqrestore(ATOMIC_HASH(v), flags);
} | [
0,
0
] |
Linux Kernel | arch/sparc/lib/atomic32.c |
unsigned long sp32___set_bit(unsigned long *addr, unsigned long mask) {
unsigned long old, flags;
spin_lock_irqsave(ATOMIC_HASH(addr), flags);
old = *addr;
*addr = old | mask;
spin_unlock_irqrestore(ATOMIC_HASH(addr), flags);
return old & mask;
} | [
0,
0
] |
Linux Kernel | arch/sparc/lib/atomic32.c |
unsigned long sp32___clear_bit(unsigned long *addr, unsigned long mask) {
unsigned long old, flags;
spin_lock_irqsave(ATOMIC_HASH(addr), flags);
old = *addr;
*addr = old & ~mask;
spin_unlock_irqrestore(ATOMIC_HASH(addr), flags);
return old & mask;
} | [
0,
0
] |
Linux Kernel | arch/sparc/lib/atomic32.c |
unsigned long __cmpxchg_u32(volatile u32 *ptr, u32 old, u32 new) {
unsigned long flags;
u32 prev;
spin_lock_irqsave(ATOMIC_HASH(ptr), flags);
if ((prev = *ptr) == old)
*ptr = new;
spin_unlock_irqrestore(ATOMIC_HASH(ptr), flags);
return (unsigned long)prev;
} | [
0,
0
] |
Linux Kernel | arch/sparc/lib/atomic32.c |
u64 __cmpxchg_u64(u64 *ptr, u64 old, u64 new) {
unsigned long flags;
u64 prev;
spin_lock_irqsave(ATOMIC_HASH(ptr), flags);
if ((prev = *ptr) == old)
*ptr = new;
spin_unlock_irqrestore(ATOMIC_HASH(ptr), flags);
return prev;
} | [
0,
0
] |
Linux Kernel | arch/sparc/lib/atomic32.c |
unsigned long __xchg_u32(volatile u32 *ptr, u32 new) {
unsigned long flags;
u32 prev;
spin_lock_irqsave(ATOMIC_HASH(ptr), flags);
prev = *ptr;
*ptr = new;
spin_unlock_irqrestore(ATOMIC_HASH(ptr), flags);
return (unsigned long)prev;
} | [
0,
0
] |
Linux Kernel | arch/sparc/lib/iomap.c | void pci_iounmap(struct pci_dev *dev, void __iomem *addr) {} | [
0,
0
] |
Linux Kernel | arch/sparc/lib/PeeCeeI.c | void outsl(unsigned long __addr, const void *src, unsigned long count) {
void __iomem *addr = (void __iomem *)__addr;
u32 l, l2;
if (!count)
return;
switch (((unsigned long)src) & 0x3) {
case 0x0:
while (count--) {
__raw_writel(*(u32 *)src, addr);
src += sizeof(u32);
}
break;
... | [
1,
0
] |
Linux Kernel | arch/sparc/mm/fault_32.c |
static void check_stack_aligned(unsigned long sp) {
if (sp & 0x7UL)
force_sig(SIGILL);
} | [
0,
0
] |
Linux Kernel | arch/sparc/mm/fault_32.c |
void window_ret_fault(struct pt_regs *regs) {
unsigned long sp;
sp = regs->u_regs[UREG_FP];
if (((sp + 0x38) & PAGE_MASK) != (sp & PAGE_MASK))
force_user_fault(sp + 0x38, 0);
force_user_fault(sp, 0);
check_stack_aligned(sp);
} | [
0,
0
] |
Linux Kernel | arch/sparc/mm/fault_64.c |
static void noinline __kprobes bogus_32bit_fault_tpc(struct pt_regs *regs) {
static int times;
if (times++ < 10)
printk(KERN_ERR "FAULT[%s:%d]: 32-bit process reports "
"64-bit TPC [%lx]\n",
current->comm, current->pid, regs->tpc);
show_regs(regs);
} | [
1,
0
] |
Linux Kernel | arch/sparc/mm/hugetlbpage.c | static unsigned long hugetlb_get_unmapped_area_bottomup(struct file *filp,
unsigned long addr,
unsigned long len,
unsigned long pgoff,
... | [
1,
0
] |
Linux Kernel | arch/sparc/mm/hugetlbpage.c |
unsigned long hugetlb_get_unmapped_area(struct file *file, unsigned long addr,
unsigned long len, unsigned long pgoff,
unsigned long flags) {
struct hstate *h = hstate_file(file);
struct mm_struct *mm = current->mm;
struct vm_area_st... | [
1,
0
] |
Linux Kernel | arch/sparc/mm/hugetlbpage.c |
static pte_t hugepage_shift_to_tte(pte_t entry, unsigned int shift) {
if (tlb_type == hypervisor)
return sun4v_hugepage_shift_to_tte(entry, shift);
else
return sun4u_hugepage_shift_to_tte(entry, shift);
} | [
0,
0
] |
Linux Kernel | arch/sparc/mm/hugetlbpage.c |
static unsigned int sun4v_huge_tte_to_shift(pte_t entry) {
unsigned long tte_szbits = pte_val(entry) & _PAGE_SZALL_4V;
unsigned int shift;
switch (tte_szbits) {
case _PAGE_SZ16GB_4V:
shift = HPAGE_16GB_SHIFT;
break;
case _PAGE_SZ2GB_4V:
shift = HPAGE_2GB_SHIFT;
break;
case _PAGE_SZ256MB_4V... | [
1,
0
] |
Linux Kernel | arch/sparc/mm/hugetlbpage.c |
static unsigned int sun4u_huge_tte_to_shift(pte_t entry) {
unsigned long tte_szbits = pte_val(entry) & _PAGE_SZALL_4U;
unsigned int shift;
switch (tte_szbits) {
case _PAGE_SZ256MB_4U:
shift = HPAGE_256MB_SHIFT;
break;
case _PAGE_SZ4MB_4U:
shift = REAL_HPAGE_SHIFT;
break;
case _PAGE_SZ64K_4... | [
1,
0
] |
Linux Kernel | arch/sparc/mm/hugetlbpage.c |
static unsigned long huge_tte_to_size(pte_t pte) {
unsigned long size = 1UL << huge_tte_to_shift(pte);
if (size == REAL_HPAGE_SIZE)
size = HPAGE_SIZE;
return size;
} | [
1,
0
] |
Linux Kernel | arch/sparc/mm/hugetlbpage.c |
pte_t *huge_pte_offset(struct mm_struct *mm, unsigned long addr,
unsigned long sz) {
pgd_t *pgd;
p4d_t *p4d;
pud_t *pud;
pmd_t *pmd;
pgd = pgd_offset(mm, addr);
if (pgd_none(*pgd))
return NULL;
p4d = p4d_offset(pgd, addr);
if (p4d_none(*p4d))
return NULL;
pud = pud_off... | [
0,
0
] |
Linux Kernel | arch/sparc/mm/hugetlbpage.c | void set_huge_pte_at(struct mm_struct *mm, unsigned long addr, pte_t *ptep,
pte_t entry) {
unsigned int nptes, orig_shift, shift;
unsigned long i, size;
pte_t orig;
size = huge_tte_to_size(entry);
shift = PAGE_SHIFT;
if (size >= PUD_SIZE)
shift = PUD_SHIFT;
else if (size >= PMD_... | [
0,
0
] |
Linux Kernel | arch/sparc/mm/hugetlbpage.c |
static void hugetlb_free_pmd_range(struct mmu_gather *tlb, pud_t *pud,
unsigned long addr, unsigned long end,
unsigned long floor, unsigned long ceiling) {
pmd_t *pmd;
unsigned long next;
unsigned long start;
start = addr;
pmd = pmd_offse... | [
1,
0
] |
Linux Kernel | arch/sparc/mm/hugetlbpage.c |
void hugetlb_free_pgd_range(struct mmu_gather *tlb, unsigned long addr,
unsigned long end, unsigned long floor,
unsigned long ceiling) {
pgd_t *pgd;
p4d_t *p4d;
unsigned long next;
addr &= PMD_MASK;
if (addr < floor) {
addr += PMD_SIZE;
if (!ad... | [
1,
0
] |
Linux Kernel | arch/sparc/mm/init_32.c |
static void map_high_region(unsigned long start_pfn, unsigned long end_pfn) {
unsigned long tmp;
#ifdef CONFIG_DEBUG_HIGHMEM
printk("mapping high region %08lx - %08lx\n", start_pfn, end_pfn);
#endif
for (tmp = start_pfn; tmp < end_pfn; tmp++)
free_highmem_page(pfn_to_page(tmp));
} | [
1,
0
] |
Linux Kernel | arch/sparc/mm/init_64.c |
static int cmp_p64(const void *a, const void *b) {
const struct linux_prom64_registers *x = a, *y = b;
if (x->phys_addr > y->phys_addr)
return 1;
if (x->phys_addr < y->phys_addr)
return -1;
return 0;
} | [
0,
0
] |
Linux Kernel | arch/sparc/mm/init_64.c | static void __init read_obp_memory(const char *property,
struct linux_prom64_registers *regs,
int *num_ents) {
phandle node = prom_finddevice("/memory");
int prop_size = prom_getproplen(node, property);
int ents, ret, i;
ents = prop_size / s... | [
1,
0
] |
Linux Kernel | arch/sparc/mm/init_64.c |
inline void flush_dcache_page_impl(struct page *page) {
BUG_ON(tlb_type == hypervisor);
#ifdef CONFIG_DEBUG_DCFLUSH
atomic_inc(&dcpage_flushes);
#endif
#ifdef DCACHE_ALIASING_POSSIBLE
__flush_dcache_page(page_address(page), ((tlb_type == spitfire) &&
page_mapping_file(... | [
1,
0
] |
Linux Kernel | arch/sparc/mm/init_64.c | static inline void set_dcache_dirty(struct page *page, int this_cpu) {
unsigned long mask = this_cpu;
unsigned long non_cpu_bits;
non_cpu_bits = ~(PG_dcache_cpu_mask << PG_dcache_cpu_shift);
mask = (mask << PG_dcache_cpu_shift) | (1UL << PG_dcache_dirty);
__asm__ __volatile__("1:\n\t"
... | [
1,
0
] |
Linux Kernel | arch/sparc/mm/init_64.c | void flush_dcache_page(struct page *page) {
struct address_space *mapping;
int this_cpu;
if (tlb_type == hypervisor)
return;
if (page == ZERO_PAGE(0))
return;
this_cpu = get_cpu();
mapping = page_mapping_file(page);
if (mapping && !mapping_mapped(mapping)) {
int dirty = test_bit(PG_dcache_... | [
0,
0
] |
Linux Kernel | arch/sparc/mm/init_64.c | void __kprobes flush_icache_range(unsigned long start, unsigned long end) {
if (tlb_type == spitfire) {
unsigned long kaddr;
/* This code only runs on Spitfire cpus so this is
* why we can assume _PAGE_PADDR_4U.
*/
for (kaddr = start; kaddr < end; kaddr += PAGE_SIZE) {
unsigned long padd... | [
1,
0
] |
Linux Kernel | arch/sparc/mm/init_64.c |
static void __init hypervisor_tlb_lock(unsigned long vaddr, unsigned long pte,
unsigned long mmu) {
unsigned long ret = sun4v_mmu_map_perm_addr(vaddr, 0, pte, mmu);
if (ret != 0) {
prom_printf("hypervisor_tlb_lock[%lx:%x:%lx:%lx]: "
"errors with %lx\n",
... | [
1,
0
] |
Linux Kernel | arch/sparc/mm/init_64.c |
static u64 __init memblock_nid_range_sun4u(u64 start, u64 end, int *nid) {
int prev_nid, new_nid;
prev_nid = NUMA_NO_NODE;
for (; start < end; start += PAGE_SIZE) {
for (new_nid = 0; new_nid < num_node_masks; new_nid++) {
struct node_mem_mask *p = &node_masks[new_nid];
if ((start & p->mask) == ... | [
0,
0
] |
Linux Kernel | arch/sparc/mm/init_64.c |
static int scan_arcs_for_cfg_handle(struct mdesc_handle *md, u64 grp,
u32 cfg_handle) {
u64 arc, candidate, best_latency = ~(u64)0;
candidate = MDESC_NODE_NULL;
mdesc_for_each_arc(arc, md, grp, MDESC_ARC_TYPE_FWD) {
u64 target = mdesc_arc_target(md, arc);
const char *... | [
0,
0
] |
Linux Kernel | arch/sparc/mm/init_64.c |
static struct mdesc_mlgroup *__init find_mlgroup(u64 node) {
int i;
for (i = 0; i < num_mlgroups; i++) {
struct mdesc_mlgroup *m = &mlgroups[i];
if (m->node == node)
return m;
}
return NULL;
} | [
0,
0
] |
Linux Kernel | arch/sparc/mm/init_64.c |
int __node_distance(int from, int to) {
if ((from >= MAX_NUMNODES) || (to >= MAX_NUMNODES)) {
pr_warn("Returning default NUMA distance value for %d->%d\n", from, to);
return (from == to) ? LOCAL_DISTANCE : REMOTE_DISTANCE;
}
return numa_latency[from][to];
} | [
0,
0
] |
Linux Kernel | arch/sparc/mm/init_64.c |
static int bootmem_init_numa(void) { return -1; }
#endif | [
0,
0
] |
Linux Kernel | arch/sparc/mm/init_64.c |
static void __init bootmem_init_nonnuma(void) {
unsigned long top_of_ram = memblock_end_of_DRAM();
unsigned long total_ram = memblock_phys_mem_size();
numadbg("bootmem_init_nonnuma()\n");
printk(KERN_INFO "Top of RAM: 0x%lx, Total RAM: 0x%lx\n", top_of_ram,
total_ram);
printk(KERN_INFO "Memory hol... | [
1,
0
] |
Linux Kernel | arch/sparc/mm/init_64.c |
static void __init flush_all_kernel_tsbs(void) {
int i;
for (i = 0; i < KERNEL_TSB_NENTRIES; i++) {
struct tsb *ent = &swapper_tsb[i];
ent->tag = (1UL << TSB_TAG_INVALID_BIT);
}
#ifndef CONFIG_DEBUG_PAGEALLOC
for (i = 0; i < KERNEL_TSB4M_NENTRIES; i++) {
struct tsb *ent = &swapper_4m_tsb[i];
... | [
0,
0
] |
Linux Kernel | arch/sparc/mm/init_64.c | int __meminit vmemmap_populate(unsigned long vstart, unsigned long vend,
int node, struct vmem_altmap *altmap) {
unsigned long pte_base;
pte_base = (_PAGE_VALID | _PAGE_SZ4MB_4U | _PAGE_CP_4U | _PAGE_CV_4U |
_PAGE_P_4U | _PAGE_W_4U);
if (tlb_type == hypervisor)
pt... | [
0,
0
] |
Linux Kernel | arch/sparc/mm/init_64.c |
static unsigned long kern_large_tte(unsigned long paddr) {
unsigned long val;
val = (_PAGE_VALID | _PAGE_SZ4MB_4U | _PAGE_CP_4U | _PAGE_CV_4U | _PAGE_P_4U |
_PAGE_EXEC_4U | _PAGE_L_4U | _PAGE_W_4U);
if (tlb_type == hypervisor)
val = (_PAGE_VALID | _PAGE_SZ4MB_4V | page_cache4v_flag | _PAGE_P_4V |
... | [
0,
0
] |
Linux Kernel | arch/sparc/mm/init_64.c |
void pte_free_kernel(struct mm_struct *mm, pte_t *pte) {
free_page((unsigned long)pte);
} | [
0,
0
] |
Linux Kernel | arch/sparc/mm/init_64.c |
static void __pte_free(pgtable_t pte) {
struct page *page = virt_to_page(pte);
pgtable_pte_page_dtor(page);
__free_page(page);
} | [
0,
0
] |
Linux Kernel | arch/sparc/mm/init_64.c |
static inline resource_size_t compute_kern_paddr(void *addr) {
return (resource_size_t)(addr - KERNBASE + kern_base);
} | [
0,
0
] |
Linux Kernel | arch/sparc/mm/init_64.c |
static void __init kernel_lds_init(void) {
code_resource.start = compute_kern_paddr(_text);
code_resource.end = compute_kern_paddr(_etext - 1);
data_resource.start = compute_kern_paddr(_etext);
data_resource.end = compute_kern_paddr(_edata - 1);
bss_resource.start = compute_kern_paddr(__bss_start);
bss_res... | [
0,
0
] |
Linux Kernel | arch/sparc/mm/init_64.c |
pgprot_t vm_get_page_prot(unsigned long vm_flags) {
unsigned long prot = pgprot_val(
protection_map[vm_flags & (VM_READ | VM_WRITE | VM_EXEC | VM_SHARED)]);
if (vm_flags & VM_SPARC_ADI)
prot |= _PAGE_MCD_4V;
return __pgprot(prot);
} | [
1,
0
] |
Linux Kernel | arch/sparc/mm/io-unit.c |
static int __init iounit_init(void) {
extern void sun4d_init_sbi_irq(void);
struct device_node *dp;
for_each_node_by_name(dp, "sbi") {
struct platform_device *op = of_find_device_by_node(dp);
iounit_iommu_init(op);
of_propagate_archdata(op);
}
sun4d_init_sbi_irq();
return 0;
} | [
0,
0
] |
Linux Kernel | arch/sparc/mm/io-unit.c | static dma_addr_t iounit_map_page(struct device *dev, struct page *page,
unsigned long offset, size_t len,
enum dma_data_direction dir,
unsigned long attrs) {
void *vaddr = page_address(page) + offset;
struct iouni... | [
1,
1
] |
Linux Kernel | arch/sparc/mm/io-unit.c |
static void iounit_unmap_sg(struct device *dev, struct scatterlist *sgl,
int nents, enum dma_data_direction dir,
unsigned long attrs) {
struct iounit_struct *iounit = dev->archdata.iommu;
unsigned long flags, vaddr, len;
struct scatterlist *sg;
int i;
... | [
1,
0
] |
Linux Kernel | arch/sparc/mm/io-unit.c | static void *iounit_alloc(struct device *dev, size_t len,
dma_addr_t *dma_handle, gfp_t gfp,
unsigned long attrs) {
struct iounit_struct *iounit = dev->archdata.iommu;
unsigned long va, addr, page, end, ret;
pgprot_t dvma_prot;
iopte_t __iomem *iopte;
/* XX... | [
1,
1
] |
Linux Kernel | arch/sparc/mm/iommu.c |
static dma_addr_t sbus_iommu_map_page_gflush(struct device *dev,
struct page *page,
unsigned long offset, size_t len,
enum dma_data_direction dir,
... | [
0,
0
] |
Linux Kernel | arch/sparc/mm/iommu.c |
static int sbus_iommu_map_sg_pflush(struct device *dev, struct scatterlist *sgl,
int nents, enum dma_data_direction dir,
unsigned long attrs) {
return __sbus_iommu_map_sg(dev, sgl, nents, dir, attrs, true);
} | [
0,
0
] |
Linux Kernel | arch/sparc/mm/leon_mm.c | void leon_flush_icache_all(void) { __asm__ __volatile__(" flush "); } | [
0,
0
] |
Linux Kernel | arch/sparc/mm/leon_mm.c |
void leon_flush_pcache_all(struct vm_area_struct *vma, unsigned long page) {
if (vma->vm_flags & VM_EXEC)
leon_flush_icache_all();
leon_flush_dcache_all();
} | [
0,
0
] |
Linux Kernel | arch/sparc/mm/leon_mm.c | void leon3_getCacheRegs(struct leon3_cacheregs *regs) {
unsigned long ccr, iccr, dccr;
if (!regs)
return;
__asm__ __volatile__("lda [%%g0] %3, %0\n\t"
"mov 0x08, %%g1\n\t"
"lda [%%g1] %3, %1\n\t"
"mov 0x0c, %%g1\n\t"
... | [
0,
0
] |
Linux Kernel | arch/sparc/mm/leon_mm.c |
void leon_switch_mm(void) {
flush_tlb_mm((void *)0);
if (leon_flush_during_switch)
leon_flush_cache_all();
} | [
0,
0
] |
Linux Kernel | arch/sparc/mm/leon_mm.c |
static void leon_flush_tlb_page(struct vm_area_struct *vma,
unsigned long page) {
leon_flush_tlb_all();
} | [
0,
0
] |
Linux Kernel | arch/sparc/mm/leon_mm.c |
static void leon_flush_sig_insns(struct mm_struct *mm, unsigned long page) {
leon_flush_cache_all();
} | [
0,
0
] |
Linux Kernel | arch/sparc/mm/leon_mm.c |
static void leon_flush_page_for_dma(unsigned long page) {
leon_flush_dcache_all();
} | [
0,
0
] |
Linux Kernel | arch/sparc/mm/leon_mm.c |
void __init init_leon(void) {
srmmu_name = "LEON";
sparc32_cachetlb_ops = &leon_ops;
poke_srmmu = poke_leonsparc;
leon_flush_during_switch = leon_flush_needed();
} | [
0,
0
] |
Linux Kernel | arch/sparc/mm/srmmu.c | static unsigned long __init probe_memory(void) {
unsigned long total = 0;
int i;
for (i = 0; sp_banks[i].num_bytes; i++)
total += sp_banks[i].num_bytes;
return total;
} | [
1,
0
] |
Linux Kernel | arch/sparc/mm/srmmu.c |
static inline void add_to_ctx_list(struct ctx_list *head,
struct ctx_list *entry) {
entry->next = head;
(entry->prev = head->prev)->next = entry;
head->prev = entry;
}
#define add_to_free_ctxlist(entry) add_to_ctx_list(&ctx_free, entry)
#define add_to_used_ctxlist(entry) add_to... | [
0,
0
] |
Linux Kernel | arch/sparc/mm/srmmu.c |
void switch_mm(struct mm_struct *old_mm, struct mm_struct *mm,
struct task_struct *tsk) {
unsigned long flags;
if (mm->context == NO_CONTEXT) {
spin_lock_irqsave(&srmmu_context_spinlock, flags);
alloc_context(old_mm, mm);
spin_unlock_irqrestore(&srmmu_context_spinlock, flags);
srmmu... | [
0,
0
] |
Linux Kernel | arch/sparc/mm/srmmu.c | static inline void srmmu_mapioaddr(unsigned long physaddr,
unsigned long virt_addr, int bus_type) {
pgd_t *pgdp;
p4d_t *p4dp;
pud_t *pudp;
pmd_t *pmdp;
pte_t *ptep;
unsigned long tmp;
physaddr &= PAGE_MASK;
pgdp = pgd_offset_k(virt_addr);
p4dp = p4d_offset(pgdp, vir... | [
0,
0
] |
Linux Kernel | arch/sparc/mm/srmmu.c | static void __init init_vac_layout(void) {
phandle nd;
int cache_lines;
char node_str[128];
#ifdef CONFIG_SMP
int cpu = 0;
unsigned long max_size = 0;
unsigned long min_line_size = 0x10000000;
#endif
nd = prom_getchild(prom_root_node);
while ((nd = prom_getsibling(nd)) != 0) {
prom_getstring(nd, "d... | [
1,
1
] |
Linux Kernel | arch/sparc/mm/srmmu.c | static void poke_hypersparc(void) {
volatile unsigned long clear;
unsigned long mreg = srmmu_get_mmureg();
hyper_flush_unconditional_combined();
mreg &= ~(HYPERSPARC_CWENABLE);
mreg |= (HYPERSPARC_CENABLE | HYPERSPARC_WBENABLE);
mreg |= (HYPERSPARC_CMODE);
srmmu_set_mmureg(mreg);
#if 0 /* XXX I think ... | [
1,
1
] |
Linux Kernel | arch/sparc/mm/srmmu.c |
static void __init init_hypersparc(void) {
srmmu_name = "ROSS HyperSparc";
srmmu_modtype = HyperSparc;
init_vac_layout();
is_hypersparc = 1;
sparc32_cachetlb_ops = &hypersparc_ops;
poke_srmmu = poke_hypersparc;
hypersparc_setup_blockops();
} | [
0,
0
] |
Linux Kernel | arch/sparc/mm/srmmu.c |
static void turbosparc_flush_cache_range(struct vm_area_struct *vma,
unsigned long start,
unsigned long end) {
FLUSH_BEGIN(vma->vm_mm)
flush_user_windows();
turbosparc_idflash_clear();
FLUSH_END
} | [
0,
0
] |
Linux Kernel | arch/sparc/mm/srmmu.c |
static void turbosparc_flush_cache_page(struct vm_area_struct *vma,
unsigned long page) {
FLUSH_BEGIN(vma->vm_mm)
flush_user_windows();
if (vma->vm_flags & VM_EXEC)
turbosparc_flush_icache();
turbosparc_flush_dcache();
FLUSH_END
} | [
0,
0
] |
Linux Kernel | arch/sparc/mm/srmmu.c | static void turbosparc_flush_page_to_ram(unsigned long page) {
#ifdef TURBOSPARC_WRITEBACK
volatile unsigned long clear;
if (srmmu_probe(page))
turbosparc_flush_page_cache(page);
clear = srmmu_get_fstatus();
#endif
} | [
0,
0
] |
Linux Kernel | arch/sparc/mm/srmmu.c |
static void turbosparc_flush_tlb_page(struct vm_area_struct *vma,
unsigned long page) {
FLUSH_BEGIN(vma->vm_mm)
srmmu_flush_whole_tlb();
FLUSH_END
} | [
0,
0
] |
Linux Kernel | arch/sparc/mm/srmmu.c |
static void poke_tsunami(void) {
unsigned long mreg = srmmu_get_mmureg();
tsunami_flush_icache();
tsunami_flush_dcache();
mreg &= ~TSUNAMI_ITD;
mreg |= (TSUNAMI_IENAB | TSUNAMI_DENAB);
srmmu_set_mmureg(mreg);
} | [
1,
0
] |
Linux Kernel | arch/sparc/mm/srmmu.c | static void poke_viking(void) {
unsigned long mreg = srmmu_get_mmureg();
static int smp_catch;
if (viking_mxcc_present) {
unsigned long mxcc_control = mxcc_get_creg();
mxcc_control |= (MXCC_CTL_ECE | MXCC_CTL_PRE | MXCC_CTL_MCE);
mxcc_control &= ~(MXCC_CTL_RRC);
mxcc_set_creg(mxcc_control);
... | [
1,
1
] |
Linux Kernel | arch/sparc/mm/srmmu.c |
static void smp_flush_cache_all(void) {
xc0(local_ops->cache_all);
local_ops->cache_all();
} | [
0,
0
] |
Linux Kernel | arch/sparc/mm/srmmu.c |
static void smp_flush_cache_range(struct vm_area_struct *vma,
unsigned long start, unsigned long end) {
struct mm_struct *mm = vma->vm_mm;
if (mm->context != NO_CONTEXT) {
cpumask_t cpu_mask;
cpumask_copy(&cpu_mask, mm_cpumask(mm));
cpumask_clear_cpu(smp_processor_id(... | [
0,
0
] |
Linux Kernel | arch/sparc/mm/tlb.c |
void arch_leave_lazy_mmu_mode(void) {
struct tlb_batch *tb = this_cpu_ptr(&tlb_batch);
if (tb->tlb_nr)
flush_tlb_pending();
tb->active = 0;
} | [
0,
0
] |
Linux Kernel | arch/sparc/mm/tlb.c | void tlb_batch_add(struct mm_struct *mm, unsigned long vaddr, pte_t *ptep,
pte_t orig, int fullmm, unsigned int hugepage_shift) {
if (tlb_type != hypervisor && pte_dirty(orig)) {
unsigned long paddr, pfn = pte_pfn(orig);
struct address_space *mapping;
struct page *page;
if (!pfn_va... | [
1,
0
] |
Linux Kernel | arch/sparc/mm/tlb.c | static void tlb_batch_pmd_scan(struct mm_struct *mm, unsigned long vaddr,
pmd_t pmd) {
unsigned long end;
pte_t *pte;
pte = pte_offset_map(&pmd, vaddr);
end = vaddr + HPAGE_SIZE;
while (vaddr < end) {
if (pte_val(*pte) & _PAGE_VALID) {
bool exec = pte_exec(*pte);
... | [
0,
0
] |
Linux Kernel | arch/sparc/mm/tlb.c | static void __set_pmd_acct(struct mm_struct *mm, unsigned long addr, pmd_t orig,
pmd_t pmd) {
if (mm == &init_mm)
return;
if ((pmd_val(pmd) ^ pmd_val(orig)) & _PAGE_PMD_HUGE) {
if (pmd_val(pmd) & _PAGE_PMD_HUGE) {
if (is_huge_zero_page(pmd_page(pmd)))
mm->context.h... | [
0,
0
] |
Linux Kernel | arch/sparc/mm/tlb.c |
void set_pmd_at(struct mm_struct *mm, unsigned long addr, pmd_t *pmdp,
pmd_t pmd) {
pmd_t orig = *pmdp;
*pmdp = pmd;
__set_pmd_acct(mm, addr, orig, pmd);
} | [
0,
0
] |
Linux Kernel | arch/sparc/mm/tlb.c | pmd_t pmdp_invalidate(struct vm_area_struct *vma, unsigned long address,
pmd_t *pmdp) {
pmd_t old, entry;
entry = __pmd(pmd_val(*pmdp) & ~_PAGE_VALID);
old = pmdp_establish(vma, address, pmdp, entry);
flush_tlb_range(vma, address, address + HPAGE_PMD_SIZE);
if ((pmd_val(entry) & _PAGE_... | [
1,
0
] |
Linux Kernel | arch/sparc/mm/tsb.c |
static void __flush_tsb_one(struct tlb_batch *tb, unsigned long hash_shift,
unsigned long tsb, unsigned long nentries) {
unsigned long i;
for (i = 0; i < tb->tlb_nr; i++)
__flush_tsb_one_entry(tsb, tb->vaddrs[i], hash_shift, nentries);
} | [
0,
0
] |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.