1 /******************************************************************************
   2  *
   3  * Module Name: exstubs - Stub routines for the Example program
   4  *
   5  *****************************************************************************/
   6 
   7 /*
   8  * Copyright (C) 2000 - 2013, Intel Corp.
   9  * All rights reserved.
  10  *
  11  * Redistribution and use in source and binary forms, with or without
  12  * modification, are permitted provided that the following conditions
  13  * are met:
  14  * 1. Redistributions of source code must retain the above copyright
  15  *    notice, this list of conditions, and the following disclaimer,
  16  *    without modification.
  17  * 2. Redistributions in binary form must reproduce at minimum a disclaimer
  18  *    substantially similar to the "NO WARRANTY" disclaimer below
  19  *    ("Disclaimer") and any redistribution must be conditioned upon
  20  *    including a substantially similar Disclaimer requirement for further
  21  *    binary redistribution.
  22  * 3. Neither the names of the above-listed copyright holders nor the names
  23  *    of any contributors may be used to endorse or promote products derived
  24  *    from this software without specific prior written permission.
  25  *
  26  * Alternatively, this software may be distributed under the terms of the
  27  * GNU General Public License ("GPL") version 2 as published by the Free
  28  * Software Foundation.
  29  *
  30  * NO WARRANTY
  31  * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
  32  * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
  33  * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTIBILITY AND FITNESS FOR
  34  * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
  35  * HOLDERS OR CONTRIBUTORS BE LIABLE FOR SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
  36  * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
  37  * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
  38  * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT,
  39  * STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING
  40  * IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
  41  * POSSIBILITY OF SUCH DAMAGES.
  42  */
  43 
  44 #include "examples.h"
  45 
  46 #include <acutils.h>
  47 #include <acevents.h>
  48 #include <acdispat.h>
  49 
  50 #define _COMPONENT          ACPI_EXAMPLE
  51         ACPI_MODULE_NAME    ("exstubs")
  52 
  53 
  54 /******************************************************************************
  55  *
  56  * DESCRIPTION: Stubs used to facilitate linkage of the example program
  57  *
  58  *****************************************************************************/
  59 
  60 
  61 /* Utilities */
  62 
  63 void
  64 AcpiUtSubsystemShutdown (
  65     void)
  66 {
  67 }
  68 
  69 ACPI_STATUS
  70 AcpiUtExecute_STA (
  71     ACPI_NAMESPACE_NODE     *DeviceNode,
  72     UINT32                  *StatusFlags)
  73 {
  74     return (AE_NOT_IMPLEMENTED);
  75 }
  76 
  77 ACPI_STATUS
  78 AcpiUtExecute_HID (
  79     ACPI_NAMESPACE_NODE     *DeviceNode,
  80     ACPI_PNP_DEVICE_ID      **ReturnId)
  81 {
  82     return (AE_NOT_IMPLEMENTED);
  83 }
  84 
  85 ACPI_STATUS
  86 AcpiUtExecute_CID (
  87     ACPI_NAMESPACE_NODE     *DeviceNode,
  88     ACPI_PNP_DEVICE_ID_LIST **ReturnCidList)
  89 {
  90     return (AE_NOT_IMPLEMENTED);
  91 }
  92 
  93 ACPI_STATUS
  94 AcpiUtExecute_UID (
  95     ACPI_NAMESPACE_NODE     *DeviceNode,
  96     ACPI_PNP_DEVICE_ID      **ReturnId)
  97 {
  98     return (AE_NOT_IMPLEMENTED);
  99 }
 100 
 101 ACPI_STATUS
 102 AcpiUtExecute_SUB (
 103     ACPI_NAMESPACE_NODE     *DeviceNode,
 104     ACPI_PNP_DEVICE_ID      **ReturnId)
 105 {
 106     return (AE_NOT_IMPLEMENTED);
 107 }
 108 
 109 ACPI_STATUS
 110 AcpiUtExecutePowerMethods (
 111     ACPI_NAMESPACE_NODE     *DeviceNode,
 112     const char              **MethodNames,
 113     UINT8                   MethodCount,
 114     UINT8                   *OutValues)
 115 {
 116     return (AE_NOT_IMPLEMENTED);
 117 }
 118 
 119 ACPI_STATUS
 120 AcpiUtEvaluateNumericObject (
 121     char                    *ObjectName,
 122     ACPI_NAMESPACE_NODE     *DeviceNode,
 123     UINT64                  *Value)
 124 {
 125     return (AE_NOT_IMPLEMENTED);
 126 }
 127 
 128 ACPI_STATUS
 129 AcpiUtGetResourceEndTag (
 130     ACPI_OPERAND_OBJECT     *ObjDesc,
 131     UINT8                   **EndTag)
 132 {
 133     return (AE_OK);
 134 }
 135 
 136 
 137 /* Hardware manager */
 138 
 139 UINT32
 140 AcpiHwGetMode (
 141     void)
 142 {
 143     return (0);
 144 }
 145 
 146 ACPI_STATUS
 147 AcpiHwReadPort (
 148     ACPI_IO_ADDRESS         Address,
 149     UINT32                  *Value,
 150     UINT32                  Width)
 151 {
 152     return (AE_OK);
 153 }
 154 
 155 ACPI_STATUS
 156 AcpiHwWritePort (
 157     ACPI_IO_ADDRESS         Address,
 158     UINT32                  Value,
 159     UINT32                  Width)
 160 {
 161     return (AE_OK);
 162 }
 163 
 164 
 165 /* Event manager */
 166 
 167 ACPI_STATUS
 168 AcpiInstallNotifyHandler (
 169     ACPI_HANDLE             Device,
 170     UINT32                  HandlerType,
 171     ACPI_NOTIFY_HANDLER     Handler,
 172     void                    *Context)
 173 {
 174     return (AE_OK);
 175 }
 176 
 177 ACPI_STATUS
 178 AcpiEvInstallXruptHandlers (
 179     void)
 180 {
 181     return (AE_OK);
 182 }
 183 
 184 ACPI_STATUS
 185 AcpiEvInitializeEvents (
 186     void)
 187 {
 188     return (AE_OK);
 189 }
 190 
 191 ACPI_STATUS
 192 AcpiEvInstallRegionHandlers (
 193     void)
 194 {
 195     return (AE_OK);
 196 }
 197 
 198 ACPI_STATUS
 199 AcpiEvInitializeOpRegions (
 200     void)
 201 {
 202     return (AE_OK);
 203 }
 204 
 205 ACPI_STATUS
 206 AcpiEvInitializeRegion (
 207     ACPI_OPERAND_OBJECT     *RegionObj,
 208     BOOLEAN                 AcpiNsLocked)
 209 {
 210     return (AE_OK);
 211 }
 212 
 213 #if (!ACPI_REDUCED_HARDWARE)
 214 ACPI_STATUS
 215 AcpiEvDeleteGpeBlock (
 216     ACPI_GPE_BLOCK_INFO     *GpeBlock)
 217 {
 218     return (AE_OK);
 219 }
 220 
 221 ACPI_STATUS
 222 AcpiEnable (
 223     void)
 224 {
 225     return (AE_OK);
 226 }
 227 #endif /* !ACPI_REDUCED_HARDWARE */
 228 
 229 void
 230 AcpiEvUpdateGpes (
 231     ACPI_OWNER_ID           TableOwnerId)
 232 {
 233 }
 234 
 235 ACPI_STATUS
 236 AcpiEvAddressSpaceDispatch (
 237     ACPI_OPERAND_OBJECT     *RegionObj,
 238     ACPI_OPERAND_OBJECT     *FieldObj,
 239     UINT32                  Function,
 240     UINT32                  RegionOffset,
 241     UINT32                  BitWidth,
 242     UINT64                  *Value)
 243 {
 244     return (AE_OK);
 245 }
 246 
 247 ACPI_STATUS
 248 AcpiEvAcquireGlobalLock (
 249     UINT16                  Timeout)
 250 {
 251     return (AE_OK);
 252 }
 253 
 254 ACPI_STATUS
 255 AcpiEvReleaseGlobalLock (
 256     void)
 257 {
 258     return (AE_OK);
 259 }
 260 
 261 ACPI_STATUS
 262 AcpiEvQueueNotifyRequest (
 263     ACPI_NAMESPACE_NODE     *Node,
 264     UINT32                  NotifyValue)
 265 {
 266     return (AE_OK);
 267 }
 268 
 269 BOOLEAN
 270 AcpiEvIsNotifyObject (
 271     ACPI_NAMESPACE_NODE     *Node)
 272 {
 273     return (TRUE);
 274 }
 275 
 276 
 277 /* Namespace manager */
 278 
 279 ACPI_STATUS
 280 AcpiNsCheckReturnValue (
 281     ACPI_NAMESPACE_NODE         *Node,
 282     ACPI_EVALUATE_INFO          *Info,
 283     UINT32                      UserParamCount,
 284     ACPI_STATUS                 ReturnStatus,
 285     ACPI_OPERAND_OBJECT         **ReturnObjectPtr)
 286 {
 287     return (AE_OK);
 288 }
 289 
 290 void
 291 AcpiNsCheckArgumentTypes (
 292     ACPI_EVALUATE_INFO          *Info)
 293 {
 294     return;
 295 }
 296 
 297 void
 298 AcpiNsCheckArgumentCount (
 299     char                        *Pathname,
 300     ACPI_NAMESPACE_NODE         *Node,
 301     UINT32                      UserParamCount,
 302     const ACPI_PREDEFINED_INFO  *Predefined)
 303 {
 304     return;
 305 }
 306 
 307 void
 308 AcpiNsCheckAcpiCompliance (
 309     char                        *Pathname,
 310     ACPI_NAMESPACE_NODE         *Node,
 311     const ACPI_PREDEFINED_INFO  *Predefined)
 312 {
 313     return;
 314 }
 315 
 316 const ACPI_PREDEFINED_INFO *
 317 AcpiUtMatchPredefinedMethod (
 318     char                        *Name)
 319 {
 320     return (NULL);
 321 }
 322 
 323 /* OSL interfaces */
 324 
 325 ACPI_THREAD_ID
 326 AcpiOsGetThreadId (
 327     void)
 328 {
 329     return (1);
 330 }
 331 
 332 ACPI_STATUS
 333 AcpiOsExecute (
 334     ACPI_EXECUTE_TYPE       Type,
 335     ACPI_OSD_EXEC_CALLBACK  Function,
 336     void                    *Context)
 337 {
 338     return (AE_SUPPORT);
 339 }