Projectname large_stringclasses 15
values | Filepath large_stringlengths 4 106 ⌀ | Function large_stringlengths 11 3.45k | Label list |
|---|---|---|---|
Linux Kernel | arch/x86/platform/olpc/olpc_dt.c | static u32 __init olpc_dt_get_board_revision(void) {
phandle node;
__be32 rev;
int r;
node = olpc_dt_finddevice("/");
if (!node)
return 0;
r = olpc_dt_getproperty(node, "board-revision-int", (char *)&rev,
sizeof(rev));
if (r < 0)
return 0;
return be32_to_cpu(rev);
} | [
1,
0
] |
Linux Kernel | arch/x86/platform/pvh/enlighten.c |
static u64 __init pvh_get_root_pointer(void) {
return pvh_start_info.rsdp_paddr;
} | [
0,
0
] |
Linux Kernel | arch/x86/platform/ts5500/ts5500.c |
static ssize_t name_show(struct device *dev, struct device_attribute *attr,
char *buf) {
struct ts5500_sbc *sbc = dev_get_drvdata(dev);
return sprintf(buf, "%s\n", sbc->name);
} | [
1,
0
] |
Linux Kernel | arch/x86/platform/uv/bios_uv.c |
int uv_bios_mq_watchlist_free(int blade, int watchlist_num) {
return (int)uv_bios_call_irqsave(UV_BIOS_WATCHLIST_FREE, blade, watchlist_num,
0, 0, 0);
} | [
0,
0
] |
Linux Kernel | arch/x86/platform/uv/bios_uv.c |
s64 uv_bios_freq_base(u64 clock_type, u64 *ticks_per_second) {
return uv_bios_call(UV_BIOS_FREQ_BASE, clock_type, (u64)ticks_per_second, 0,
0, 0);
} | [
0,
0
] |
Linux Kernel | arch/x86/platform/uv/bios_uv.c |
extern s64 uv_bios_get_heapsize(u64 nasid, u64 size, u64 *heap_size) {
return uv_bios_call(UV_BIOS_EXTRA, nasid, UV_BIOS_EXTRA_GET_HEAPSIZE, 0, size,
(u64)heap_size);
} | [
0,
0
] |
Linux Kernel | arch/x86/platform/uv/bios_uv.c |
extern s64 uv_bios_install_heap(u64 nasid, u64 heap_size, u64 *bios_heap) {
return uv_bios_call(UV_BIOS_EXTRA, nasid, UV_BIOS_EXTRA_INSTALL_HEAP, 0,
heap_size, (u64)bios_heap);
} | [
0,
0
] |
Linux Kernel | arch/x86/platform/uv/bios_uv.c |
extern s64 uv_bios_enum_objs(u64 nasid, u64 size, u64 *objbuf) {
return uv_bios_call(UV_BIOS_EXTRA, nasid, UV_BIOS_EXTRA_ENUM_OBJECTS, 0, size,
(u64)objbuf);
} | [
0,
0
] |
Linux Kernel | arch/x86/platform/uv/bios_uv.c |
unsigned long get_uv_systab_phys(bool msg) {
if ((uv_systab_phys == EFI_INVALID_TABLE_ADDR) || !uv_systab_phys ||
efi_runtime_disabled()) {
if (msg)
pr_crit("UV: UVsystab: missing\n");
return 0;
}
return uv_systab_phys;
} | [
0,
0
] |
Linux Kernel | arch/x86/platform/uv/uv_irq.c |
static void uv_program_mmr(struct irq_cfg *cfg,
struct uv_irq_2_mmr_pnode *info) {
unsigned long mmr_value;
struct uv_IO_APIC_route_entry *entry;
BUILD_BUG_ON(sizeof(struct uv_IO_APIC_route_entry) != sizeof(unsigned long));
mmr_value = 0;
entry = (struct uv_IO_APIC_route_entry *)... | [
1,
0
] |
Linux Kernel | arch/x86/platform/uv/uv_irq.c |
static void uv_domain_free(struct irq_domain *domain, unsigned int virq,
unsigned int nr_irqs) {
struct irq_data *irq_data = irq_domain_get_irq_data(domain, virq);
BUG_ON(nr_irqs != 1);
kfree(irq_data->chip_data);
irq_clear_status_flags(virq, IRQ_MOVE_PCNTXT);
irq_clear_status_fla... | [
0,
0
] |
Linux Kernel | arch/x86/platform/uv/uv_irq.c | static void uv_domain_deactivate(struct irq_domain *domain,
struct irq_data *irq_data) {
unsigned long mmr_value;
struct uv_IO_APIC_route_entry *entry;
mmr_value = 0;
entry = (struct uv_IO_APIC_route_entry *)&mmr_value;
entry->mask = 1;
uv_program_mmr(irqd_cfg(irq_data), ir... | [
0,
0
] |
Linux Kernel | arch/x86/platform/uv/uv_nmi.c | static inline void uv_reassert_nmi(void) {
outb(0x8f, NMI_CONTROL_PORT);
inb(NMI_DUMMY_PORT); /* dummy read */
outb(0x0f, NMI_CONTROL_PORT);
inb(NMI_DUMMY_PORT); /* dummy read */
} | [
0,
0
] |
Linux Kernel | arch/x86/platform/uv/uv_nmi.c | static int uv_check_nmi(struct uv_hub_nmi_s *hub_nmi) {
int cpu = smp_processor_id();
int nmi = 0;
int nmi_detected = 0;
local64_inc(&uv_nmi_count);
this_cpu_inc(uv_cpu_nmi.queries);
do {
nmi = atomic_read(&hub_nmi->in_nmi);
if (nmi)
break;
if (raw_spin_trylock(&hub_nmi->nmi_lock)) {
... | [
0,
0
] |
Linux Kernel | arch/x86/platform/uv/uv_nmi.c | static inline void uv_clear_nmi(int cpu) {
struct uv_hub_nmi_s *hub_nmi = uv_hub_nmi;
if (cpu == atomic_read(&hub_nmi->cpu_owner)) {
atomic_set(&hub_nmi->cpu_owner, -1);
atomic_set(&hub_nmi->in_nmi, 0);
if (hub_nmi->hub_present)
uv_local_mmr_clear_nmi();
else
uv_reassert_nmi();
raw_... | [
0,
0
] |
Linux Kernel | arch/x86/platform/uv/uv_nmi.c | static int uv_nmi_wait_cpus(int first) {
int i, j, k, n = num_online_cpus();
int last_k = 0, waiting = 0;
int cpu = smp_processor_id();
if (first) {
cpumask_copy(uv_nmi_cpu_mask, cpu_online_mask);
k = 0;
} else {
k = n - cpumask_weight(uv_nmi_cpu_mask);
}
if (first && uv_pch_intr_now_enabled... | [
0,
0
] |
Linux Kernel | arch/x86/platform/uv/uv_nmi.c | static void uv_nmi_trigger_dump(int cpu) {
int retry = uv_nmi_trigger_delay;
if (uv_cpu_nmi_per(cpu).state != UV_NMI_STATE_IN)
return;
uv_cpu_nmi_per(cpu).state = UV_NMI_STATE_DUMP;
do {
cpu_relax();
udelay(10);
if (uv_cpu_nmi_per(cpu).state != UV_NMI_STATE_DUMP)
return;
} while (--ret... | [
0,
0
] |
Linux Kernel | arch/x86/platform/uv/uv_nmi.c | static void uv_nmi_sync_exit(int master) {
atomic_dec(&uv_nmi_cpus_in_nmi);
if (master) {
while (atomic_read(&uv_nmi_cpus_in_nmi) > 0)
cpu_relax();
atomic_set(&uv_nmi_slave_continue, SLAVE_CLEAR);
} else {
while (atomic_read(&uv_nmi_slave_continue))
cpu_relax();
}
} | [
0,
0
] |
Linux Kernel | arch/x86/platform/uv/uv_nmi.c | static void uv_nmi_action_health(int cpu, struct pt_regs *regs, int master) {
if (master) {
int in = atomic_read(&uv_nmi_cpus_in_nmi);
int out = num_online_cpus() - in;
pr_alert("UV: NMI CPU health check (non-responding:%d)\n", out);
atomic_set(&uv_nmi_slave_continue, SLAVE_EXIT);
} else {
whil... | [
0,
0
] |
Linux Kernel | arch/x86/platform/uv/uv_nmi.c | static void uv_nmi_dump_state(int cpu, struct pt_regs *regs, int master) {
if (master) {
int tcpu;
int ignored = 0;
int saved_console_loglevel = console_loglevel;
pr_alert("UV: tracing %s for %d CPUs from CPU %d\n",
uv_nmi_action_is("ips") ? "IPs" : "processes",
atomic_read(... | [
0,
0
] |
Linux Kernel | arch/x86/platform/uv/uv_nmi.c | static inline int uv_nmi_kdb_reason(void) { return KDB_REASON_SYSTEM_NMI; }
#else | [
0,
0
] |
Linux Kernel | arch/x86/platform/uv/uv_nmi.c | static inline void uv_call_kgdb_kdb(int cpu, struct pt_regs *regs, int master) {
pr_err("UV: NMI error: KGDB is not enabled in this kernel\n");
}
#endif | [
0,
0
] |
Linux Kernel | arch/x86/platform/uv/uv_nmi.c | static int uv_handle_nmi_ping(unsigned int reason, struct pt_regs *regs) {
int ret;
this_cpu_inc(uv_cpu_nmi.queries);
if (!this_cpu_read(uv_cpu_nmi.pinging)) {
local64_inc(&uv_nmi_ping_misses);
return NMI_DONE;
}
this_cpu_inc(uv_cpu_nmi.pings);
local64_inc(&uv_nmi_ping_count);
ret = uv_handle_nm... | [
0,
0
] |
Linux Kernel | arch/x86/platform/uv/uv_nmi.c | static void __init uv_nmi_setup_common(bool hubbed) {
int size = sizeof(void *) * (1 << NODES_SHIFT);
int cpu;
uv_hub_nmi_list = kzalloc(size, GFP_KERNEL);
nmi_debug("UV: NMI hub list @ 0x%p (%d)\n", uv_hub_nmi_list, size);
BUG_ON(!uv_hub_nmi_list);
size = sizeof(struct uv_hub_nmi_s);
for_each_present_cp... | [
1,
0
] |
Linux Kernel | arch/x86/platform/uv/uv_nmi.c | void __init uv_nmi_setup_hubless(void) {
uv_nmi_setup_common(false);
pch_base = xlate_dev_mem_ptr(PCH_PCR_GPIO_1_BASE);
nmi_debug("UV: PCH base:%p from 0x%lx, GPP_D_0\n", pch_base,
PCH_PCR_GPIO_1_BASE);
if (uv_pch_init_enable)
uv_init_hubless_pch_d0();
uv_init_hubless_pch_io(GPI_NMI_ENA_GPP_D_... | [
0,
0
] |
Linux Kernel | arch/x86/platform/uv/uv_time.c | static void uv_rtc_send_IPI(int cpu) {
unsigned long apicid, val;
int pnode;
apicid = cpu_physical_id(cpu);
pnode = uv_apicid_to_pnode(apicid);
val = (1UL << UVH_IPI_INT_SEND_SHFT) | (apicid << UVH_IPI_INT_APIC_ID_SHFT) |
(X86_PLATFORM_IPI_VECTOR << UVH_IPI_INT_VECTOR_SHFT);
uv_write_global_mmr64(... | [
0,
0
] |
Linux Kernel | arch/x86/platform/uv/uv_time.c | static void uv_rtc_find_next_timer(struct uv_rtc_timer_head *head, int pnode) {
u64 lowest = ULLONG_MAX;
int c, bcpu = -1;
head->next_cpu = -1;
for (c = 0; c < head->ncpus; c++) {
u64 exp = head->cpu[c].expires;
if (exp < lowest) {
bcpu = c;
lowest = exp;
}
}
if (bcpu >= 0) {
he... | [
0,
0
] |
Linux Kernel | arch/x86/power/cpu.c | static void do_fpu_end(void) { kernel_fpu_end(); } | [
0,
0
] |
Linux Kernel | arch/x86/power/cpu.c | static void fix_processor_context(void) {
int cpu = smp_processor_id();
#ifdef CONFIG_X86_64
struct desc_struct *desc = get_cpu_gdt_rw(cpu);
tss_desc tss;
#endif
/*
* We need to reload TR, which requires that we change the
* GDT entry to indicate "available" first.
*
* XXX: This could probably all ... | [
1,
1
] |
Linux Kernel | arch/x86/power/cpu.c | static int msr_build_context(const u32 *msr_id, const int num) {
struct saved_msrs *saved_msrs = &saved_context.saved_msrs;
struct saved_msr *msr_array;
int total_num;
int i, j;
total_num = saved_msrs->num + num;
msr_array = kmalloc_array(total_num, sizeof(struct saved_msr), GFP_KERNEL);
if (!msr_array)... | [
1,
0
] |
Linux Kernel | arch/x86/power/hibernate.c | static inline u32 compute_e820_crc32(struct e820_table *table) {
int size = offsetof(struct e820_table, entries) +
sizeof(struct e820_entry) * table->nr_entries;
return ~crc32_le(~0, (unsigned char const *)table, size);
} | [
1,
0
] |
Linux Kernel | arch/x86/power/hibernate.c | int arch_hibernation_header_restore(void *addr) {
struct restore_data_record *rdr = addr;
if (rdr->magic != RESTORE_MAGIC) {
pr_crit("Unrecognized hibernate image header format!\n");
return -EINVAL;
}
restore_jump_address = rdr->jump_address;
jump_address_phys = rdr->jump_address_phys;
restore_cr3... | [
0,
0
] |
Linux Kernel | arch/x86/power/hibernate_32.c | static int resume_physical_mapping_init(pgd_t *pgd_base) {
unsigned long pfn;
pgd_t *pgd;
pmd_t *pmd;
pte_t *pte;
int pgd_idx, pmd_idx;
pgd_idx = pgd_index(PAGE_OFFSET);
pgd = pgd_base + pgd_idx;
pfn = 0;
for (; pgd_idx < PTRS_PER_PGD; pgd++, pgd_idx++) {
pmd = resume_one_md_table_init(pgd);
... | [
0,
0
] |
Linux Kernel | arch/x86/power/hibernate_32.c | asmlinkage int swsusp_arch_resume(void) {
int error;
resume_pg_dir = (pgd_t *)get_safe_page(GFP_ATOMIC);
if (!resume_pg_dir)
return -ENOMEM;
resume_init_first_level_page_table(resume_pg_dir);
error = set_up_temporary_text_mapping(resume_pg_dir);
if (error)
return error;
error = resume_physical... | [
0,
0
] |
Linux Kernel | arch/x86/power/hibernate_64.c | asmlinkage int swsusp_arch_resume(void) {
int error;
error = set_up_temporary_mappings();
if (error)
return error;
error = relocate_restore_code();
if (error)
return error;
restore_image();
return 0;
} | [
0,
0
] |
Linux Kernel | arch/x86/realmode/init.c | void load_trampoline_pgtable(void) {
#ifdef CONFIG_X86_32
load_cr3(initial_page_table);
#else
if (boot_cpu_has(X86_FEATURE_PCID))
cr4_clear_bits(X86_CR4_PCIDE);
write_cr3(real_mode_header->trampoline_pgd);
#endif
/*
* The CR3 write above will not flush global TLB entries.
* Stale, global entries fr... | [
0,
0
] |
Linux Kernel | arch/x86/realmode/init.c | static void __init set_real_mode_permissions(void) {
unsigned char *base = (unsigned char *)real_mode_header;
size_t size = PAGE_ALIGN(real_mode_blob_end - real_mode_blob);
size_t ro_size = PAGE_ALIGN(real_mode_header->ro_end) - __pa(base);
size_t text_size =
PAGE_ALIGN(real_mode_header->ro_end) - real_... | [
1,
0
] |
Linux Kernel | arch/x86/realmode/init.c |
void __init init_real_mode(void) {
if (!real_mode_header)
panic("Real mode trampoline was not allocated");
setup_real_mode();
set_real_mode_permissions();
} | [
0,
0
] |
Linux Kernel | arch/x86/realmode/rm/wakemain.c | static void beep(unsigned int hz) {
u8 enable;
if (!hz) {
enable = 0x00;
} else {
u16 div = 1193181 / hz;
outb(0xb6, 0x43); /* Ctr 2, squarewave, load, binary */
io_delay();
outb(div, 0x42); /* LSB of counter */
io_delay();
outb(div >> 8, 0x42); /* MSB of counter */
io_delay();
... | [
1,
0
] |
Linux Kernel | arch/x86/tools/insn_decoder_test.c |
static void usage(void) {
fprintf(stderr,
"Usage: objdump -d a.out | awk -f objdump_reformat.awk"
" | %s [-y|-n] [-v]\n",
prog);
fprintf(stderr, "\t-y 64bit mode\n");
fprintf(stderr, "\t-n 32bit mode\n");
fprintf(stderr, "\t-v verbose mode\n");
exit(1);
} | [
1,
0
] |
Linux Kernel | arch/x86/tools/insn_sanity.c |
static void usage(const char *err) {
if (err)
fprintf(stderr, "%s: Error: %s\n\n", prog, err);
fprintf(stderr, "Usage: %s [-y|-n|-v] [-s seed[,no]] [-m max] [-i input]\n",
prog);
fprintf(stderr, "\t-y 64bit mode\n");
fprintf(stderr, "\t-n 32bit mode\n");
fprintf(stderr, "\t-v Verbosity(-vv dump... | [
1,
0
] |
Linux Kernel | arch/x86/tools/relocs.c |
static const char *sym_visibility(unsigned visibility) {
static const char *visibility_name[] = {
#define SYM_VISIBILITY(X) [X] = #X
SYM_VISIBILITY(STV_DEFAULT),
SYM_VISIBILITY(STV_INTERNAL),
SYM_VISIBILITY(STV_HIDDEN),
SYM_VISIBILITY(STV_PROTECTED),
#undef SYM_VISIBILITY
};
const char *n... | [
0,
0
] |
Linux Kernel | arch/x86/tools/relocs.c |
static uint32_t elf32_to_cpu(uint32_t val) { return le32_to_cpu(val); } | [
0,
0
] |
Linux Kernel | arch/x86/tools/relocs.c | static uint64_t elf64_to_cpu(uint64_t val) { return le64_to_cpu(val); } | [
0,
0
] |
Linux Kernel | arch/x86/tools/relocs.c | static int sym_index(Elf_Sym *sym) {
Elf_Sym *symtab = secs[shsymtabndx].symtab;
Elf32_Word *xsymtab = secs[shxsymtabndx].xsymtab;
unsigned long offset;
int index;
if (sym->st_shndx != SHN_XINDEX)
return sym->st_shndx;
offset = (unsigned long)sym - (unsigned long)symtab;
index = offset / sizeof(*sym... | [
1,
0
] |
Linux Kernel | arch/x86/tools/relocs.c |
static void read_relocs(FILE *fp) {
int i, j;
for (i = 0; i < shnum; i++) {
struct section *sec = &secs[i];
if (sec->shdr.sh_type != SHT_REL_TYPE) {
continue;
}
sec->reltab = malloc(sec->shdr.sh_size);
if (!sec->reltab) {
die("malloc of %" FMT " bytes for relocs failed\n", sec->shd... | [
1,
0
] |
Linux Kernel | arch/x86/tools/relocs.c |
static void print_absolute_symbols(void) {
int i;
const char *format;
if (ELF_BITS == 64)
format = "%5d %016" PRIx64 " %5" PRId64 " %10s %10s %12s %s\n";
else
format = "%5d %08" PRIx32 " %5" PRId32 " %10s %10s %12s %s\n";
printf("Absolute symbols\n");
printf(" Num: Value Size Type Bin... | [
0,
0
] |
Linux Kernel | arch/x86/tools/relocs.c | static void percpu_init(void) {
int i;
for (i = 0; i < shnum; i++) {
ElfW(Sym) * sym;
if (strcmp(sec_name(i), ".data..percpu"))
continue;
if (secs[i].shdr.sh_addr != 0)
return;
sym = sym_lookup("__per_cpu_load");
if (!sym)
die("can't find __per_cpu_load\n");
per_cpu_shnd... | [
0,
0
] |
Linux Kernel | arch/x86/tools/relocs_common.c |
int main(int argc, char **argv) {
int show_absolute_syms, show_absolute_relocs, show_reloc_info;
int as_text, use_real_mode;
const char *fname;
FILE *fp;
int i;
unsigned char e_ident[EI_NIDENT];
show_absolute_syms = 0;
show_absolute_relocs = 0;
show_reloc_info = 0;
as_text = 0;
use_real_mode = 0... | [
1,
0
] |
Linux Kernel | arch/x86/um/asm/processor.h | static __always_inline void rep_nop(void) {
__asm__ __volatile__("rep;nop" : : : "memory");
} | [
0,
0
] |
Linux Kernel | arch/x86/um/asm/processor_32.h |
static inline void arch_copy_thread(struct arch_thread *from,
struct arch_thread *to) {
memcpy(&to->tls_array, &from->tls_array, sizeof(from->tls_array));
} | [
1,
0
] |
Linux Kernel | arch/x86/um/asm/processor_64.h |
static inline void arch_flush_thread(struct arch_thread *thread) {} | [
0,
0
] |
Linux Kernel | arch/x86/um/asm/processor_64.h |
static inline void arch_copy_thread(struct arch_thread *from,
struct arch_thread *to) {
to->fs = from->fs;
} | [
0,
0
] |
Linux Kernel | arch/x86/um/bugs_32.c | void arch_check_bugs(void) {
struct sigaction old, new;
printk(UM_KERN_INFO "Checking for host processor cmov support...");
new.sa_handler = cmov_sigill_test_handler;
new.sa_flags = SA_NODEFER;
sigemptyset(&new.sa_mask);
sigaction(SIGILL, &new, &old);
if (setjmp(cmov_test_return) == 0) {
unsigned l... | [
1,
0
] |
Linux Kernel | arch/x86/um/bugs_32.c | void arch_examine_signal(int sig, struct uml_pt_regs *regs) {
unsigned char tmp[2];
if ((sig != SIGILL) || (get_current_pid() != 1))
return;
if (copy_from_user_proc(tmp, (void *)UPT_IP(regs), 2)) {
printk(UM_KERN_ERR "SIGILL in init, could not read "
"instructions!\n");
return... | [
1,
0
] |
Linux Kernel | arch/x86/um/bugs_64.c |
void arch_check_bugs(void) {} | [
0,
0
] |
Linux Kernel | arch/x86/um/elfcore.c |
Elf32_Half elf_core_extra_phdrs(void) {
return vsyscall_ehdr ? (((struct elfhdr *)vsyscall_ehdr)->e_phnum) : 0;
} | [
0,
0
] |
Linux Kernel | arch/x86/um/ldt.c |
static long write_ldt_entry(struct mm_id *mm_idp, int func,
struct user_desc *desc, void **addr, int done) {
long res;
void *stub_addr;
BUILD_BUG_ON(sizeof(*desc) % sizeof(long));
res = syscall_stub_data(mm_idp, (unsigned long *)desc,
sizeof(*desc) / size... | [
1,
0
] |
Linux Kernel | arch/x86/um/ldt.c | static int read_default_ldt(void __user *ptr, unsigned long bytecount) {
int err;
if (bytecount > 5 * LDT_ENTRY_SIZE)
bytecount = 5 * LDT_ENTRY_SIZE;
err = bytecount;
if (clear_user(ptr, bytecount))
err = -EFAULT;
return err;
} | [
0,
0
] |
Linux Kernel | arch/x86/um/ldt.c |
void free_ldt(struct mm_context *mm) {
int i;
if (mm->arch.ldt.entry_count > LDT_DIRECT_ENTRIES) {
i = mm->arch.ldt.entry_count / LDT_ENTRIES_PER_PAGE;
while (i-- > 0)
free_page((long)mm->arch.ldt.u.pages[i]);
}
mm->arch.ldt.entry_count = 0;
} | [
0,
0
] |
Linux Kernel | arch/x86/um/mem_64.c |
const char *arch_vma_name(struct vm_area_struct *vma) {
if (vma->vm_mm && vma->vm_start == um_vdso_addr)
return "[vdso]";
return NULL;
} | [
1,
0
] |
Linux Kernel | arch/x86/um/os-Linux/mcontext.c | void get_regs_from_mc(struct uml_pt_regs *regs, mcontext_t *mc) {
#ifdef __i386__
#define COPY2(X, Y) regs->gp[X] = mc->gregs[REG_##Y]
#define COPY(X) regs->gp[X] = mc->gregs[REG_##X]
#define COPY_SEG(X) regs->gp[X] = mc->gregs[REG_##X] & 0xffff;
#define COPY_SEG_CPL3(X) regs->gp[X] = (mc->gregs[REG_##X] & 0xffff) | 3;... | [
1,
0
] |
Linux Kernel | arch/x86/um/os-Linux/registers.c |
int save_fp_registers(int pid, unsigned long *fp_regs) {
#ifdef PTRACE_GETREGSET
struct iovec iov;
if (have_xstate_support) {
iov.iov_base = fp_regs;
iov.iov_len = FP_SIZE * sizeof(unsigned long);
if (ptrace(PTRACE_GETREGSET, pid, NT_X86_XSTATE, &iov) < 0)
return -errno;
return 0;
} else
#... | [
1,
0
] |
Linux Kernel | arch/x86/um/os-Linux/registers.c |
int restore_i387_registers(int pid, unsigned long *fp_regs) {
if (ptrace(PTRACE_SETFPREGS, pid, 0, fp_regs) < 0)
return -errno;
return 0;
} | [
0,
0
] |
Linux Kernel | arch/x86/um/os-Linux/registers.c | int save_fpx_registers(int pid, unsigned long *fp_regs) {
if (ptrace(PTRACE_GETFPXREGS, pid, 0, fp_regs) < 0)
return -errno;
return 0;
} | [
0,
0
] |
Linux Kernel | arch/x86/um/os-Linux/registers.c |
int restore_fpx_registers(int pid, unsigned long *fp_regs) {
if (ptrace(PTRACE_SETFPXREGS, pid, 0, fp_regs) < 0)
return -errno;
return 0;
} | [
0,
0
] |
Linux Kernel | arch/x86/um/os-Linux/registers.c |
int get_fp_registers(int pid, unsigned long *regs) {
if (have_fpx_regs)
return save_fpx_registers(pid, regs);
else
return save_fp_registers(pid, regs);
} | [
0,
0
] |
Linux Kernel | arch/x86/um/os-Linux/registers.c |
void arch_init_registers(int pid) {
struct user_fpxregs_struct fpx_regs;
int err;
err = ptrace(PTRACE_GETFPXREGS, pid, 0, &fpx_regs);
if (!err)
return;
if (errno != EIO)
panic("check_ptrace : PTRACE_GETFPXREGS failed, errno = %d", errno);
have_fpx_regs = 0;
} | [
0,
0
] |
Linux Kernel | arch/x86/um/os-Linux/registers.c |
int put_fp_registers(int pid, unsigned long *regs) {
return restore_fp_registers(pid, regs);
} | [
0,
0
] |
Linux Kernel | arch/x86/um/os-Linux/registers.c |
void arch_init_registers(int pid) {
#ifdef PTRACE_GETREGSET
void *fp_regs;
struct iovec iov;
fp_regs = malloc(FP_SIZE * sizeof(unsigned long));
if (fp_regs == NULL)
return;
iov.iov_base = fp_regs;
iov.iov_len = FP_SIZE * sizeof(unsigned long);
if (ptrace(PTRACE_GETREGSET, pid, NT_X86_XSTATE, &iov) ... | [
1,
0
] |
Linux Kernel | arch/x86/um/os-Linux/task_size.c |
static void segfault(int sig) { longjmp(buf, 1); } | [
0,
0
] |
Linux Kernel | arch/x86/um/os-Linux/task_size.c | static int page_ok(unsigned long page) {
unsigned long *address = (unsigned long *)(page << UM_KERN_PAGE_SHIFT);
unsigned long n = ~0UL;
void *mapped = NULL;
int ok = 0;
if (setjmp(buf) == 0)
n = *address;
else {
mapped = mmap(address, UM_KERN_PAGE_SIZE, PROT_READ | PROT_WRITE,
MA... | [
1,
0
] |
Linux Kernel | arch/x86/um/os-Linux/task_size.c | unsigned long os_get_top_address(void) { return 0x7fc0002000; } | [
0,
0
] |
Linux Kernel | arch/x86/um/ptrace_32.c |
void arch_switch_to(struct task_struct *to) {
int err = arch_switch_tls(to);
if (!err)
return;
if (err != -EINVAL)
printk(KERN_WARNING "arch_switch_tls failed, errno %d, "
"not EINVAL\n",
-err);
else
printk(KERN_WARNING "arch_switch_tls failed, errno = EINVAL\n")... | [
1,
0
] |
Linux Kernel | arch/x86/um/ptrace_32.c |
unsigned long getreg(struct task_struct *child, int regno) {
unsigned long mask = ~0UL;
regno >>= 2;
switch (regno) {
case FS:
case GS:
case DS:
case ES:
case SS:
case CS:
mask = 0xffff;
break;
case EIP:
case UESP:
case EAX:
case EBX:
case ECX:
case EDX:
case ESI:
case EDI:
... | [
1,
0
] |
Linux Kernel | arch/x86/um/ptrace_32.c | int peek_user(struct task_struct *child, long addr, long data) {
unsigned long tmp;
if ((addr & 3) || addr < 0)
return -EIO;
tmp = 0;
if (addr < MAX_REG_OFFSET) {
tmp = getreg(child, addr);
} else if ((addr >= offsetof(struct user, u_debugreg[0])) &&
(addr <= offsetof(struct user, u_deb... | [
1,
0
] |
Linux Kernel | arch/x86/um/ptrace_64.c | int peek_user(struct task_struct *child, long addr, long data) {
unsigned long tmp;
if ((addr & 3) || addr < 0)
return -EIO;
tmp = 0; /* Default return condition */
if (addr < MAX_REG_OFFSET)
tmp = getreg(child, addr);
else if ((addr >= offsetof(struct user, u_debugreg[0])) &&
(addr <= o... | [
1,
0
] |
Linux Kernel | arch/x86/um/ptrace_64.c | int is_syscall(unsigned long addr) {
unsigned short instr;
int n;
n = copy_from_user(&instr, (void __user *)addr, sizeof(instr));
if (n) {
n = access_process_vm(current, addr, &instr, sizeof(instr), FOLL_FORCE);
if (n != sizeof(instr)) {
printk("is_syscall : failed to read instruction from "
... | [
1,
1
] |
Linux Kernel | arch/x86/um/ptrace_user.c |
int ptrace_getregs(long pid, unsigned long *regs_out) {
if (ptrace(PTRACE_GETREGS, pid, 0, regs_out) < 0)
return -errno;
return 0;
} | [
0,
0
] |
Linux Kernel | arch/x86/um/shared/sysdep/stub_32.h |
static inline long stub_syscall2(long syscall, long arg1, long arg2) {
long ret;
__asm__ volatile("int $0x80"
: "=a"(ret)
: "0"(syscall), "b"(arg1), "c"(arg2));
return ret;
} | [
0,
0
] |
Linux Kernel | arch/x86/um/shared/sysdep/stub_32.h |
static __always_inline void *get_stub_page(void) {
unsigned long ret;
asm volatile("movl %%esp,%0 ;"
"andl %1,%0"
: "=a"(ret)
: "g"(~(UM_KERN_PAGE_SIZE - 1)));
return (void *)ret;
} | [
0,
0
] |
Linux Kernel | arch/x86/um/shared/sysdep/stub_64.h |
static inline void remap_stack_and_trap(void) {
__asm__ volatile(
"movq %0,%%rax ;"
"movq %%rsp,%%rdi ;"
"andq %1,%%rdi ;"
"movq %2,%%r10 ;"
"movq %%rdi,%%r8 ; addq %3,%%r8 ; movq (%%r8),%%r8 ;"
"movq %%rdi,%%r9 ; addq %4,%%r9 ; movq (%%r9),%%r9 ;" __syscall ";"
"movq %%rsp,... | [
0,
0
] |
Linux Kernel | arch/x86/um/signal.c | static inline unsigned long twd_fxsr_to_i387(struct user_fxsr_struct *fxsave) {
struct _fpxreg *st = NULL;
unsigned long twd = (unsigned long)fxsave->twd;
unsigned long tag;
unsigned long ret = 0xffff0000;
int i;
#define FPREG_ADDR(f, n) ((char *)&(f)->st_space + (n) * 16)
for (i = 0; i < 8; i++) {
if... | [
1,
0
] |
Linux Kernel | arch/x86/um/signal.c |
static int convert_fxsr_from_user(struct user_fxsr_struct *fxsave,
struct _fpstate __user *buf) {
unsigned long env[7];
struct _fpxreg *to;
struct _fpreg __user *from;
int i;
if (copy_from_user(env, buf, 7 * sizeof(long)))
return 1;
fxsave->cwd = (unsigned short)(env... | [
1,
0
] |
Linux Kernel | arch/x86/um/signal.c | long sys_rt_sigreturn(void) {
unsigned long sp = PT_REGS_SP(¤t->thread.regs);
struct rt_sigframe __user *frame =
(struct rt_sigframe __user *)(sp - sizeof(long));
struct ucontext __user *uc = &frame->uc;
sigset_t set;
if (copy_from_user(&set, &uc->uc_sigmask, sizeof(set)))
goto segfault;
s... | [
1,
0
] |
Linux Kernel | arch/x86/um/syscalls_64.c |
void arch_switch_to(struct task_struct *to) {
if ((to->thread.arch.fs == 0) || (to->mm == NULL))
return;
arch_prctl(to, ARCH_SET_FS, (void __user *)to->thread.arch.fs);
} | [
0,
0
] |
Linux Kernel | arch/x86/um/sysrq_32.c | void show_regs(struct pt_regs *regs) {
printk("\n");
printk("EIP: %04lx:[<%08lx>] CPU: %d %s", 0xffff & PT_REGS_CS(regs),
PT_REGS_IP(regs), smp_processor_id(), print_tainted());
if (PT_REGS_CS(regs) & 3)
printk(" ESP: %04lx:%08lx", 0xffff & PT_REGS_SS(regs), PT_REGS_SP(regs));
printk(" EFLAGS: %08l... | [
1,
0
] |
Linux Kernel | arch/x86/um/tls_32.c |
int do_get_thread_area(struct user_desc *info) {
int ret;
u32 cpu;
cpu = get_cpu();
ret = os_get_thread_area(info, userspace_pid[cpu]);
put_cpu();
if (ret)
printk(KERN_ERR "PTRACE_GET_THREAD_AREA failed, err = %d, "
"index = %d\n",
ret, info->entry_number);
return re... | [
0,
0
] |
Linux Kernel | arch/x86/um/tls_32.c | static int get_free_idx(struct task_struct *task) {
struct thread_struct *t = &task->thread;
int idx;
for (idx = 0; idx < GDT_ENTRY_TLS_ENTRIES; idx++)
if (!t->arch.tls_array[idx].present)
return idx + GDT_ENTRY_TLS_MIN;
return -ESRCH;
} | [
0,
1
] |
Linux Kernel | arch/x86/um/tls_32.c | static inline int needs_TLS_update(struct task_struct *task) {
int i;
int ret = 0;
for (i = GDT_ENTRY_TLS_MIN; i < GDT_ENTRY_TLS_MAX; i++) {
struct uml_tls_struct *curr =
&task->thread.arch.tls_array[i - GDT_ENTRY_TLS_MIN];
if (curr->flushed)
continue;
ret = 1;
break;
}
return ... | [
0,
0
] |
Linux Kernel | arch/x86/um/tls_32.c |
static int set_tls_entry(struct task_struct *task, struct user_desc *info,
int idx, int flushed) {
struct thread_struct *t = &task->thread;
if (idx < GDT_ENTRY_TLS_MIN || idx > GDT_ENTRY_TLS_MAX)
return -EINVAL;
t->arch.tls_array[idx - GDT_ENTRY_TLS_MIN].tls = *info;
t->arch.tls_... | [
1,
0
] |
Linux Kernel | arch/x86/um/tls_32.c |
int arch_set_tls(struct task_struct *new, unsigned long tls) {
struct user_desc info;
int idx, ret = -EFAULT;
if (copy_from_user(&info, (void __user *)tls, sizeof(info)))
goto out;
ret = -EINVAL;
if (LDT_empty(&info))
goto out;
idx = info.entry_number;
ret = set_tls_entry(new, &info, idx, 0);... | [
1,
0
] |
Linux Kernel | arch/x86/um/tls_32.c | static int get_tls_entry(struct task_struct *task, struct user_desc *info,
int idx) {
struct thread_struct *t = &task->thread;
if (idx < GDT_ENTRY_TLS_MIN || idx > GDT_ENTRY_TLS_MAX)
return -EINVAL;
if (!t->arch.tls_array[idx - GDT_ENTRY_TLS_MIN].present)
goto clear;
*info = ... | [
1,
1
] |
Linux Kernel | arch/x86/um/vdso/vma.c |
int arch_setup_additional_pages(struct linux_binprm *bprm, int uses_interp) {
int err;
struct mm_struct *mm = current->mm;
if (!vdso_enabled)
return 0;
if (mmap_write_lock_killable(mm))
return -EINTR;
err = install_special_mapping(
mm, um_vdso_addr, PAGE_SIZE,
VM_READ | VM_EXEC | VM_MA... | [
0,
0
] |
Linux Kernel | arch/x86/xen/apic.c | static u32 xen_apic_read(u32 reg) {
struct xen_platform_op op = {
.cmd = XENPF_get_cpuinfo,
.interface_version = XENPF_INTERFACE_VERSION,
.u.pcpu_info.xen_cpuid = 0,
};
int ret;
if (!xen_initial_domain() || smp_processor_id())
return 0;
if (reg == APIC_LVR)
return 0x14;
if (reg !... | [
0,
0
] |
Linux Kernel | arch/x86/xen/apic.c |
static int xen_id_always_registered(void) { return 1; } | [
0,
0
] |
Linux Kernel | arch/x86/xen/apic.c |
static void xen_silent_inquire(int apicid) {} | [
0,
0
] |
Linux Kernel | arch/x86/xen/efi.c | static enum efi_secureboot_mode xen_efi_get_secureboot(void) {
static efi_guid_t shim_guid = EFI_SHIM_LOCK_GUID;
enum efi_secureboot_mode mode;
efi_status_t status;
u8 moksbstate;
unsigned long size;
mode = efi_get_secureboot_mode(efi.get_variable);
if (mode == efi_secureboot_mode_unknown) {
pr_err("... | [
1,
0
] |
Linux Kernel | arch/x86/xen/enlighten.c |
int xen_cpuhp_setup(int (*cpu_up_prepare_cb)(unsigned int),
int (*cpu_dead_cb)(unsigned int)) {
int rc;
rc = cpuhp_setup_state_nocalls(CPUHP_XEN_PREPARE, "x86/xen/guest:prepare",
cpu_up_prepare_cb, cpu_dead_cb);
if (rc >= 0) {
rc = cpuhp_setup_state_nocal... | [
0,
0
] |
Linux Kernel | arch/x86/xen/enlighten.c | static void xen_vcpu_setup_restore(int cpu) {
xen_vcpu_info_reset(cpu);
/*
* For PVH and PVHVM, setup online VCPUs only. The rest will
* be handled by hotplug.
*/
if (xen_pv_domain() || (xen_hvm_domain() && cpu_online(cpu)))
xen_vcpu_setup(cpu);
} | [
0,
0
] |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.