[BACK]Return to acpi.c CVS log [TXT][DIR] Up to [cvs.NetBSD.org] / src / sys / dev / acpi

Please note that diffs are not public domain; they are subject to the copyright notices on the relevant files.

Diff for /src/sys/dev/acpi/acpi.c between version 1.79.2.2 and 1.79.2.3

version 1.79.2.2, 2006/02/18 15:39:02 version 1.79.2.3, 2006/03/01 09:28:11
Line 282  acpi_attach(struct device *parent, struc
Line 282  acpi_attach(struct device *parent, struc
         struct acpibus_attach_args *aa = aux;          struct acpibus_attach_args *aa = aux;
         ACPI_STATUS rv;          ACPI_STATUS rv;
   
         printf("\n");          aprint_naive(": Advanced Configuration and Power Interface\n");
           aprint_normal(": Advanced Configuration and Power Interface\n");
   
         if (acpi_softc != NULL)          if (acpi_softc != NULL)
                 panic("acpi_attach: ACPI has already been attached");                  panic("acpi_attach: ACPI has already been attached");
   
         sysmon_power_settype("acpi");          sysmon_power_settype("acpi");
   
         printf("%s: using Intel ACPI CA subsystem version %08x\n",          aprint_verbose("%s: using Intel ACPI CA subsystem version %08x\n",
             sc->sc_dev.dv_xname, ACPI_CA_VERSION);              sc->sc_dev.dv_xname, ACPI_CA_VERSION);
   
         printf("%s: X/RSDT: OemId <%6.6s,%8.8s,%08x>, AslId <%4.4s,%08x>\n",          aprint_verbose("%s: X/RSDT: OemId <%6.6s,%8.8s,%08x>, AslId <%4.4s,%08x>\n",
             sc->sc_dev.dv_xname,              sc->sc_dev.dv_xname,
             AcpiGbl_XSDT->OemId, AcpiGbl_XSDT->OemTableId,              AcpiGbl_XSDT->OemId, AcpiGbl_XSDT->OemTableId,
             AcpiGbl_XSDT->OemRevision,              AcpiGbl_XSDT->OemRevision,
Line 318  acpi_attach(struct device *parent, struc
Line 319  acpi_attach(struct device *parent, struc
   
         rv = AcpiEnableSubsystem(0);          rv = AcpiEnableSubsystem(0);
         if (ACPI_FAILURE(rv)) {          if (ACPI_FAILURE(rv)) {
                 printf("%s: unable to enable ACPI: %s\n",                  aprint_error("%s: unable to enable ACPI: %s\n",
                     sc->sc_dev.dv_xname, AcpiFormatException(rv));                      sc->sc_dev.dv_xname, AcpiFormatException(rv));
                 return;                  return;
         }          }
Line 330  acpi_attach(struct device *parent, struc
Line 331  acpi_attach(struct device *parent, struc
   
         rv = AcpiInitializeObjects(0);          rv = AcpiInitializeObjects(0);
         if (ACPI_FAILURE(rv)) {          if (ACPI_FAILURE(rv)) {
                 printf("%s: unable to initialize ACPI objects: %s\n",                  aprint_error("%s: unable to initialize ACPI objects: %s\n",
                     sc->sc_dev.dv_xname, AcpiFormatException(rv));                      sc->sc_dev.dv_xname, AcpiFormatException(rv));
                 return;                  return;
         }          }
Line 341  acpi_attach(struct device *parent, struc
Line 342  acpi_attach(struct device *parent, struc
   
         /* Show SCI interrupt. */          /* Show SCI interrupt. */
         if (AcpiGbl_FADT != NULL)          if (AcpiGbl_FADT != NULL)
                 printf("%s: SCI interrupting at int %d\n",                  aprint_verbose("%s: SCI interrupting at int %d\n",
                         sc->sc_dev.dv_xname, AcpiGbl_FADT->SciInt);                      sc->sc_dev.dv_xname, AcpiGbl_FADT->SciInt);
         /*          /*
          * Check for fixed-hardware features.           * Check for fixed-hardware features.
          */           */
Line 380  acpi_attach(struct device *parent, struc
Line 381  acpi_attach(struct device *parent, struc
          */           */
         sc->sc_sdhook = shutdownhook_establish(acpi_shutdown, sc);          sc->sc_sdhook = shutdownhook_establish(acpi_shutdown, sc);
         if (sc->sc_sdhook == NULL)          if (sc->sc_sdhook == NULL)
                 printf("%s: WARNING: unable to register shutdown hook\n",                  aprint_error("%s: WARNING: unable to register shutdown hook\n",
                     sc->sc_dev.dv_xname);                      sc->sc_dev.dv_xname);
   
 #ifdef ACPI_DEBUGGER  #ifdef ACPI_DEBUGGER
Line 528  acpi_activate_device(ACPI_HANDLE handle,
Line 529  acpi_activate_device(ACPI_HANDLE handle,
         buf.Length = ACPI_ALLOCATE_BUFFER;          buf.Length = ACPI_ALLOCATE_BUFFER;
   
 #ifdef ACPI_DEBUG  #ifdef ACPI_DEBUG
         printf("acpi_activate_device: %s, old status=%x\n",          aprint_normal("acpi_activate_device: %s, old status=%x\n",
                (*di)->HardwareId.Value, (*di)->CurrentStatus);                 (*di)->HardwareId.Value, (*di)->CurrentStatus);
 #endif  #endif
   
         rv = acpi_allocate_resources(handle);          rv = acpi_allocate_resources(handle);
         if (ACPI_FAILURE(rv)) {          if (ACPI_FAILURE(rv)) {
                 printf("acpi: activate failed for %s\n",                  aprint_error("acpi: activate failed for %s\n",
                        (*di)->HardwareId.Value);                         (*di)->HardwareId.Value);
         } else {          } else {
                 printf("acpi: activated %s\n", (*di)->HardwareId.Value);                  aprint_normal("acpi: activated %s\n", (*di)->HardwareId.Value);
         }          }
   
         (void)AcpiGetObjectInfo(handle, &buf);          (void)AcpiGetObjectInfo(handle, &buf);
Line 545  acpi_activate_device(ACPI_HANDLE handle,
Line 546  acpi_activate_device(ACPI_HANDLE handle,
         *di = buf.Pointer;          *di = buf.Pointer;
   
 #ifdef ACPI_DEBUG  #ifdef ACPI_DEBUG
         printf("acpi_activate_device: %s, new status=%x\n",          aprint_normal("acpi_activate_device: %s, new status=%x\n",
                (*di)->HardwareId.Value, (*di)->CurrentStatus);                 (*di)->HardwareId.Value, (*di)->CurrentStatus);
 #endif  #endif
 }  }
Line 578  acpi_make_devnode(ACPI_HANDLE handle, UI
Line 579  acpi_make_devnode(ACPI_HANDLE handle, UI
                 rv = AcpiGetObjectInfo(handle, &buf);                  rv = AcpiGetObjectInfo(handle, &buf);
                 if (ACPI_FAILURE(rv)) {                  if (ACPI_FAILURE(rv)) {
 #ifdef ACPI_DEBUG  #ifdef ACPI_DEBUG
                         printf("%s: AcpiGetObjectInfo failed: %s\n",                          aprint_normal("%s: AcpiGetObjectInfo failed: %s\n",
                             sc->sc_dev.dv_xname, AcpiFormatException(rv));                              sc->sc_dev.dv_xname, AcpiFormatException(rv));
 #endif  #endif
                         goto out; /* XXX why return OK */                          goto out; /* XXX why return OK */
Line 618  acpi_make_devnode(ACPI_HANDLE handle, UI
Line 619  acpi_make_devnode(ACPI_HANDLE handle, UI
                                 goto out;                                  goto out;
   
 #ifdef ACPI_EXTRA_DEBUG  #ifdef ACPI_EXTRA_DEBUG
                         printf("%s: HID %s found in scope %s level %d\n",                          aprint_normal("%s: HID %s found in scope %s level %d\n",
                             sc->sc_dev.dv_xname,                              sc->sc_dev.dv_xname,
                             ad->ad_devinfo->HardwareId.Value,                              ad->ad_devinfo->HardwareId.Value,
                             as->as_name, ad->ad_level);                              as->as_name, ad->ad_level);
                         if (ad->ad_devinfo->Valid & ACPI_VALID_UID)                          if (ad->ad_devinfo->Valid & ACPI_VALID_UID)
                                 printf("       UID %s\n",                                  aprint_normal("       UID %s\n",
                                     ad->ad_devinfo->UniqueId.Value);                                      ad->ad_devinfo->UniqueId.Value);
                         if (ad->ad_devinfo->Valid & ACPI_VALID_ADR)                          if (ad->ad_devinfo->Valid & ACPI_VALID_ADR)
                                 printf("       ADR 0x%016qx\n",                                  aprint_normal("       ADR 0x%016qx\n",
                                     ad->ad_devinfo->Address);                                      ad->ad_devinfo->Address);
                         if (ad->ad_devinfo->Valid & ACPI_VALID_STA)                          if (ad->ad_devinfo->Valid & ACPI_VALID_STA)
                                 printf("       STA 0x%08x\n",                                  aprint_normal("       STA 0x%08x\n",
                                     ad->ad_devinfo->CurrentStatus);                                      ad->ad_devinfo->CurrentStatus);
 #endif  #endif
                 }                  }
Line 670  acpi_print(void *aux, const char *pnp)
Line 671  acpi_print(void *aux, const char *pnp)
                                     sizeof(acpi_knowndevs[0]); i++) {                                      sizeof(acpi_knowndevs[0]); i++) {
                                         if (strcmp(acpi_knowndevs[i].pnp,                                          if (strcmp(acpi_knowndevs[i].pnp,
                                             pnpstr) == 0) {                                              pnpstr) == 0) {
                                                 printf("[%s] ",                                                  aprint_normal("[%s] ",
                                                     acpi_knowndevs[i].str);                                                      acpi_knowndevs[i].str);
                                         }                                          }
                                 }                                  }
Line 727  acpi_enable_fixed_events(struct acpi_sof
Line 728  acpi_enable_fixed_events(struct acpi_sof
          */           */
   
         if (AcpiGbl_FADT != NULL && AcpiGbl_FADT->PwrButton == 0) {          if (AcpiGbl_FADT != NULL && AcpiGbl_FADT->PwrButton == 0) {
                 printf("%s: fixed-feature power button present\n",                  aprint_normal("%s: fixed-feature power button present\n",
                     sc->sc_dev.dv_xname);                      sc->sc_dev.dv_xname);
                 sc->sc_smpsw_power.smpsw_name = sc->sc_dev.dv_xname;                  sc->sc_smpsw_power.smpsw_name = sc->sc_dev.dv_xname;
                 sc->sc_smpsw_power.smpsw_type = PSWITCH_TYPE_POWER;                  sc->sc_smpsw_power.smpsw_type = PSWITCH_TYPE_POWER;
                 if (sysmon_pswitch_register(&sc->sc_smpsw_power) != 0) {                  if (sysmon_pswitch_register(&sc->sc_smpsw_power) != 0) {
                         printf("%s: unable to register fixed power button "                          aprint_error("%s: unable to register fixed power "
                             "with sysmon\n", sc->sc_dev.dv_xname);                              "button with sysmon\n", sc->sc_dev.dv_xname);
                 } else {                  } else {
                         rv = AcpiInstallFixedEventHandler(                          rv = AcpiInstallFixedEventHandler(
                             ACPI_EVENT_POWER_BUTTON,                              ACPI_EVENT_POWER_BUTTON,
                             acpi_fixed_button_handler, &sc->sc_smpsw_power);                              acpi_fixed_button_handler, &sc->sc_smpsw_power);
                         if (ACPI_FAILURE(rv)) {                          if (ACPI_FAILURE(rv)) {
                                 printf("%s: unable to install handler for "                                  aprint_error("%s: unable to install handler "
                                     "fixed power button: %s\n",                                      "for fixed power button: %s\n",
                                     sc->sc_dev.dv_xname,                                      sc->sc_dev.dv_xname,
                                     AcpiFormatException(rv));                                      AcpiFormatException(rv));
                         }                          }
Line 748  acpi_enable_fixed_events(struct acpi_sof
Line 749  acpi_enable_fixed_events(struct acpi_sof
         }          }
   
         if (AcpiGbl_FADT != NULL && AcpiGbl_FADT->SleepButton == 0) {          if (AcpiGbl_FADT != NULL && AcpiGbl_FADT->SleepButton == 0) {
                 printf("%s: fixed-feature sleep button present\n",                  aprint_normal("%s: fixed-feature sleep button present\n",
                     sc->sc_dev.dv_xname);                      sc->sc_dev.dv_xname);
                 sc->sc_smpsw_sleep.smpsw_name = sc->sc_dev.dv_xname;                  sc->sc_smpsw_sleep.smpsw_name = sc->sc_dev.dv_xname;
                 sc->sc_smpsw_sleep.smpsw_type = PSWITCH_TYPE_SLEEP;                  sc->sc_smpsw_sleep.smpsw_type = PSWITCH_TYPE_SLEEP;
                 if (sysmon_pswitch_register(&sc->sc_smpsw_power) != 0) {                  if (sysmon_pswitch_register(&sc->sc_smpsw_power) != 0) {
                         printf("%s: unable to register fixed sleep button "                          aprint_error("%s: unable to register fixed sleep "
                             "with sysmon\n", sc->sc_dev.dv_xname);                              "button with sysmon\n", sc->sc_dev.dv_xname);
                 } else {                  } else {
                         rv = AcpiInstallFixedEventHandler(                          rv = AcpiInstallFixedEventHandler(
                             ACPI_EVENT_SLEEP_BUTTON,                              ACPI_EVENT_SLEEP_BUTTON,
                             acpi_fixed_button_handler, &sc->sc_smpsw_sleep);                              acpi_fixed_button_handler, &sc->sc_smpsw_sleep);
                         if (ACPI_FAILURE(rv)) {                          if (ACPI_FAILURE(rv)) {
                                 printf("%s: unable to install handler for "                                  aprint_error("%s: unable to install handler "
                                     "fixed sleep button: %s\n",                                      "for fixed sleep button: %s\n",
                                     sc->sc_dev.dv_xname,                                      sc->sc_dev.dv_xname,
                                     AcpiFormatException(rv));                                      AcpiFormatException(rv));
                         }                          }
Line 1136  acpi_get_intr(ACPI_HANDLE handle)
Line 1137  acpi_get_intr(ACPI_HANDLE handle)
         rv = acpi_get(handle, &ret, AcpiGetCurrentResources);          rv = acpi_get(handle, &ret, AcpiGetCurrentResources);
         if (ACPI_FAILURE(rv))          if (ACPI_FAILURE(rv))
                 return intr;                  return intr;
         for (res = ret.Pointer; res->Type != ACPI_RESOURCE_TYPE_END_DEPENDENT;          for (res = ret.Pointer; res->Type != ACPI_RESOURCE_TYPE_END_TAG;
              res = ACPI_NEXT_RESOURCE(res)) {               res = ACPI_NEXT_RESOURCE(res)) {
                 if (res->Type == ACPI_RESOURCE_TYPE_IRQ) {                  if (res->Type == ACPI_RESOURCE_TYPE_IRQ) {
                         irq = (ACPI_RESOURCE_IRQ *)&res->Data;                          irq = (ACPI_RESOURCE_IRQ *)&res->Data;
Line 1309  acpi_allocate_resources(ACPI_HANDLE hand
Line 1310  acpi_allocate_resources(ACPI_HANDLE hand
         bufn.Pointer = resn = malloc(bufn.Length, M_ACPI, M_WAITOK);          bufn.Pointer = resn = malloc(bufn.Length, M_ACPI, M_WAITOK);
         resp = bufp.Pointer;          resp = bufp.Pointer;
         resc = bufc.Pointer;          resc = bufc.Pointer;
         while (resc->Type != ACPI_RESOURCE_TYPE_END_DEPENDENT &&          while (resc->Type != ACPI_RESOURCE_TYPE_END_TAG &&
                resp->Type != ACPI_RESOURCE_TYPE_END_DEPENDENT) {                 resp->Type != ACPI_RESOURCE_TYPE_END_TAG) {
                 while (resc->Type != resp->Type && resp->Type != ACPI_RESOURCE_TYPE_END_DEPENDENT)                  while (resc->Type != resp->Type && resp->Type != ACPI_RESOURCE_TYPE_END_TAG)
                         resp = ACPI_NEXT_RESOURCE(resp);                          resp = ACPI_NEXT_RESOURCE(resp);
                 if (resp->Type == ACPI_RESOURCE_TYPE_END_DEPENDENT)                  if (resp->Type == ACPI_RESOURCE_TYPE_END_TAG)
                         break;                          break;
                 /* Found identical Id */                  /* Found identical Id */
                 resn->Type = resc->Type;                  resn->Type = resc->Type;
Line 1349  acpi_allocate_resources(ACPI_HANDLE hand
Line 1350  acpi_allocate_resources(ACPI_HANDLE hand
                         resn = (ACPI_RESOURCE *)((UINT8 *)bufn.Pointer + delta);                          resn = (ACPI_RESOURCE *)((UINT8 *)bufn.Pointer + delta);
                 }                  }
         }          }
         if (resc->Type != ACPI_RESOURCE_TYPE_END_DEPENDENT) {          if (resc->Type != ACPI_RESOURCE_TYPE_END_TAG) {
                 printf("acpi_allocate_resources: resc not exhausted\n");                  printf("acpi_allocate_resources: resc not exhausted\n");
                 rv = AE_BAD_DATA;                  rv = AE_BAD_DATA;
                 goto out3;                  goto out3;
         }          }
   
         resn->Type = ACPI_RESOURCE_TYPE_END_DEPENDENT;          resn->Type = ACPI_RESOURCE_TYPE_END_TAG;
         rv = AcpiSetCurrentResources(handle, &bufn);          rv = AcpiSetCurrentResources(handle, &bufn);
         if (ACPI_FAILURE(rv)) {          if (ACPI_FAILURE(rv)) {
                 printf("acpi_allocate_resources: AcpiSetCurrentResources %s\n",                  printf("acpi_allocate_resources: AcpiSetCurrentResources %s\n",

Legend:
Removed from v.1.79.2.2  
changed lines
  Added in v.1.79.2.3

CVSweb <webmaster@jp.NetBSD.org>