Lines Matching defs:vector

211 		/* Use a vector of 0. */
404 /* Setup spurious vector and enable the local APIC. */
598 /* Program the spurious vector to enable the local APIC. */
622 lapic_intr_pending(u_int vector)
629 * we divide the vector by 32 to get the 128-bit index. We then
632 * modulus the vector by 32 to determine the individual bit to
636 return (irr[(vector / 32) * 4] & 1 << (vector % 32));
786 * the passed in vector.
789 lapic_set_tpr(u_int vector)
792 lapic->tpr = vector;
797 tpr |= vector;
810 lapic_handle_intr(int vector, struct trapframe *frame)
815 vector));
970 /* Request a free IDT vector to be used by the specified IRQ. */
974 u_int vector;
979 * Search for a free vector. Currently we just use a very simple
980 * algorithm to find the first free vector.
983 for (vector = 0; vector < APIC_NUM_IOINTS; vector++) {
984 if (lapics[apic_id].la_ioint_irqs[vector] != -1)
986 lapics[apic_id].la_ioint_irqs[vector] = irq;
988 return (vector + APIC_IO_INTS);
1003 u_int first, run, vector;
1021 for (vector = 0; vector < APIC_NUM_IOINTS; vector++) {
1024 if (lapics[apic_id].la_ioint_irqs[vector] != -1) {
1030 /* Start a new run if run == 0 and vector is aligned. */
1032 if ((vector & (align - 1)) != 0)
1034 first = vector;
1042 /* Found a run, assign IRQs and return the first vector. */
1043 for (vector = 0; vector < count; vector++)
1044 lapics[apic_id].la_ioint_irqs[first + vector] =
1045 irqs[vector];
1055 * Enable a vector for a particular apic_id. Since all lapics share idt
1056 * entries and ioint_handlers this enables the vector on all lapics. lapics
1057 * which do not have the vector configured would report spurious interrupts
1061 apic_enable_vector(u_int apic_id, u_int vector)
1064 KASSERT(vector != IDT_SYSCALL, ("Attempt to overwrite syscall entry"));
1065 KASSERT(ioint_handlers[vector / 32] != NULL,
1066 ("No ISR handler for vector %u", vector));
1068 KASSERT(vector != IDT_DTRACE_RET,
1071 setidt(vector, ioint_handlers[vector / 32], SDT_APIC, SEL_KPL,
1076 apic_disable_vector(u_int apic_id, u_int vector)
1079 KASSERT(vector != IDT_SYSCALL, ("Attempt to overwrite syscall entry"));
1081 KASSERT(vector != IDT_DTRACE_RET,
1084 KASSERT(ioint_handlers[vector / 32] != NULL,
1085 ("No ISR handler for vector %u", vector));
1089 * may have a valid vector at this offset.
1091 setidt(vector, &IDTVEC(rsvd), SDT_APICT, SEL_KPL, GSEL_APIC);
1095 /* Release an APIC vector when it's no longer in use. */
1097 apic_free_vector(u_int apic_id, u_int vector, u_int irq)
1101 KASSERT(vector >= APIC_IO_INTS && vector != IDT_SYSCALL &&
1102 vector <= APIC_IO_INTS + APIC_NUM_IOINTS,
1103 ("Vector %u does not map to an IRQ line", vector));
1105 KASSERT(lapics[apic_id].la_ioint_irqs[vector - APIC_IO_INTS] ==
1108 KASSERT(vector != IDT_DTRACE_RET,
1113 * Bind us to the cpu that owned the vector before freeing it so
1125 lapics[apic_id].la_ioint_irqs[vector - APIC_IO_INTS] = -1;
1134 /* Map an IDT vector (APIC) to an IRQ (interrupt source). */
1136 apic_idt_to_irq(u_int apic_id, u_int vector)
1140 KASSERT(vector >= APIC_IO_INTS && vector != IDT_SYSCALL &&
1141 vector <= APIC_IO_INTS + APIC_NUM_IOINTS,
1142 ("Vector %u does not map to an IRQ line", vector));
1144 KASSERT(vector != IDT_DTRACE_RET,
1147 irq = lapics[apic_id].la_ioint_irqs[vector - APIC_IO_INTS];
1155 * Dump data about APIC IDT vector mappings.
1476 lapic_ipi_vectored(u_int vector, int dest)
1480 KASSERT((vector & ~APIC_VECTOR_MASK) == 0,
1481 ("%s: invalid vector %d", __func__, vector));
1486 * IPI_STOP_HARD is just a "fake" vector used to send a NMI.
1488 * the vector.
1490 if (vector == IPI_STOP_HARD)
1493 icrlo |= vector | APIC_DELMODE_FIXED;