Lines Matching defs:cpu
60 #pragma mark **** cpu enable/disable ****
66 kern_return_t chudxnu_enable_cpu(int cpu, boolean_t enable)
70 if(cpu<0 || cpu>=chudxnu_phys_cpu_count()) { // check sanity of cpu argument
74 if((PerProcTable[cpu].ppe_vaddr != (struct per_proc_info *)NULL)
75 && cpu != master_cpu) {
76 processor_t processor = cpu_to_processor(cpu);
90 kern_return_t chudxnu_enable_cpu_nap(int cpu, boolean_t enable)
92 if(cpu<0 || cpu>=chudxnu_phys_cpu_count()) { // check sanity of cpu argument
96 if(PerProcTable[cpu].ppe_vaddr != (struct per_proc_info *)NULL) {
97 ml_enable_nap(cpu, enable);
105 boolean_t chudxnu_cpu_nap_enabled(int cpu)
109 if(cpu<0 || cpu>=chudxnu_phys_cpu_count()) { // check sanity of cpu argument
110 cpu = 0;
113 prev = ml_enable_nap(cpu, TRUE);
114 ml_enable_nap(cpu, prev);
122 kern_return_t chudxnu_set_shadowed_spr(int cpu, int spr, uint32_t val)
130 if(cpu>=chudxnu_phys_cpu_count()) { // check sanity of cpu argument
134 if(cpu<0) { // cpu<0 means don't bind (current cpu)
135 cpu = chudxnu_cpu_number();
138 chudxnu_bind_thread(current_thread(), cpu, 0);
142 per_proc = PerProcTable[cpu].ppe_vaddr;
263 kern_return_t chudxnu_set_shadowed_spr64(int cpu, int spr, uint64_t val)
270 if(cpu>=chudxnu_phys_cpu_count()) { // check sanity of cpu argument
274 if(cpu<0) { // cpu<0 means don't bind (current cpu)
275 cpu = chudxnu_cpu_number();
278 chudxnu_bind_thread(current_thread(), cpu, 0);
282 per_proc = PerProcTable[cpu].ppe_vaddr;
344 uint32_t chudxnu_get_orig_cpu_l2cr(int cpu)
346 if(cpu<0 || cpu>=chudxnu_phys_cpu_count()) { // check sanity of cpu argument
347 cpu = 0;
349 return PerProcTable[cpu].ppe_vaddr->pf.l2crOriginal;
353 uint32_t chudxnu_get_orig_cpu_l3cr(int cpu)
355 if(cpu<0 || cpu>=chudxnu_phys_cpu_count()) { // check sanity of cpu argument
356 cpu = 0;
358 return PerProcTable[cpu].ppe_vaddr->pf.l3crOriginal;
364 kern_return_t chudxnu_read_spr(int cpu, int spr, uint32_t *val_p)
371 if(cpu>=0 && !(ml_at_interrupt_context() && cpu_number() == cpu)) { // cpu<0 means don't bind
372 if(chudxnu_bind_thread(current_thread(), cpu, 0)!=KERN_SUCCESS) {
586 if(cpu>=0) { // cpu<0 means don't bind
596 kern_return_t chudxnu_read_spr64(int cpu, int spr, uint64_t *val_p)
602 if(cpu>=0 && !(ml_at_interrupt_context() && cpu_number() == cpu)) { // cpu<0 means don't bind
603 if(chudxnu_bind_thread(current_thread(), cpu, 0)!=KERN_SUCCESS) {
676 if(cpu>=0) { // cpu<0 means don't bind
684 kern_return_t chudxnu_write_spr(int cpu, int spr, uint32_t val)
690 if(cpu>=0 && !(ml_at_interrupt_context() && cpu_number() == cpu)) { // cpu<0 means don't bind
691 if(chudxnu_bind_thread(current_thread(), cpu, 0)!=KERN_SUCCESS) {
781 retval = chudxnu_set_shadowed_spr(cpu, spr, val);
785 retval = chudxnu_set_shadowed_spr(cpu, spr, val);
789 retval = chudxnu_set_shadowed_spr(cpu, spr, val);
833 retval = chudxnu_set_shadowed_spr(cpu, spr, val);
837 retval = chudxnu_set_shadowed_spr(cpu, spr, val);
841 retval = chudxnu_set_shadowed_spr(cpu, spr, val);
845 retval = chudxnu_set_shadowed_spr(cpu, spr, val);
849 retval = chudxnu_set_shadowed_spr(cpu, spr, val);
882 retval = chudxnu_set_shadowed_spr(cpu, spr, val);
887 retval = chudxnu_set_shadowed_spr(cpu, spr, val);
891 retval = chudxnu_set_shadowed_spr(cpu, spr, val);
895 retval = chudxnu_set_shadowed_spr(cpu, spr, val);
899 retval = chudxnu_set_shadowed_spr(cpu, spr, val);
903 retval = chudxnu_set_shadowed_spr(cpu, spr, val);
907 retval = chudxnu_set_shadowed_spr(cpu, spr, val);
911 retval = chudxnu_set_shadowed_spr(cpu, spr, val);
957 if(cpu>=0) { // cpu<0 means don't bind
965 kern_return_t chudxnu_write_spr64(int cpu, int spr, uint64_t val)
972 if(cpu>=0 && !(ml_at_interrupt_context() && cpu_number() == cpu)) { // cpu<0 means don't bind
973 if(chudxnu_bind_thread(current_thread(), cpu, 0)!=KERN_SUCCESS) {
1046 retval = chudxnu_set_shadowed_spr64(cpu, spr, val);
1051 retval = chudxnu_set_shadowed_spr64(cpu, spr, val);
1056 retval = chudxnu_set_shadowed_spr64(cpu, spr, val);
1061 retval = chudxnu_set_shadowed_spr64(cpu, spr, val);
1073 if(cpu>=0) { // cpu<0 means don't bind
1097 kern_return_t chudxnu_get_cpu_interrupt_counters(int cpu, rupt_counters_t *rupts)
1099 if(cpu<0 || cpu>=chudxnu_phys_cpu_count()) { // check sanity of cpu argument
1107 per_proc = PerProcTable[cpu].ppe_vaddr;
1139 kern_return_t chudxnu_clear_cpu_interrupt_counters(int cpu)
1141 if(cpu<0 || cpu>=chudxnu_phys_cpu_count()) { // check sanity of cpu argument
1145 bzero((char *)&(PerProcTable[cpu].ppe_vaddr->hwCtr), sizeof(struct hwCtrs));
1179 chudxnu_get_cpu_rupt_counters(int cpu, rupt_counters_t *rupts) {
1180 return chudxnu_get_cpu_interrupt_counters(cpu, rupts);
1185 chudxnu_clear_cpu_rupt_counters(int cpu) {
1186 return chudxnu_clear_cpu_interrupt_counters(cpu);