Projectname
large_stringclasses
15 values
Filepath
large_stringlengths
4
106
⌀
Function
large_stringlengths
11
3.45k
Label
list
Linux Kernel
arch/sh/math-emu/math.c
static int id_fnmx(struct sh_fpu_soft_struct *fregs, struct pt_regs *regs, u16 code) { int n = (code >> 8) & 0xf, m = (code >> 4) & 0xf, x = code & 0xf; return (fnmx[x])(fregs, regs, m, n); }
[ 1, 0 ]
Linux Kernel
arch/sh/math-emu/math.c
static int fpu_emulate(u16 code, struct sh_fpu_soft_struct *fregs, struct pt_regs *regs) { if ((code & 0xf000) == 0xf000) return id_fnmx(fregs, regs, code); else return id_sys(fregs, regs, code); }
[ 0, 0 ]
Linux Kernel
arch/sh/math-emu/math.c
int do_fpu_inst(unsigned short inst, struct pt_regs *regs) { struct task_struct *tsk = current; struct sh_fpu_soft_struct *fpu = &(tsk->thread.xstate->softfpu); perf_sw_event(PERF_COUNT_SW_EMULATION_FAULTS, 1, regs, 0); if (!(task_thread_info(tsk)->status & TS_USEDFPU)) { fpu_init(fpu); task_thread_i...
[ 0, 0 ]
Linux Kernel
arch/sh/mm/alignment.c
void inc_unaligned_byte_access(void) { se_half++; }
[ 0, 0 ]
Linux Kernel
arch/sh/mm/alignment.c
void inc_unaligned_word_access(void) { se_word++; }
[ 0, 0 ]
Linux Kernel
arch/sh/mm/alignment.c
void inc_unaligned_dword_access(void) { se_dword++; }
[ 0, 0 ]
Linux Kernel
arch/sh/mm/alignment.c
int get_unalign_ctl(struct task_struct *tsk, unsigned long addr) { return put_user(tsk->thread.flags & SH_THREAD_UAC_MASK, (unsigned int __user *)addr); }
[ 0, 0 ]
Linux Kernel
arch/sh/mm/alignment.c
void unaligned_fixups_notify(struct task_struct *tsk, insn_size_t insn, struct pt_regs *regs) { if (user_mode(regs) && (se_usermode & UM_WARN)) pr_notice_ratelimited("Fixing up unaligned userspace access " "in \"%s\" pid=%d pc=0x%p ins=0x%04hx\n", ...
[ 0, 0 ]
Linux Kernel
arch/sh/mm/asids-debugfs.c
static int __init asids_debugfs_init(void) { debugfs_create_file("asids", S_IRUSR, arch_debugfs_dir, NULL, &asids_debugfs_fops); return 0; }
[ 0, 0 ]
Linux Kernel
arch/sh/mm/cache-j2.c
static void j2_flush_dcache(void *args) { unsigned cpu; for_each_possible_cpu(cpu) __raw_writel(CACHE_ENABLE | DCACHE_FLUSH, j2_ccr_base + cpu); }
[ 0, 0 ]
Linux Kernel
arch/sh/mm/cache-sh2.c
static void sh2__flush_purge_region(void *start, int size) { unsigned long v; unsigned long begin, end; begin = (unsigned long)start & ~(L1_CACHE_BYTES - 1); end = ((unsigned long)start + size + L1_CACHE_BYTES - 1) & ~(L1_CACHE_BYTES - 1); for (v = begin; v < end; v += L1_CACHE_BYTES) __raw_wri...
[ 0, 0 ]
Linux Kernel
arch/sh/mm/cache-sh2a.c
static void sh2a__flush_invalidate_region(void *start, int size) { unsigned long v; unsigned long begin, end; unsigned long flags; begin = (unsigned long)start & ~(L1_CACHE_BYTES - 1); end = ((unsigned long)start + size + L1_CACHE_BYTES - 1) & ~(L1_CACHE_BYTES - 1); local_irq_save(flags); jump_t...
[ 1, 0 ]
Linux Kernel
arch/sh/mm/cache-sh2a.c
void __init sh2a_cache_init(void) { local_flush_icache_range = sh2a_flush_icache_range; __flush_wback_region = sh2a__flush_wback_region; __flush_purge_region = sh2a__flush_purge_region; __flush_invalidate_region = sh2a__flush_invalidate_region; }
[ 0, 0 ]
Linux Kernel
arch/sh/mm/cache-sh4.c
static void sh4_flush_dcache_page(void *arg) { struct page *page = arg; unsigned long addr = (unsigned long)page_address(page); #ifndef CONFIG_SMP struct address_space *mapping = page_mapping_file(page); if (mapping && !mapping_mapped(mapping)) clear_bit(PG_dcache_clean, &page->flags); else #endif fl...
[ 0, 0 ]
Linux Kernel
arch/sh/mm/cache-sh4.c
static void flush_icache_all(void) { unsigned long flags, ccr; local_irq_save(flags); jump_to_uncached(); ccr = __raw_readl(SH_CCR); ccr |= CCR_CACHE_ICI; __raw_writel(ccr, SH_CCR); /* * back_to_cached() will take care of the barrier for us, don't add * another one! */ back_to_cached(); l...
[ 0, 1 ]
Linux Kernel
arch/sh/mm/cache-sh4.c
static void sh4_flush_cache_page(void *args) { struct flusher_data *data = args; struct vm_area_struct *vma; struct page *page; unsigned long address, pfn, phys; int map_coherent = 0; pmd_t *pmd; pte_t *pte; void *vaddr; vma = data->vma; address = data->addr1 & PAGE_MASK; pfn = data->addr2; phy...
[ 0, 0 ]
Linux Kernel
arch/sh/mm/cache-sh4.c
static void __flush_cache_one(unsigned long addr, unsigned long phys, unsigned long exec_offset) { int way_count; unsigned long base_addr = addr; struct cache_info *dcache; unsigned long way_incr; unsigned long a, ea, p; unsigned long temp_pc; dcache = &boot_cpu_data.dcache;...
[ 1, 1 ]
Linux Kernel
arch/sh/mm/cache-sh7705.c
static inline void cache_wback_all(void) { unsigned long ways, waysize, addrstart; ways = current_cpu_data.dcache.ways; waysize = current_cpu_data.dcache.sets; waysize <<= current_cpu_data.dcache.entry_shift; addrstart = CACHE_OC_ADDRESS_ARRAY; do { unsigned long addr; for (addr = addrstart; add...
[ 1, 0 ]
Linux Kernel
arch/sh/mm/cache.c
void copy_to_user_page(struct vm_area_struct *vma, struct page *page, unsigned long vaddr, void *dst, const void *src, unsigned long len) { if (boot_cpu_data.dcache.n_aliases && page_mapcount(page) && test_bit(PG_dcache_clean, &page->flags)) { void *vto = kmap_...
[ 1, 0 ]
Linux Kernel
arch/sh/mm/cache.c
void clear_user_highpage(struct page *page, unsigned long vaddr) { void *kaddr = kmap_atomic(page); clear_page(kaddr); if (pages_do_alias((unsigned long)kaddr, vaddr & PAGE_MASK)) __flush_purge_region(kaddr, PAGE_SIZE); kunmap_atomic(kaddr); }
[ 0, 0 ]
Linux Kernel
arch/sh/mm/cache.c
void flush_cache_range(struct vm_area_struct *vma, unsigned long start, unsigned long end) { struct flusher_data data; data.vma = vma; data.addr1 = start; data.addr2 = end; cacheop_on_each_cpu(local_flush_cache_range, (void *)&data, 1); }
[ 0, 0 ]
Linux Kernel
arch/sh/mm/cache.c
void flush_icache_page(struct vm_area_struct *vma, struct page *page) { cacheop_on_each_cpu(local_flush_icache_page, page, 1); }
[ 0, 0 ]
Linux Kernel
arch/sh/mm/cache.c
static void __init emit_cache_params(void) { printk(KERN_NOTICE "I-cache : n_ways=%d n_sets=%d way_incr=%d\n", boot_cpu_data.icache.ways, boot_cpu_data.icache.sets, boot_cpu_data.icache.way_incr); printk(KERN_NOTICE "I-cache : entry_mask=0x%08x alias_mask=0x%08x n_aliases=%d\n", ...
[ 1, 0 ]
Linux Kernel
arch/sh/mm/cache.c
void __init cpu_cache_init(void) { unsigned int cache_disabled = 0; #ifdef SH_CCR cache_disabled = !(__raw_readl(SH_CCR) & CCR_CACHE_ENABLE); #endif compute_alias(&boot_cpu_data.icache); compute_alias(&boot_cpu_data.dcache); compute_alias(&boot_cpu_data.scache); __flush_wback_region = noop__flush_region;...
[ 1, 0 ]
Linux Kernel
arch/sh/mm/consistent.c
static void __init memchunk_cmdline_override(char *name, unsigned long *sizep) { char *p = boot_command_line; int k = strlen(name); while ((p = strstr(p, "memchunk."))) { p += 9; if (!strncmp(name, p, k) && p[k] == '=') { p += k + 1; *sizep = memparse(p, NULL); pr_info("%s: forcing memo...
[ 0, 0 ]
Linux Kernel
arch/sh/mm/fault.c
static noinline void no_context(struct pt_regs *regs, unsigned long error_code, unsigned long address) { if (fixup_exception(regs)) return; if (handle_trapped_io(regs, address)) return; /* * Oops. The kernel tried to access some bad page. We'll have to * terminate ...
[ 0, 0 ]
Linux Kernel
arch/sh/mm/fault.c
static noinline void bad_area_nosemaphore(struct pt_regs *regs, unsigned long error_code, unsigned long address) { __bad_area_nosemaphore(regs, error_code, address, SEGV_MAPERR); }
[ 0, 0 ]
Linux Kernel
arch/sh/mm/flush-sh4.c
static void sh4__flush_purge_region(void *start, int size) { reg_size_t aligned_start, v, cnt, end; aligned_start = register_align(start); v = aligned_start & ~(L1_CACHE_BYTES - 1); end = (aligned_start + size + L1_CACHE_BYTES - 1) & ~(L1_CACHE_BYTES - 1); cnt = (end - v) / L1_CACHE_BYTES; while (cnt >= 8...
[ 0, 0 ]
Linux Kernel
arch/sh/mm/flush-sh4.c
static void sh4__flush_invalidate_region(void *start, int size) { reg_size_t aligned_start, v, cnt, end; aligned_start = register_align(start); v = aligned_start & ~(L1_CACHE_BYTES - 1); end = (aligned_start + size + L1_CACHE_BYTES - 1) & ~(L1_CACHE_BYTES - 1); cnt = (end - v) / L1_CACHE_BYTES; while (cnt...
[ 0, 0 ]
Linux Kernel
arch/sh/mm/flush-sh4.c
void __init sh4__flush_region_init(void) { __flush_wback_region = sh4__flush_wback_region; __flush_invalidate_region = sh4__flush_invalidate_region; __flush_purge_region = sh4__flush_purge_region; }
[ 0, 0 ]
Linux Kernel
arch/sh/mm/init.c
void __init generic_mem_init(void) { memblock_add(__MEMORY_START, __MEMORY_SIZE); }
[ 0, 0 ]
Linux Kernel
arch/sh/mm/init.c
static void clear_pte_phys(unsigned long addr, pgprot_t prot) { pte_t *pte; pte = __get_pte_phys(addr); if (pgprot_val(prot) & _PAGE_WIRED) tlb_unwire_entry(); set_pte(pte, pfn_pte(0, __pgprot(0))); local_flush_tlb_one(get_asid(), addr); }
[ 0, 0 ]
Linux Kernel
arch/sh/mm/init.c
void __set_fixmap(enum fixed_addresses idx, unsigned long phys, pgprot_t prot) { unsigned long address = __fix_to_virt(idx); if (idx >= __end_of_fixed_addresses) { BUG(); return; } set_pte_phys(address, phys, prot); }
[ 1, 0 ]
Linux Kernel
arch/sh/mm/init.c
void __clear_fixmap(enum fixed_addresses idx, pgprot_t prot) { unsigned long address = __fix_to_virt(idx); if (idx >= __end_of_fixed_addresses) { BUG(); return; } clear_pte_phys(address, prot); }
[ 1, 0 ]
Linux Kernel
arch/sh/mm/init.c
void __init paging_init(void) { unsigned long max_zone_pfns[MAX_NR_ZONES]; unsigned long vaddr, end; sh_mv.mv_mem_init(); early_reserve_mem(); if (sh_mv.mv_mem_reserve) sh_mv.mv_mem_reserve(); memblock_enforce_memory_limit(memory_limit); memblock_allow_resize(); memblock_dump_all(); /* * ...
[ 1, 0 ]
Linux Kernel
arch/sh/mm/init.c
int arch_add_memory(int nid, u64 start, u64 size, struct mhp_params *params) { unsigned long start_pfn = PFN_DOWN(start); unsigned long nr_pages = size >> PAGE_SHIFT; int ret; if (WARN_ON_ONCE(params->pgprot.pgprot != PAGE_KERNEL.pgprot)) return -EINVAL; ret = __add_pages(nid, start_pfn, nr_pages, param...
[ 1, 0 ]
Linux Kernel
arch/sh/mm/init.c
void arch_remove_memory(u64 start, u64 size, struct vmem_altmap *altmap) { unsigned long start_pfn = PFN_DOWN(start); unsigned long nr_pages = size >> PAGE_SHIFT; __remove_pages(start_pfn, nr_pages, altmap); } #endif
[ 1, 0 ]
Linux Kernel
arch/sh/mm/ioremap.c
static inline int iomapping_nontranslatable(unsigned long offset) { #ifdef CONFIG_29BIT if (PXSEG(offset) < P3SEG || offset >= P3_ADDR_MAX) return 1; #endif return 0; }
[ 1, 0 ]
Linux Kernel
arch/sh/mm/ioremap.h
static inline void __iomem *ioremap_fixed(phys_addr_t phys_addr, unsigned long size, pgprot_t prot) { BUG(); return NULL; }
[ 0, 0 ]
Linux Kernel
arch/sh/mm/kmap.c
void kunmap_coherent(void *kvaddr) { if (kvaddr >= (void *)FIXADDR_START) { unsigned long vaddr = (unsigned long)kvaddr & PAGE_MASK; enum fixed_addresses idx = __virt_to_fix(vaddr); /* XXX.. Kill this later, here for sanity at the moment.. */ __flush_purge_region((void *)vaddr, PAGE_SIZE); pte_c...
[ 0, 1 ]
Linux Kernel
arch/sh/mm/nommu.c
__kernel_size_t __copy_user(void *to, const void *from, __kernel_size_t n) { memcpy(to, from, n); return 0; }
[ 1, 0 ]
Linux Kernel
arch/sh/mm/nommu.c
void local_flush_tlb_all(void) { BUG(); }
[ 0, 0 ]
Linux Kernel
arch/sh/mm/nommu.c
void local_flush_tlb_range(struct vm_area_struct *vma, unsigned long start, unsigned long end) { BUG(); }
[ 0, 0 ]
Linux Kernel
arch/sh/mm/nommu.c
void __flush_tlb_global(void) {}
[ 0, 0 ]
Linux Kernel
arch/sh/mm/nommu.c
void __init kmap_coherent_init(void) {}
[ 0, 0 ]
Linux Kernel
arch/sh/mm/nommu.c
void kunmap_coherent(void *kvaddr) { BUG(); }
[ 0, 0 ]
Linux Kernel
arch/sh/mm/pgtable.c
void pgd_ctor(void *x) { pgd_t *pgd = x; memset(pgd, 0, USER_PTRS_PER_PGD * sizeof(pgd_t)); memcpy(pgd + USER_PTRS_PER_PGD, swapper_pg_dir + USER_PTRS_PER_PGD, (PTRS_PER_PGD - USER_PTRS_PER_PGD) * sizeof(pgd_t)); }
[ 1, 0 ]
Linux Kernel
arch/sh/mm/pgtable.c
pgd_t *pgd_alloc(struct mm_struct *mm) { return kmem_cache_alloc(pgd_cachep, GFP_KERNEL); }
[ 0, 0 ]
Linux Kernel
arch/sh/mm/pgtable.c
pmd_t *pmd_alloc_one(struct mm_struct *mm, unsigned long address) { return kmem_cache_alloc(pmd_cachep, GFP_KERNEL | __GFP_ZERO); }
[ 0, 0 ]
Linux Kernel
arch/sh/mm/pmb.c
static __always_inline unsigned long mk_pmb_entry(unsigned int entry) { return (entry & PMB_E_MASK) << PMB_E_SHIFT; }
[ 0, 0 ]
Linux Kernel
arch/sh/mm/pmb.c
static __always_inline unsigned long pmb_cache_flags(void) { unsigned long flags = 0; #if defined(CONFIG_CACHE_OFF) flags |= PMB_WT | PMB_UB; #elif defined(CONFIG_CACHE_WRITETHROUGH) flags |= PMB_C | PMB_WT | PMB_UB; #elif defined(CONFIG_CACHE_WRITEBACK) flags |= PMB_C; #endif return flags; }
[ 1, 0 ]
Linux Kernel
arch/sh/mm/pmb.c
static inline unsigned long pgprot_to_pmb_flags(pgprot_t prot) { unsigned long pmb_flags = 0; u64 flags = pgprot_val(prot); if (flags & _PAGE_CACHABLE) pmb_flags |= PMB_C; if (flags & _PAGE_WT) pmb_flags |= PMB_WT | PMB_UB; return pmb_flags; }
[ 1, 0 ]
Linux Kernel
arch/sh/mm/pmb.c
static inline bool pmb_addr_valid(unsigned long addr, unsigned long size) { return (addr >= P1SEG && (addr + size - 1) < P3SEG); }
[ 1, 0 ]
Linux Kernel
arch/sh/mm/pmb.c
static int pmb_size_to_flags(unsigned long size) { int i; for (i = 0; i < ARRAY_SIZE(pmb_sizes); i++) if (pmb_sizes[i].size == size) return pmb_sizes[i].flag; return 0; }
[ 0, 0 ]
Linux Kernel
arch/sh/mm/pmb.c
static int pmb_alloc_entry(void) { int pos; pos = find_first_zero_bit(pmb_map, NR_PMB_ENTRIES); if (pos >= 0 && pos < NR_PMB_ENTRIES) __set_bit(pos, pmb_map); else pos = -ENOSPC; return pos; }
[ 1, 0 ]
Linux Kernel
arch/sh/mm/pmb.c
void __init pmb_init(void) { pmb_synchronize(); /* Attempt to combine compound mappings */ pmb_coalesce(); #ifdef CONFIG_UNCACHED_MAPPING /* Resize initial mappings, if necessary */ pmb_resize(); #endif /* Log them */ pmb_notify(); writel_uncached(0, PMB_IRMCR); /* Flush out the TLB */ local_f...
[ 0, 0 ]
Linux Kernel
arch/sh/mm/pmb.c
static int pmb_debugfs_show(struct seq_file *file, void *iter) { int i; seq_printf(file, "V: Valid, C: Cacheable, WT: Write-Through\n" "CB: Copy-Back, B: Buffered, UB: Unbuffered\n"); seq_printf(file, "ety vpn ppn size flags\n"); for (i = 0; i < NR_PMB_ENTRIES; i++) { unsigned lon...
[ 0, 0 ]
Linux Kernel
arch/sh/mm/pmb.c
static int __init pmb_sysdev_init(void) { register_syscore_ops(&pmb_syscore_ops); return 0; }
[ 0, 0 ]
Linux Kernel
arch/sh/mm/tlb-debugfs.c
static int tlb_debugfs_open(struct inode *inode, struct file *file) { return single_open(file, tlb_seq_show, inode->i_private); }
[ 0, 0 ]
Linux Kernel
arch/sh/mm/tlb-pteaex.c
void __update_tlb(struct vm_area_struct *vma, unsigned long address, pte_t pte) { unsigned long flags, pteval, vpn; if (vma && current->active_mm != vma->vm_mm) return; local_irq_save(flags); /* Set PTEH register */ vpn = address & MMU_VPN_MASK; __raw_writel(vpn, MMU_PTEH); /* Se...
[ 1, 0 ]
Linux Kernel
arch/sh/mm/tlb-sh3.c
void __update_tlb(struct vm_area_struct *vma, unsigned long address, pte_t pte) { unsigned long flags, pteval, vpn; if (vma && current->active_mm != vma->vm_mm) return; local_irq_save(flags); /* Set PTEH register */ vpn = (address & MMU_VPN_MASK) | get_asid(); __raw_writel(vpn, MMU_...
[ 1, 0 ]
Linux Kernel
arch/sh/mm/tlb-sh4.c
void __update_tlb(struct vm_area_struct *vma, unsigned long address, pte_t pte) { unsigned long flags, pteval, vpn; if (vma && current->active_mm != vma->vm_mm) return; local_irq_save(flags); /* Set PTEH register */ vpn = (address & MMU_VPN_MASK) | get_asid(); __raw_writel(vpn, MMU_...
[ 1, 0 ]
Linux Kernel
arch/sh/mm/tlb-sh4.c
void local_flush_tlb_one(unsigned long asid, unsigned long page) { unsigned long addr, data; addr = MMU_UTLB_ADDRESS_ARRAY | MMU_PAGE_ASSOC_BIT; data = page | asid; /* VALID bit is off */ jump_to_uncached(); __raw_writel(data, addr); back_to_cached(); }
[ 0, 0 ]
Linux Kernel
arch/sh/mm/tlb-urb.c
void tlb_wire_entry(struct vm_area_struct *vma, unsigned long addr, pte_t pte) { unsigned long status, flags; int urb; local_irq_save(flags); status = __raw_readl(MMUCR); urb = (status & MMUCR_URB) >> MMUCR_URB_SHIFT; status &= ~MMUCR_URC; BUG_ON(!--urb); urb = urb % MMUCR_URB_NENTRIES; /* * I...
[ 0, 0 ]
Linux Kernel
arch/sh/mm/tlbflush_32.c
void local_flush_tlb_mm(struct mm_struct *mm) { unsigned int cpu = smp_processor_id(); /* Instead of invalidating each TLB, we get new MMU context. */ if (cpu_context(cpu, mm) != NO_CONTEXT) { unsigned long flags; local_irq_save(flags); cpu_context(cpu, mm) = NO_CONTEXT; if (mm == current->mm) ...
[ 1, 0 ]
Linux Kernel
arch/sparc/boot/piggyback.c
static int end_line(const char *line) { if (strcmp(line + 10, " _end\n") == 0) return 1; else if (strcmp(line + 18, " _end\n") == 0) return 1; return 0; }
[ 0, 0 ]
Linux Kernel
arch/sparc/boot/piggyback.c
static off_t get_hdrs_offset(int kernelfd, const char *filename) { char buffer[BUFSIZE]; off_t offset; int i; if (lseek(kernelfd, 0, SEEK_SET) < 0) die("lseek"); if (read(kernelfd, buffer, BUFSIZE) != BUFSIZE) die(filename); if (buffer[40] == 'H' && buffer[41] == 'd' && buffer[42] == 'r' && ...
[ 1, 0 ]
Linux Kernel
arch/sparc/crypto/aes_glue.c
static void crypto_aes_encrypt(struct crypto_tfm *tfm, u8 *dst, const u8 *src) { struct crypto_sparc64_aes_ctx *ctx = crypto_tfm_ctx(tfm); ctx->ops->encrypt(&ctx->key[0], (const u32 *)src, (u32 *)dst); }
[ 0, 0 ]
Linux Kernel
arch/sparc/crypto/aes_glue.c
static int ecb_decrypt(struct skcipher_request *req) { struct crypto_skcipher *tfm = crypto_skcipher_reqtfm(req); const struct crypto_sparc64_aes_ctx *ctx = crypto_skcipher_ctx(tfm); const u64 *key_end; struct skcipher_walk walk; unsigned int nbytes; int err; err = skcipher_walk_virt(&walk, req, true); ...
[ 1, 0 ]
Linux Kernel
arch/sparc/crypto/aes_glue.c
static int __init aes_sparc64_mod_init(void) { int err; if (!sparc64_has_aes_opcode()) { pr_info("sparc64 aes opcodes not available.\n"); return -ENODEV; } pr_info("Using sparc64 aes opcodes optimized AES implementation\n"); err = crypto_register_alg(&cipher_alg); if (err) return err; err = ...
[ 0, 0 ]
Linux Kernel
arch/sparc/crypto/camellia_glue.c
static int camellia_set_key_skcipher(struct crypto_skcipher *tfm, const u8 *in_key, unsigned int key_len) { return camellia_set_key(crypto_skcipher_tfm(tfm), in_key, key_len); }
[ 0, 0 ]
Linux Kernel
arch/sparc/crypto/camellia_glue.c
static int cbc_decrypt(struct skcipher_request *req) { struct crypto_skcipher *tfm = crypto_skcipher_reqtfm(req); const struct camellia_sparc64_ctx *ctx = crypto_skcipher_ctx(tfm); struct skcipher_walk walk; cbc_crypt_op *op; const u64 *key; unsigned int nbytes; int err; op = camellia_sparc64_cbc_decr...
[ 0, 0 ]
Linux Kernel
arch/sparc/crypto/camellia_glue.c
static bool __init sparc64_has_camellia_opcode(void) { unsigned long cfr; if (!(sparc64_elf_hwcap & HWCAP_SPARC_CRYPTO)) return false; __asm__ __volatile__("rd %%asr26, %0" : "=r"(cfr)); if (!(cfr & CFR_CAMELLIA)) return false; return true; }
[ 0, 0 ]
Linux Kernel
arch/sparc/crypto/crc32c_glue.c
static int crc32c_sparc64_update(struct shash_desc *desc, const u8 *data, unsigned int len) { u32 *crcp = shash_desc_ctx(desc); crc32c_compute(crcp, (const u64 *)data, len); return 0; }
[ 0, 0 ]
Linux Kernel
arch/sparc/crypto/crc32c_glue.c
static int crc32c_sparc64_finup(struct shash_desc *desc, const u8 *data, unsigned int len, u8 *out) { return __crc32c_sparc64_finup(shash_desc_ctx(desc), data, len, out); }
[ 0, 0 ]
Linux Kernel
arch/sparc/crypto/crc32c_glue.c
static int crc32c_sparc64_final(struct shash_desc *desc, u8 *out) { u32 *crcp = shash_desc_ctx(desc); *(__le32 *)out = ~cpu_to_le32p(crcp); return 0; }
[ 0, 0 ]
Linux Kernel
arch/sparc/crypto/crc32c_glue.c
static int crc32c_sparc64_digest(struct shash_desc *desc, const u8 *data, unsigned int len, u8 *out) { return __crc32c_sparc64_finup(crypto_shash_ctx(desc->tfm), data, len, out); }
[ 0, 0 ]
Linux Kernel
arch/sparc/crypto/des_glue.c
static void sparc_des_encrypt(struct crypto_tfm *tfm, u8 *dst, const u8 *src) { struct des_sparc64_ctx *ctx = crypto_tfm_ctx(tfm); const u64 *K = ctx->encrypt_expkey; des_sparc64_crypt(K, (const u64 *)src, (u64 *)dst); }
[ 0, 0 ]
Linux Kernel
arch/sparc/crypto/des_glue.c
static int __cbc_crypt(struct skcipher_request *req, bool encrypt) { struct crypto_skcipher *tfm = crypto_skcipher_reqtfm(req); const struct des_sparc64_ctx *ctx = crypto_skcipher_ctx(tfm); struct skcipher_walk walk; unsigned int nbytes; int err; err = skcipher_walk_virt(&walk, req, true); if (err) ...
[ 0, 0 ]
Linux Kernel
arch/sparc/crypto/des_glue.c
static int cbc_decrypt(struct skcipher_request *req) { return __cbc_crypt(req, false); }
[ 0, 0 ]
Linux Kernel
arch/sparc/crypto/des_glue.c
static int des3_ede_set_key(struct crypto_tfm *tfm, const u8 *key, unsigned int keylen) { struct des3_ede_sparc64_ctx *dctx = crypto_tfm_ctx(tfm); u64 k1[DES_EXPKEY_WORDS / 2]; u64 k2[DES_EXPKEY_WORDS / 2]; u64 k3[DES_EXPKEY_WORDS / 2]; int err; err = crypto_des3_ede_verify_key...
[ 1, 0 ]
Linux Kernel
arch/sparc/crypto/des_glue.c
static void sparc_des3_ede_encrypt(struct crypto_tfm *tfm, u8 *dst, const u8 *src) { struct des3_ede_sparc64_ctx *ctx = crypto_tfm_ctx(tfm); const u64 *K = ctx->encrypt_expkey; des3_ede_sparc64_crypt(K, (const u64 *)src, (u64 *)dst); }
[ 0, 0 ]
Linux Kernel
arch/sparc/crypto/des_glue.c
static int __ecb3_crypt(struct skcipher_request *req, bool encrypt) { struct crypto_skcipher *tfm = crypto_skcipher_reqtfm(req); const struct des3_ede_sparc64_ctx *ctx = crypto_skcipher_ctx(tfm); struct skcipher_walk walk; const u64 *K; unsigned int nbytes; int err; err = skcipher_walk_virt(&walk, req, ...
[ 0, 0 ]
Linux Kernel
arch/sparc/crypto/des_glue.c
static int ecb3_encrypt(struct skcipher_request *req) { return __ecb3_crypt(req, true); }
[ 0, 0 ]
Linux Kernel
arch/sparc/crypto/md5_glue.c
static int md5_sparc64_init(struct shash_desc *desc) { struct md5_state *mctx = shash_desc_ctx(desc); mctx->hash[0] = MD5_H0; mctx->hash[1] = MD5_H1; mctx->hash[2] = MD5_H2; mctx->hash[3] = MD5_H3; le32_to_cpu_array(mctx->hash, 4); mctx->byte_count = 0; return 0; }
[ 0, 0 ]
Linux Kernel
arch/sparc/crypto/md5_glue.c
static int md5_sparc64_final(struct shash_desc *desc, u8 *out) { struct md5_state *sctx = shash_desc_ctx(desc); unsigned int i, index, padlen; u32 *dst = (u32 *)out; __le64 bits; static const u8 padding[MD5_HMAC_BLOCK_SIZE] = { 0x80, }; bits = cpu_to_le64(sctx->byte_count << 3); index = sctx->by...
[ 1, 0 ]
Linux Kernel
arch/sparc/crypto/md5_glue.c
static bool __init sparc64_has_md5_opcode(void) { unsigned long cfr; if (!(sparc64_elf_hwcap & HWCAP_SPARC_CRYPTO)) return false; __asm__ __volatile__("rd %%asr26, %0" : "=r"(cfr)); if (!(cfr & CFR_MD5)) return false; return true; }
[ 0, 0 ]
Linux Kernel
arch/sparc/crypto/sha1_glue.c
static int sha1_sparc64_final(struct shash_desc *desc, u8 *out) { struct sha1_state *sctx = shash_desc_ctx(desc); unsigned int i, index, padlen; __be32 *dst = (__be32 *)out; __be64 bits; static const u8 padding[SHA1_BLOCK_SIZE] = { 0x80, }; bits = cpu_to_be64(sctx->count << 3); index = sctx->cou...
[ 1, 0 ]
Linux Kernel
arch/sparc/crypto/sha256_glue.c
static bool __init sparc64_has_sha256_opcode(void) { unsigned long cfr; if (!(sparc64_elf_hwcap & HWCAP_SPARC_CRYPTO)) return false; __asm__ __volatile__("rd %%asr26, %0" : "=r"(cfr)); if (!(cfr & CFR_SHA256)) return false; return true; }
[ 0, 0 ]
Linux Kernel
arch/sparc/crypto/sha256_glue.c
static int __init sha256_sparc64_mod_init(void) { if (sparc64_has_sha256_opcode()) { int ret = crypto_register_shash(&sha224_alg); if (ret < 0) return ret; ret = crypto_register_shash(&sha256_alg); if (ret < 0) { crypto_unregister_shash(&sha224_alg); return ret; } pr_info(...
[ 1, 0 ]
Linux Kernel
arch/sparc/crypto/sha512_glue.c
static int sha512_sparc64_update(struct shash_desc *desc, const u8 *data, unsigned int len) { struct sha512_state *sctx = shash_desc_ctx(desc); unsigned int partial = sctx->count[0] % SHA512_BLOCK_SIZE; if (partial + len < SHA512_BLOCK_SIZE) { if ((sctx->count[0] += len) < le...
[ 1, 0 ]
Linux Kernel
arch/sparc/crypto/sha512_glue.c
static int __init sha512_sparc64_mod_init(void) { if (sparc64_has_sha512_opcode()) { int ret = crypto_register_shash(&sha384); if (ret < 0) return ret; ret = crypto_register_shash(&sha512); if (ret < 0) { crypto_unregister_shash(&sha384); return ret; } pr_info("Using sparc...
[ 1, 0 ]
Linux Kernel
arch/sparc/include/asm/adi_64.h
static inline unsigned long adi_nbits(void) { return adi_state.caps.nbits; }
[ 0, 0 ]
Linux Kernel
arch/sparc/include/asm/atomic_64.h
static inline int arch_atomic_xchg(atomic_t *v, int new) { return arch_xchg(&v->counter, new); } #define arch_atomic64_cmpxchg(v, o, n) \ ((__typeof__((v)->counter))arch_cmpxchg(&((v)->counter), (o), (n)))
[ 0, 0 ]
Linux Kernel
arch/sparc/include/asm/checksum_32.h
static inline __wsum csum_partial_copy_nocheck(const void *src, void *dst, int len) { register unsigned int ret asm("o0") = (unsigned int)src; register char *d asm("o1") = dst; register int l asm("g1") = len; __asm__ __volatile__("call __csum_partial_copy_sparc_g...
[ 1, 0 ]
Linux Kernel
arch/sparc/include/asm/checksum_32.h
static inline __sum16 ip_fast_csum(const void *iph, unsigned int ihl) { __sum16 sum; __asm__ __volatile__("sub\t%2, 4, %%g4\n\t" "ld\t[%1 + 0x00], %0\n\t" "ld\t[%1 + 0x04], %%g2\n\t" "ld\t[%1 + 0x08], %%g3\n\t" "addcc\t%%g2...
[ 1, 0 ]
Linux Kernel
arch/sparc/include/asm/checksum_64.h
static inline __sum16 csum_fold(__wsum sum) { unsigned int tmp; __asm__ __volatile__(" addcc %0, %1, %1\n" " srl %1, 16, %1\n" " addc %1, %%g0, %1\n" " xnor %%g0, %1, %0\n" : "=&r"(sum), "=r"(tmp) ...
[ 0, 0 ]
Linux Kernel
arch/sparc/include/asm/checksum_64.h
static inline __wsum csum_add(__wsum csum, __wsum addend) { __asm__ __volatile__("addcc %0, %1, %0\n" "addx %0, %%g0, %0" : "=r"(csum) : "r"(addend), "0"(csum)); return csum; } #endif
[ 0, 0 ]
Linux Kernel
arch/sparc/include/asm/cmpxchg_32.h
static inline unsigned long __xchg(unsigned long x, __volatile__ void *ptr, int size) { switch (size) { case 4: return __xchg_u32(ptr, x); } __xchg_called_with_bad_pointer(); return x; }
[ 1, 0 ]
Linux Kernel
arch/sparc/include/asm/cmpxchg_64.h
static inline unsigned long xchg64(__volatile__ unsigned long *m, unsigned long val) { unsigned long tmp1, tmp2; __asm__ __volatile__(" mov %0, %1\n" "1: ldx [%4], %2\n" " casx [%4], %2, %0\n" " cmp %2, %0\...
[ 1, 0 ]