Rev 1498 | Go to most recent revision | Show entire file | Regard whitespace | Details | Blame | Last modification | View Log | RSS feed
Rev 1498 | Rev 2216 | ||
---|---|---|---|
Line 6... | Line 6... | ||
6 | 6 | ||
7 | /****************************************************************************** |
7 | /****************************************************************************** |
8 | * |
8 | * |
9 | * 1. Copyright Notice |
9 | * 1. Copyright Notice |
10 | * |
10 | * |
11 | * Some or all of this work - Copyright (c) 1999 - 2010, Intel Corp. |
11 | * Some or all of this work - Copyright (c) 1999 - 2011, Intel Corp. |
12 | * All rights reserved. |
12 | * All rights reserved. |
13 | * |
13 | * |
14 | * 2. License |
14 | * 2. License |
15 | * |
15 | * |
Line 191... | Line 191... | ||
191 | { |
191 | { |
192 | ACPI_EXCEPTION ((AE_INFO, Status, "During Namespace initialization")); |
192 | ACPI_EXCEPTION ((AE_INFO, Status, "During Namespace initialization")); |
193 | return_ACPI_STATUS (Status); |
193 | return_ACPI_STATUS (Status); |
194 | } |
194 | } |
Line -... | Line 195... | ||
- | 195 | ||
- | 196 | /* Initialize the global OSI interfaces list with the static names */ |
|
- | 197 | ||
- | 198 | Status = AcpiUtInitializeInterfaces (); |
|
- | 199 | if (ACPI_FAILURE (Status)) |
|
- | 200 | { |
|
- | 201 | ACPI_EXCEPTION ((AE_INFO, Status, "During OSI interfaces initialization")); |
|
- | 202 | return_ACPI_STATUS (Status); |
|
- | 203 | } |
|
195 | 204 | ||
Line 196... | Line 205... | ||
196 | /* If configured, initialize the AML debugger */ |
205 | /* If configured, initialize the AML debugger */ |
197 | 206 | ||
198 | ACPI_DEBUGGER_EXEC (Status = AcpiDbInitialize ()); |
207 | ACPI_DEBUGGER_EXEC (Status = AcpiDbInitialize ()); |
Line 401... | Line 410... | ||
401 | return_ACPI_STATUS (Status); |
410 | return_ACPI_STATUS (Status); |
402 | } |
411 | } |
403 | } |
412 | } |
Line 404... | Line 413... | ||
404 | 413 | ||
405 | /* |
- | |
406 | * Initialize the GPE blocks defined in the FADT (GPE block 0 and 1). |
- | |
407 | * The runtime GPEs are enabled here. |
- | |
408 | * |
- | |
409 | * This is where the _PRW methods are executed for the GPEs. These |
- | |
410 | * methods can only be executed after the SCI and Global Lock handlers are |
- | |
411 | * installed and initialized. |
- | |
412 | * |
- | |
413 | * GPEs can only be enabled after the _REG, _STA, and _INI methods have |
- | |
414 | * been run. This ensures that all Operation Regions and all Devices have |
- | |
415 | * been initialized and are ready. |
- | |
416 | */ |
- | |
417 | if (!(Flags & ACPI_NO_EVENT_INIT)) |
- | |
418 | { |
- | |
419 | Status = AcpiEvInstallFadtGpes (); |
- | |
420 | if (ACPI_FAILURE (Status)) |
- | |
421 | { |
- | |
422 | return (Status); |
- | |
423 | } |
- | |
424 | } |
- | |
425 | - | ||
426 | /* |
414 | /* |
427 | * Empty the caches (delete the cached objects) on the assumption that |
415 | * Empty the caches (delete the cached objects) on the assumption that |
428 | * the table load filled them up more than they will be at runtime -- |
416 | * the table load filled them up more than they will be at runtime -- |
429 | * thus wasting non-paged memory. |
417 | * thus wasting non-paged memory. |
430 | */ |
418 | */ |
Line 728... | Line 716... | ||
728 | return_ACPI_STATUS (AE_OK); |
716 | return_ACPI_STATUS (AE_OK); |
729 | } |
717 | } |
Line 730... | Line 718... | ||
730 | 718 | ||
Line -... | Line 719... | ||
- | 719 | ACPI_EXPORT_SYMBOL (AcpiPurgeCachedObjects) |
|
- | 720 | ||
- | 721 | ||
- | 722 | /***************************************************************************** |
|
- | 723 | * |
|
- | 724 | * FUNCTION: AcpiInstallInterface |
|
- | 725 | * |
|
- | 726 | * PARAMETERS: InterfaceName - The interface to install |
|
- | 727 | * |
|
- | 728 | * RETURN: Status |
|
- | 729 | * |
|
- | 730 | * DESCRIPTION: Install an _OSI interface to the global list |
|
- | 731 | * |
|
- | 732 | ****************************************************************************/ |
|
- | 733 | ||
- | 734 | ACPI_STATUS |
|
- | 735 | AcpiInstallInterface ( |
|
- | 736 | ACPI_STRING InterfaceName) |
|
- | 737 | { |
|
- | 738 | ACPI_STATUS Status; |
|
- | 739 | ACPI_INTERFACE_INFO *InterfaceInfo; |
|
- | 740 | ||
- | 741 | ||
- | 742 | /* Parameter validation */ |
|
- | 743 | ||
- | 744 | if (!InterfaceName || (ACPI_STRLEN (InterfaceName) == 0)) |
|
- | 745 | { |
|
- | 746 | return (AE_BAD_PARAMETER); |
|
- | 747 | } |
|
- | 748 | ||
- | 749 | (void) AcpiOsAcquireMutex (AcpiGbl_OsiMutex, ACPI_WAIT_FOREVER); |
|
- | 750 | ||
- | 751 | /* Check if the interface name is already in the global list */ |
|
- | 752 | ||
- | 753 | InterfaceInfo = AcpiUtGetInterface (InterfaceName); |
|
- | 754 | if (InterfaceInfo) |
|
- | 755 | { |
|
- | 756 | /* |
|
- | 757 | * The interface already exists in the list. This is OK if the |
|
- | 758 | * interface has been marked invalid -- just clear the bit. |
|
- | 759 | */ |
|
- | 760 | if (InterfaceInfo->Flags & ACPI_OSI_INVALID) |
|
- | 761 | { |
|
- | 762 | InterfaceInfo->Flags &= ~ACPI_OSI_INVALID; |
|
- | 763 | Status = AE_OK; |
|
- | 764 | } |
|
- | 765 | else |
|
- | 766 | { |
|
- | 767 | Status = AE_ALREADY_EXISTS; |
|
- | 768 | } |
|
- | 769 | } |
|
- | 770 | else |
|
- | 771 | { |
|
- | 772 | /* New interface name, install into the global list */ |
|
- | 773 | ||
- | 774 | Status = AcpiUtInstallInterface (InterfaceName); |
|
- | 775 | } |
|
- | 776 | ||
- | 777 | AcpiOsReleaseMutex (AcpiGbl_OsiMutex); |
|
- | 778 | return (Status); |
|
- | 779 | } |
|
- | 780 | ||
- | 781 | ACPI_EXPORT_SYMBOL (AcpiInstallInterface) |
|
- | 782 | ||
- | 783 | ||
- | 784 | /***************************************************************************** |
|
- | 785 | * |
|
- | 786 | * FUNCTION: AcpiRemoveInterface |
|
- | 787 | * |
|
- | 788 | * PARAMETERS: InterfaceName - The interface to remove |
|
- | 789 | * |
|
- | 790 | * RETURN: Status |
|
- | 791 | * |
|
- | 792 | * DESCRIPTION: Remove an _OSI interface from the global list |
|
- | 793 | * |
|
- | 794 | ****************************************************************************/ |
|
- | 795 | ||
- | 796 | ACPI_STATUS |
|
- | 797 | AcpiRemoveInterface ( |
|
- | 798 | ACPI_STRING InterfaceName) |
|
- | 799 | { |
|
- | 800 | ACPI_STATUS Status; |
|
- | 801 | ||
- | 802 | ||
- | 803 | /* Parameter validation */ |
|
- | 804 | ||
- | 805 | if (!InterfaceName || (ACPI_STRLEN (InterfaceName) == 0)) |
|
- | 806 | { |
|
- | 807 | return (AE_BAD_PARAMETER); |
|
- | 808 | } |
|
- | 809 | ||
- | 810 | (void) AcpiOsAcquireMutex (AcpiGbl_OsiMutex, ACPI_WAIT_FOREVER); |
|
- | 811 | ||
- | 812 | Status = AcpiUtRemoveInterface (InterfaceName); |
|
- | 813 | ||
- | 814 | AcpiOsReleaseMutex (AcpiGbl_OsiMutex); |
|
- | 815 | return (Status); |
|
- | 816 | } |
|
- | 817 | ||
- | 818 | ACPI_EXPORT_SYMBOL (AcpiRemoveInterface) |
|
- | 819 | ||
- | 820 | ||
- | 821 | /***************************************************************************** |
|
- | 822 | * |
|
- | 823 | * FUNCTION: AcpiInstallInterfaceHandler |
|
- | 824 | * |
|
- | 825 | * PARAMETERS: Handler - The _OSI interface handler to install |
|
- | 826 | * NULL means "remove existing handler" |
|
- | 827 | * |
|
- | 828 | * RETURN: Status |
|
- | 829 | * |
|
- | 830 | * DESCRIPTION: Install a handler for the predefined _OSI ACPI method. |
|
- | 831 | * invoked during execution of the internal implementation of |
|
- | 832 | * _OSI. A NULL handler simply removes any existing handler. |
|
- | 833 | * |
|
- | 834 | ****************************************************************************/ |
|
- | 835 | ||
- | 836 | ACPI_STATUS |
|
- | 837 | AcpiInstallInterfaceHandler ( |
|
- | 838 | ACPI_INTERFACE_HANDLER Handler) |
|
- | 839 | { |
|
- | 840 | ACPI_STATUS Status = AE_OK; |
|
- | 841 | ||
- | 842 | ||
- | 843 | (void) AcpiOsAcquireMutex (AcpiGbl_OsiMutex, ACPI_WAIT_FOREVER); |
|
- | 844 | ||
- | 845 | if (Handler && AcpiGbl_InterfaceHandler) |
|
- | 846 | { |
|
- | 847 | Status = AE_ALREADY_EXISTS; |
|
- | 848 | } |
|
- | 849 | else |
|
- | 850 | { |
|
- | 851 | AcpiGbl_InterfaceHandler = Handler; |
|
- | 852 | } |
|
- | 853 | ||
- | 854 | AcpiOsReleaseMutex (AcpiGbl_OsiMutex); |
|
- | 855 | return (Status); |
|
- | 856 | } |
|
- | 857 | ||
731 | ACPI_EXPORT_SYMBOL (AcpiPurgeCachedObjects) |
858 | ACPI_EXPORT_SYMBOL (AcpiInstallInterfaceHandler) |