Projectname large_stringclasses 15
values | Filepath large_stringlengths 4 106 ⌀ | Function large_stringlengths 11 3.45k | Label list |
|---|---|---|---|
Linux Kernel | arch/powerpc/kernel/pci-hotplug.c |
struct pci_bus *pci_find_bus_by_node(struct device_node *dn) {
struct pci_dn *pdn = PCI_DN(dn);
if (!pdn || !pdn->phb || !pdn->phb->bus)
return NULL;
return find_bus_among_children(pdn->phb->bus, dn);
} | [
1,
0
] |
Linux Kernel | arch/powerpc/kernel/pci-hotplug.c | void pcibios_release_device(struct pci_dev *dev) {
struct pci_controller *phb = pci_bus_to_host(dev->bus);
struct pci_dn *pdn = pci_get_pdn(dev);
if (phb->controller_ops.release_device)
phb->controller_ops.release_device(dev);
if (pdn && (pdn->flags & PCI_DN_FLAG_DEAD)) {
pci_dbg(dev, "freeing dead pd... | [
1,
0
] |
Linux Kernel | arch/powerpc/kernel/pci_32.c | int pci_device_from_OF_node(struct device_node *node, u8 *bus, u8 *devfn) {
struct pci_dev *dev = NULL;
const __be32 *reg;
int size;
if (!pci_find_hose_for_OF_device(node))
return -ENODEV;
reg = of_get_property(node, "reg", &size);
if (!reg || size < 5 * sizeof(u32))
return -ENODEV;
*bus = (be3... | [
1,
0
] |
Linux Kernel | arch/powerpc/kernel/pci_32.c | void __init pci_create_OF_bus_map(void) {
struct property *of_prop;
struct device_node *dn;
of_prop = memblock_alloc(sizeof(struct property) + 256, SMP_CACHE_BYTES);
if (!of_prop)
panic("%s: Failed to allocate %zu bytes\n", __func__,
sizeof(struct property) + 256);
dn = of_find_node_by_path("/"... | [
1,
0
] |
Linux Kernel | arch/powerpc/kernel/pci_64.c | static int pcibios_map_phb_io_space(struct pci_controller *hose) {
unsigned long phys_page;
unsigned long size_page;
unsigned long io_virt_offset;
phys_page = ALIGN_DOWN(hose->io_base_phys, PAGE_SIZE);
size_page = ALIGN(hose->pci_io_size, PAGE_SIZE);
hose->io_base_alloc = NULL;
/* If there's no IO to m... | [
1,
0
] |
Linux Kernel | arch/powerpc/kernel/pci_64.c | int pci_device_from_OF_node(struct device_node *np, u8 *bus, u8 *devfn) {
if (!PCI_DN(np))
return -ENODEV;
*bus = PCI_DN(np)->busno;
*devfn = PCI_DN(np)->devfn;
return 0;
} | [
0,
0
] |
Linux Kernel | arch/powerpc/kernel/pci_dn.c | struct pci_dn *pci_get_pdn_by_devfn(struct pci_bus *bus, int devfn) {
struct device_node *dn = NULL;
struct pci_dn *parent, *pdn;
struct pci_dev *pdev = NULL;
list_for_each_entry(pdev, &bus->devices, bus_list) {
if (pdev->devfn == devfn) {
if (pdev->dev.archdata.pci_data)
return pdev->dev.arc... | [
0,
0
] |
Linux Kernel | arch/powerpc/kernel/pci_of_scan.c | static u32 get_int_prop(struct device_node *np, const char *name, u32 def) {
const __be32 *prop;
int len;
prop = of_get_property(np, name, &len);
if (prop && len >= 4)
return of_read_number(prop, 1);
return def;
}
#define OF_PCI_ADDR0_SPACE(ss) (((ss) & 3) << 24)
#define OF_PCI_ADDR0_SPACE_CFG OF_PCI_AD... | [
0,
0
] |
Linux Kernel | arch/powerpc/kernel/pmc.c | void power4_enable_pmcs(void) {
unsigned long hid0;
hid0 = mfspr(SPRN_HID0);
hid0 |= 1UL << (63 - 20);
asm volatile("sync\n"
"mtspr %1, %0\n"
"mfspr %0, %1\n"
"mfspr %0, %1\n"
"mfspr %0, %1\n"
"mfspr %0, %1\n"
... | [
0,
0
] |
Linux Kernel | arch/powerpc/kernel/process.c |
static int __init enable_strict_msr_control(char *str) {
strict_msr_control = true;
pr_info("Enabling strict facility control\n");
return 0;
} | [
0,
0
] |
Linux Kernel | arch/powerpc/kernel/process.c | static void __giveup_fpu(struct task_struct *tsk) {
unsigned long msr;
save_fpu(tsk);
msr = tsk->thread.regs->msr;
msr &= ~(MSR_FP | MSR_FE0 | MSR_FE1);
if (cpu_has_feature(CPU_FTR_VSX))
msr &= ~MSR_VSX;
regs_set_return_msr(tsk->thread.regs, msr);
} | [
0,
0
] |
Linux Kernel | arch/powerpc/kernel/process.c | void flush_fp_to_thread(struct task_struct *tsk) {
if (tsk->thread.regs) {
preempt_disable();
if (tsk->thread.regs->msr & MSR_FP) {
/*
* This should only ever be called for current or
* for a stopped child process. Since we save away
* the FP register state on context switch,
... | [
1,
0
] |
Linux Kernel | arch/powerpc/kernel/process.c | static void __giveup_altivec(struct task_struct *tsk) {
unsigned long msr;
save_altivec(tsk);
msr = tsk->thread.regs->msr;
msr &= ~MSR_VEC;
if (cpu_has_feature(CPU_FTR_VSX))
msr &= ~MSR_VSX;
regs_set_return_msr(tsk->thread.regs, msr);
} | [
0,
0
] |
Linux Kernel | arch/powerpc/kernel/process.c | void enable_kernel_altivec(void) {
unsigned long cpumsr;
WARN_ON(preemptible());
cpumsr = msr_check_and_set(MSR_VEC);
if (current->thread.regs && (current->thread.regs->msr & MSR_VEC)) {
check_if_tm_restore_required(current);
if (!MSR_TM_ACTIVE(cpumsr) && MSR_TM_ACTIVE(current->thread.regs->msr))
... | [
1,
0
] |
Linux Kernel | arch/powerpc/kernel/process.c | static void __giveup_vsx(struct task_struct *tsk) {
unsigned long msr = tsk->thread.regs->msr;
WARN_ON((msr & MSR_VSX) && !((msr & MSR_FP) && (msr & MSR_VEC)));
/* __giveup_fpu will clear MSR_VSX */
if (msr & MSR_FP)
__giveup_fpu(tsk);
if (msr & MSR_VEC)
__giveup_altivec(tsk);
} | [
1,
0
] |
Linux Kernel | arch/powerpc/kernel/process.c | void enable_kernel_vsx(void) {
unsigned long cpumsr;
WARN_ON(preemptible());
cpumsr = msr_check_and_set(MSR_FP | MSR_VEC | MSR_VSX);
if (current->thread.regs &&
(current->thread.regs->msr & (MSR_VSX | MSR_VEC | MSR_FP))) {
check_if_tm_restore_required(current);
if (!MSR_TM_ACTIVE(cpumsr) && MS... | [
0,
0
] |
Linux Kernel | arch/powerpc/kernel/process.c |
void flush_vsx_to_thread(struct task_struct *tsk) {
if (tsk->thread.regs) {
preempt_disable();
if (tsk->thread.regs->msr & (MSR_VSX | MSR_VEC | MSR_FP)) {
BUG_ON(tsk != current);
giveup_vsx(tsk);
}
preempt_enable();
}
} | [
0,
0
] |
Linux Kernel | arch/powerpc/kernel/process.c |
void flush_spe_to_thread(struct task_struct *tsk) {
if (tsk->thread.regs) {
preempt_disable();
if (tsk->thread.regs->msr & MSR_SPE) {
BUG_ON(tsk != current);
tsk->thread.spefscr = mfspr(SPRN_SPEFSCR);
giveup_spe(tsk);
}
preempt_enable();
}
} | [
1,
0
] |
Linux Kernel | arch/powerpc/kernel/process.c |
void giveup_all(struct task_struct *tsk) {
unsigned long usermsr;
if (!tsk->thread.regs)
return;
check_if_tm_restore_required(tsk);
usermsr = tsk->thread.regs->msr;
if ((usermsr & msr_all_available) == 0)
return;
msr_check_and_set(msr_all_available);
WARN_ON((usermsr & MSR_VSX) && !((userms... | [
0,
0
] |
Linux Kernel | arch/powerpc/kernel/process.c | static bool should_restore_fp(void) {
if (current->thread.load_fp) {
current->thread.load_fp++;
return true;
}
return false;
} | [
0,
0
] |
Linux Kernel | arch/powerpc/kernel/process.c | static bool should_restore_fp(void) { return false; } | [
0,
0
] |
Linux Kernel | arch/powerpc/kernel/process.c | static bool should_restore_altivec(void) { return false; } | [
0,
0
] |
Linux Kernel | arch/powerpc/kernel/process.c |
static void save_all(struct task_struct *tsk) {
unsigned long usermsr;
if (!tsk->thread.regs)
return;
usermsr = tsk->thread.regs->msr;
if ((usermsr & msr_all_available) == 0)
return;
msr_check_and_set(msr_all_available);
WARN_ON((usermsr & MSR_VSX) && !((usermsr & MSR_FP) && (usermsr & MSR_VEC... | [
0,
0
] |
Linux Kernel | arch/powerpc/kernel/process.c | static void do_break_handler(struct pt_regs *regs) {
struct arch_hw_breakpoint null_brk = {0};
struct arch_hw_breakpoint *info;
ppc_inst_t instr = ppc_inst(0);
int type = 0;
int size = 0;
unsigned long ea;
int i;
if (nr_wp_slots() == 1) {
__set_breakpoint(0, &null_brk);
current->thread.hw_brk[0... | [
0,
0
] |
Linux Kernel | arch/powerpc/kernel/process.c |
static inline int set_breakpoint_8xx(struct arch_hw_breakpoint *brk) {
unsigned long lctrl1 =
LCTRL1_CTE_GT | LCTRL1_CTF_LT | LCTRL1_CRWE_RW | LCTRL1_CRWF_RW;
unsigned long lctrl2 = LCTRL2_LW0EN | LCTRL2_LW0LADC | LCTRL2_SLW0EN;
unsigned long start_addr = ALIGN_DOWN(brk->address, HW_BREAKPOINT_SIZE);
uns... | [
1,
0
] |
Linux Kernel | arch/powerpc/kernel/process.c |
static inline bool tm_enabled(struct task_struct *tsk) {
return tsk && tsk->thread.regs && (tsk->thread.regs->msr & MSR_TM);
} | [
1,
0
] |
Linux Kernel | arch/powerpc/kernel/process.c | static void tm_reclaim_thread(struct thread_struct *thr, uint8_t cause) {
if (!MSR_TM_SUSPENDED(mfmsr()))
return;
giveup_all(container_of(thr, struct task_struct, thread));
tm_reclaim(thr, cause);
/*
* If we are in a transaction and FP is off then we can't have
* used FP inside that transaction. H... | [
1,
0
] |
Linux Kernel | arch/powerpc/kernel/process.c |
void tm_reclaim_current(uint8_t cause) {
tm_enable();
tm_reclaim_thread(¤t->thread, cause);
} | [
0,
0
] |
Linux Kernel | arch/powerpc/kernel/process.c | static inline void tm_reclaim_task(struct task_struct *tsk) {
struct thread_struct *thr = &tsk->thread;
if (!thr->regs)
return;
if (!MSR_TM_ACTIVE(thr->regs->msr))
goto out_and_saveregs;
WARN_ON(tm_suspend_disabled);
TM_DEBUG("--- tm_reclaim on pid %d (NIP=%lx, "
"ccr=%lx, msr=%lx, tra... | [
1,
0
] |
Linux Kernel | arch/powerpc/kernel/process.c | void restore_tm_state(struct pt_regs *regs) {
unsigned long msr_diff;
clear_thread_flag(TIF_RESTORE_TM);
if (!MSR_TM_ACTIVE(regs->msr))
return;
msr_diff = current->thread.ckpt_regs.msr & ~regs->msr;
msr_diff &= MSR_FP | MSR_VEC | MSR_VSX;
/* Ensure that restore_math() will restore */
if (msr_diff &... | [
0,
0
] |
Linux Kernel | arch/powerpc/kernel/process.c | void tm_reclaim_current(uint8_t cause) {}
#endif | [
0,
0
] |
Linux Kernel | arch/powerpc/kernel/process.c | void kvmppc_save_user_regs(void) {
unsigned long usermsr;
if (!current->thread.regs)
return;
usermsr = current->thread.regs->msr;
if (usermsr & MSR_FP)
save_fpu(current);
if (usermsr & MSR_VEC)
save_altivec(current);
#ifdef CONFIG_PPC_TRANSACTIONAL_MEM
if (usermsr & MSR_TM) {
current->t... | [
0,
0
] |
Linux Kernel | arch/powerpc/kernel/process.c |
void kvmppc_save_current_sprs(void) { save_sprs(¤t->thread); } | [
0,
0
] |
Linux Kernel | arch/powerpc/kernel/process.c | static void print_tm_bits(unsigned long val) {
if (val & (MSR_TM | MSR_TS_S | MSR_TS_T)) {
pr_cont(",TM[");
print_bits(val, msr_tm_bits, "");
pr_cont("]");
}
} | [
0,
0
] |
Linux Kernel | arch/powerpc/kernel/process.c | static void print_tm_bits(unsigned long val) {}
#endif | [
0,
0
] |
Linux Kernel | arch/powerpc/kernel/process.c | int set_thread_tidr(struct task_struct *t) {
if (!cpu_has_feature(CPU_FTR_P9_TIDR))
return -EINVAL;
if (t != current)
return -EINVAL;
if (t->thread.tidr)
return 0;
t->thread.tidr = (u16)task_pid_nr(t);
mtspr(SPRN_TIDR, t->thread.tidr);
return 0;
} | [
0,
0
] |
Linux Kernel | arch/powerpc/kernel/process.c |
static void setup_ksp_vsid(struct task_struct *p, unsigned long sp) {
#ifdef CONFIG_PPC_64S_HASH_MMU
unsigned long sp_vsid;
unsigned long llp = mmu_psize_defs[mmu_linear_psize].sllp;
if (radix_enabled())
return;
if (mmu_has_feature(MMU_FTR_1T_SEGMENT))
sp_vsid = get_kernel_vsid(sp, MMU_SEGSIZE_1T) <<... | [
1,
0
] |
Linux Kernel | arch/powerpc/kernel/process.c | int get_fpexc_mode(struct task_struct *tsk, unsigned long adr) {
unsigned int val = 0;
if (tsk->thread.fpexc_mode & PR_FP_EXC_SW_ENABLE) {
if (cpu_has_feature(CPU_FTR_SPE)) {
#ifdef CONFIG_SPE
tsk->thread.spefscr_last = mfspr(SPRN_SPEFSCR);
val = tsk->thread.fpexc_mode;
#endif
} else
ret... | [
1,
0
] |
Linux Kernel | arch/powerpc/kernel/process.c |
static inline int valid_emergency_stack(unsigned long sp, struct task_struct *p,
unsigned long nbytes) {
#ifdef CONFIG_PPC64
unsigned long stack_page;
unsigned long cpu = task_cpu(p);
if (!paca_ptrs)
return 0;
stack_page = (unsigned long)paca_ptrs[cpu]->emergency_s... | [
1,
0
] |
Linux Kernel | arch/powerpc/kernel/process.c |
unsigned long __get_wchan(struct task_struct *p) {
unsigned long ret;
if (!try_get_task_stack(p))
return 0;
ret = ___get_wchan(p);
put_task_stack(p);
return ret;
} | [
0,
0
] |
Linux Kernel | arch/powerpc/kernel/process.c | void notrace __ppc64_runlatch_off(void) {
struct thread_info *ti = current_thread_info();
ti->local_flags &= ~_TLF_RUNLATCH;
if (cpu_has_feature(CPU_FTR_ARCH_206)) {
mtspr(SPRN_CTRLT, 0);
} else {
unsigned long ctrl;
ctrl = mfspr(SPRN_CTRLF);
ctrl &= ~CTRL_RUNLATCH;
mtspr(SPRN_CTRLT, ctrl... | [
0,
0
] |
Linux Kernel | arch/powerpc/kernel/proc_powerpc.c |
static ssize_t page_map_read(struct file *file, char __user *buf, size_t nbytes,
loff_t *ppos) {
return simple_read_from_buffer(buf, nbytes, ppos, pde_data(file_inode(file)),
PAGE_SIZE);
} | [
0,
0
] |
Linux Kernel | arch/powerpc/kernel/proc_powerpc.c |
static int page_map_mmap(struct file *file, struct vm_area_struct *vma) {
if ((vma->vm_end - vma->vm_start) > PAGE_SIZE)
return -EINVAL;
remap_pfn_range(vma, vma->vm_start,
__pa(pde_data(file_inode(file))) >> PAGE_SHIFT, PAGE_SIZE,
vma->vm_page_prot);
return 0;
} | [
0,
0
] |
Linux Kernel | arch/powerpc/kernel/prom.c | static void __init move_device_tree(void) {
unsigned long start, size;
void *p;
DBG("-> move_device_tree\n");
start = __pa(initial_boot_params);
size = fdt_totalsize(initial_boot_params);
if ((memory_limit && (start + size) > PHYSICAL_START + memory_limit) ||
!memblock_is_memory(start + size - 1) |... | [
1,
0
] |
Linux Kernel | arch/powerpc/kernel/prom.c | static void __init scan_features(unsigned long node, const unsigned char *ftrs,
unsigned long tablelen, struct ibm_feature *fp,
unsigned long ft_size) {
unsigned long i, len, bit;
for (;;) {
if (tablelen < 3)
return;
len = 2 + ftrs[0];... | [
0,
0
] |
Linux Kernel | arch/powerpc/kernel/prom.c |
static void __init check_cpu_feature_properties(unsigned long node) {
int i;
struct feature_property *fp = feature_properties;
const __be32 *prop;
for (i = 0; i < (int)ARRAY_SIZE(feature_properties); ++i, ++fp) {
prop = of_get_flat_dt_prop(node, fp->name, NULL);
if (prop && be32_to_cpup(prop) >= fp->m... | [
0,
0
] |
Linux Kernel | arch/powerpc/kernel/prom.c | static bool __init validate_mem_limit(u64 base, u64 *size) { return true; }
#endif
#ifdef CONFIG_PPC_PSERIES | [
0,
0
] |
Linux Kernel | arch/powerpc/kernel/prom.c | static void __init save_fscr_to_task(void) {
if (early_cpu_has_feature(CPU_FTR_ARCH_207S))
init_task.thread.fscr = mfspr(SPRN_FSCR);
} | [
0,
0
] |
Linux Kernel | arch/powerpc/kernel/prom.c | bool arch_match_cpu_phys_id(int cpu, u64 phys_id) {
#ifdef CONFIG_SMP
if (cpu_to_phys_id != NULL)
return (int)phys_id == cpu_to_phys_id[cpu];
#endif
return (int)phys_id == get_hard_smp_processor_id(cpu);
} | [
0,
0
] |
Linux Kernel | arch/powerpc/kernel/prom_init.c | static size_t __init prom_strlen(const char *s) {
const char *sc;
for (sc = s; *sc != '\0'; ++sc)
;
return sc - s;
} | [
0,
0
] |
Linux Kernel | arch/powerpc/kernel/prom_init.c |
static char __init *prom_strstr(const char *s1, const char *s2) {
size_t l1, l2;
l2 = prom_strlen(s2);
if (!l2)
return (char *)s1;
l1 = prom_strlen(s1);
while (l1 >= l2) {
l1--;
if (!prom_memcmp(s1, s2, l2))
return (char *)s1;
s1++;
}
return NULL;
} | [
0,
0
] |
Linux Kernel | arch/powerpc/kernel/prom_init.c |
static void __init prom_print(const char *msg) {
const char *p, *q;
if (prom.stdout == 0)
return;
for (p = msg; *p != 0; p = q) {
for (q = p; *q != 0 && *q != '\n'; ++q)
;
if (q > p)
call_prom("write", 3, 1, prom.stdout, p, q - p);
if (*q == 0)
break;
++q;
call_prom("... | [
0,
0
] |
Linux Kernel | arch/powerpc/kernel/prom_init.c | static void __init prom_print_hex(unsigned long val) {
int i, nibbles = sizeof(val) * 2;
char buf[sizeof(val) * 2 + 1];
for (i = nibbles - 1; i >= 0; i--) {
buf[i] = (val & 0xf) + '0';
if (buf[i] > '9')
buf[i] += ('a' - '0' - 10);
val >>= 4;
}
buf[nibbles] = '\0';
call_prom("write", 3, 1,... | [
1,
0
] |
Linux Kernel | arch/powerpc/kernel/prom_init.c | static unsigned int __init prom_claim(unsigned long virt, unsigned long size,
unsigned long align) {
if (align == 0 && (OF_WORKAROUNDS & OF_WA_CLAIM)) {
int ret;
prom_arg_t result;
ret = call_prom_ret("call-method", 5, 2, &result, ADDR("claim"),
... | [
1,
0
] |
Linux Kernel | arch/powerpc/kernel/prom_init.c |
static int __init prom_next_node(phandle *nodep) {
phandle node;
if ((node = *nodep) != 0 && (*nodep = call_prom("child", 1, 1, node)) != 0)
return 1;
if ((*nodep = call_prom("peer", 1, 1, node)) != 0)
return 1;
for (;;) {
if ((node = call_prom("parent", 1, 1, node)) == 0)
return 0;
if ... | [
0,
0
] |
Linux Kernel | arch/powerpc/kernel/prom_init.c | static unsigned long __init prom_memparse(const char *ptr,
const char **retptr) {
unsigned long ret = prom_strtoul(ptr, retptr);
int shift = 0;
if ('G' == **retptr || 'g' == **retptr)
shift = 30;
if ('M' == **retptr || 'm' == **retptr)
shift = 20;
if ('K' =... | [
1,
0
] |
Linux Kernel | arch/powerpc/kernel/prom_init.c | static void __init prom_parse_mmu_model(u8 val,
struct platform_support *support) {
switch (val) {
case OV5_FEAT(OV5_MMU_DYNAMIC):
case OV5_FEAT(OV5_MMU_EITHER):
prom_debug("MMU - either supported\n");
support->radix_mmu = !prom_radix_disable;
support->hash_mmu ... | [
0,
0
] |
Linux Kernel | arch/powerpc/kernel/prom_init.c | static void __init prom_parse_xive_model(u8 val,
struct platform_support *support) {
switch (val) {
case OV5_FEAT(OV5_XIVE_EITHER):
prom_debug("XIVE - either mode supported\n");
support->xive = !prom_xive_disable;
break;
case OV5_FEAT(OV5_XIVE_EXPLOIT): /* Only... | [
0,
0
] |
Linux Kernel | arch/powerpc/kernel/prom_init.c | static void __init prom_send_capabilities(void) {
ihandle root;
prom_arg_t ret;
u32 cores;
prom_check_platform_support();
root = call_prom("open", 1, 1, ADDR("/"));
if (root != 0) {
/* We need to tell the FW about the number of cores we support.
*
* To do that, we count the number of threads... | [
1,
0
] |
Linux Kernel | arch/powerpc/kernel/prom_init.c | static void __init reserve_mem(u64 base, u64 size) {
u64 top = base + size;
unsigned long cnt = mem_reserve_cnt;
if (size == 0)
return;
base = ALIGN_DOWN(base, PAGE_SIZE);
top = ALIGN(top, PAGE_SIZE);
size = top - base;
if (cnt >= (MEM_RESERVE_MAP_SIZE - 1))
prom_panic("Memory reserve map exhau... | [
1,
1
] |
Linux Kernel | arch/powerpc/kernel/prom_init.c |
static void __init prom_close_stdin(void) {
__be32 val;
ihandle stdin;
if (prom_getprop(prom.chosen, "stdin", &val, sizeof(val)) > 0) {
stdin = be32_to_cpu(val);
call_prom("close", 1, 0, stdin);
}
}
#ifdef CONFIG_PPC_SVM | [
1,
0
] |
Linux Kernel | arch/powerpc/kernel/prom_init.c | static void __init prom_init_client_services(unsigned long pp) {
prom_entry = pp;
/* get a handle for the stdout device */
prom.chosen = call_prom("finddevice", 1, 1, ADDR("/chosen"));
if (!PHANDLE_VALID(prom.chosen))
prom_panic("cannot find chosen"); /* msg won't be printed :( */
/* get device tree ro... | [
0,
0
] |
Linux Kernel | arch/powerpc/kernel/prom_init.c | static void __init prom_find_mmu(void) {
phandle oprom;
char version[64];
oprom = call_prom("finddevice", 1, 1, ADDR("/openprom"));
if (!PHANDLE_VALID(oprom))
return;
if (prom_getprop(oprom, "model", version, sizeof(version)) <= 0)
return;
version[sizeof(version) - 1] = 0;
/* XXX might need to ad... | [
1,
1
] |
Linux Kernel | arch/powerpc/kernel/prom_init.c |
static int __init prom_set_color(ihandle ih, int i, int r, int g, int b) {
return call_prom("call-method", 6, 1, ADDR("color!"), ih, i, b, g, r);
} | [
0,
0
] |
Linux Kernel | arch/powerpc/kernel/prom_init.c | static void __init *make_room(unsigned long *mem_start, unsigned long *mem_end,
unsigned long needed, unsigned long align) {
void *ret;
*mem_start = ALIGN(*mem_start, align);
while ((*mem_start + needed) > *mem_end) {
unsigned long room, chunk;
prom_debug("Chunk exhausted, ... | [
1,
0
] |
Linux Kernel | arch/powerpc/kernel/prom_init.c | static void __init fixup_device_tree_maple(void) {
phandle isa;
u32 rloc = 0x01002000;
u32 isa_ranges[6];
char *name;
name = "/ht@0/isa@4";
isa = call_prom("finddevice", 1, 1, ADDR(name));
if (!PHANDLE_VALID(isa)) {
name = "/ht@0/isa@6";
isa = call_prom("finddevice", 1, 1, ADDR(name));
rloc =... | [
1,
0
] |
Linux Kernel | arch/powerpc/kernel/prom_init.c |
static void __init prom_find_boot_cpu(void) {
__be32 rval;
ihandle prom_cpu;
phandle cpu_pkg;
rval = 0;
if (prom_getprop(prom.chosen, "cpu", &rval, sizeof(rval)) <= 0)
return;
prom_cpu = be32_to_cpu(rval);
cpu_pkg = call_prom("instance-to-package", 1, 1, prom_cpu);
if (!PHANDLE_VALID(cpu_pkg))
... | [
1,
0
] |
Linux Kernel | arch/powerpc/kernel/ptrace/ptrace-adv.c |
void ppc_gethwdinfo(struct ppc_debug_info *dbginfo) {
dbginfo->version = 1;
dbginfo->num_instruction_bps = CONFIG_PPC_ADV_DEBUG_IACS;
dbginfo->num_data_bps = CONFIG_PPC_ADV_DEBUG_DACS;
dbginfo->num_condition_regs = CONFIG_PPC_ADV_DEBUG_DVCS;
dbginfo->data_bp_alignment = 4;
dbginfo->sizeof_condition = 4;
... | [
0,
0
] |
Linux Kernel | arch/powerpc/kernel/ptrace/ptrace-altivec.c | int vr_active(struct task_struct *target, const struct user_regset *regset) {
flush_altivec_to_thread(target);
return target->thread.used_vr ? regset->n : 0;
} | [
0,
0
] |
Linux Kernel | arch/powerpc/kernel/ptrace/ptrace-fpu.c | int ptrace_get_fpr(struct task_struct *child, int index, unsigned long *data) {
#ifdef CONFIG_PPC_FPU_REGS
unsigned int fpidx = index - PT_FPR0;
#endif
if (index > PT_FPSCR)
return -EIO;
#ifdef CONFIG_PPC_FPU_REGS
flush_fp_to_thread(child);
if (fpidx < (PT_FPSCR - PT_FPR0)) {
if (IS_ENABLED(CONFIG_PPC... | [
1,
0
] |
Linux Kernel | arch/powerpc/kernel/ptrace/ptrace-noadv.c |
void user_enable_single_step(struct task_struct *task) {
struct pt_regs *regs = task->thread.regs;
if (regs != NULL)
regs_set_return_msr(regs, (regs->msr & ~MSR_BE) | MSR_SE);
set_tsk_thread_flag(task, TIF_SINGLESTEP);
} | [
0,
0
] |
Linux Kernel | arch/powerpc/kernel/ptrace/ptrace-noadv.c |
void user_disable_single_step(struct task_struct *task) {
struct pt_regs *regs = task->thread.regs;
if (regs != NULL)
regs_set_return_msr(regs, regs->msr & ~(MSR_SE | MSR_BE));
clear_tsk_thread_flag(task, TIF_SINGLESTEP);
} | [
0,
0
] |
Linux Kernel | arch/powerpc/kernel/ptrace/ptrace-spe.c | int evr_active(struct task_struct *target, const struct user_regset *regset) {
flush_spe_to_thread(target);
return target->thread.used_spe ? regset->n : 0;
} | [
0,
0
] |
Linux Kernel | arch/powerpc/kernel/ptrace/ptrace-spe.c |
int evr_get(struct task_struct *target, const struct user_regset *regset,
struct membuf to) {
flush_spe_to_thread(target);
membuf_write(&to, &target->thread.evr, sizeof(target->thread.evr));
BUILD_BUG_ON(offsetof(struct thread_struct, acc) + sizeof(u64) !=
offsetof(struct thread_stru... | [
1,
0
] |
Linux Kernel | arch/powerpc/kernel/ptrace/ptrace-tm.c |
static unsigned long get_user_ckpt_msr(struct task_struct *task) {
return task->thread.ckpt_regs.msr | task->thread.fpexc_mode;
} | [
0,
0
] |
Linux Kernel | arch/powerpc/kernel/ptrace/ptrace-tm.c |
static int set_user_ckpt_msr(struct task_struct *task, unsigned long msr) {
task->thread.ckpt_regs.msr &= ~MSR_DEBUGCHANGE;
task->thread.ckpt_regs.msr |= msr & MSR_DEBUGCHANGE;
return 0;
} | [
0,
0
] |
Linux Kernel | arch/powerpc/kernel/ptrace/ptrace-tm.c | int tm_cgpr_get(struct task_struct *target, const struct user_regset *regset,
struct membuf to) {
struct membuf to_msr = membuf_at(&to, offsetof(struct pt_regs, msr));
#ifdef CONFIG_PPC64
struct membuf to_softe = membuf_at(&to, offsetof(struct pt_regs, softe));
#endif
if (!cpu_has_feature(CPU_FTR... | [
1,
0
] |
Linux Kernel | arch/powerpc/kernel/ptrace/ptrace-tm.c | int tm_cvsx_active(struct task_struct *target,
const struct user_regset *regset) {
if (!cpu_has_feature(CPU_FTR_TM))
return -ENODEV;
if (!MSR_TM_ACTIVE(target->thread.regs->msr))
return 0;
flush_vsx_to_thread(target);
return target->thread.used_vsr ? regset->n : 0;
} | [
0,
0
] |
Linux Kernel | arch/powerpc/kernel/ptrace/ptrace-tm.c | int tm_spr_active(struct task_struct *target,
const struct user_regset *regset) {
if (!cpu_has_feature(CPU_FTR_TM))
return -ENODEV;
return regset->n;
} | [
0,
0
] |
Linux Kernel | arch/powerpc/kernel/ptrace/ptrace-tm.c | int tm_spr_get(struct task_struct *target, const struct user_regset *regset,
struct membuf to) {
BUILD_BUG_ON(TSO(tm_tfhar) + sizeof(u64) != TSO(tm_texasr));
BUILD_BUG_ON(TSO(tm_texasr) + sizeof(u64) != TSO(tm_tfiar));
BUILD_BUG_ON(TSO(tm_tfiar) + sizeof(u64) != TSO(ckpt_regs));
if (!cpu_has_fe... | [
1,
0
] |
Linux Kernel | arch/powerpc/kernel/ptrace/ptrace-tm.c | int tm_spr_set(struct task_struct *target, const struct user_regset *regset,
unsigned int pos, unsigned int count, const void *kbuf,
const void __user *ubuf) {
int ret;
BUILD_BUG_ON(TSO(tm_tfhar) + sizeof(u64) != TSO(tm_texasr));
BUILD_BUG_ON(TSO(tm_texasr) + sizeof(u64) != TSO(tm_t... | [
1,
0
] |
Linux Kernel | arch/powerpc/kernel/ptrace/ptrace-tm.c |
int tm_tar_get(struct task_struct *target, const struct user_regset *regset,
struct membuf to) {
if (!cpu_has_feature(CPU_FTR_TM))
return -ENODEV;
if (!MSR_TM_ACTIVE(target->thread.regs->msr))
return -ENODATA;
return membuf_write(&to, &target->thread.tm_tar, sizeof(u64));
} | [
1,
0
] |
Linux Kernel | arch/powerpc/kernel/ptrace/ptrace-tm.c |
int tm_dscr_active(struct task_struct *target,
const struct user_regset *regset) {
if (!cpu_has_feature(CPU_FTR_TM))
return -ENODEV;
if (MSR_TM_ACTIVE(target->thread.regs->msr))
return regset->n;
return 0;
} | [
0,
0
] |
Linux Kernel | arch/powerpc/kernel/ptrace/ptrace-tm.c |
int tm_dscr_get(struct task_struct *target, const struct user_regset *regset,
struct membuf to) {
if (!cpu_has_feature(CPU_FTR_TM))
return -ENODEV;
if (!MSR_TM_ACTIVE(target->thread.regs->msr))
return -ENODATA;
return membuf_write(&to, &target->thread.tm_dscr, sizeof(u64));
} | [
1,
0
] |
Linux Kernel | arch/powerpc/kernel/ptrace/ptrace-tm.c |
int tm_dscr_set(struct task_struct *target, const struct user_regset *regset,
unsigned int pos, unsigned int count, const void *kbuf,
const void __user *ubuf) {
int ret;
if (!cpu_has_feature(CPU_FTR_TM))
return -ENODEV;
if (!MSR_TM_ACTIVE(target->thread.regs->msr))
retur... | [
1,
0
] |
Linux Kernel | arch/powerpc/kernel/ptrace/ptrace-tm.c |
int tm_cgpr32_set(struct task_struct *target, const struct user_regset *regset,
unsigned int pos, unsigned int count, const void *kbuf,
const void __user *ubuf) {
return gpr32_set_common(target, regset, pos, count, kbuf, ubuf,
&target->thread.ckpt_regs.gp... | [
0,
0
] |
Linux Kernel | arch/powerpc/kernel/ptrace/ptrace-view.c |
static int set_user_dscr(struct task_struct *task, unsigned long dscr) {
return -EIO;
} | [
0,
0
] |
Linux Kernel | arch/powerpc/kernel/ptrace/ptrace-view.c | int ptrace_get_reg(struct task_struct *task, int regno, unsigned long *data) {
unsigned int regs_max;
if (task->thread.regs == NULL || !data)
return -EIO;
if (regno == PT_MSR) {
*data = get_user_msr(task);
return 0;
}
if (regno == PT_DSCR)
return get_user_dscr(task, data);
if (IS_ENABLED... | [
1,
0
] |
Linux Kernel | arch/powerpc/kernel/ptrace/ptrace-view.c | static int tar_set(struct task_struct *target, const struct user_regset *regset,
unsigned int pos, unsigned int count, const void *kbuf,
const void __user *ubuf) {
return user_regset_copyin(&pos, &count, &kbuf, &ubuf, &target->thread.tar, 0,
sizeof(u64... | [
1,
0
] |
Linux Kernel | arch/powerpc/kernel/ptrace/ptrace-view.c | static int ebb_set(struct task_struct *target, const struct user_regset *regset,
unsigned int pos, unsigned int count, const void *kbuf,
const void __user *ubuf) {
int ret = 0;
BUILD_BUG_ON(TSO(ebbrr) + sizeof(unsigned long) != TSO(ebbhr));
BUILD_BUG_ON(TSO(ebbhr) + sizeof(u... | [
1,
0
] |
Linux Kernel | arch/powerpc/kernel/ptrace/ptrace-view.c | static int pmu_set(struct task_struct *target, const struct user_regset *regset,
unsigned int pos, unsigned int count, const void *kbuf,
const void __user *ubuf) {
int ret = 0;
BUILD_BUG_ON(TSO(siar) + sizeof(unsigned long) != TSO(sdar));
BUILD_BUG_ON(TSO(sdar) + sizeof(unsi... | [
1,
0
] |
Linux Kernel | arch/powerpc/kernel/ptrace/ptrace-view.c | static int pkey_active(struct task_struct *target,
const struct user_regset *regset) {
if (!arch_pkeys_enabled())
return -ENODEV;
return regset->n;
} | [
0,
0
] |
Linux Kernel | arch/powerpc/kernel/ptrace/ptrace-view.c |
static int pkey_get(struct task_struct *target,
const struct user_regset *regset, struct membuf to) {
if (!arch_pkeys_enabled())
return -ENODEV;
membuf_store(&to, target->thread.regs->amr);
membuf_store(&to, target->thread.regs->iamr);
return membuf_store(&to, default_uamor);
} | [
0,
0
] |
Linux Kernel | arch/powerpc/kernel/ptrace/ptrace-view.c | static int pkey_set(struct task_struct *target,
const struct user_regset *regset, unsigned int pos,
unsigned int count, const void *kbuf,
const void __user *ubuf) {
u64 new_amr;
int ret;
if (!arch_pkeys_enabled())
return -ENODEV;
if (pos != 0 || ... | [
1,
0
] |
Linux Kernel | arch/powerpc/kernel/ptrace/ptrace-view.c |
int gpr32_get_common(struct task_struct *target,
const struct user_regset *regset, struct membuf to,
unsigned long *regs) {
int i;
for (i = 0; i < PT_MSR; i++)
membuf_store(&to, (u32)regs[i]);
membuf_store(&to, (u32)get_user_msr(target));
for (i++; i < PT_REGS_COU... | [
1,
0
] |
Linux Kernel | arch/powerpc/kernel/ptrace/ptrace-view.c |
static int gpr32_get(struct task_struct *target,
const struct user_regset *regset, struct membuf to) {
if (target->thread.regs == NULL)
return -EIO;
return gpr32_get_common(target, regset, to, &target->thread.regs->gpr[0]);
} | [
1,
0
] |
Linux Kernel | arch/powerpc/kernel/ptrace/ptrace-view.c |
static int gpr32_set(struct task_struct *target,
const struct user_regset *regset, unsigned int pos,
unsigned int count, const void *kbuf,
const void __user *ubuf) {
if (target->thread.regs == NULL)
return -EIO;
return gpr32_set_common(target, reg... | [
1,
0
] |
Linux Kernel | arch/powerpc/kernel/ptrace/ptrace-vsx.c | int vsr_active(struct task_struct *target, const struct user_regset *regset) {
flush_vsx_to_thread(target);
return target->thread.used_vsr ? regset->n : 0;
} | [
0,
0
] |
Linux Kernel | arch/powerpc/kernel/ptrace/ptrace-vsx.c | int vsr_set(struct task_struct *target, const struct user_regset *regset,
unsigned int pos, unsigned int count, const void *kbuf,
const void __user *ubuf) {
u64 buf[32];
int ret, i;
flush_tmregs_to_thread(target);
flush_fp_to_thread(target);
flush_altivec_to_thread(target);
flush_vs... | [
1,
0
] |
Linux Kernel | arch/powerpc/kernel/ptrace/ptrace.c | void ptrace_disable(struct task_struct *child) {
user_disable_single_step(child);
} | [
0,
0
] |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.