• Home
  • History
  • Annotate
  • Raw
  • Download
  • only in /freebsd-13-stable/sys/dev/acpica/

Lines Matching defs:ge

343 apei_ge_handler(struct apei_ge *ge, bool copy)
345 uint8_t *buf = copy ? ge->copybuf : ge->buf;
366 if (!copy && ge->v1.Header.Type == ACPI_HEST_TYPE_GENERIC_ERROR_V2 &&
367 ge->res2) {
368 uint64_t val = READ8(ge->res2, 0);
369 val &= ge->v2.ReadAckPreserve;
370 val |= ge->v2.ReadAckWrite;
371 WRITE8(ge->res2, 0, val);
384 struct apei_ge *ge = arg;
386 apei_ge_handler(ge, true);
392 struct apei_ge *ge = apei_nmi_ge;
395 if (ge == NULL)
398 ges = (ACPI_HEST_GENERIC_STATUS *)ge->buf;
407 gesc = (ACPI_HEST_GENERIC_STATUS *)ge->copybuf;
409 memcpy(ge->copybuf, ge->buf, ge->v1.ErrorBlockLength);
413 if (ge->v1.Header.Type == ACPI_HEST_TYPE_GENERIC_ERROR_V2 &&
414 ge->res2) {
415 uint64_t val = READ8(ge->res2, 0);
416 val &= ge->v2.ReadAckPreserve;
417 val |= ge->v2.ReadAckWrite;
418 WRITE8(ge->res2, 0, val);
422 swi_sched(ge->swi_ih, SWI_FROMNMI);
430 struct apei_ge *ge = context;
432 apei_ge_handler(ge, false);
433 callout_schedule(&ge->poll, ge->v1.Notify.PollInterval * hz / 1000);
441 struct apei_ge *ge;
443 TAILQ_FOREACH(ge, &sc->ges, link) {
444 if (ge->v1.Notify.Type == ACPI_HEST_NOTIFY_SCI ||
445 ge->v1.Notify.Type == ACPI_HEST_NOTIFY_GPIO ||
446 ge->v1.Notify.Type == ACPI_HEST_NOTIFY_GSIV)
447 apei_ge_handler(ge, false);
455 struct apei_ge *ge;
489 ge = malloc(sizeof(*ge), M_DEVBUF, M_WAITOK | M_ZERO);
490 ge->v1 = *s;
491 TAILQ_INSERT_TAIL(&sc->ges, ge, link);
496 ge = malloc(sizeof(*ge), M_DEVBUF, M_WAITOK | M_ZERO);
497 ge->v2 = *s;
498 TAILQ_INSERT_TAIL(&sc->ges, ge, link);
613 struct apei_ge *ge;
627 TAILQ_FOREACH(ge, &sc->ges, link) {
628 ge->res_rid = rid++;
629 acpi_bus_alloc_gas(dev, &ge->res_type, &ge->res_rid,
630 &ge->v1.ErrorStatusAddress, &ge->res, 0);
631 if (ge->res) {
632 ge->buf = pmap_mapdev_attr(READ8(ge->res, 0),
633 ge->v1.ErrorBlockLength, VM_MEMATTR_WRITE_COMBINING);
637 if (ge->v1.Header.Type == ACPI_HEST_TYPE_GENERIC_ERROR_V2) {
638 ge->res2_rid = rid++;
639 acpi_bus_alloc_gas(dev, &ge->res2_type, &ge->res2_rid,
640 &ge->v2.ReadAckRegister, &ge->res2, 0);
641 if (ge->res2 == NULL)
644 if (ge->v1.Notify.Type == ACPI_HEST_NOTIFY_POLLED) {
645 callout_init(&ge->poll, 1);
646 callout_reset(&ge->poll,
647 ge->v1.Notify.PollInterval * hz / 1000,
648 apei_callout_handler, ge);
649 } else if (ge->v1.Notify.Type == ACPI_HEST_NOTIFY_NMI) {
650 ge->copybuf = malloc(ge->v1.ErrorBlockLength,
652 swi_add(&clk_intr_event, "apei", apei_nmi_swi, ge,
653 SWI_CLOCK, INTR_MPSAFE, &ge->swi_ih);
654 apei_nmi_ge = ge;
670 struct apei_ge *ge;
679 while ((ge = TAILQ_FIRST(&sc->ges)) != NULL) {
680 TAILQ_REMOVE(&sc->ges, ge, link);
681 if (ge->res) {
682 bus_release_resource(dev, ge->res_type,
683 ge->res_rid, ge->res);
685 if (ge->res2) {
686 bus_release_resource(dev, ge->res2_type,
687 ge->res2_rid, ge->res2);
689 if (ge->v1.Notify.Type == ACPI_HEST_NOTIFY_POLLED) {
690 callout_drain(&ge->poll);
691 } else if (ge->v1.Notify.Type == ACPI_HEST_NOTIFY_NMI) {
692 swi_remove(&ge->swi_ih);
693 free(ge->copybuf, M_DEVBUF);
695 if (ge->buf) {
696 pmap_unmapdev((vm_offset_t)ge->buf,
697 ge->v1.ErrorBlockLength);
699 free(ge, M_DEVBUF);