Lines Matching refs:pin

77 	int		acnt[8];	/* sum of pin asserts and deasserts */
113 static void vatpic_set_pinstate(struct vatpic *vatpic, int pin, bool newstate);
128 int bit, pin;
131 ATPIC_PIN_FOREACH(pin, atpic, i) {
132 bit = (1 << pin);
142 return (pin);
153 int bit, pin, tmp;
173 ATPIC_PIN_FOREACH(pin, atpic, tmp) {
174 bit = 1 << pin;
185 * the corresponding 'pin' to the caller.
188 return (pin);
198 int pin;
207 (pin = vatpic_get_highest_irrpin(atpic)) != -1) {
208 VATPIC_CTR4(vatpic, "atpic slave notify pin = %d "
209 "(imr 0x%x irr 0x%x isr 0x%x)", pin,
229 (pin = vatpic_get_highest_irrpin(atpic)) != -1) {
230 VATPIC_CTR4(vatpic, "atpic master notify pin = %d "
231 "(imr 0x%x irr 0x%x isr 0x%x)", pin,
415 vatpic_set_pinstate(struct vatpic *vatpic, int pin, bool newstate)
421 KASSERT(pin >= 0 && pin < 16,
422 ("vatpic_set_pinstate: invalid pin number %d", pin));
426 atpic = &vatpic->atpic[pin >> 3];
428 oldcnt = atpic->acnt[pin & 0x7];
430 atpic->acnt[pin & 0x7]++;
432 atpic->acnt[pin & 0x7]--;
433 newcnt = atpic->acnt[pin & 0x7];
436 VATPIC_CTR2(vatpic, "atpic pin%d: bad acnt %d", pin, newcnt);
439 level = ((vatpic->elc[pin >> 3] & (1 << (pin & 0x7))) != 0);
443 VATPIC_CTR1(vatpic, "atpic pin%d: asserted", pin);
444 atpic->request |= (1 << (pin & 0x7));
447 VATPIC_CTR1(vatpic, "atpic pin%d: deasserted", pin);
449 atpic->request &= ~(1 << (pin & 0x7));
451 VATPIC_CTR3(vatpic, "atpic pin%d: %s, ignored, acnt %d",
452 pin, newstate ? "asserted" : "deasserted", newcnt);
553 int pin;
561 pin = vatpic_get_highest_irrpin(atpic);
562 if (pin == 2) {
564 pin = vatpic_get_highest_irrpin(atpic);
571 if (pin == -1)
572 pin = 7;
574 KASSERT(pin >= 0 && pin <= 7, ("%s: invalid pin %d", __func__, pin));
575 *vecptr = atpic->irq_base + pin;
581 vatpic_pin_accepted(struct atpic *atpic, int pin)
585 if (atpic->acnt[pin] == 0)
586 atpic->request &= ~(1 << pin);
590 atpic->lowprio = pin;
592 atpic->service |= (1 << pin);
600 int pin;
606 pin = vector & 0x7;
609 vatpic_pin_accepted(&vatpic->atpic[1], pin);
616 vatpic_pin_accepted(&vatpic->atpic[0], pin);
628 int pin;
634 pin = vatpic_get_highest_irrpin(atpic);
635 if (pin >= 0) {
636 vatpic_pin_accepted(atpic, pin);
637 *eax = 0x80 | pin;