Import acpica-unix-20061109 from Intel.
[dragonfly.git] / sys / contrib / dev / acpica-unix-20061109 / osunixxf.c
blob246f426cf97385c45dd2c7183306fedd833dfaf1
1 /******************************************************************************
3 * Module Name: osunixxf - UNIX OSL interfaces
5 *****************************************************************************/
7 /******************************************************************************
9 * 1. Copyright Notice
11 * Some or all of this work - Copyright (c) 1999 - 2006, Intel Corp.
12 * All rights reserved.
14 * 2. License
16 * 2.1. This is your license from Intel Corp. under its intellectual property
17 * rights. You may have additional license terms from the party that provided
18 * you this software, covering your right to use that party's intellectual
19 * property rights.
21 * 2.2. Intel grants, free of charge, to any person ("Licensee") obtaining a
22 * copy of the source code appearing in this file ("Covered Code") an
23 * irrevocable, perpetual, worldwide license under Intel's copyrights in the
24 * base code distributed originally by Intel ("Original Intel Code") to copy,
25 * make derivatives, distribute, use and display any portion of the Covered
26 * Code in any form, with the right to sublicense such rights; and
28 * 2.3. Intel grants Licensee a non-exclusive and non-transferable patent
29 * license (with the right to sublicense), under only those claims of Intel
30 * patents that are infringed by the Original Intel Code, to make, use, sell,
31 * offer to sell, and import the Covered Code and derivative works thereof
32 * solely to the minimum extent necessary to exercise the above copyright
33 * license, and in no event shall the patent license extend to any additions
34 * to or modifications of the Original Intel Code. No other license or right
35 * is granted directly or by implication, estoppel or otherwise;
37 * The above copyright and patent license is granted only if the following
38 * conditions are met:
40 * 3. Conditions
42 * 3.1. Redistribution of Source with Rights to Further Distribute Source.
43 * Redistribution of source code of any substantial portion of the Covered
44 * Code or modification with rights to further distribute source must include
45 * the above Copyright Notice, the above License, this list of Conditions,
46 * and the following Disclaimer and Export Compliance provision. In addition,
47 * Licensee must cause all Covered Code to which Licensee contributes to
48 * contain a file documenting the changes Licensee made to create that Covered
49 * Code and the date of any change. Licensee must include in that file the
50 * documentation of any changes made by any predecessor Licensee. Licensee
51 * must include a prominent statement that the modification is derived,
52 * directly or indirectly, from Original Intel Code.
54 * 3.2. Redistribution of Source with no Rights to Further Distribute Source.
55 * Redistribution of source code of any substantial portion of the Covered
56 * Code or modification without rights to further distribute source must
57 * include the following Disclaimer and Export Compliance provision in the
58 * documentation and/or other materials provided with distribution. In
59 * addition, Licensee may not authorize further sublicense of source of any
60 * portion of the Covered Code, and must include terms to the effect that the
61 * license from Licensee to its licensee is limited to the intellectual
62 * property embodied in the software Licensee provides to its licensee, and
63 * not to intellectual property embodied in modifications its licensee may
64 * make.
66 * 3.3. Redistribution of Executable. Redistribution in executable form of any
67 * substantial portion of the Covered Code or modification must reproduce the
68 * above Copyright Notice, and the following Disclaimer and Export Compliance
69 * provision in the documentation and/or other materials provided with the
70 * distribution.
72 * 3.4. Intel retains all right, title, and interest in and to the Original
73 * Intel Code.
75 * 3.5. Neither the name Intel nor any other trademark owned or controlled by
76 * Intel shall be used in advertising or otherwise to promote the sale, use or
77 * other dealings in products derived from or relating to the Covered Code
78 * without prior written authorization from Intel.
80 * 4. Disclaimer and Export Compliance
82 * 4.1. INTEL MAKES NO WARRANTY OF ANY KIND REGARDING ANY SOFTWARE PROVIDED
83 * HERE. ANY SOFTWARE ORIGINATING FROM INTEL OR DERIVED FROM INTEL SOFTWARE
84 * IS PROVIDED "AS IS," AND INTEL WILL NOT PROVIDE ANY SUPPORT, ASSISTANCE,
85 * INSTALLATION, TRAINING OR OTHER SERVICES. INTEL WILL NOT PROVIDE ANY
86 * UPDATES, ENHANCEMENTS OR EXTENSIONS. INTEL SPECIFICALLY DISCLAIMS ANY
87 * IMPLIED WARRANTIES OF MERCHANTABILITY, NONINFRINGEMENT AND FITNESS FOR A
88 * PARTICULAR PURPOSE.
90 * 4.2. IN NO EVENT SHALL INTEL HAVE ANY LIABILITY TO LICENSEE, ITS LICENSEES
91 * OR ANY OTHER THIRD PARTY, FOR ANY LOST PROFITS, LOST DATA, LOSS OF USE OR
92 * COSTS OF PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES, OR FOR ANY INDIRECT,
93 * SPECIAL OR CONSEQUENTIAL DAMAGES ARISING OUT OF THIS AGREEMENT, UNDER ANY
94 * CAUSE OF ACTION OR THEORY OF LIABILITY, AND IRRESPECTIVE OF WHETHER INTEL
95 * HAS ADVANCE NOTICE OF THE POSSIBILITY OF SUCH DAMAGES. THESE LIMITATIONS
96 * SHALL APPLY NOTWITHSTANDING THE FAILURE OF THE ESSENTIAL PURPOSE OF ANY
97 * LIMITED REMEDY.
99 * 4.3. Licensee shall not export, either directly or indirectly, any of this
100 * software or system incorporating such software without first obtaining any
101 * required license or other approval from the U. S. Department of Commerce or
102 * any other agency or department of the United States Government. In the
103 * event Licensee exports any such software from the United States or
104 * re-exports any such software from a foreign destination, Licensee shall
105 * ensure that the distribution and export/re-export of the software is in
106 * compliance with all laws, regulations, orders, or other restrictions of the
107 * U.S. Export Administration Regulations. Licensee agrees that neither it nor
108 * any of its subsidiaries will export/re-export any technical data, process,
109 * software, or service, directly or indirectly, to any country for which the
110 * United States government or any agency thereof requires an export license,
111 * other governmental approval, or letter of assurance, without first obtaining
112 * such license, approval or letter.
114 *****************************************************************************/
118 * These interfaces are required in order to compile the ASL compiler under
119 * Linux.
122 #include <stdio.h>
123 #include <stdlib.h>
124 #include <stdarg.h>
125 #include <unistd.h>
126 #include <sys/time.h>
128 #include "acpi.h"
129 #include "amlcode.h"
130 #include "acparser.h"
131 #include "acdebug.h"
133 #define _COMPONENT ACPI_OS_SERVICES
134 ACPI_MODULE_NAME ("osunixxf")
137 extern FILE *AcpiGbl_DebugFile;
138 FILE *AcpiGbl_OutputFile;
140 ACPI_PHYSICAL_ADDRESS
141 AeLocalGetRootPointer (
142 void);
145 /******************************************************************************
147 * FUNCTION: AcpiOsInitialize, AcpiOsTerminate
149 * PARAMETERS: None
151 * RETURN: Status
153 * DESCRIPTION: Init and terminate. Nothing to do.
155 *****************************************************************************/
157 ACPI_STATUS
158 AcpiOsInitialize (void)
160 AcpiGbl_OutputFile = stdout;
162 return AE_OK;
166 ACPI_STATUS
167 AcpiOsTerminate (void)
169 return AE_OK;
173 /******************************************************************************
175 * FUNCTION: AcpiOsGetRootPointer
177 * PARAMETERS: None
179 * RETURN: RSDP physical address
181 * DESCRIPTION: Gets the root pointer (RSDP)
183 *****************************************************************************/
185 ACPI_PHYSICAL_ADDRESS
186 AcpiOsGetRootPointer (
187 void)
190 return (AeLocalGetRootPointer ());
194 /******************************************************************************
196 * FUNCTION: AcpiOsPredefinedOverride
198 * PARAMETERS: InitVal - Initial value of the predefined object
199 * NewVal - The new value for the object
201 * RETURN: Status, pointer to value. Null pointer returned if not
202 * overriding.
204 * DESCRIPTION: Allow the OS to override predefined names
206 *****************************************************************************/
208 ACPI_STATUS
209 AcpiOsPredefinedOverride (
210 const ACPI_PREDEFINED_NAMES *InitVal,
211 ACPI_STRING *NewVal)
214 if (!InitVal || !NewVal)
216 return (AE_BAD_PARAMETER);
219 *NewVal = NULL;
220 return (AE_OK);
224 /******************************************************************************
226 * FUNCTION: AcpiOsTableOverride
228 * PARAMETERS: ExistingTable - Header of current table (probably firmware)
229 * NewTable - Where an entire new table is returned.
231 * RETURN: Status, pointer to new table. Null pointer returned if no
232 * table is available to override
234 * DESCRIPTION: Return a different version of a table if one is available
236 *****************************************************************************/
238 ACPI_STATUS
239 AcpiOsTableOverride (
240 ACPI_TABLE_HEADER *ExistingTable,
241 ACPI_TABLE_HEADER **NewTable)
244 if (!ExistingTable || !NewTable)
246 return (AE_BAD_PARAMETER);
249 *NewTable = NULL;
251 #ifdef ACPI_EXEC_APP
253 /* This code exercises the table override mechanism in the core */
255 if (ACPI_COMPARE_NAME (ExistingTable->Signature, ACPI_SIG_DSDT))
257 /* override DSDT with itself */
259 *NewTable = AcpiGbl_DbTablePtr;
261 return (AE_OK);
262 #else
263 return AE_NO_ACPI_TABLES;
264 #endif
268 /******************************************************************************
270 * FUNCTION: AcpiOsReadable
272 * PARAMETERS: Pointer - Area to be verified
273 * Length - Size of area
275 * RETURN: TRUE if readable for entire length
277 * DESCRIPTION: Verify that a pointer is valid for reading
279 *****************************************************************************/
281 BOOLEAN
282 AcpiOsReadable (
283 void *Pointer,
284 ACPI_SIZE Length)
287 return (TRUE);
291 /******************************************************************************
293 * FUNCTION: AcpiOsWritable
295 * PARAMETERS: Pointer - Area to be verified
296 * Length - Size of area
298 * RETURN: TRUE if writable for entire length
300 * DESCRIPTION: Verify that a pointer is valid for writing
302 *****************************************************************************/
304 BOOLEAN
305 AcpiOsWritable (
306 void *Pointer,
307 ACPI_SIZE Length)
310 return (TRUE);
314 /******************************************************************************
316 * FUNCTION: AcpiOsRedirectOutput
318 * PARAMETERS: Destination - An open file handle/pointer
320 * RETURN: None
322 * DESCRIPTION: Causes redirect of AcpiOsPrintf and AcpiOsVprintf
324 *****************************************************************************/
326 void
327 AcpiOsRedirectOutput (
328 void *Destination)
331 AcpiGbl_OutputFile = Destination;
335 /******************************************************************************
337 * FUNCTION: AcpiOsPrintf
339 * PARAMETERS: fmt, ... Standard printf format
341 * RETURN: None
343 * DESCRIPTION: Formatted output
345 *****************************************************************************/
347 void ACPI_INTERNAL_VAR_XFACE
348 AcpiOsPrintf (
349 const char *Fmt,
350 ...)
352 va_list Args;
355 va_start (Args, Fmt);
357 AcpiOsVprintf (Fmt, Args);
359 va_end (Args);
360 return;
364 /******************************************************************************
366 * FUNCTION: AcpiOsVprintf
368 * PARAMETERS: fmt Standard printf format
369 * args Argument list
371 * RETURN: None
373 * DESCRIPTION: Formatted output with argument list pointer
375 *****************************************************************************/
377 void
378 AcpiOsVprintf (
379 const char *Fmt,
380 va_list Args)
382 INT32 Count = 0;
383 UINT8 Flags;
386 Flags = AcpiGbl_DbOutputFlags;
387 if (Flags & ACPI_DB_REDIRECTABLE_OUTPUT)
389 /* Output is directable to either a file (if open) or the console */
391 if (AcpiGbl_DebugFile)
393 /* Output file is open, send the output there */
395 Count = vfprintf (AcpiGbl_DebugFile, Fmt, Args);
397 else
399 /* No redirection, send output to console (once only!) */
401 Flags |= ACPI_DB_CONSOLE_OUTPUT;
405 if (Flags & ACPI_DB_CONSOLE_OUTPUT)
407 Count = vfprintf (AcpiGbl_OutputFile, Fmt, Args);
410 return;
414 /******************************************************************************
416 * FUNCTION: AcpiOsGetLine
418 * PARAMETERS: fmt Standard printf format
419 * args Argument list
421 * RETURN: Actual bytes read
423 * DESCRIPTION: Formatted input with argument list pointer
425 *****************************************************************************/
427 UINT32
428 AcpiOsGetLine (
429 char *Buffer)
431 UINT8 Temp;
432 UINT32 i;
435 for (i = 0; ; i++)
437 scanf ("%1c", &Temp);
438 if (!Temp || Temp == '\n')
440 break;
443 Buffer [i] = Temp;
446 /* Null terminate the buffer */
448 Buffer [i] = 0;
450 /* Return the number of bytes in the string */
452 return (i);
455 /******************************************************************************
457 * FUNCTION: AcpiOsMapMemory
459 * PARAMETERS: where Physical address of memory to be mapped
460 * length How much memory to map
462 * RETURN: Pointer to mapped memory. Null on error.
464 * DESCRIPTION: Map physical memory into caller's address space
466 *****************************************************************************/
468 void *
469 AcpiOsMapMemory (
470 ACPI_PHYSICAL_ADDRESS where,
471 ACPI_SIZE length)
474 return (ACPI_TO_POINTER ((ACPI_NATIVE_UINT) where));
478 /******************************************************************************
480 * FUNCTION: AcpiOsUnmapMemory
482 * PARAMETERS: where Logical address of memory to be unmapped
483 * length How much memory to unmap
485 * RETURN: None.
487 * DESCRIPTION: Delete a previously created mapping. Where and Length must
488 * correspond to a previous mapping exactly.
490 *****************************************************************************/
492 void
493 AcpiOsUnmapMemory (
494 void *where,
495 ACPI_SIZE length)
498 return;
502 /******************************************************************************
504 * FUNCTION: AcpiOsAllocate
506 * PARAMETERS: Size Amount to allocate, in bytes
508 * RETURN: Pointer to the new allocation. Null on error.
510 * DESCRIPTION: Allocate memory. Algorithm is dependent on the OS.
512 *****************************************************************************/
514 void *
515 AcpiOsAllocate (
516 ACPI_SIZE size)
518 void *Mem;
521 Mem = (void *) malloc ((size_t) size);
523 return Mem;
527 /******************************************************************************
529 * FUNCTION: AcpiOsFree
531 * PARAMETERS: mem Pointer to previously allocated memory
533 * RETURN: None.
535 * DESCRIPTION: Free memory allocated via AcpiOsAllocate
537 *****************************************************************************/
539 void
540 AcpiOsFree (
541 void *mem)
545 free (mem);
549 /******************************************************************************
551 * FUNCTION: AcpiOsCreateSemaphore
553 * PARAMETERS: InitialUnits - Units to be assigned to the new semaphore
554 * OutHandle - Where a handle will be returned
556 * RETURN: Status
558 * DESCRIPTION: Create an OS semaphore
560 *****************************************************************************/
562 ACPI_STATUS
563 AcpiOsCreateSemaphore (
564 UINT32 MaxUnits,
565 UINT32 InitialUnits,
566 ACPI_HANDLE *OutHandle)
570 *OutHandle = (ACPI_HANDLE) 1;
571 return AE_OK;
574 /******************************************************************************
576 * FUNCTION: AcpiOsDeleteSemaphore
578 * PARAMETERS: Handle - Handle returned by AcpiOsCreateSemaphore
580 * RETURN: Status
582 * DESCRIPTION: Delete an OS semaphore
584 *****************************************************************************/
586 ACPI_STATUS
587 AcpiOsDeleteSemaphore (
588 ACPI_HANDLE Handle)
591 if (!Handle)
593 return AE_BAD_PARAMETER;
596 return AE_OK;
600 /******************************************************************************
602 * FUNCTION: AcpiOsWaitSemaphore
604 * PARAMETERS: Handle - Handle returned by AcpiOsCreateSemaphore
605 * Units - How many units to wait for
606 * Timeout - How long to wait
608 * RETURN: Status
610 * DESCRIPTION: Wait for units
612 *****************************************************************************/
614 ACPI_STATUS
615 AcpiOsWaitSemaphore (
616 ACPI_HANDLE Handle,
617 UINT32 Units,
618 UINT16 Timeout)
622 return AE_OK;
626 /******************************************************************************
628 * FUNCTION: AcpiOsSignalSemaphore
630 * PARAMETERS: Handle - Handle returned by AcpiOsCreateSemaphore
631 * Units - Number of units to send
633 * RETURN: Status
635 * DESCRIPTION: Send units
637 *****************************************************************************/
639 ACPI_STATUS
640 AcpiOsSignalSemaphore (
641 ACPI_HANDLE Handle,
642 UINT32 Units)
646 return AE_OK;
650 ACPI_STATUS
651 AcpiOsCreateLock (
652 ACPI_SPINLOCK *OutHandle)
655 return (AcpiOsCreateSemaphore (1, 1, OutHandle));
658 void
659 AcpiOsDeleteLock (
660 ACPI_SPINLOCK Handle)
662 AcpiOsDeleteSemaphore (Handle);
666 ACPI_CPU_FLAGS
667 AcpiOsAcquireLock (
668 ACPI_HANDLE Handle)
670 AcpiOsWaitSemaphore (Handle, 1, 0xFFFF);
671 return (0);
675 void
676 AcpiOsReleaseLock (
677 ACPI_SPINLOCK Handle,
678 ACPI_CPU_FLAGS Flags)
680 AcpiOsSignalSemaphore (Handle, 1);
684 /******************************************************************************
686 * FUNCTION: AcpiOsInstallInterruptHandler
688 * PARAMETERS: InterruptNumber Level handler should respond to.
689 * Isr Address of the ACPI interrupt handler
690 * ExceptPtr Where status is returned
692 * RETURN: Handle to the newly installed handler.
694 * DESCRIPTION: Install an interrupt handler. Used to install the ACPI
695 * OS-independent handler.
697 *****************************************************************************/
699 UINT32
700 AcpiOsInstallInterruptHandler (
701 UINT32 InterruptNumber,
702 ACPI_OSD_HANDLER ServiceRoutine,
703 void *Context)
707 return AE_OK;
711 /******************************************************************************
713 * FUNCTION: AcpiOsRemoveInterruptHandler
715 * PARAMETERS: Handle Returned when handler was installed
717 * RETURN: Status
719 * DESCRIPTION: Uninstalls an interrupt handler.
721 *****************************************************************************/
723 ACPI_STATUS
724 AcpiOsRemoveInterruptHandler (
725 UINT32 InterruptNumber,
726 ACPI_OSD_HANDLER ServiceRoutine)
729 return AE_OK;
733 /******************************************************************************
735 * FUNCTION: AcpiOsExecute
737 * PARAMETERS: Type - Type of execution
738 * Function - Address of the function to execute
739 * Context - Passed as a parameter to the function
741 * RETURN: Status.
743 * DESCRIPTION: Execute a new thread
745 *****************************************************************************/
747 ACPI_STATUS
748 AcpiOsExecute (
749 ACPI_EXECUTE_TYPE Type,
750 ACPI_OSD_EXEC_CALLBACK Function,
751 void *Context)
754 // _beginthread (Function, (unsigned) 0, Context);
755 return 0;
759 /******************************************************************************
761 * FUNCTION: AcpiOsBreakpoint
763 * PARAMETERS: Msg Message to print
765 * RETURN: Status
767 * DESCRIPTION: Print a message and break to the debugger.
769 *****************************************************************************/
771 ACPI_STATUS
772 AcpiOsBreakpoint (
773 char *Msg)
776 if (Msg)
778 AcpiOsPrintf ("AcpiOsBreakpoint: %s ****\n", Msg);
780 else
782 AcpiOsPrintf ("At AcpiOsBreakpoint ****\n");
785 return AE_OK;
789 /******************************************************************************
791 * FUNCTION: AcpiOsStall
793 * PARAMETERS: microseconds To sleep
795 * RETURN: Blocks until sleep is completed.
797 * DESCRIPTION: Sleep at microsecond granularity
799 *****************************************************************************/
801 void
802 AcpiOsStall (
803 UINT32 microseconds)
806 if (microseconds)
808 usleep (microseconds);
810 return;
814 /******************************************************************************
816 * FUNCTION: AcpiOsSleep
818 * PARAMETERS: milliseconds To sleep
820 * RETURN: Blocks until sleep is completed.
822 * DESCRIPTION: Sleep at millisecond granularity
824 *****************************************************************************/
826 void
827 AcpiOsSleep (
828 ACPI_INTEGER milliseconds)
831 sleep (milliseconds / 1000); /* Sleep for whole seconds */
834 * Arg to usleep() must be less than 1,000,000 (1 second)
836 usleep ((milliseconds % 1000) * 1000); /* Sleep for remaining usecs */
838 return;
841 /******************************************************************************
843 * FUNCTION: AcpiOsGetTimer
845 * PARAMETERS: None
847 * RETURN: Current time in 100 nanosecond units
849 * DESCRIPTION: Get the current system time
851 *****************************************************************************/
853 UINT64
854 AcpiOsGetTimer (void)
856 struct timeval time;
858 gettimeofday(&time, NULL);
860 /* Seconds * 10^7 = 100ns(10^-7), Microseconds(10^-6) * 10^1 = 100ns */
862 return (((UINT64) time.tv_sec * 10000000) + ((UINT64) time.tv_usec * 10));
866 /******************************************************************************
868 * FUNCTION: AcpiOsValidateInterface
870 * PARAMETERS: Interface - Requested interface to be validated
872 * RETURN: AE_OK if interface is supported, AE_SUPPORT otherwise
874 * DESCRIPTION: Match an interface string to the interfaces supported by the
875 * host. Strings originate from an AML call to the _OSI method.
877 *****************************************************************************/
879 ACPI_STATUS
880 AcpiOsValidateInterface (
881 char *Interface)
884 return (AE_SUPPORT);
888 /******************************************************************************
890 * FUNCTION: AcpiOsValidateAddress
892 * PARAMETERS: SpaceId - ACPI space ID
893 * Address - Physical address
894 * Length - Address length
896 * RETURN: AE_OK if Address/Length is valid for the SpaceId. Otherwise,
897 * should return AE_AML_ILLEGAL_ADDRESS.
899 * DESCRIPTION: Validate a system address via the host OS. Used to validate
900 * the addresses accessed by AML operation regions.
902 *****************************************************************************/
904 ACPI_STATUS
905 AcpiOsValidateAddress (
906 UINT8 SpaceId,
907 ACPI_PHYSICAL_ADDRESS Address,
908 ACPI_SIZE Length)
911 return (AE_OK);
915 /******************************************************************************
917 * FUNCTION: AcpiOsReadPciConfiguration
919 * PARAMETERS: PciId Seg/Bus/Dev
920 * Register Device Register
921 * Value Buffer where value is placed
922 * Width Number of bits
924 * RETURN: Status
926 * DESCRIPTION: Read data from PCI configuration space
928 *****************************************************************************/
930 ACPI_STATUS
931 AcpiOsReadPciConfiguration (
932 ACPI_PCI_ID *PciId,
933 UINT32 Register,
934 void *Value,
935 UINT32 Width)
938 return (AE_OK);
942 /******************************************************************************
944 * FUNCTION: AcpiOsWritePciConfiguration
946 * PARAMETERS: PciId Seg/Bus/Dev
947 * Register Device Register
948 * Value Value to be written
949 * Width Number of bits
951 * RETURN: Status.
953 * DESCRIPTION: Write data to PCI configuration space
955 *****************************************************************************/
957 ACPI_STATUS
958 AcpiOsWritePciConfiguration (
959 ACPI_PCI_ID *PciId,
960 UINT32 Register,
961 ACPI_INTEGER Value,
962 UINT32 Width)
965 return (AE_OK);
968 /* TEMPORARY STUB FUNCTION */
969 void
970 AcpiOsDerivePciId(
971 ACPI_HANDLE rhandle,
972 ACPI_HANDLE chandle,
973 ACPI_PCI_ID **PciId)
979 /******************************************************************************
981 * FUNCTION: AcpiOsReadPort
983 * PARAMETERS: Address Address of I/O port/register to read
984 * Value Where value is placed
985 * Width Number of bits
987 * RETURN: Value read from port
989 * DESCRIPTION: Read data from an I/O port or register
991 *****************************************************************************/
993 ACPI_STATUS
994 AcpiOsReadPort (
995 ACPI_IO_ADDRESS Address,
996 UINT32 *Value,
997 UINT32 Width)
1000 switch (Width)
1002 case 8:
1003 *Value = 0xFF;
1004 break;
1006 case 16:
1007 *Value = 0xFFFF;
1008 break;
1010 case 32:
1011 *Value = 0xFFFFFFFF;
1012 break;
1015 return (AE_OK);
1019 /******************************************************************************
1021 * FUNCTION: AcpiOsWritePort
1023 * PARAMETERS: Address Address of I/O port/register to write
1024 * Value Value to write
1025 * Width Number of bits
1027 * RETURN: None
1029 * DESCRIPTION: Write data to an I/O port or register
1031 *****************************************************************************/
1033 ACPI_STATUS
1034 AcpiOsWritePort (
1035 ACPI_IO_ADDRESS Address,
1036 UINT32 Value,
1037 UINT32 Width)
1040 return (AE_OK);
1044 /******************************************************************************
1046 * FUNCTION: AcpiOsReadMemory
1048 * PARAMETERS: Address Physical Memory Address to read
1049 * Value Where value is placed
1050 * Width Number of bits
1052 * RETURN: Value read from physical memory address
1054 * DESCRIPTION: Read data from a physical memory address
1056 *****************************************************************************/
1058 ACPI_STATUS
1059 AcpiOsReadMemory (
1060 ACPI_PHYSICAL_ADDRESS Address,
1061 UINT32 *Value,
1062 UINT32 Width)
1065 switch (Width)
1067 case 8:
1068 case 16:
1069 case 32:
1070 *Value = 0;
1071 break;
1073 default:
1074 return (AE_BAD_PARAMETER);
1075 break;
1077 return (AE_OK);
1081 /******************************************************************************
1083 * FUNCTION: AcpiOsWriteMemory
1085 * PARAMETERS: Address Physical Memory Address to write
1086 * Value Value to write
1087 * Width Number of bits
1089 * RETURN: None
1091 * DESCRIPTION: Write data to a physical memory address
1093 *****************************************************************************/
1095 ACPI_STATUS
1096 AcpiOsWriteMemory (
1097 ACPI_PHYSICAL_ADDRESS Address,
1098 UINT32 Value,
1099 UINT32 Width)
1102 return (AE_OK);
1106 ACPI_THREAD_ID
1107 AcpiOsGetThreadId(void)
1109 return getpid();
1113 /******************************************************************************
1115 * FUNCTION: AcpiOsSignal
1117 * PARAMETERS: Function ACPI CA signal function code
1118 * Info Pointer to function-dependent structure
1120 * RETURN: Status
1122 * DESCRIPTION: Miscellaneous functions
1124 *****************************************************************************/
1126 ACPI_STATUS
1127 AcpiOsSignal (
1128 UINT32 Function,
1129 void *Info)
1132 switch (Function)
1134 case ACPI_SIGNAL_FATAL:
1135 break;
1137 case ACPI_SIGNAL_BREAKPOINT:
1139 if (Info)
1141 AcpiOsPrintf ("AcpiOsBreakpoint: %s ****\n", Info);
1143 else
1145 AcpiOsPrintf ("At AcpiOsBreakpoint ****\n");
1148 break;
1152 return (AE_OK);