Deleted Added
full compact
evxfevnt.c (202771) evxfevnt.c (206117)
1/******************************************************************************
2 *
3 * Module Name: evxfevnt - External Interfaces, ACPI event disable/enable
4 *
5 *****************************************************************************/
6
7/******************************************************************************
8 *

--- 293 unchanged lines hidden (view full) ---

302 return_ACPI_STATUS (Status);
303}
304
305ACPI_EXPORT_SYMBOL (AcpiEnableEvent)
306
307
308/*******************************************************************************
309 *
1/******************************************************************************
2 *
3 * Module Name: evxfevnt - External Interfaces, ACPI event disable/enable
4 *
5 *****************************************************************************/
6
7/******************************************************************************
8 *

--- 293 unchanged lines hidden (view full) ---

302 return_ACPI_STATUS (Status);
303}
304
305ACPI_EXPORT_SYMBOL (AcpiEnableEvent)
306
307
308/*******************************************************************************
309 *
310 * FUNCTION: AcpiSetGpeType
310 * FUNCTION: AcpiEnableGpe
311 *
311 *
312 * PARAMETERS: GpeDevice - Parent GPE Device
312 * PARAMETERS: GpeDevice - Parent GPE Device. NULL for GPE0/GPE1
313 * GpeNumber - GPE level within the GPE block
313 * GpeNumber - GPE level within the GPE block
314 * Type - New GPE type
314 * GpeType - ACPI_GPE_TYPE_RUNTIME or ACPI_GPE_TYPE_WAKE
315 * or both
315 *
316 * RETURN: Status
317 *
316 *
317 * RETURN: Status
318 *
318 * DESCRIPTION: Set the type of an individual GPE
319 * DESCRIPTION: Add a reference to a GPE. On the first reference, the GPE is
320 * hardware-enabled (for runtime GPEs), or the GPE register mask
321 * is updated (for wake GPEs).
319 *
320 ******************************************************************************/
321
322ACPI_STATUS
322 *
323 ******************************************************************************/
324
325ACPI_STATUS
323AcpiSetGpeType (
326AcpiEnableGpe (
324 ACPI_HANDLE GpeDevice,
325 UINT32 GpeNumber,
327 ACPI_HANDLE GpeDevice,
328 UINT32 GpeNumber,
326 UINT8 Type)
329 UINT8 GpeType)
327{
328 ACPI_STATUS Status = AE_OK;
329 ACPI_GPE_EVENT_INFO *GpeEventInfo;
330{
331 ACPI_STATUS Status = AE_OK;
332 ACPI_GPE_EVENT_INFO *GpeEventInfo;
333 ACPI_CPU_FLAGS Flags;
330
331
334
335
332 ACPI_FUNCTION_TRACE (AcpiSetGpeType);
336 ACPI_FUNCTION_TRACE (AcpiEnableGpe);
333
334
337
338
339 /* Parameter validation */
340
341 if (!GpeType || (GpeType & ~ACPI_GPE_TYPE_WAKE_RUN))
342 {
343 return_ACPI_STATUS (AE_BAD_PARAMETER);
344 }
345
346 Flags = AcpiOsAcquireLock (AcpiGbl_GpeLock);
347
335 /* Ensure that we have a valid GPE number */
336
337 GpeEventInfo = AcpiEvGetGpeEventInfo (GpeDevice, GpeNumber);
338 if (!GpeEventInfo)
339 {
340 Status = AE_BAD_PARAMETER;
341 goto UnlockAndExit;
342 }
343
348 /* Ensure that we have a valid GPE number */
349
350 GpeEventInfo = AcpiEvGetGpeEventInfo (GpeDevice, GpeNumber);
351 if (!GpeEventInfo)
352 {
353 Status = AE_BAD_PARAMETER;
354 goto UnlockAndExit;
355 }
356
344 if ((GpeEventInfo->Flags & ACPI_GPE_TYPE_MASK) == Type)
357 if (GpeType & ACPI_GPE_TYPE_RUNTIME)
345 {
358 {
346 return_ACPI_STATUS (AE_OK);
359 if (GpeEventInfo->RuntimeCount == ACPI_UINT8_MAX)
360 {
361 Status = AE_LIMIT; /* Too many references */
362 goto UnlockAndExit;
363 }
364
365 GpeEventInfo->RuntimeCount++;
366 if (GpeEventInfo->RuntimeCount == 1)
367 {
368 Status = AcpiEvEnableGpe (GpeEventInfo);
369 if (ACPI_FAILURE (Status))
370 {
371 GpeEventInfo->RuntimeCount--;
372 goto UnlockAndExit;
373 }
374 }
347 }
348
375 }
376
349 /* Set the new type (will disable GPE if currently enabled) */
377 if (GpeType & ACPI_GPE_TYPE_WAKE)
378 {
379 /* The GPE must have the ability to wake the system */
350
380
351 Status = AcpiEvSetGpeType (GpeEventInfo, Type);
381 if (!(GpeEventInfo->Flags & ACPI_GPE_CAN_WAKE))
382 {
383 Status = AE_TYPE;
384 goto UnlockAndExit;
385 }
352
386
387 if (GpeEventInfo->WakeupCount == ACPI_UINT8_MAX)
388 {
389 Status = AE_LIMIT; /* Too many references */
390 goto UnlockAndExit;
391 }
392
393 /*
394 * Update the enable mask on the first wakeup reference. Wake GPEs
395 * are only hardware-enabled just before sleeping.
396 */
397 GpeEventInfo->WakeupCount++;
398 if (GpeEventInfo->WakeupCount == 1)
399 {
400 (void) AcpiEvUpdateGpeEnableMasks (GpeEventInfo);
401 }
402 }
403
353UnlockAndExit:
404UnlockAndExit:
405 AcpiOsReleaseLock (AcpiGbl_GpeLock, Flags);
354 return_ACPI_STATUS (Status);
355}
356
406 return_ACPI_STATUS (Status);
407}
408
357ACPI_EXPORT_SYMBOL (AcpiSetGpeType)
409ACPI_EXPORT_SYMBOL (AcpiEnableGpe)
358
359
360/*******************************************************************************
361 *
410
411
412/*******************************************************************************
413 *
362 * FUNCTION: AcpiEnableGpe
414 * FUNCTION: AcpiDisableGpe
363 *
415 *
364 * PARAMETERS: GpeDevice - Parent GPE Device
416 * PARAMETERS: GpeDevice - Parent GPE Device. NULL for GPE0/GPE1
365 * GpeNumber - GPE level within the GPE block
417 * GpeNumber - GPE level within the GPE block
366 * Flags - Just enable, or also wake enable?
367 * Called from ISR or not
418 * GpeType - ACPI_GPE_TYPE_RUNTIME or ACPI_GPE_TYPE_WAKE
419 * or both
368 *
369 * RETURN: Status
370 *
420 *
421 * RETURN: Status
422 *
371 * DESCRIPTION: Enable an ACPI event (general purpose)
423 * DESCRIPTION: Remove a reference to a GPE. When the last reference is
424 * removed, only then is the GPE disabled (for runtime GPEs), or
425 * the GPE mask bit disabled (for wake GPEs)
372 *
373 ******************************************************************************/
374
375ACPI_STATUS
426 *
427 ******************************************************************************/
428
429ACPI_STATUS
376AcpiEnableGpe (
430AcpiDisableGpe (
377 ACPI_HANDLE GpeDevice,
378 UINT32 GpeNumber,
431 ACPI_HANDLE GpeDevice,
432 UINT32 GpeNumber,
379 UINT32 Flags)
433 UINT8 GpeType)
380{
381 ACPI_STATUS Status = AE_OK;
382 ACPI_GPE_EVENT_INFO *GpeEventInfo;
434{
435 ACPI_STATUS Status = AE_OK;
436 ACPI_GPE_EVENT_INFO *GpeEventInfo;
437 ACPI_CPU_FLAGS Flags;
383
384
438
439
385 ACPI_FUNCTION_TRACE (AcpiEnableGpe);
440 ACPI_FUNCTION_TRACE (AcpiDisableGpe);
386
387
441
442
388 /* Use semaphore lock if not executing at interrupt level */
443 /* Parameter validation */
389
444
390 if (Flags & ACPI_NOT_ISR)
445 if (!GpeType || (GpeType & ~ACPI_GPE_TYPE_WAKE_RUN))
391 {
446 {
392 Status = AcpiUtAcquireMutex (ACPI_MTX_EVENTS);
393 if (ACPI_FAILURE (Status))
394 {
395 return_ACPI_STATUS (Status);
396 }
447 return_ACPI_STATUS (AE_BAD_PARAMETER);
397 }
398
448 }
449
450 Flags = AcpiOsAcquireLock (AcpiGbl_GpeLock);
451
399 /* Ensure that we have a valid GPE number */
400
401 GpeEventInfo = AcpiEvGetGpeEventInfo (GpeDevice, GpeNumber);
402 if (!GpeEventInfo)
403 {
404 Status = AE_BAD_PARAMETER;
405 goto UnlockAndExit;
406 }
407
452 /* Ensure that we have a valid GPE number */
453
454 GpeEventInfo = AcpiEvGetGpeEventInfo (GpeDevice, GpeNumber);
455 if (!GpeEventInfo)
456 {
457 Status = AE_BAD_PARAMETER;
458 goto UnlockAndExit;
459 }
460
408 /* Perform the enable */
461 /* Hardware-disable a runtime GPE on removal of the last reference */
409
462
410 Status = AcpiEvEnableGpe (GpeEventInfo, TRUE);
463 if (GpeType & ACPI_GPE_TYPE_RUNTIME)
464 {
465 if (!GpeEventInfo->RuntimeCount)
466 {
467 Status = AE_LIMIT; /* There are no references to remove */
468 goto UnlockAndExit;
469 }
411
470
412UnlockAndExit:
413 if (Flags & ACPI_NOT_ISR)
471 GpeEventInfo->RuntimeCount--;
472 if (!GpeEventInfo->RuntimeCount)
473 {
474 Status = AcpiEvDisableGpe (GpeEventInfo);
475 if (ACPI_FAILURE (Status))
476 {
477 GpeEventInfo->RuntimeCount++;
478 goto UnlockAndExit;
479 }
480 }
481 }
482
483 /*
484 * Update masks for wake GPE on removal of the last reference.
485 * No need to hardware-disable wake GPEs here, they are not currently
486 * enabled.
487 */
488 if (GpeType & ACPI_GPE_TYPE_WAKE)
414 {
489 {
415 (void) AcpiUtReleaseMutex (ACPI_MTX_EVENTS);
490 if (!GpeEventInfo->WakeupCount)
491 {
492 Status = AE_LIMIT; /* There are no references to remove */
493 goto UnlockAndExit;
494 }
495
496 GpeEventInfo->WakeupCount--;
497 if (!GpeEventInfo->WakeupCount)
498 {
499 (void) AcpiEvUpdateGpeEnableMasks (GpeEventInfo);
500 }
416 }
501 }
502
503
504UnlockAndExit:
505 AcpiOsReleaseLock (AcpiGbl_GpeLock, Flags);
417 return_ACPI_STATUS (Status);
418}
419
506 return_ACPI_STATUS (Status);
507}
508
420ACPI_EXPORT_SYMBOL (AcpiEnableGpe)
509ACPI_EXPORT_SYMBOL (AcpiDisableGpe)
421
422
423/*******************************************************************************
424 *
510
511
512/*******************************************************************************
513 *
425 * FUNCTION: AcpiDisableGpe
514 * FUNCTION: AcpiSetGpe
426 *
515 *
427 * PARAMETERS: GpeDevice - Parent GPE Device
516 * PARAMETERS: GpeDevice - Parent GPE Device. NULL for GPE0/GPE1
428 * GpeNumber - GPE level within the GPE block
517 * GpeNumber - GPE level within the GPE block
429 * Flags - Just disable, or also wake disable?
430 * Called from ISR or not
518 * Action - ACPI_GPE_ENABLE or ACPI_GPE_DISABLE
431 *
432 * RETURN: Status
433 *
519 *
520 * RETURN: Status
521 *
434 * DESCRIPTION: Disable an ACPI event (general purpose)
522 * DESCRIPTION: Enable or disable an individual GPE. This function bypasses
523 * the reference count mechanism used in the AcpiEnableGpe and
524 * AcpiDisableGpe interfaces -- and should be used with care.
435 *
525 *
526 * Note: Typically used to disable a runtime GPE for short period of time,
527 * then re-enable it, without disturbing the existing reference counts. This
528 * is useful, for example, in the Embedded Controller (EC) driver.
529 *
436 ******************************************************************************/
437
438ACPI_STATUS
530 ******************************************************************************/
531
532ACPI_STATUS
439AcpiDisableGpe (
533AcpiSetGpe (
440 ACPI_HANDLE GpeDevice,
441 UINT32 GpeNumber,
534 ACPI_HANDLE GpeDevice,
535 UINT32 GpeNumber,
442 UINT32 Flags)
536 UINT8 Action)
443{
537{
444 ACPI_STATUS Status = AE_OK;
445 ACPI_GPE_EVENT_INFO *GpeEventInfo;
538 ACPI_GPE_EVENT_INFO *GpeEventInfo;
539 ACPI_STATUS Status;
540 ACPI_CPU_FLAGS Flags;
446
447
541
542
448 ACPI_FUNCTION_TRACE (AcpiDisableGpe);
543 ACPI_FUNCTION_TRACE (AcpiSetGpe);
449
450
544
545
451 /* Use semaphore lock if not executing at interrupt level */
546 Flags = AcpiOsAcquireLock (AcpiGbl_GpeLock);
452
547
453 if (Flags & ACPI_NOT_ISR)
454 {
455 Status = AcpiUtAcquireMutex (ACPI_MTX_EVENTS);
456 if (ACPI_FAILURE (Status))
457 {
458 return_ACPI_STATUS (Status);
459 }
460 }
461
462 /* Ensure that we have a valid GPE number */
463
464 GpeEventInfo = AcpiEvGetGpeEventInfo (GpeDevice, GpeNumber);
465 if (!GpeEventInfo)
466 {
467 Status = AE_BAD_PARAMETER;
468 goto UnlockAndExit;
469 }
470
548 /* Ensure that we have a valid GPE number */
549
550 GpeEventInfo = AcpiEvGetGpeEventInfo (GpeDevice, GpeNumber);
551 if (!GpeEventInfo)
552 {
553 Status = AE_BAD_PARAMETER;
554 goto UnlockAndExit;
555 }
556
471 Status = AcpiEvDisableGpe (GpeEventInfo);
557 /* Perform the action */
472
558
473UnlockAndExit:
474 if (Flags & ACPI_NOT_ISR)
559 switch (Action)
475 {
560 {
476 (void) AcpiUtReleaseMutex (ACPI_MTX_EVENTS);
561 case ACPI_GPE_ENABLE:
562 Status = AcpiEvEnableGpe (GpeEventInfo);
563 break;
564
565 case ACPI_GPE_DISABLE:
566 Status = AcpiEvDisableGpe (GpeEventInfo);
567 break;
568
569 default:
570 Status = AE_BAD_PARAMETER;
571 break;
477 }
572 }
573
574UnlockAndExit:
575 AcpiOsReleaseLock (AcpiGbl_GpeLock, Flags);
478 return_ACPI_STATUS (Status);
479}
480
576 return_ACPI_STATUS (Status);
577}
578
481ACPI_EXPORT_SYMBOL (AcpiDisableGpe)
579ACPI_EXPORT_SYMBOL (AcpiSetGpe)
482
483
484/*******************************************************************************
485 *
486 * FUNCTION: AcpiDisableEvent
487 *
488 * PARAMETERS: Event - The fixed eventto be enabled
489 * Flags - Reserved

--- 97 unchanged lines hidden (view full) ---

587
588ACPI_EXPORT_SYMBOL (AcpiClearEvent)
589
590
591/*******************************************************************************
592 *
593 * FUNCTION: AcpiClearGpe
594 *
580
581
582/*******************************************************************************
583 *
584 * FUNCTION: AcpiDisableEvent
585 *
586 * PARAMETERS: Event - The fixed eventto be enabled
587 * Flags - Reserved

--- 97 unchanged lines hidden (view full) ---

685
686ACPI_EXPORT_SYMBOL (AcpiClearEvent)
687
688
689/*******************************************************************************
690 *
691 * FUNCTION: AcpiClearGpe
692 *
595 * PARAMETERS: GpeDevice - Parent GPE Device
693 * PARAMETERS: GpeDevice - Parent GPE Device. NULL for GPE0/GPE1
596 * GpeNumber - GPE level within the GPE block
694 * GpeNumber - GPE level within the GPE block
597 * Flags - Called from an ISR or not
598 *
599 * RETURN: Status
600 *
601 * DESCRIPTION: Clear an ACPI event (general purpose)
602 *
603 ******************************************************************************/
604
605ACPI_STATUS
606AcpiClearGpe (
607 ACPI_HANDLE GpeDevice,
695 *
696 * RETURN: Status
697 *
698 * DESCRIPTION: Clear an ACPI event (general purpose)
699 *
700 ******************************************************************************/
701
702ACPI_STATUS
703AcpiClearGpe (
704 ACPI_HANDLE GpeDevice,
608 UINT32 GpeNumber,
609 UINT32 Flags)
705 UINT32 GpeNumber)
610{
611 ACPI_STATUS Status = AE_OK;
612 ACPI_GPE_EVENT_INFO *GpeEventInfo;
706{
707 ACPI_STATUS Status = AE_OK;
708 ACPI_GPE_EVENT_INFO *GpeEventInfo;
709 ACPI_CPU_FLAGS Flags;
613
614
615 ACPI_FUNCTION_TRACE (AcpiClearGpe);
616
617
710
711
712 ACPI_FUNCTION_TRACE (AcpiClearGpe);
713
714
618 /* Use semaphore lock if not executing at interrupt level */
715 Flags = AcpiOsAcquireLock (AcpiGbl_GpeLock);
619
716
620 if (Flags & ACPI_NOT_ISR)
621 {
622 Status = AcpiUtAcquireMutex (ACPI_MTX_EVENTS);
623 if (ACPI_FAILURE (Status))
624 {
625 return_ACPI_STATUS (Status);
626 }
627 }
628
629 /* Ensure that we have a valid GPE number */
630
631 GpeEventInfo = AcpiEvGetGpeEventInfo (GpeDevice, GpeNumber);
632 if (!GpeEventInfo)
633 {
634 Status = AE_BAD_PARAMETER;
635 goto UnlockAndExit;
636 }
637
638 Status = AcpiHwClearGpe (GpeEventInfo);
639
640UnlockAndExit:
717 /* Ensure that we have a valid GPE number */
718
719 GpeEventInfo = AcpiEvGetGpeEventInfo (GpeDevice, GpeNumber);
720 if (!GpeEventInfo)
721 {
722 Status = AE_BAD_PARAMETER;
723 goto UnlockAndExit;
724 }
725
726 Status = AcpiHwClearGpe (GpeEventInfo);
727
728UnlockAndExit:
641 if (Flags & ACPI_NOT_ISR)
642 {
643 (void) AcpiUtReleaseMutex (ACPI_MTX_EVENTS);
644 }
729 AcpiOsReleaseLock (AcpiGbl_GpeLock, Flags);
645 return_ACPI_STATUS (Status);
646}
647
648ACPI_EXPORT_SYMBOL (AcpiClearGpe)
649
650
651/*******************************************************************************
652 *

--- 42 unchanged lines hidden (view full) ---

695
696ACPI_EXPORT_SYMBOL (AcpiGetEventStatus)
697
698
699/*******************************************************************************
700 *
701 * FUNCTION: AcpiGetGpeStatus
702 *
730 return_ACPI_STATUS (Status);
731}
732
733ACPI_EXPORT_SYMBOL (AcpiClearGpe)
734
735
736/*******************************************************************************
737 *

--- 42 unchanged lines hidden (view full) ---

780
781ACPI_EXPORT_SYMBOL (AcpiGetEventStatus)
782
783
784/*******************************************************************************
785 *
786 * FUNCTION: AcpiGetGpeStatus
787 *
703 * PARAMETERS: GpeDevice - Parent GPE Device
788 * PARAMETERS: GpeDevice - Parent GPE Device. NULL for GPE0/GPE1
704 * GpeNumber - GPE level within the GPE block
789 * GpeNumber - GPE level within the GPE block
705 * Flags - Called from an ISR or not
706 * EventStatus - Where the current status of the event will
707 * be returned
708 *
709 * RETURN: Status
710 *
711 * DESCRIPTION: Get status of an event (general purpose)
712 *
713 ******************************************************************************/
714
715ACPI_STATUS
716AcpiGetGpeStatus (
717 ACPI_HANDLE GpeDevice,
718 UINT32 GpeNumber,
790 * EventStatus - Where the current status of the event will
791 * be returned
792 *
793 * RETURN: Status
794 *
795 * DESCRIPTION: Get status of an event (general purpose)
796 *
797 ******************************************************************************/
798
799ACPI_STATUS
800AcpiGetGpeStatus (
801 ACPI_HANDLE GpeDevice,
802 UINT32 GpeNumber,
719 UINT32 Flags,
720 ACPI_EVENT_STATUS *EventStatus)
721{
722 ACPI_STATUS Status = AE_OK;
723 ACPI_GPE_EVENT_INFO *GpeEventInfo;
803 ACPI_EVENT_STATUS *EventStatus)
804{
805 ACPI_STATUS Status = AE_OK;
806 ACPI_GPE_EVENT_INFO *GpeEventInfo;
807 ACPI_CPU_FLAGS Flags;
724
725
726 ACPI_FUNCTION_TRACE (AcpiGetGpeStatus);
727
728
808
809
810 ACPI_FUNCTION_TRACE (AcpiGetGpeStatus);
811
812
729 /* Use semaphore lock if not executing at interrupt level */
813 Flags = AcpiOsAcquireLock (AcpiGbl_GpeLock);
730
814
731 if (Flags & ACPI_NOT_ISR)
732 {
733 Status = AcpiUtAcquireMutex (ACPI_MTX_EVENTS);
734 if (ACPI_FAILURE (Status))
735 {
736 return_ACPI_STATUS (Status);
737 }
738 }
739
740 /* Ensure that we have a valid GPE number */
741
742 GpeEventInfo = AcpiEvGetGpeEventInfo (GpeDevice, GpeNumber);
743 if (!GpeEventInfo)
744 {
745 Status = AE_BAD_PARAMETER;
746 goto UnlockAndExit;
747 }
748
749 /* Obtain status on the requested GPE number */
750
751 Status = AcpiHwGetGpeStatus (GpeEventInfo, EventStatus);
752
753UnlockAndExit:
815 /* Ensure that we have a valid GPE number */
816
817 GpeEventInfo = AcpiEvGetGpeEventInfo (GpeDevice, GpeNumber);
818 if (!GpeEventInfo)
819 {
820 Status = AE_BAD_PARAMETER;
821 goto UnlockAndExit;
822 }
823
824 /* Obtain status on the requested GPE number */
825
826 Status = AcpiHwGetGpeStatus (GpeEventInfo, EventStatus);
827
828UnlockAndExit:
754 if (Flags & ACPI_NOT_ISR)
755 {
756 (void) AcpiUtReleaseMutex (ACPI_MTX_EVENTS);
757 }
829 AcpiOsReleaseLock (AcpiGbl_GpeLock, Flags);
758 return_ACPI_STATUS (Status);
759}
760
761ACPI_EXPORT_SYMBOL (AcpiGetGpeStatus)
762
763
764/*******************************************************************************
765 *

--- 52 unchanged lines hidden (view full) ---

818 */
819 Status = AcpiEvCreateGpeBlock (Node, GpeBlockAddress, RegisterCount,
820 0, InterruptNumber, &GpeBlock);
821 if (ACPI_FAILURE (Status))
822 {
823 goto UnlockAndExit;
824 }
825
830 return_ACPI_STATUS (Status);
831}
832
833ACPI_EXPORT_SYMBOL (AcpiGetGpeStatus)
834
835
836/*******************************************************************************
837 *

--- 52 unchanged lines hidden (view full) ---

890 */
891 Status = AcpiEvCreateGpeBlock (Node, GpeBlockAddress, RegisterCount,
892 0, InterruptNumber, &GpeBlock);
893 if (ACPI_FAILURE (Status))
894 {
895 goto UnlockAndExit;
896 }
897
826 /* Run the _PRW methods and enable the GPEs */
898 /* Install block in the DeviceObject attached to the node */
827
899
828 Status = AcpiEvInitializeGpeBlock (Node, GpeBlock);
829 if (ACPI_FAILURE (Status))
830 {
831 goto UnlockAndExit;
832 }
833
834 /* Get the DeviceObject attached to the node */
835
836 ObjDesc = AcpiNsGetAttachedObject (Node);
837 if (!ObjDesc)
838 {
900 ObjDesc = AcpiNsGetAttachedObject (Node);
901 if (!ObjDesc)
902 {
839 /* No object, create a new one */
840
903 /*
904 * No object, create a new one (Device nodes do not always have
905 * an attached object)
906 */
841 ObjDesc = AcpiUtCreateInternalObject (ACPI_TYPE_DEVICE);
842 if (!ObjDesc)
843 {
844 Status = AE_NO_MEMORY;
845 goto UnlockAndExit;
846 }
847
848 Status = AcpiNsAttachObject (Node, ObjDesc, ACPI_TYPE_DEVICE);
849
850 /* Remove local reference to the object */
851
852 AcpiUtRemoveReference (ObjDesc);
907 ObjDesc = AcpiUtCreateInternalObject (ACPI_TYPE_DEVICE);
908 if (!ObjDesc)
909 {
910 Status = AE_NO_MEMORY;
911 goto UnlockAndExit;
912 }
913
914 Status = AcpiNsAttachObject (Node, ObjDesc, ACPI_TYPE_DEVICE);
915
916 /* Remove local reference to the object */
917
918 AcpiUtRemoveReference (ObjDesc);
853
854 if (ACPI_FAILURE (Status))
855 {
856 goto UnlockAndExit;
857 }
858 }
859
919 if (ACPI_FAILURE (Status))
920 {
921 goto UnlockAndExit;
922 }
923 }
924
860 /* Install the GPE block in the DeviceObject */
925 /* Now install the GPE block in the DeviceObject */
861
862 ObjDesc->Device.GpeBlock = GpeBlock;
863
926
927 ObjDesc->Device.GpeBlock = GpeBlock;
928
929 /* Run the _PRW methods and enable the runtime GPEs in the new block */
864
930
931 Status = AcpiEvInitializeGpeBlock (Node, GpeBlock);
932
933
865UnlockAndExit:
866 (void) AcpiUtReleaseMutex (ACPI_MTX_NAMESPACE);
867 return_ACPI_STATUS (Status);
868}
869
870ACPI_EXPORT_SYMBOL (AcpiInstallGpeBlock)
871
872

