Print this page
acpica-unix2-20130823
PANKOVs restructure
Split |
Close |
Expand all |
Collapse all |
--- old/usr/src/uts/intel/io/acpica/utilities/utinit.c
+++ new/usr/src/common/acpica/components/utilities/utinit.c
1 1 /******************************************************************************
2 2 *
3 3 * Module Name: utinit - Common ACPI subsystem initialization
4 4 *
5 5 *****************************************************************************/
6 6
7 7 /*
8 - * Copyright (C) 2000 - 2011, Intel Corp.
8 + * Copyright (C) 2000 - 2013, Intel Corp.
9 9 * All rights reserved.
10 10 *
11 11 * Redistribution and use in source and binary forms, with or without
12 12 * modification, are permitted provided that the following conditions
13 13 * are met:
14 14 * 1. Redistributions of source code must retain the above copyright
15 15 * notice, this list of conditions, and the following disclaimer,
16 16 * without modification.
17 17 * 2. Redistributions in binary form must reproduce at minimum a disclaimer
18 18 * substantially similar to the "NO WARRANTY" disclaimer below
19 19 * ("Disclaimer") and any redistribution must be conditioned upon
20 20 * including a substantially similar Disclaimer requirement for further
21 21 * binary redistribution.
22 22 * 3. Neither the names of the above-listed copyright holders nor the names
23 23 * of any contributors may be used to endorse or promote products derived
24 24 * from this software without specific prior written permission.
25 25 *
26 26 * Alternatively, this software may be distributed under the terms of the
27 27 * GNU General Public License ("GPL") version 2 as published by the Free
28 28 * Software Foundation.
29 29 *
30 30 * NO WARRANTY
31 31 * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
32 32 * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
33 33 * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTIBILITY AND FITNESS FOR
34 34 * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
35 35 * HOLDERS OR CONTRIBUTORS BE LIABLE FOR SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
36 36 * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
37 37 * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
38 38 * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT,
39 39 * STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING
40 40 * IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
41 41 * POSSIBILITY OF SUCH DAMAGES.
42 42 */
43 43
44 44
45 45 #define __UTINIT_C__
46 46
47 47 #include "acpi.h"
48 48 #include "accommon.h"
49 49 #include "acnamesp.h"
50 50 #include "acevents.h"
↓ open down ↓ |
32 lines elided |
↑ open up ↑ |
51 51 #include "actables.h"
52 52
53 53 #define _COMPONENT ACPI_UTILITIES
54 54 ACPI_MODULE_NAME ("utinit")
55 55
56 56 /* Local prototypes */
57 57
58 58 static void AcpiUtTerminate (
59 59 void);
60 60
61 +#if (!ACPI_REDUCED_HARDWARE)
61 62
63 +static void
64 +AcpiUtFreeGpeLists (
65 + void);
66 +
67 +#else
68 +
69 +#define AcpiUtFreeGpeLists()
70 +#endif /* !ACPI_REDUCED_HARDWARE */
71 +
72 +
73 +#if (!ACPI_REDUCED_HARDWARE)
62 74 /******************************************************************************
63 75 *
64 - * FUNCTION: AcpiUtTerminate
76 + * FUNCTION: AcpiUtFreeGpeLists
65 77 *
66 78 * PARAMETERS: none
67 79 *
68 80 * RETURN: none
69 81 *
70 - * DESCRIPTION: Free global memory
82 + * DESCRIPTION: Free global GPE lists
71 83 *
72 84 ******************************************************************************/
73 85
74 86 static void
75 -AcpiUtTerminate (
87 +AcpiUtFreeGpeLists (
76 88 void)
77 89 {
78 90 ACPI_GPE_BLOCK_INFO *GpeBlock;
79 91 ACPI_GPE_BLOCK_INFO *NextGpeBlock;
80 92 ACPI_GPE_XRUPT_INFO *GpeXruptInfo;
81 93 ACPI_GPE_XRUPT_INFO *NextGpeXruptInfo;
82 94
83 95
84 - ACPI_FUNCTION_TRACE (UtTerminate);
85 -
86 -
87 96 /* Free global GPE blocks and related info structures */
88 97
89 98 GpeXruptInfo = AcpiGbl_GpeXruptListHead;
90 99 while (GpeXruptInfo)
91 100 {
92 101 GpeBlock = GpeXruptInfo->GpeBlockListHead;
93 102 while (GpeBlock)
94 103 {
95 104 NextGpeBlock = GpeBlock->Next;
96 105 ACPI_FREE (GpeBlock->EventInfo);
97 106 ACPI_FREE (GpeBlock->RegisterInfo);
98 107 ACPI_FREE (GpeBlock);
99 108
100 109 GpeBlock = NextGpeBlock;
101 110 }
102 111 NextGpeXruptInfo = GpeXruptInfo->Next;
103 112 ACPI_FREE (GpeXruptInfo);
104 113 GpeXruptInfo = NextGpeXruptInfo;
105 114 }
115 +}
116 +#endif /* !ACPI_REDUCED_HARDWARE */
106 117
118 +
119 +/******************************************************************************
120 + *
121 + * FUNCTION: AcpiUtTerminate
122 + *
123 + * PARAMETERS: none
124 + *
125 + * RETURN: none
126 + *
127 + * DESCRIPTION: Free global memory
128 + *
129 + ******************************************************************************/
130 +
131 +static void
132 +AcpiUtTerminate (
133 + void)
134 +{
135 + ACPI_FUNCTION_TRACE (UtTerminate);
136 +
137 + AcpiUtFreeGpeLists ();
138 + AcpiUtDeleteAddressLists ();
107 139 return_VOID;
108 140 }
109 141
110 142
111 143 /*******************************************************************************
112 144 *
113 145 * FUNCTION: AcpiUtSubsystemShutdown
114 146 *
115 147 * PARAMETERS: None
116 148 *
117 149 * RETURN: None
118 150 *
119 151 * DESCRIPTION: Shutdown the various components. Do not delete the mutex
120 152 * objects here, because the AML debugger may be still running.
121 153 *
122 154 ******************************************************************************/
123 155
124 156 void
125 157 AcpiUtSubsystemShutdown (
126 158 void)
127 159 {
128 160 ACPI_FUNCTION_TRACE (UtSubsystemShutdown);
129 161
130 162
131 163 #ifndef ACPI_ASL_COMPILER
132 164
133 165 /* Close the AcpiEvent Handling */
134 166
135 167 AcpiEvTerminate ();
136 168
137 169 /* Delete any dynamic _OSI interfaces */
138 170
139 171 AcpiUtInterfaceTerminate ();
140 172 #endif
141 173
142 174 /* Close the Namespace */
143 175
144 176 AcpiNsTerminate ();
145 177
146 178 /* Delete the ACPI tables */
147 179
148 180 AcpiTbTerminate ();
↓ open down ↓ |
32 lines elided |
↑ open up ↑ |
149 181
150 182 /* Close the globals */
151 183
152 184 AcpiUtTerminate ();
153 185
154 186 /* Purge the local caches */
155 187
156 188 (void) AcpiUtDeleteCaches ();
157 189 return_VOID;
158 190 }
159 -
160 -
XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX