Projectname large_stringclasses 15
values | Filepath large_stringlengths 4 106 ⌀ | Function large_stringlengths 11 3.45k | Label list |
|---|---|---|---|
Linux Kernel | arch/riscv/mm/init.c |
static phys_addr_t __init alloc_pmd_late(uintptr_t va) {
unsigned long vaddr;
vaddr = __get_free_page(GFP_KERNEL);
BUG_ON(!vaddr || !pgtable_pmd_page_ctor(virt_to_page(vaddr)));
return __pa(vaddr);
} | [
0,
0
] |
Linux Kernel | arch/riscv/mm/init.c |
static pud_t *__init get_pud_virt_fixmap(phys_addr_t pa) {
clear_fixmap(FIX_PUD);
return (pud_t *)set_fixmap_offset(FIX_PUD, pa);
} | [
0,
0
] |
Linux Kernel | arch/riscv/mm/init.c |
static pud_t *__init get_pud_virt_late(phys_addr_t pa) {
return (pud_t *)__va(pa);
} | [
0,
0
] |
Linux Kernel | arch/riscv/mm/init.c |
static phys_addr_t __init alloc_pud_fixmap(uintptr_t va) {
return memblock_phys_alloc(PAGE_SIZE, PAGE_SIZE);
} | [
0,
0
] |
Linux Kernel | arch/riscv/mm/init.c | asmlinkage void __init __copy_data(void) {
void *from = (void *)(&__data_loc);
void *to = (void *)CONFIG_PHYS_RAM_BASE;
size_t sz = (size_t)((uintptr_t)(&_end) - (uintptr_t)(&_sdata));
memcpy(to, from, sz);
} | [
1,
0
] |
Linux Kernel | arch/riscv/mm/init.c | static __init pgprot_t pgprot_from_va(uintptr_t va) {
if (IS_ENABLED(CONFIG_64BIT) && !is_kernel_mapping(va))
return PAGE_KERNEL;
return PAGE_KERNEL_EXEC;
} | [
0,
0
] |
Linux Kernel | arch/riscv/mm/init.c | static void __init disable_pgtable_l5(void) {
pgtable_l5_enabled = false;
kernel_map.page_offset = PAGE_OFFSET_L4;
satp_mode = SATP_MODE_48;
} | [
0,
0
] |
Linux Kernel | arch/riscv/mm/init.c | static void __init create_kernel_page_table(pgd_t *pgdir,
__always_unused bool early) {
uintptr_t va, end_va;
end_va = kernel_map.virt_addr + kernel_map.xiprom_sz;
for (va = kernel_map.virt_addr; va < end_va; va += PMD_SIZE)
create_pgd_mapping(pgdir, va,
... | [
1,
0
] |
Linux Kernel | arch/riscv/mm/init.c | static void __init reserve_crashkernel(void) {
unsigned long long crash_base = 0;
unsigned long long crash_size = 0;
unsigned long search_start = memblock_start_of_DRAM();
unsigned long search_end = memblock_end_of_DRAM();
int ret = 0;
if (!IS_ENABLED(CONFIG_KEXEC_CORE))
return;
if (is_kdump_kernel... | [
1,
0
] |
Linux Kernel | arch/riscv/mm/init.c |
void __init paging_init(void) {
setup_bootmem();
setup_vm_final();
} | [
0,
0
] |
Linux Kernel | arch/riscv/mm/init.c |
void __init misc_mem_init(void) {
early_memtest(min_low_pfn << PAGE_SHIFT, max_low_pfn << PAGE_SHIFT);
arch_numa_init();
sparse_init();
zone_sizes_init();
reserve_crashkernel();
memblock_dump_all();
} | [
0,
0
] |
Linux Kernel | arch/riscv/mm/kasan_init.c |
static void __init kasan_shallow_populate_pmd(pgd_t *pgdp, unsigned long vaddr,
unsigned long end) {
unsigned long next;
pmd_t *pmdp, *base_pmd;
bool is_kasan_pte;
base_pmd = (pmd_t *)pgd_page_vaddr(*pgdp);
pmdp = base_pmd + pmd_index(vaddr);
do {
next = ... | [
0,
0
] |
Linux Kernel | arch/riscv/mm/kasan_init.c |
static void __init kasan_shallow_populate_pgd(unsigned long vaddr,
unsigned long end) {
unsigned long next;
void *p;
pgd_t *pgd_k = pgd_offset_k(vaddr);
bool is_kasan_pgd_next;
do {
next = pgd_addr_end(vaddr, end);
is_kasan_pgd_next = (pgd_page_vaddr(*pg... | [
1,
0
] |
Linux Kernel | arch/riscv/mm/kasan_init.c |
static void __init kasan_shallow_populate(void *start, void *end) {
unsigned long vaddr = (unsigned long)start & PAGE_MASK;
unsigned long vend = PAGE_ALIGN((unsigned long)end);
kasan_shallow_populate_pgd(vaddr, vend);
local_flush_tlb_all();
} | [
0,
0
] |
Linux Kernel | arch/riscv/mm/pageattr.c |
static int pageattr_p4d_entry(p4d_t *p4d, unsigned long addr,
unsigned long next, struct mm_walk *walk) {
p4d_t val = READ_ONCE(*p4d);
if (p4d_leaf(val)) {
val = __p4d(set_pageattr_masks(p4d_val(val), walk));
set_p4d(p4d, val);
}
return 0;
} | [
0,
0
] |
Linux Kernel | arch/riscv/mm/pageattr.c |
static int pageattr_pud_entry(pud_t *pud, unsigned long addr,
unsigned long next, struct mm_walk *walk) {
pud_t val = READ_ONCE(*pud);
if (pud_leaf(val)) {
val = __pud(set_pageattr_masks(pud_val(val), walk));
set_pud(pud, val);
}
return 0;
} | [
0,
0
] |
Linux Kernel | arch/riscv/mm/pageattr.c |
static int pageattr_pte_entry(pte_t *pte, unsigned long addr,
unsigned long next, struct mm_walk *walk) {
pte_t val = READ_ONCE(*pte);
val = __pte(set_pageattr_masks(pte_val(val), walk));
set_pte(pte, val);
return 0;
} | [
0,
0
] |
Linux Kernel | arch/riscv/mm/pageattr.c | static int pageattr_pte_hole(unsigned long addr, unsigned long next, int depth,
struct mm_walk *walk) {
return 0;
} | [
0,
0
] |
Linux Kernel | arch/riscv/mm/pageattr.c |
int set_memory_rw(unsigned long addr, int numpages) {
return __set_memory(addr, numpages, __pgprot(_PAGE_READ | _PAGE_WRITE),
__pgprot(0));
} | [
0,
0
] |
Linux Kernel | arch/riscv/mm/pageattr.c |
int set_direct_map_invalid_noflush(struct page *page) {
int ret;
unsigned long start = (unsigned long)page_address(page);
unsigned long end = start + PAGE_SIZE;
struct pageattr_masks masks = {.set_mask = __pgprot(0),
.clear_mask = __pgprot(_PAGE_PRESENT)};
mmap_read_lock(&in... | [
1,
0
] |
Linux Kernel | arch/riscv/mm/pageattr.c |
bool kernel_page_present(struct page *page) {
unsigned long addr = (unsigned long)page_address(page);
pgd_t *pgd;
pud_t *pud;
p4d_t *p4d;
pmd_t *pmd;
pte_t *pte;
pgd = pgd_offset_k(addr);
if (!pgd_present(*pgd))
return false;
p4d = p4d_offset(pgd, addr);
if (!p4d_present(*p4d))
return fal... | [
0,
0
] |
Linux Kernel | arch/riscv/mm/ptdump.c |
static void note_page(struct ptdump_state *pt_st, unsigned long addr, int level,
u64 val) {
struct pg_state *st = container_of(pt_st, struct pg_state, ptdump);
u64 pa = PFN_PHYS(pte_pfn(__pte(val)));
u64 prot = 0;
if (level >= 0)
prot = val & pg_level[level].mask;
if (st->level ==... | [
1,
0
] |
Linux Kernel | arch/riscv/mm/ptdump.c |
static void ptdump_walk(struct seq_file *s, struct ptd_mm_info *pinfo) {
struct pg_state st = {
.seq = s,
.marker = pinfo->markers,
.level = -1,
.ptdump = {.note_page = note_page,
.range = (struct ptdump_range[]){
{pinfo->base_addr, pinfo->end}, {0, 0}}}}... | [
0,
0
] |
Linux Kernel | arch/riscv/mm/ptdump.c |
static int __init ptdump_init(void) {
unsigned int i, j;
#ifdef CONFIG_KASAN
address_markers[KASAN_SHADOW_START_NR].start_address = KASAN_SHADOW_START;
address_markers[KASAN_SHADOW_END_NR].start_address = KASAN_SHADOW_END;
#endif
address_markers[FIXMAP_START_NR].start_address = FIXADDR_START;
address_marker... | [
0,
0
] |
Linux Kernel | arch/riscv/mm/tlbflush.c | static void __sbi_tlb_flush_range(struct mm_struct *mm, unsigned long start,
unsigned long size, unsigned long stride) {
struct cpumask *cmask = mm_cpumask(mm);
unsigned int cpuid;
bool broadcast;
if (cpumask_empty(cmask))
return;
cpuid = get_cpu();
broadcast = cpuma... | [
1,
0
] |
Linux Kernel | arch/riscv/net/bpf_jit.h | static inline int ninsns_rvoff(int ninsns) { return ninsns << 1; } | [
0,
0
] |
Linux Kernel | arch/riscv/net/bpf_jit.h |
static inline bool is_10b_int(long val) {
return -(1L << 9) <= val && val < (1L << 9);
} | [
1,
0
] |
Linux Kernel | arch/riscv/net/bpf_jit.h | static inline int rv_offset(int insn, int off, struct rv_jit_context *ctx) {
int from, to;
off++;
from = (insn > 0) ? ctx->offset[insn - 1] : 0;
to = (insn + off > 0) ? ctx->offset[insn + off - 1] : 0;
return ninsns_rvoff(to - from);
} | [
1,
0
] |
Linux Kernel | arch/riscv/net/bpf_jit.h |
static inline u32 rv_i_insn(u16 imm11_0, u8 rs1, u8 funct3, u8 rd, u8 opcode) {
return (imm11_0 << 20) | (rs1 << 15) | (funct3 << 12) | (rd << 7) | opcode;
} | [
1,
0
] |
Linux Kernel | arch/riscv/net/bpf_jit.h |
static inline u32 rv_b_insn(u16 imm12_1, u8 rs2, u8 rs1, u8 funct3, u8 opcode) {
u8 imm12 = ((imm12_1 & 0x800) >> 5) | ((imm12_1 & 0x3f0) >> 4);
u8 imm4_1 = ((imm12_1 & 0xf) << 1) | ((imm12_1 & 0x400) >> 10);
return (imm12 << 25) | (rs2 << 20) | (rs1 << 15) | (funct3 << 12) |
(imm4_1 << 7) | opcode;
} | [
1,
0
] |
Linux Kernel | arch/riscv/net/bpf_jit.h |
static inline u32 rv_u_insn(u32 imm31_12, u8 rd, u8 opcode) {
return (imm31_12 << 12) | (rd << 7) | opcode;
} | [
1,
0
] |
Linux Kernel | arch/riscv/net/bpf_jit.h | static inline u16 rv_cr_insn(u8 funct4, u8 rd, u8 rs2, u8 op) {
return (funct4 << 12) | (rd << 7) | (rs2 << 2) | op;
} | [
1,
0
] |
Linux Kernel | arch/riscv/net/bpf_jit.h |
static inline u16 rv_cs_insn(u8 funct3, u32 imm_hi, u8 rs1, u32 imm_lo, u8 rs2,
u8 op) {
return (funct3 << 13) | (imm_hi << 10) | ((rs1 & 0x7) << 7) | (imm_lo << 5) |
((rs2 & 0x7) << 2) | op;
} | [
1,
0
] |
Linux Kernel | arch/riscv/net/bpf_jit.h |
static inline u16 rv_cb_insn(u8 funct3, u32 imm6, u8 funct2, u8 rd, u8 op) {
u32 imm;
imm = ((imm6 & 0x20) << 7) | ((imm6 & 0x1f) << 2);
return (funct3 << 13) | (funct2 << 10) | ((rd & 0x7) << 7) | op | imm;
} | [
1,
0
] |
Linux Kernel | arch/riscv/net/bpf_jit.h |
static inline u32 rv_srai(u8 rd, u8 rs1, u16 imm11_0) {
return rv_i_insn(0x400 | imm11_0, rs1, 5, rd, 0x13);
} | [
0,
0
] |
Linux Kernel | arch/riscv/net/bpf_jit.h |
static inline u32 rv_sltu(u8 rd, u8 rs1, u8 rs2) {
return rv_r_insn(0, rs2, rs1, 3, rd, 0x33);
} | [
0,
0
] |
Linux Kernel | arch/riscv/net/bpf_jit.h |
static inline u32 rv_and(u8 rd, u8 rs1, u8 rs2) {
return rv_r_insn(0, rs2, rs1, 7, rd, 0x33);
} | [
0,
0
] |
Linux Kernel | arch/riscv/net/bpf_jit.h |
static inline u32 rv_sra(u8 rd, u8 rs1, u8 rs2) {
return rv_r_insn(0x20, rs2, rs1, 5, rd, 0x33);
} | [
0,
0
] |
Linux Kernel | arch/riscv/net/bpf_jit.h |
static inline u32 rv_divu(u8 rd, u8 rs1, u8 rs2) {
return rv_r_insn(1, rs2, rs1, 5, rd, 0x33);
} | [
0,
0
] |
Linux Kernel | arch/riscv/net/bpf_jit.h |
static inline u32 rv_bne(u8 rs1, u8 rs2, u16 imm12_1) {
return rv_b_insn(imm12_1, rs2, rs1, 1, 0x63);
} | [
0,
0
] |
Linux Kernel | arch/riscv/net/bpf_jit.h |
static inline u32 rv_bltu(u8 rs1, u8 rs2, u16 imm12_1) {
return rv_b_insn(imm12_1, rs2, rs1, 6, 0x63);
} | [
0,
0
] |
Linux Kernel | arch/riscv/net/bpf_jit.h |
static inline u32 rv_bgtu(u8 rs1, u8 rs2, u16 imm12_1) {
return rv_bltu(rs2, rs1, imm12_1);
} | [
0,
0
] |
Linux Kernel | arch/riscv/net/bpf_jit.h |
static inline u32 rv_bgt(u8 rs1, u8 rs2, u16 imm12_1) {
return rv_blt(rs2, rs1, imm12_1);
} | [
0,
0
] |
Linux Kernel | arch/riscv/net/bpf_jit.h |
static inline u32 rv_sh(u8 rs1, u16 imm11_0, u8 rs2) {
return rv_s_insn(imm11_0, rs2, rs1, 1, 0x23);
} | [
0,
0
] |
Linux Kernel | arch/riscv/net/bpf_jit.h |
static inline u32 rv_amoadd_w(u8 rd, u8 rs2, u8 rs1, u8 aq, u8 rl) {
return rv_amo_insn(0, aq, rl, rs2, rs1, 2, rd, 0x2f);
} | [
0,
0
] |
Linux Kernel | arch/riscv/net/bpf_jit.h |
static inline u32 rv_amoand_w(u8 rd, u8 rs2, u8 rs1, u8 aq, u8 rl) {
return rv_amo_insn(0xc, aq, rl, rs2, rs1, 2, rd, 0x2f);
} | [
0,
0
] |
Linux Kernel | arch/riscv/net/bpf_jit.h |
static inline u32 rv_amoxor_w(u8 rd, u8 rs2, u8 rs1, u8 aq, u8 rl) {
return rv_amo_insn(0x4, aq, rl, rs2, rs1, 2, rd, 0x2f);
} | [
0,
0
] |
Linux Kernel | arch/riscv/net/bpf_jit.h |
static inline u32 rv_fence(u8 pred, u8 succ) {
u16 imm11_0 = pred << 4 | succ;
return rv_i_insn(imm11_0, 0, 0, 0, 0xf);
} | [
0,
0
] |
Linux Kernel | arch/riscv/net/bpf_jit.h | static inline u16 rvc_addi4spn(u8 rd, u32 imm10) {
u32 imm;
imm = ((imm10 & 0x30) << 2) | ((imm10 & 0x3c0) >> 4) | ((imm10 & 0x4) >> 1) |
((imm10 & 0x8) >> 3);
return rv_ciw_insn(0x0, imm, rd, 0x0);
} | [
1,
0
] |
Linux Kernel | arch/riscv/net/bpf_jit.h |
static inline u16 rvc_lw(u8 rd, u32 imm7, u8 rs1) {
u32 imm_hi, imm_lo;
imm_hi = (imm7 & 0x38) >> 3;
imm_lo = ((imm7 & 0x4) >> 1) | ((imm7 & 0x40) >> 6);
return rv_cl_insn(0x2, imm_hi, rs1, imm_lo, rd, 0x0);
} | [
1,
0
] |
Linux Kernel | arch/riscv/net/bpf_jit.h |
static inline u16 rvc_addi(u8 rd, u32 imm6) {
return rv_ci_insn(0, imm6, rd, 0x1);
} | [
0,
0
] |
Linux Kernel | arch/riscv/net/bpf_jit.h |
static inline u16 rvc_lui(u8 rd, u32 imm6) {
return rv_ci_insn(0x3, imm6, rd, 0x1);
} | [
0,
0
] |
Linux Kernel | arch/riscv/net/bpf_jit.h |
static inline u16 rvc_srai(u8 rd, u32 imm6) {
return rv_cb_insn(0x4, imm6, 0x1, rd, 0x1);
} | [
0,
0
] |
Linux Kernel | arch/riscv/net/bpf_jit.h |
static inline u16 rvc_andi(u8 rd, u32 imm6) {
return rv_cb_insn(0x4, imm6, 0x2, rd, 0x1);
} | [
0,
0
] |
Linux Kernel | arch/riscv/net/bpf_jit.h |
static inline u16 rvc_and(u8 rd, u8 rs) {
return rv_ca_insn(0x23, rd, 0x3, rs, 0x1);
} | [
0,
0
] |
Linux Kernel | arch/riscv/net/bpf_jit.h |
static inline u16 rvc_jalr(u8 rs1) {
return rv_cr_insn(0x9, rs1, RV_REG_ZERO, 0x2);
} | [
0,
0
] |
Linux Kernel | arch/riscv/net/bpf_jit.h |
static inline u16 rvc_add(u8 rd, u8 rs) { return rv_cr_insn(0x9, rd, rs, 0x2); } | [
0,
0
] |
Linux Kernel | arch/riscv/net/bpf_jit.h |
static inline u32 rv_addiw(u8 rd, u8 rs1, u16 imm11_0) {
return rv_i_insn(imm11_0, rs1, 0, rd, 0x1b);
} | [
0,
0
] |
Linux Kernel | arch/riscv/net/bpf_jit.h |
static inline u32 rv_addw(u8 rd, u8 rs1, u8 rs2) {
return rv_r_insn(0, rs2, rs1, 0, rd, 0x3b);
} | [
0,
0
] |
Linux Kernel | arch/riscv/net/bpf_jit.h |
static inline u32 rv_amoswap_d(u8 rd, u8 rs2, u8 rs1, u8 aq, u8 rl) {
return rv_amo_insn(0x1, aq, rl, rs2, rs1, 3, rd, 0x2f);
} | [
0,
0
] |
Linux Kernel | arch/riscv/net/bpf_jit.h |
static inline u32 rv_lr_d(u8 rd, u8 rs2, u8 rs1, u8 aq, u8 rl) {
return rv_amo_insn(0x2, aq, rl, rs2, rs1, 3, rd, 0x2f);
} | [
0,
0
] |
Linux Kernel | arch/riscv/net/bpf_jit.h |
static inline u16 rvc_sd(u8 rs1, u32 imm8, u8 rs2) {
u32 imm_hi, imm_lo;
imm_hi = (imm8 & 0x38) >> 3;
imm_lo = (imm8 & 0xc0) >> 6;
return rv_cs_insn(0x7, imm_hi, rs1, imm_lo, rs2, 0x0);
} | [
0,
0
] |
Linux Kernel | arch/riscv/net/bpf_jit.h |
static inline u16 rvc_ldsp(u8 rd, u32 imm9) {
u32 imm;
imm = ((imm9 & 0x1c0) >> 6) | (imm9 & 0x38);
return rv_ci_insn(0x3, imm, rd, 0x2);
} | [
1,
0
] |
Linux Kernel | arch/riscv/net/bpf_jit.h | static inline void emit_jalr(u8 rd, u8 rs, s32 imm,
struct rv_jit_context *ctx) {
if (rvc_enabled() && rd == RV_REG_RA && rs && !imm)
emitc(rvc_jalr(rs), ctx);
else if (rvc_enabled() && !rd && rs && !imm)
emitc(rvc_jr(rs), ctx);
else
emit(rv_jalr(rd, rs, imm), ctx);
} | [
0,
0
] |
Linux Kernel | arch/riscv/net/bpf_jit.h |
static inline void emit_add(u8 rd, u8 rs1, u8 rs2, struct rv_jit_context *ctx) {
if (rvc_enabled() && rd && rd == rs1 && rs2)
emitc(rvc_add(rd, rs2), ctx);
else
emit(rv_add(rd, rs1, rs2), ctx);
} | [
0,
0
] |
Linux Kernel | arch/riscv/net/bpf_jit.h |
static inline void emit_li(u8 rd, s32 imm, struct rv_jit_context *ctx) {
if (rvc_enabled() && rd && is_6b_int(imm))
emitc(rvc_li(rd, imm), ctx);
else
emit(rv_addi(rd, RV_REG_ZERO, imm), ctx);
} | [
0,
0
] |
Linux Kernel | arch/riscv/net/bpf_jit.h |
static inline void emit_slli(u8 rd, u8 rs, s32 imm,
struct rv_jit_context *ctx) {
if (rvc_enabled() && rd && rd == rs && imm && (u32)imm < __riscv_xlen)
emitc(rvc_slli(rd, imm), ctx);
else
emit(rv_slli(rd, rs, imm), ctx);
} | [
0,
0
] |
Linux Kernel | arch/riscv/net/bpf_jit.h |
static inline void emit_srai(u8 rd, u8 rs, s32 imm,
struct rv_jit_context *ctx) {
if (rvc_enabled() && is_creg(rd) && rd == rs && imm &&
(u32)imm < __riscv_xlen)
emitc(rvc_srai(rd, imm), ctx);
else
emit(rv_srai(rd, rs, imm), ctx);
} | [
0,
0
] |
Linux Kernel | arch/riscv/net/bpf_jit.h |
static inline void emit_xor(u8 rd, u8 rs1, u8 rs2, struct rv_jit_context *ctx) {
if (rvc_enabled() && is_creg(rd) && rd == rs1 && is_creg(rs2))
emitc(rvc_xor(rd, rs2), ctx);
else
emit(rv_xor(rd, rs1, rs2), ctx);
} | [
0,
0
] |
Linux Kernel | arch/riscv/net/bpf_jit.h |
static inline void emit_lw(u8 rd, s32 off, u8 rs1, struct rv_jit_context *ctx) {
if (rvc_enabled() && rs1 == RV_REG_SP && rd && is_8b_uint(off) &&
!(off & 0x3))
emitc(rvc_lwsp(rd, off), ctx);
else if (rvc_enabled() && is_creg(rd) && is_creg(rs1) && is_7b_uint(off) &&
!(off & 0x3))
emitc(rv... | [
0,
0
] |
Linux Kernel | arch/riscv/net/bpf_jit_comp32.c |
static s8 lo(const s8 *r) { return r[1]; } | [
0,
0
] |
Linux Kernel | arch/riscv/net/bpf_jit_comp32.c |
static void emit_imm64(const s8 *rd, s32 imm_hi, s32 imm_lo,
struct rv_jit_context *ctx) {
emit_imm(lo(rd), imm_lo, ctx);
emit_imm(hi(rd), imm_hi, ctx);
} | [
0,
0
] |
Linux Kernel | arch/riscv/net/bpf_jit_comp32.c |
static const s8 *bpf_get_reg64(const s8 *reg, const s8 *tmp,
struct rv_jit_context *ctx) {
if (is_stacked(hi(reg))) {
emit(rv_lw(hi(tmp), hi(reg), RV_REG_FP), ctx);
emit(rv_lw(lo(tmp), lo(reg), RV_REG_FP), ctx);
reg = tmp;
}
return reg;
} | [
0,
0
] |
Linux Kernel | arch/riscv/net/bpf_jit_comp32.c |
static void emit_jump_and_link(u8 rd, s32 rvoff, bool force_jalr,
struct rv_jit_context *ctx) {
s32 upper, lower;
if (rvoff && is_21b_int(rvoff) && !force_jalr) {
emit(rv_jal(rd, rvoff >> 1), ctx);
return;
}
upper = (rvoff + (1 << 11)) >> 12;
lower = rvoff & 0xfff;
... | [
1,
0
] |
Linux Kernel | arch/riscv/net/bpf_jit_comp32.c | static void emit_call(bool fixed, u64 addr, struct rv_jit_context *ctx) {
const s8 *r0 = bpf2rv32[BPF_REG_0];
const s8 *r5 = bpf2rv32[BPF_REG_5];
u32 upper = ((u32)addr + (1 << 11)) >> 12;
u32 lower = addr & 0xfff;
emit(rv_addi(RV_REG_SP, RV_REG_SP, -16), ctx);
emit(rv_sw(RV_REG_SP, 0, lo(r5)), ctx);
emi... | [
1,
0
] |
Linux Kernel | arch/riscv/net/bpf_jit_comp32.c |
static void emit_rev32(const s8 rd, struct rv_jit_context *ctx) {
emit(rv_addi(RV_REG_T1, RV_REG_ZERO, 0), ctx);
emit(rv_andi(RV_REG_T0, rd, 255), ctx);
emit(rv_add(RV_REG_T1, RV_REG_T1, RV_REG_T0), ctx);
emit(rv_slli(RV_REG_T1, RV_REG_T1, 8), ctx);
emit(rv_srli(rd, rd, 8), ctx);
emit(rv_andi(RV_REG_T0, rd... | [
0,
0
] |
Linux Kernel | arch/riscv/net/bpf_jit_comp64.c |
static bool is_32b_int(s64 val) {
return -(1L << 31) <= val && val < (1L << 31);
} | [
1,
0
] |
Linux Kernel | arch/riscv/net/bpf_jit_comp64.c | static bool in_auipc_jalr_range(s64 val) {
return (-(1L << 31) - (1L << 11)) <= val && val < ((1L << 31) - (1L << 11));
} | [
1,
0
] |
Linux Kernel | arch/riscv/net/bpf_jit_comp64.c | static int emit_addr(u8 rd, u64 addr, bool extra_pass,
struct rv_jit_context *ctx) {
u64 ip = (u64)(ctx->insns + ctx->ninsns);
s64 off = addr - ip;
s64 upper = (off + (1 << 11)) >> 12;
s64 lower = off & 0xfff;
if (extra_pass && !in_auipc_jalr_range(off)) {
pr_err("bpf-jit: target off... | [
1,
0
] |
Linux Kernel | arch/riscv/net/bpf_jit_comp64.c | static void emit_imm(u8 rd, s64 val, struct rv_jit_context *ctx) {
s64 upper = (val + (1 << 11)) >> 12;
/* Sign-extend lower 12 bits to 64 bits since immediates for li, addiw,
* and addi are signed and RVC checks will perform signed comparisons.
*/
s64 lower = ((val & 0xfff) << 52) >> 52;
int shift;
i... | [
1,
0
] |
Linux Kernel | arch/riscv/net/bpf_jit_comp64.c |
static void emit_bcc(u8 cond, u8 rd, u8 rs, int rvoff,
struct rv_jit_context *ctx) {
switch (cond) {
case BPF_JEQ:
emit(rv_beq(rd, rs, rvoff >> 1), ctx);
return;
case BPF_JGT:
emit(rv_bltu(rs, rd, rvoff >> 1), ctx);
return;
case BPF_JLT:
emit(rv_bltu(rd, rs, rvoff >> 1)... | [
1,
0
] |
Linux Kernel | arch/riscv/net/bpf_jit_comp64.c |
static bool is_signed_bpf_cond(u8 cond) {
return cond == BPF_JSGT || cond == BPF_JSLT || cond == BPF_JSGE ||
cond == BPF_JSLE;
} | [
0,
0
] |
Linux Kernel | arch/riscv/net/bpf_jit_comp64.c |
static int emit_call(bool fixed, u64 addr, struct rv_jit_context *ctx) {
s64 off = 0;
u64 ip;
u8 rd;
int ret;
if (addr && ctx->insns) {
ip = (u64)(long)(ctx->insns + ctx->ninsns);
off = addr - ip;
}
ret = emit_jump_and_link(RV_REG_RA, off, !fixed, ctx);
if (ret)
return ret;
rd = bpf_to_... | [
1,
0
] |
Linux Kernel | arch/s390/appldata/appldata_base.c | static void appldata_work_fn(struct work_struct *work) {
struct list_head *lh;
struct appldata_ops *ops;
mutex_lock(&appldata_ops_mutex);
list_for_each(lh, &appldata_ops_list) {
ops = list_entry(lh, struct appldata_ops, list);
if (ops->active == 1) {
ops->callback(ops->data);
}
}
mutex_un... | [
0,
0
] |
Linux Kernel | arch/s390/appldata/appldata_base.c | int appldata_diag(char record_nr, u16 function, unsigned long buffer,
u16 length, char *mod_lvl) {
struct appldata_parameter_list *parm_list;
struct appldata_product_id *id;
int rc;
parm_list = kmalloc(sizeof(*parm_list), GFP_KERNEL);
id = kmemdup(&appldata_id, sizeof(appldata_id), GFP_KERN... | [
1,
0
] |
Linux Kernel | arch/s390/appldata/appldata_base.c | int appldata_register_ops(struct appldata_ops *ops) {
if (ops->size > APPLDATA_MAX_REC_SIZE)
return -EINVAL;
ops->ctl_table = kcalloc(4, sizeof(struct ctl_table), GFP_KERNEL);
if (!ops->ctl_table)
return -ENOMEM;
mutex_lock(&appldata_ops_mutex);
list_add(&ops->list, &appldata_ops_list);
mutex_unlo... | [
1,
0
] |
Linux Kernel | arch/s390/appldata/appldata_mem.c | static int __init appldata_mem_init(void) {
int ret;
ops.data = kzalloc(sizeof(struct appldata_mem_data), GFP_KERNEL);
if (!ops.data)
return -ENOMEM;
ret = appldata_register_ops(&ops);
if (ret)
kfree(ops.data);
return ret;
} | [
0,
0
] |
Linux Kernel | arch/s390/appldata/appldata_net_sum.c | static void appldata_get_net_sum_data(void *data) {
int i;
struct appldata_net_sum_data *net_data;
struct net_device *dev;
unsigned long rx_packets, tx_packets, rx_bytes, tx_bytes, rx_errors,
tx_errors, rx_dropped, tx_dropped, collisions;
net_data = data;
net_data->sync_count_1++;
i = 0;
rx_pack... | [
0,
0
] |
Linux Kernel | arch/s390/boot/als.c |
static void u16_to_hex(char *str, u16 val) {
int i, num;
for (i = 1; i <= 4; i++) {
num = (val >> (16 - 4 * i)) & 0xf;
if (num >= 10)
num += 7;
*str++ = '0' + num;
}
*str = '\0';
} | [
1,
0
] |
Linux Kernel | arch/s390/boot/als.c | void print_missing_facilities(void) {
static char als_str[80] = "Missing facilities: ";
unsigned long val;
char val_str[6];
int i, j, first;
first = 1;
for (i = 0; i < ARRAY_SIZE(als); i++) {
val = ~stfle_fac_list[i] & als[i];
for (j = 0; j < BITS_PER_LONG; j++) {
if (!(val & (1UL << (BITS_PE... | [
1,
0
] |
Linux Kernel | arch/s390/boot/ipl_parm.c |
static size_t scpdata_length(const u8 *buf, size_t count) {
while (count) {
if (buf[count - 1] != '\0' && buf[count - 1] != ' ')
break;
count--;
}
return count;
} | [
0,
0
] |
Linux Kernel | arch/s390/boot/ipl_parm.c |
static inline int has_ebcdic_char(const char *str) {
int i;
for (i = 0; str[i]; i++)
if (str[i] & 0x80)
return 1;
return 0;
} | [
0,
0
] |
Linux Kernel | arch/s390/boot/ipl_parm.c | void setup_boot_command_line(void) {
parmarea.command_line[COMMAND_LINE_SIZE - 1] = 0;
if (has_ebcdic_char(parmarea.command_line))
EBCASC(parmarea.command_line, COMMAND_LINE_SIZE);
/* copy arch command line */
strcpy(early_command_line, strim(parmarea.command_line));
/* append IPL PARM data to the boot ... | [
1,
0
] |
Linux Kernel | arch/s390/boot/ipl_report.c |
static inline bool intersects(unsigned long addr0, unsigned long size0,
unsigned long addr1, unsigned long size1) {
return addr0 + size0 > addr1 && addr1 + size1 > addr0;
} | [
1,
0
] |
Linux Kernel | arch/s390/boot/ipl_report.c | static unsigned long find_bootdata_space(struct ipl_rb_components *comps,
struct ipl_rb_certificates *certs,
unsigned long safe_addr) {
struct ipl_rb_certificate_entry *cert;
struct ipl_rb_component_entry *comp;
size_t size;
earl... | [
1,
0
] |
Linux Kernel | arch/s390/boot/mem_detect.c | static void *mem_detect_alloc_extended(void) {
unsigned long offset = ALIGN(mem_safe_offset(), sizeof(u64));
if (IS_ENABLED(CONFIG_BLK_DEV_INITRD) && initrd_data.start &&
initrd_data.size && initrd_data.start < offset + ENTRIES_EXTENDED_MAX)
offset = ALIGN(initrd_data.start + initrd_data.size, sizeof(u64... | [
1,
0
] |
Linux Kernel | arch/s390/boot/mem_detect.c |
static struct mem_detect_block *__get_mem_detect_block_ptr(u32 n) {
if (n < MEM_INLINED_ENTRIES)
return &mem_detect.entries[n];
if (unlikely(!mem_detect.entries_extended))
mem_detect.entries_extended = mem_detect_alloc_extended();
return &mem_detect.entries_extended[n - MEM_INLINED_ENTRIES];
} | [
0,
0
] |
Linux Kernel | arch/s390/boot/mem_detect.c | static int diag260(void) {
int rc, i;
struct {
unsigned long start;
unsigned long end;
} storage_extents[8] __aligned(16);
memset(storage_extents, 0, sizeof(storage_extents));
rc = __diag260((unsigned long)storage_extents, sizeof(storage_extents));
if (rc == -1)
return -1;
for (i = 0; i < m... | [
1,
0
] |
Linux Kernel | arch/s390/boot/mem_detect.c |
unsigned long detect_memory(void) {
unsigned long max_physmem_end;
sclp_early_get_memsize(&max_physmem_end);
if (!sclp_early_read_storage_info()) {
mem_detect.info_source = MEM_DETECT_SCLP_STOR_INFO;
return max_physmem_end;
}
if (!diag260()) {
mem_detect.info_source = MEM_DETECT_DIAG260;
r... | [
0,
0
] |
Linux Kernel | arch/s390/boot/pgm_check_info.c |
static char *as_hex(char *dst, unsigned long val, int pad) {
char *p, *end = p = dst + max(pad, (int)__fls(val | 1) / 4 + 1);
for (*p-- = 0; p >= dst; val >>= 4)
*p-- = hex_asc[val & 0x0f];
return end;
} | [
1,
0
] |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.