Lines Matching refs:cpu
510 struct cpu *cpu = CPU; in set_base_spl() local
511 uint16_t active = (uint16_t)cpu->cpu_intr_actv; in set_base_spl()
513 cpu->cpu_base_spl = active == 0 ? 0 : bsrw_insn(active); in set_base_spl()
527 hilevel_intr_prolog(struct cpu *cpu, uint_t pil, uint_t oldpil, struct regs *rp) in hilevel_intr_prolog() argument
529 struct machcpu *mcpu = &cpu->cpu_m; in hilevel_intr_prolog()
537 cpu->cpu_profile_pil = oldpil; in hilevel_intr_prolog()
539 cpu->cpu_profile_pc = 0; in hilevel_intr_prolog()
540 cpu->cpu_profile_upc = rp->r_pc; in hilevel_intr_prolog()
541 cpu->cpu_cpcprofile_pc = 0; in hilevel_intr_prolog()
542 cpu->cpu_cpcprofile_upc = rp->r_pc; in hilevel_intr_prolog()
544 cpu->cpu_profile_pc = rp->r_pc; in hilevel_intr_prolog()
545 cpu->cpu_profile_upc = 0; in hilevel_intr_prolog()
546 cpu->cpu_cpcprofile_pc = rp->r_pc; in hilevel_intr_prolog()
547 cpu->cpu_cpcprofile_upc = 0; in hilevel_intr_prolog()
551 mask = cpu->cpu_intr_actv & CPU_INTR_ACTV_HIGH_LEVEL_MASK; in hilevel_intr_prolog()
565 cpu->cpu_intracct[cpu->cpu_mstate] += intrtime; in hilevel_intr_prolog()
573 kthread_t *t = cpu->cpu_thread; in hilevel_intr_prolog()
583 cpu->cpu_intracct[cpu->cpu_mstate] += intrtime; in hilevel_intr_prolog()
593 ASSERT((cpu->cpu_intr_actv & (1 << pil)) == 0); in hilevel_intr_prolog()
602 uint16_t *refcntp = (uint16_t *)&cpu->cpu_intr_actv + 1; in hilevel_intr_prolog()
606 mask = cpu->cpu_intr_actv; in hilevel_intr_prolog()
608 cpu->cpu_intr_actv |= (1 << pil); in hilevel_intr_prolog()
623 hilevel_intr_epilog(struct cpu *cpu, uint_t pil, uint_t oldpil, uint_t vecnum) in hilevel_intr_epilog() argument
625 struct machcpu *mcpu = &cpu->cpu_m; in hilevel_intr_epilog()
632 cpu->cpu_stats.sys.intr[pil - 1]++; in hilevel_intr_epilog()
634 ASSERT(cpu->cpu_intr_actv & (1 << pil)); in hilevel_intr_epilog()
643 uint16_t *refcntp = (uint16_t *)&cpu->cpu_intr_actv + 1; in hilevel_intr_epilog()
648 cpu->cpu_intr_actv &= ~(1 << pil); in hilevel_intr_epilog()
650 cpu->cpu_intr_actv &= ~(1 << pil); in hilevel_intr_epilog()
657 cpu->cpu_intracct[cpu->cpu_mstate] += intrtime; in hilevel_intr_epilog()
664 mask = cpu->cpu_intr_actv & CPU_INTR_ACTV_HIGH_LEVEL_MASK; in hilevel_intr_epilog()
686 kthread_t *t = cpu->cpu_thread; in hilevel_intr_epilog()
695 return (cpu->cpu_intr_actv & CPU_INTR_ACTV_HIGH_LEVEL_MASK); in hilevel_intr_epilog()
704 intr_thread_prolog(struct cpu *cpu, caddr_t stackptr, uint_t pil) in intr_thread_prolog() argument
706 struct machcpu *mcpu = &cpu->cpu_m; in intr_thread_prolog()
711 ASSERT((cpu->cpu_intr_actv & (1 << pil)) == 0); in intr_thread_prolog()
712 cpu->cpu_intr_actv |= (1 << pil); in intr_thread_prolog()
721 t = cpu->cpu_thread; in intr_thread_prolog()
725 cpu->cpu_intracct[cpu->cpu_mstate] += intrtime; in intr_thread_prolog()
741 it = cpu->cpu_intr_thread; in intr_thread_prolog()
742 cpu->cpu_intr_thread = it->t_link; in intr_thread_prolog()
753 cpu->cpu_thread = it; /* new curthread on this cpu */ in intr_thread_prolog()
770 intr_thread_epilog(struct cpu *cpu, uint_t vec, uint_t oldpil) in intr_thread_epilog() argument
772 struct machcpu *mcpu = &cpu->cpu_m; in intr_thread_epilog()
774 kthread_t *it = cpu->cpu_thread; /* curthread */ in intr_thread_epilog()
780 cpu->cpu_stats.sys.intr[pil - 1]++; in intr_thread_epilog()
785 cpu->cpu_intracct[cpu->cpu_mstate] += intrtime; in intr_thread_epilog()
787 ASSERT(cpu->cpu_intr_actv & (1 << pil)); in intr_thread_epilog()
788 cpu->cpu_intr_actv &= ~(1 << pil); in intr_thread_epilog()
811 cpu->cpu_stats.sys.intrblk++; in intr_thread_epilog()
816 basespl = cpu->cpu_base_spl; in intr_thread_epilog()
825 it->t_link = cpu->cpu_intr_thread; in intr_thread_epilog()
826 cpu->cpu_intr_thread = it; in intr_thread_epilog()
835 it->t_link = cpu->cpu_intr_thread; in intr_thread_epilog()
836 cpu->cpu_intr_thread = it; in intr_thread_epilog()
839 basespl = cpu->cpu_base_spl; in intr_thread_epilog()
844 cpu->cpu_thread = t; in intr_thread_epilog()
907 struct cpu *cpu; in intr_get_time() local
914 cpu = CPU; in intr_get_time()
915 mcpu = &cpu->cpu_m; in intr_get_time()
916 t = cpu->cpu_thread; in intr_get_time()
918 ASSERT((cpu->cpu_intr_actv & CPU_INTR_ACTV_HIGH_LEVEL_MASK) == 0); in intr_get_time()
931 cpu->cpu_intracct[cpu->cpu_mstate] += delta; in intr_get_time()
939 struct cpu *cpu, in dosoftint_prolog() argument
945 struct machcpu *mcpu = &cpu->cpu_m; in dosoftint_prolog()
953 if (pil <= oldpil || pil <= cpu->cpu_base_spl) in dosoftint_prolog()
998 it = cpu->cpu_intr_thread; in dosoftint_prolog()
999 cpu->cpu_intr_thread = it->t_link; in dosoftint_prolog()
1002 t = cpu->cpu_thread; in dosoftint_prolog()
1006 cpu->cpu_intracct[cpu->cpu_mstate] += intrtime; in dosoftint_prolog()
1030 cpu->cpu_thread = it; in dosoftint_prolog()
1035 ASSERT((cpu->cpu_intr_actv & (1 << pil)) == 0); in dosoftint_prolog()
1036 cpu->cpu_intr_actv |= (1 << pil); in dosoftint_prolog()
1049 dosoftint_epilog(struct cpu *cpu, uint_t oldpil) in dosoftint_epilog() argument
1051 struct machcpu *mcpu = &cpu->cpu_m; in dosoftint_epilog()
1057 it = cpu->cpu_thread; in dosoftint_epilog()
1060 cpu->cpu_stats.sys.intr[pil - 1]++; in dosoftint_epilog()
1062 ASSERT(cpu->cpu_intr_actv & (1 << pil)); in dosoftint_epilog()
1063 cpu->cpu_intr_actv &= ~(1 << pil); in dosoftint_epilog()
1066 cpu->cpu_intracct[cpu->cpu_mstate] += intrtime; in dosoftint_epilog()
1080 it->t_link = cpu->cpu_intr_thread; in dosoftint_epilog()
1081 cpu->cpu_intr_thread = it; in dosoftint_epilog()
1088 it->t_link = cpu->cpu_intr_thread; in dosoftint_epilog()
1089 cpu->cpu_intr_thread = it; in dosoftint_epilog()
1091 cpu->cpu_thread = t; in dosoftint_epilog()
1094 basespl = cpu->cpu_base_spl; in dosoftint_epilog()
1208 cpu_t *cpu; in cpu_intr_swtch_enter() local
1231 cpu = CPU; in cpu_intr_swtch_enter()
1232 cpu->cpu_m.intrstat[t->t_pil][0] += interval; in cpu_intr_swtch_enter()
1234 atomic_add_64((uint64_t *)&cpu->cpu_intracct[cpu->cpu_mstate], in cpu_intr_swtch_enter()
1276 struct cpu *cpu = CPU; in dispatch_softint() local
1279 av_dispatch_softvect((int)cpu->cpu_thread->t_pil); in dispatch_softint()
1286 dosoftint_epilog(cpu, oldpil); in dispatch_softint()
1295 struct cpu *cpu = CPU; in dispatch_hardint() local
1305 intr_thread_epilog(cpu, vector, oldipl); in dispatch_hardint()
1315 struct cpu *cpu = CPU; in dosoftint() local
1319 while (cpu->cpu_softinfo.st_pending) { in dosoftint()
1320 oldipl = cpu->cpu_pri; in dosoftint()
1321 newsp = dosoftint_prolog(cpu, (caddr_t)regs, in dosoftint()
1322 cpu->cpu_softinfo.st_pending, oldipl); in dosoftint()
1341 struct cpu *cpu = CPU; in do_interrupt() local
1342 int newipl, oldipl = cpu->cpu_pri; in do_interrupt()
1350 ttp->ttr_spl = cpu->cpu_base_spl; in do_interrupt()
1356 ++*(uint16_t *)&cpu->cpu_m.mcpu_istamp; in do_interrupt()
1380 cpu->cpu_pri = newipl; in do_interrupt()
1389 if (hilevel_intr_prolog(cpu, newipl, oldipl, rp) == 0) { in do_interrupt()
1390 newsp = cpu->cpu_intr_stack; in do_interrupt()
1395 (void) hilevel_intr_epilog(cpu, newipl, oldipl, vector); in do_interrupt()
1400 newsp = intr_thread_prolog(cpu, (caddr_t)rp, newipl); in do_interrupt()
1408 if (cpu->cpu_softinfo.st_pending) in do_interrupt()
1528 bsrw_insn((uint16_t)cpu->cpu_softinfo.st_pending) > (newpri)))
1542 cpu_t *cpu; in do_splx() local
1546 cpu = CPU; /* ints are disabled, now safe to cache cpu ptr */ in do_splx()
1547 curpri = cpu->cpu_m.mcpu_pri; in do_splx()
1548 basepri = cpu->cpu_base_spl; in do_splx()
1551 cpu->cpu_m.mcpu_pri = newpri; in do_splx()
1572 cpu_t *cpu; in splr() local
1576 cpu = CPU; /* ints are disabled, now safe to cache cpu ptr */ in splr()
1577 curpri = cpu->cpu_m.mcpu_pri; in splr()
1582 basepri = cpu->cpu_base_spl; in splr()
1585 cpu->cpu_m.mcpu_pri = newpri; in splr()