Projectname
large_stringclasses
15 values
Filepath
large_stringlengths
4
106
⌀
Function
large_stringlengths
11
3.45k
Label
list
Linux Kernel
arch/riscv/include/asm/pgtable.h
static inline pte_t pte_mkclean(pte_t pte) { return __pte(pte_val(pte) & ~(_PAGE_DIRTY)); }
[ 0, 0 ]
Linux Kernel
arch/riscv/include/asm/pgtable.h
static inline pte_t pte_mkold(pte_t pte) { return __pte(pte_val(pte) & ~(_PAGE_ACCESSED)); }
[ 0, 0 ]
Linux Kernel
arch/riscv/include/asm/pgtable.h
static inline pte_t pte_mkhuge(pte_t pte) { return pte; }
[ 0, 0 ]
Linux Kernel
arch/riscv/include/asm/pgtable.h
static inline int pte_protnone(pte_t pte) { return (pte_val(pte) & (_PAGE_PRESENT | _PAGE_PROT_NONE)) == _PAGE_PROT_NONE; }
[ 0, 0 ]
Linux Kernel
arch/riscv/include/asm/pgtable.h
static inline void set_pte(pte_t *ptep, pte_t pteval) { *ptep = pteval; }
[ 0, 0 ]
Linux Kernel
arch/riscv/include/asm/pgtable.h
static inline int ptep_set_access_flags(struct vm_area_struct *vma, unsigned long address, pte_t *ptep, pte_t entry, int dirty) { if (!pte_same(*ptep, entry)) set_pte_at(vma->vm_mm, address, ptep, entry); return true; }
[ 0, 0 ]
Linux Kernel
arch/riscv/include/asm/pgtable.h
static inline pgprot_t pgprot_writecombine(pgprot_t _prot) { unsigned long prot = pgprot_val(_prot); prot &= ~_PAGE_MTMASK; prot |= _PAGE_NOCACHE; return __pgprot(prot); }
[ 1, 0 ]
Linux Kernel
arch/riscv/include/asm/pgtable.h
static inline pmd_t pte_pmd(pte_t pte) { return __pmd(pte_val(pte)); }
[ 0, 0 ]
Linux Kernel
arch/riscv/include/asm/pgtable.h
static inline pmd_t pmd_mkinvalid(pmd_t pmd) { return __pmd(pmd_val(pmd) & ~(_PAGE_PRESENT | _PAGE_PROT_NONE)); }
[ 0, 0 ]
Linux Kernel
arch/riscv/include/asm/pgtable.h
static inline unsigned long pmd_pfn(pmd_t pmd) { return ((__pmd_to_phys(pmd) & PMD_MASK) >> PAGE_SHIFT); }
[ 0, 0 ]
Linux Kernel
arch/riscv/include/asm/pgtable.h
static inline pmd_t pmd_mkyoung(pmd_t pmd) { return pte_pmd(pte_mkyoung(pmd_pte(pmd))); }
[ 0, 0 ]
Linux Kernel
arch/riscv/include/asm/pgtable.h
static inline pmd_t pmd_mkwrite(pmd_t pmd) { return pte_pmd(pte_mkwrite(pmd_pte(pmd))); }
[ 0, 0 ]
Linux Kernel
arch/riscv/include/asm/pgtable.h
static inline pmd_t pmd_wrprotect(pmd_t pmd) { return pte_pmd(pte_wrprotect(pmd_pte(pmd))); }
[ 0, 0 ]
Linux Kernel
arch/riscv/include/asm/pgtable.h
static inline void set_pmd_at(struct mm_struct *mm, unsigned long addr, pmd_t *pmdp, pmd_t pmd) { page_table_check_pmd_set(mm, addr, pmdp, pmd); return __set_pte_at(mm, addr, (pte_t *)pmdp, pmd_pte(pmd)); }
[ 0, 0 ]
Linux Kernel
arch/riscv/include/asm/pgtable.h
static inline bool pud_user_accessible_page(pud_t pud) { return pud_leaf(pud) && pud_user(pud); }
[ 0, 0 ]
Linux Kernel
arch/riscv/include/asm/pgtable.h
static inline int pmdp_test_and_clear_young(struct vm_area_struct *vma, unsigned long address, pmd_t *pmdp) { return ptep_test_and_clear_young(vma, address, (pte_t *)pmdp); }
[ 0, 0 ]
Linux Kernel
arch/riscv/include/asm/processor.h
static inline void wait_for_interrupt(void) { __asm__ __volatile__("wfi"); }
[ 0, 0 ]
Linux Kernel
arch/riscv/include/asm/ptrace.h
static inline unsigned long user_stack_pointer(struct pt_regs *regs) { return regs->sp; }
[ 0, 0 ]
Linux Kernel
arch/riscv/include/asm/ptrace.h
static inline unsigned long kernel_stack_pointer(struct pt_regs *regs) { return regs->sp; }
[ 0, 0 ]
Linux Kernel
arch/riscv/include/asm/ptrace.h
static inline unsigned long frame_pointer(struct pt_regs *regs) { return regs->s0; }
[ 0, 0 ]
Linux Kernel
arch/riscv/include/asm/ptrace.h
static inline void frame_pointer_set(struct pt_regs *regs, unsigned long val) { regs->s0 = val; }
[ 0, 0 ]
Linux Kernel
arch/riscv/include/asm/ptrace.h
static inline void regs_set_return_value(struct pt_regs *regs, unsigned long val) { regs->a0 = val; }
[ 0, 0 ]
Linux Kernel
arch/riscv/include/asm/ptrace.h
static inline unsigned long regs_get_register(struct pt_regs *regs, unsigned int offset) { if (unlikely(offset > MAX_REG_OFFSET)) return 0; return *(unsigned long *)((unsigned long)regs + offset); }
[ 0, 0 ]
Linux Kernel
arch/riscv/include/asm/sbi.h
static inline unsigned long sbi_minor_version(void) { return sbi_spec_version & SBI_SPEC_VERSION_MINOR_MASK; }
[ 0, 0 ]
Linux Kernel
arch/riscv/include/asm/set_memory.h
static inline int set_memory_rw(unsigned long addr, int numpages) { return 0; }
[ 0, 0 ]
Linux Kernel
arch/riscv/include/asm/set_memory.h
static inline int set_memory_nx(unsigned long addr, int numpages) { return 0; }
[ 0, 0 ]
Linux Kernel
arch/riscv/include/asm/smp.h
static inline int riscv_hartid_to_cpuid(unsigned long hartid) { if (hartid == boot_cpu_hartid) return 0; return -1; }
[ 0, 0 ]
Linux Kernel
arch/riscv/include/asm/stackprotector.h
static __always_inline void boot_init_stack_canary(void) { unsigned long canary = get_random_canary(); current->stack_canary = canary; if (!IS_ENABLED(CONFIG_STACKPROTECTOR_PER_TASK)) __stack_chk_guard = current->stack_canary; }
[ 1, 0 ]
Linux Kernel
arch/riscv/include/asm/switch_to.h
static inline void __fstate_clean(struct pt_regs *regs) { regs->status = (regs->status & ~SR_FS) | SR_FS_CLEAN; }
[ 0, 0 ]
Linux Kernel
arch/riscv/include/asm/switch_to.h
static inline void fstate_off(struct task_struct *task, struct pt_regs *regs) { regs->status = (regs->status & ~SR_FS) | SR_FS_OFF; }
[ 0, 0 ]
Linux Kernel
arch/riscv/include/asm/switch_to.h
static inline void fstate_save(struct task_struct *task, struct pt_regs *regs) { if ((regs->status & SR_FS) == SR_FS_DIRTY) { __fstate_save(task); __fstate_clean(regs); } }
[ 0, 0 ]
Linux Kernel
arch/riscv/include/asm/syscall.h
static inline void syscall_rollback(struct task_struct *task, struct pt_regs *regs) { regs->a0 = regs->orig_a0; }
[ 0, 0 ]
Linux Kernel
arch/riscv/include/asm/syscall.h
static inline long syscall_get_error(struct task_struct *task, struct pt_regs *regs) { unsigned long error = regs->a0; return IS_ERR_VALUE(error) ? error : 0; }
[ 1, 0 ]
Linux Kernel
arch/riscv/include/asm/syscall.h
static inline void syscall_get_arguments(struct task_struct *task, struct pt_regs *regs, unsigned long *args) { args[0] = regs->orig_a0; args++; memcpy(args, &regs->a1, 5 * sizeof(args[0])); }
[ 1, 0 ]
Linux Kernel
arch/riscv/include/asm/timex.h
static inline unsigned long random_get_entropy(void) { if (unlikely(clint_time_val == NULL)) return random_get_entropy_fallback(); return get_cycles(); }
[ 0, 0 ]
Linux Kernel
arch/riscv/include/asm/uaccess.h
static inline unsigned long raw_copy_to_user(void __user *to, const void *from, unsigned long n) { return __asm_copy_to_user(to, from, n); }
[ 0, 0 ]
Linux Kernel
arch/riscv/include/asm/vdso/gettimeofday.h
static __always_inline int clock_getres_fallback(clockid_t _clkid, struct __kernel_timespec *_ts) { register clockid_t clkid asm("a0") = _clkid; register struct __kernel_timespec *ts asm("a1") = _ts; register long ret asm("a0"); register long nr asm("a7") = __NR_clock_getres; asm volatile("ecall\n" : "=r"(r...
[ 0, 0 ]
Linux Kernel
arch/riscv/include/asm/vdso/processor.h
static inline void cpu_relax(void) { if (!static_branch_likely( &riscv_isa_ext_keys[RISCV_ISA_EXT_KEY_ZIHINTPAUSE])) { #ifdef __riscv_muldiv int dummy; __asm__ __volatile__("div %0, %0, zero" : "=r"(dummy)); #endif } else { /* * Reduce instruction retirement. * This assumes the PC c...
[ 0, 0 ]
Linux Kernel
arch/riscv/include/asm/word-at-a-time.h
static inline unsigned long has_zero(unsigned long val, unsigned long *bits, const struct word_at_a_time *c) { unsigned long mask = ((val - c->one_bits) & ~val) & c->high_bits; *bits = mask; return mask; }
[ 1, 0 ]
Linux Kernel
arch/riscv/include/asm/word-at-a-time.h
static inline unsigned long prep_zero_mask(unsigned long val, unsigned long bits, const struct word_at_a_time *c) { return bits; }
[ 0, 0 ]
Linux Kernel
arch/riscv/kernel/alternative.c
void __init apply_boot_alternatives(void) { WARN_ON(smp_processor_id() != 0); _apply_alternatives((struct alt_entry *)__alt_start, (struct alt_entry *)__alt_end, RISCV_ALTERNATIVES_BOOT); }
[ 0, 0 ]
Linux Kernel
arch/riscv/kernel/alternative.c
void __init apply_early_boot_alternatives(void) { #ifdef CONFIG_RISCV_ALTERNATIVE_EARLY _apply_alternatives((struct alt_entry *)__alt_start, (struct alt_entry *)__alt_end, RISCV_ALTERNATIVES_EARLY_BOOT); #endif }
[ 0, 0 ]
Linux Kernel
arch/riscv/kernel/cacheinfo.c
void riscv_set_cacheinfo_ops(struct riscv_cacheinfo_ops *ops) { rv_cache_ops = ops; }
[ 0, 0 ]
Linux Kernel
arch/riscv/kernel/cacheinfo.c
const struct attribute_group * cache_get_priv_group(struct cacheinfo *this_leaf) { if (rv_cache_ops && rv_cache_ops->get_priv_group) return rv_cache_ops->get_priv_group(this_leaf); return NULL; }
[ 1, 0 ]
Linux Kernel
arch/riscv/kernel/cacheinfo.c
uintptr_t get_cache_size(u32 level, enum cache_type type) { struct cacheinfo *this_leaf = get_cacheinfo(level, type); return this_leaf ? this_leaf->size : 0; }
[ 0, 0 ]
Linux Kernel
arch/riscv/kernel/cacheinfo.c
uintptr_t get_cache_geometry(u32 level, enum cache_type type) { struct cacheinfo *this_leaf = get_cacheinfo(level, type); return this_leaf ? (this_leaf->ways_of_associativity << 16 | this_leaf->coherency_line_size) : 0; }
[ 0, 0 ]
Linux Kernel
arch/riscv/kernel/cacheinfo.c
static void ci_leaf_init(struct cacheinfo *this_leaf, enum cache_type type, unsigned int level, unsigned int size, unsigned int sets, unsigned int line_size) { this_leaf->level = level; this_leaf->type = type; this_leaf->size = size; this_leaf->number_of_sets = ...
[ 1, 0 ]
Linux Kernel
arch/riscv/kernel/cacheinfo.c
static void fill_cacheinfo(struct cacheinfo **this_leaf, struct device_node *node, unsigned int level) { unsigned int size, sets, line_size; if (!of_property_read_u32(node, "cache-size", &size) && !of_property_read_u32(node, "cache-block-size", &line_size) && !of_property_re...
[ 0, 0 ]
Linux Kernel
arch/riscv/kernel/cacheinfo.c
int init_cache_level(unsigned int cpu) { struct cpu_cacheinfo *this_cpu_ci = get_cpu_cacheinfo(cpu); struct device_node *np = of_cpu_device_node_get(cpu); struct device_node *prev = NULL; int levels = 0, leaves = 0, level; if (of_property_read_bool(np, "cache-size")) ++leaves; if (of_property_read_boo...
[ 0, 0 ]
Linux Kernel
arch/riscv/kernel/compat_signal.c
static long compat_save_fp_state(struct pt_regs *regs, union __riscv_fp_state __user *sc_fpregs) { long err; struct __riscv_d_ext_state __user *state = &sc_fpregs->d; size_t i; fstate_save(current, regs); err = __copy_to_user(state, &current->thread.fstate, sizeof(*state)); ...
[ 1, 0 ]
Linux Kernel
arch/riscv/kernel/compat_signal.c
static inline void __user *compat_get_sigframe(struct ksignal *ksig, struct pt_regs *regs, size_t framesize) { unsigned long sp; sp = regs->sp; /* * If we are on the alternate signal stack and would overflow it, don...
[ 1, 0 ]
Linux Kernel
arch/riscv/kernel/compat_signal.c
int compat_setup_rt_frame(struct ksignal *ksig, sigset_t *set, struct pt_regs *regs) { struct compat_rt_sigframe __user *frame; long err = 0; frame = compat_get_sigframe(ksig, regs, sizeof(*frame)); if (!access_ok(frame, sizeof(*frame))) return -EFAULT; err |= copy_siginfo_to_u...
[ 1, 0 ]
Linux Kernel
arch/riscv/kernel/cpu-hotplug.c
void __cpu_die(unsigned int cpu) { int ret = 0; if (!cpu_wait_death(cpu, 5)) { pr_err("CPU %u: didn't die\n", cpu); return; } pr_notice("CPU%u: off\n", cpu); if (cpu_ops[cpu]->cpu_is_stopped) ret = cpu_ops[cpu]->cpu_is_stopped(cpu); if (ret) pr_warn("CPU%d may not have stopped: %d\n", cpu,...
[ 0, 0 ]
Linux Kernel
arch/riscv/kernel/cpu-hotplug.c
void arch_cpu_idle_dead(void) { idle_task_exit(); (void)cpu_report_death(); cpu_ops[smp_processor_id()]->cpu_stop(); BUG(); }
[ 0, 0 ]
Linux Kernel
arch/riscv/kernel/cpu.c
static void c_stop(struct seq_file *m, void *v) {}
[ 0, 0 ]
Linux Kernel
arch/riscv/kernel/cpufeature.c
static bool __init_or_module cpufeature_probe_zicbom(unsigned int stage) { if (!IS_ENABLED(CONFIG_RISCV_ISA_ZICBOM)) return false; if (stage == RISCV_ALTERNATIVES_EARLY_BOOT) return false; if (!riscv_isa_extension_available(NULL, ZICBOM)) return false; riscv_noncoherent_supported(); return tru...
[ 0, 0 ]
Linux Kernel
arch/riscv/kernel/cpufeature.c
static u32 __init_or_module cpufeature_probe(unsigned int stage) { u32 cpu_req_feature = 0; if (cpufeature_probe_svpbmt(stage)) cpu_req_feature |= BIT(CPUFEATURE_SVPBMT); if (cpufeature_probe_zicbom(stage)) cpu_req_feature |= BIT(CPUFEATURE_ZICBOM); return cpu_req_feature; }
[ 0, 0 ]
Linux Kernel
arch/riscv/kernel/cpu_ops_sbi.c
static int sbi_cpu_start(unsigned int cpuid, struct task_struct *tidle) { unsigned long boot_addr = __pa_symbol(secondary_start_sbi); unsigned long hartid = cpuid_to_hartid_map(cpuid); unsigned long hsm_data; struct sbi_hart_boot_data *bdata = &per_cpu(boot_data, cpuid); smp_mb(); bdata->task_ptr = tidle; ...
[ 1, 0 ]
Linux Kernel
arch/riscv/kernel/cpu_ops_sbi.c
static int sbi_cpu_disable(unsigned int cpuid) { if (!cpu_ops_sbi.cpu_stop) return -EOPNOTSUPP; return 0; }
[ 0, 0 ]
Linux Kernel
arch/riscv/kernel/cpu_ops_sbi.c
static void sbi_cpu_stop(void) { int ret; ret = sbi_hsm_hart_stop(); pr_crit("Unable to stop the cpu %u (%d)\n", smp_processor_id(), ret); }
[ 0, 0 ]
Linux Kernel
arch/riscv/kernel/cpu_ops_sbi.c
static int sbi_cpu_is_stopped(unsigned int cpuid) { int rc; unsigned long hartid = cpuid_to_hartid_map(cpuid); rc = sbi_hsm_hart_get_status(hartid); if (rc == SBI_HSM_STATE_STOPPED) return 0; return rc; }
[ 1, 0 ]
Linux Kernel
arch/riscv/kernel/cpu_ops_spinwait.c
static int spinwait_cpu_prepare(unsigned int cpuid) { if (!cpu_ops_spinwait.cpu_start) { pr_err("cpu start method not defined for CPU [%d]\n", cpuid); return -ENODEV; } return 0; }
[ 0, 0 ]
Linux Kernel
arch/riscv/kernel/efi.c
static __init pgprot_t efimem_to_pgprot_map(efi_memory_desc_t *md) { u64 attr = md->attribute; u32 type = md->type; if (type == EFI_MEMORY_MAPPED_IO) return PAGE_KERNEL; if ((attr & (EFI_MEMORY_XP | EFI_MEMORY_RO)) == (EFI_MEMORY_XP | EFI_MEMORY_RO)) return PAGE_KERNEL_READ; /* R-X */ if (a...
[ 0, 0 ]
Linux Kernel
arch/riscv/kernel/elf_kexec.c
static int elf_find_pbase(struct kimage *image, unsigned long kernel_len, struct elfhdr *ehdr, struct kexec_elf_info *elf_info, unsigned long *old_pbase, unsigned long *new_pbase) { int i; int ret; struct kexec_buf kbuf; const struct elf_phdr *phdr; unsigned...
[ 1, 0 ]
Linux Kernel
arch/riscv/kernel/elf_kexec.c
static int get_nr_ram_ranges_callback(struct resource *res, void *arg) { unsigned int *nr_ranges = arg; (*nr_ranges)++; return 0; }
[ 1, 0 ]
Linux Kernel
arch/riscv/kernel/ftrace.c
int ftrace_init_nop(struct module *mod, struct dyn_ftrace *rec) { int out; ftrace_arch_code_modify_prepare(); out = ftrace_make_nop(mod, rec, MCOUNT_ADDR); ftrace_arch_code_modify_post_process(); return out; }
[ 0, 0 ]
Linux Kernel
arch/riscv/kernel/irq.c
void __init init_IRQ(void) { irqchip_init(); if (!handle_arch_irq) panic("No interrupt controller found."); }
[ 0, 0 ]
Linux Kernel
arch/riscv/kernel/kgdb.c
int dbg_set_reg(int regno, void *mem, struct pt_regs *regs) { if (regno >= DBG_MAX_REG_NUM || regno < 0) return -EINVAL; if (dbg_reg_def[regno].offset != -1) memcpy((void *)regs + dbg_reg_def[regno].offset, mem, dbg_reg_def[regno].size); return 0; }
[ 1, 0 ]
Linux Kernel
arch/riscv/kernel/module-sections.c
unsigned long module_emit_got_entry(struct module *mod, unsigned long val) { struct mod_section *got_sec = &mod->arch.got; int i = got_sec->num_entries; struct got_entry *got = get_got_entry(val, got_sec); if (got) return (unsigned long)got; got = (struct got_entry *)got_sec->shdr->sh_addr; got[i] = e...
[ 0, 0 ]
Linux Kernel
arch/riscv/kernel/module-sections.c
unsigned long module_emit_plt_entry(struct module *mod, unsigned long val) { struct mod_section *got_plt_sec = &mod->arch.got_plt; struct got_entry *got_plt; struct mod_section *plt_sec = &mod->arch.plt; struct plt_entry *plt = get_plt_entry(val, plt_sec, got_plt_sec); int i = plt_sec->num_entries; if (plt...
[ 0, 0 ]
Linux Kernel
arch/riscv/kernel/module-sections.c
static bool duplicate_rela(const Elf_Rela *rela, int idx) { int i; for (i = 0; i < idx; i++) { if (is_rela_equal(&rela[i], &rela[idx])) return true; } return false; }
[ 0, 0 ]
Linux Kernel
arch/riscv/kernel/module.c
static bool riscv_insn_valid_32bit_offset(ptrdiff_t val) { #ifdef CONFIG_32BIT return true; #else return (-(1L << 31) - (1L << 11)) <= val && val < ((1L << 31) - (1L << 11)); #endif }
[ 1, 0 ]
Linux Kernel
arch/riscv/kernel/module.c
static int apply_r_riscv_32_rela(struct module *me, u32 *location, Elf_Addr v) { if (v != (u32)v) { pr_err("%s: value %016llx out of range for 32-bit field\n", me->name, (long long)v); return -EINVAL; } *location = v; return 0; }
[ 1, 0 ]
Linux Kernel
arch/riscv/kernel/module.c
static int apply_r_riscv_pcrel_hi20_rela(struct module *me, u32 *location, Elf_Addr v) { ptrdiff_t offset = (void *)v - (void *)location; s32 hi20; if (!riscv_insn_valid_32bit_offset(offset)) { pr_err("%s: target %016llx can not be addressed by the 32-bit offset from...
[ 1, 0 ]
Linux Kernel
arch/riscv/kernel/module.c
static int apply_r_riscv_pcrel_lo12_s_rela(struct module *me, u32 *location, Elf_Addr v) { u32 imm11_5 = (v & 0xfe0) << (31 - 11); u32 imm4_0 = (v & 0x1f) << (11 - 4); *location = (*location & 0x1fff07f) | imm11_5 | imm4_0; return 0; }
[ 0, 0 ]
Linux Kernel
arch/riscv/kernel/module.c
static int apply_r_riscv_hi20_rela(struct module *me, u32 *location, Elf_Addr v) { s32 hi20; if (IS_ENABLED(CONFIG_CMODEL_MEDLOW)) { pr_err("%s: target %016llx can not be addressed by the 32-bit offset from " "PC = %p\n", me->name, (long long)v, locatio...
[ 1, 0 ]
Linux Kernel
arch/riscv/kernel/module.c
static int apply_r_riscv_add32_rela(struct module *me, u32 *location, Elf_Addr v) { *(u32 *)location += (u32)v; return 0; }
[ 0, 0 ]
Linux Kernel
arch/riscv/kernel/module.c
static int apply_r_riscv_sub32_rela(struct module *me, u32 *location, Elf_Addr v) { *(u32 *)location -= (u32)v; return 0; }
[ 0, 0 ]
Linux Kernel
arch/riscv/kernel/module.c
static int apply_r_riscv_sub64_rela(struct module *me, u32 *location, Elf_Addr v) { *(u64 *)location -= (u64)v; return 0; }
[ 0, 0 ]
Linux Kernel
arch/riscv/kernel/module.c
static const Elf_Shdr *find_section(const Elf_Ehdr *hdr, const Elf_Shdr *sechdrs, const char *name) { const Elf_Shdr *s, *se; const char *secstrs = (void *)hdr + sechdrs[hdr->e_shstrndx].sh_offset; for (s = sechdrs, se = sechdrs + hdr->e_shnum; s < se; s++) { if (strcmp(n...
[ 1, 0 ]
Linux Kernel
arch/riscv/kernel/patch.c
static int patch_insn_write(void *addr, const void *insn, size_t len) { void *waddr = addr; bool across_pages = (((uintptr_t)addr & ~PAGE_MASK) + len) > PAGE_SIZE; int ret; lockdep_assert_held(&text_mutex); if (across_pages) patch_map(addr + len, FIX_TEXT_POKE1); waddr = patch_map(addr, FIX_TEXT_POKE...
[ 0, 0 ]
Linux Kernel
arch/riscv/kernel/probes/ftrace.c
void kprobe_ftrace_handler(unsigned long ip, unsigned long parent_ip, struct ftrace_ops *ops, struct ftrace_regs *fregs) { struct kprobe *p; struct pt_regs *regs; struct kprobe_ctlblk *kcb; int bit; bit = ftrace_test_recursion_trylock(ip, parent_ip); if (bit < 0) return; p...
[ 1, 0 ]
Linux Kernel
arch/riscv/kernel/probes/ftrace.c
int arch_prepare_kprobe_ftrace(struct kprobe *p) { p->ainsn.api.insn = NULL; return 0; }
[ 0, 0 ]
Linux Kernel
arch/riscv/kernel/probes/kprobes.c
static void __kprobes arch_prepare_ss_slot(struct kprobe *p) { unsigned long offset = GET_INSN_LENGTH(p->opcode); p->ainsn.api.restore = (unsigned long)p->addr + offset; patch_text(p->ainsn.api.insn, p->opcode); patch_text((void *)((unsigned long)(p->ainsn.api.insn) + offset), __BUG_INSN_32); }
[ 1, 0 ]
Linux Kernel
arch/riscv/kernel/probes/kprobes.c
void __kprobes arch_remove_kprobe(struct kprobe *p) {}
[ 0, 0 ]
Linux Kernel
arch/riscv/kernel/probes/kprobes.c
static void __kprobes set_current_kprobe(struct kprobe *p) { __this_cpu_write(current_kprobe, p); }
[ 0, 0 ]
Linux Kernel
arch/riscv/kernel/probes/kprobes.c
static void __kprobes kprobes_restore_local_irqflag(struct kprobe_ctlblk *kcb, struct pt_regs *regs) { regs->status = kcb->saved_status; }
[ 0, 0 ]
Linux Kernel
arch/riscv/kernel/probes/kprobes.c
static void __kprobes setup_singlestep(struct kprobe *p, struct pt_regs *regs, struct kprobe_ctlblk *kcb, int reenter) { unsigned long slot; if (reenter) { save_previous_kprobe(kcb); set_current_kprobe(p); kcb->kprobe_status = KPROBE_REENTER; } else { kcb->k...
[ 0, 0 ]
Linux Kernel
arch/riscv/kernel/probes/kprobes.c
bool __kprobes kprobe_breakpoint_handler(struct pt_regs *regs) { struct kprobe *p, *cur_kprobe; struct kprobe_ctlblk *kcb; unsigned long addr = instruction_pointer(regs); kcb = get_kprobe_ctlblk(); cur_kprobe = kprobe_running(); p = get_kprobe((kprobe_opcode_t *)addr); if (p) { if (cur_kprobe) { ...
[ 1, 0 ]
Linux Kernel
arch/riscv/kernel/probes/kprobes.c
bool __kprobes kprobe_single_step_handler(struct pt_regs *regs) { struct kprobe_ctlblk *kcb = get_kprobe_ctlblk(); unsigned long addr = instruction_pointer(regs); struct kprobe *cur = kprobe_running(); if (cur && (kcb->kprobe_status & (KPROBE_HIT_SS | KPROBE_REENTER)) && ((unsigned long)&cur->ainsn.api.i...
[ 1, 0 ]
Linux Kernel
arch/riscv/kernel/probes/kprobes.c
int __init arch_populate_kprobe_blacklist(void) { int ret; ret = kprobe_add_area_blacklist((unsigned long)__irqentry_text_start, (unsigned long)__irqentry_text_end); return ret; }
[ 0, 0 ]
Linux Kernel
arch/riscv/kernel/probes/kprobes.c
void __kprobes __used *trampoline_probe_handler(struct pt_regs *regs) { return (void *)kretprobe_trampoline_handler(regs, NULL); }
[ 0, 0 ]
Linux Kernel
arch/riscv/kernel/probes/simulate-insn.c
static inline bool rv_insn_reg_get_val(struct pt_regs *regs, u32 index, unsigned long *ptr) { if (index == 0) *ptr = 0; else if (index <= 31) *ptr = *((unsigned long *)regs + index); else return false; return true; }
[ 0, 0 ]
Linux Kernel
arch/riscv/kernel/probes/uprobes.c
int arch_uprobe_exception_notify(struct notifier_block *self, unsigned long val, void *data) { return NOTIFY_DONE; }
[ 0, 0 ]
Linux Kernel
arch/riscv/kernel/process.c
static int __init compat_mode_detect(void) { unsigned long tmp = csr_read(CSR_STATUS); csr_write(CSR_STATUS, (tmp & ~SR_UXL) | SR_UXL_32); compat_mode_supported = (csr_read(CSR_STATUS) & SR_UXL) == SR_UXL_32; csr_write(CSR_STATUS, tmp); pr_info("riscv: ELF compat mode %s", compat_mode_supported ...
[ 1, 0 ]
Linux Kernel
arch/riscv/kernel/ptrace.c
static int riscv_gpr_get(struct task_struct *target, const struct user_regset *regset, struct membuf to) { return membuf_write(&to, task_pt_regs(target), sizeof(struct user_regs_struct)); }
[ 1, 0 ]
Linux Kernel
arch/riscv/kernel/ptrace.c
static int riscv_gpr_set(struct task_struct *target, const struct user_regset *regset, unsigned int pos, unsigned int count, const void *kbuf, const void __user *ubuf) { struct pt_regs *regs; regs = task_pt_regs(target); return user_regs...
[ 0, 0 ]
Linux Kernel
arch/riscv/kernel/ptrace.c
static int riscv_fpr_get(struct task_struct *target, const struct user_regset *regset, struct membuf to) { struct __riscv_d_ext_state *fstate = &target->thread.fstate; if (target == current) fstate_save(current, task_pt_regs(current)); membuf_write(&to, fstate, offsetof(struct __ris...
[ 0, 0 ]
Linux Kernel
arch/riscv/kernel/ptrace.c
int regs_query_register_offset(const char *name) { const struct pt_regs_offset *roff; for (roff = regoffset_table; roff->name != NULL; roff++) if (!strcmp(roff->name, name)) return roff->offset; return -EINVAL; }
[ 0, 0 ]
Linux Kernel
arch/riscv/kernel/ptrace.c
void ptrace_disable(struct task_struct *child) { clear_tsk_thread_flag(child, TIF_SYSCALL_TRACE); }
[ 0, 0 ]