--- 140 unchanged lines hidden (view full) ---

1013 ACPI_GPE_BLOCK_INFO *GpeBlock,
1014 void *Context)
1015{
1016 ACPI_GPE_DEVICE_INFO *Info = Context;
1017
1018
1019 /* Increment Index by the number of GPEs in this block */
1020
934UnlockAndExit:
935 (void) AcpiUtReleaseMutex (ACPI_MTX_NAMESPACE);
936 return_ACPI_STATUS (Status);
937}
938
939ACPI_EXPORT_SYMBOL (AcpiInstallGpeBlock)
940
941

--- 140 unchanged lines hidden (view full) ---

1082 ACPI_GPE_BLOCK_INFO *GpeBlock,
1083 void *Context)
1084{
1085 ACPI_GPE_DEVICE_INFO *Info = Context;
1086
1087
1088 /* Increment Index by the number of GPEs in this block */
1089
1021 Info->NextBlockBaseIndex +=
1022 (GpeBlock->RegisterCount * ACPI_GPE_REGISTER_WIDTH);
1090 Info->NextBlockBaseIndex += GpeBlock->GpeCount;
1023
1024 if (Info->Index < Info->NextBlockBaseIndex)
1025 {
1026 /*
1027 * The GPE index is within this block, get the node. Leave the node
1028 * NULL for the FADT-defined GPEs
1029 */
1030 if ((GpeBlock->Node)->Type == ACPI_TYPE_DEVICE)

--- 82 unchanged lines hidden ---
1091
1092 if (Info->Index < Info->NextBlockBaseIndex)
1093 {
1094 /*
1095 * The GPE index is within this block, get the node. Leave the node
1096 * NULL for the FADT-defined GPEs
1097 */
1098 if ((GpeBlock->Node)->Type == ACPI_TYPE_DEVICE)

--- 82 unchanged lines hidden ---