11.1Sjruoho/******************************************************************************
21.1Sjruoho *
31.1Sjruoho * Name: accygwin.h - OS specific defines, etc. for cygwin environment
41.1Sjruoho *
51.1Sjruoho *****************************************************************************/
61.1Sjruoho
71.1.1.16Schristos/******************************************************************************
81.1.1.16Schristos *
91.1.1.16Schristos * 1. Copyright Notice
101.1.1.16Schristos *
111.1.1.17Schristos * Some or all of this work - Copyright (c) 1999 - 2025, Intel Corp.
121.1Sjruoho * All rights reserved.
131.1Sjruoho *
141.1.1.16Schristos * 2. License
151.1.1.16Schristos *
161.1.1.16Schristos * 2.1. This is your license from Intel Corp. under its intellectual property
171.1.1.16Schristos * rights. You may have additional license terms from the party that provided
181.1.1.16Schristos * you this software, covering your right to use that party's intellectual
191.1.1.16Schristos * property rights.
201.1.1.16Schristos *
211.1.1.16Schristos * 2.2. Intel grants, free of charge, to any person ("Licensee") obtaining a
221.1.1.16Schristos * copy of the source code appearing in this file ("Covered Code") an
231.1.1.16Schristos * irrevocable, perpetual, worldwide license under Intel's copyrights in the
241.1.1.16Schristos * base code distributed originally by Intel ("Original Intel Code") to copy,
251.1.1.16Schristos * make derivatives, distribute, use and display any portion of the Covered
261.1.1.16Schristos * Code in any form, with the right to sublicense such rights; and
271.1.1.16Schristos *
281.1.1.16Schristos * 2.3. Intel grants Licensee a non-exclusive and non-transferable patent
291.1.1.16Schristos * license (with the right to sublicense), under only those claims of Intel
301.1.1.16Schristos * patents that are infringed by the Original Intel Code, to make, use, sell,
311.1.1.16Schristos * offer to sell, and import the Covered Code and derivative works thereof
321.1.1.16Schristos * solely to the minimum extent necessary to exercise the above copyright
331.1.1.16Schristos * license, and in no event shall the patent license extend to any additions
341.1.1.16Schristos * to or modifications of the Original Intel Code. No other license or right
351.1.1.16Schristos * is granted directly or by implication, estoppel or otherwise;
361.1.1.16Schristos *
371.1.1.16Schristos * The above copyright and patent license is granted only if the following
381.1.1.16Schristos * conditions are met:
391.1.1.16Schristos *
401.1.1.16Schristos * 3. Conditions
411.1.1.16Schristos *
421.1.1.16Schristos * 3.1. Redistribution of Source with Rights to Further Distribute Source.
431.1.1.16Schristos * Redistribution of source code of any substantial portion of the Covered
441.1.1.16Schristos * Code or modification with rights to further distribute source must include
451.1.1.16Schristos * the above Copyright Notice, the above License, this list of Conditions,
461.1.1.16Schristos * and the following Disclaimer and Export Compliance provision. In addition,
471.1.1.16Schristos * Licensee must cause all Covered Code to which Licensee contributes to
481.1.1.16Schristos * contain a file documenting the changes Licensee made to create that Covered
491.1.1.16Schristos * Code and the date of any change. Licensee must include in that file the
501.1.1.16Schristos * documentation of any changes made by any predecessor Licensee. Licensee
511.1.1.16Schristos * must include a prominent statement that the modification is derived,
521.1.1.16Schristos * directly or indirectly, from Original Intel Code.
531.1.1.16Schristos *
541.1.1.16Schristos * 3.2. Redistribution of Source with no Rights to Further Distribute Source.
551.1.1.16Schristos * Redistribution of source code of any substantial portion of the Covered
561.1.1.16Schristos * Code or modification without rights to further distribute source must
571.1.1.16Schristos * include the following Disclaimer and Export Compliance provision in the
581.1.1.16Schristos * documentation and/or other materials provided with distribution. In
591.1.1.16Schristos * addition, Licensee may not authorize further sublicense of source of any
601.1.1.16Schristos * portion of the Covered Code, and must include terms to the effect that the
611.1.1.16Schristos * license from Licensee to its licensee is limited to the intellectual
621.1.1.16Schristos * property embodied in the software Licensee provides to its licensee, and
631.1.1.16Schristos * not to intellectual property embodied in modifications its licensee may
641.1.1.16Schristos * make.
651.1.1.16Schristos *
661.1.1.16Schristos * 3.3. Redistribution of Executable. Redistribution in executable form of any
671.1.1.16Schristos * substantial portion of the Covered Code or modification must reproduce the
681.1.1.16Schristos * above Copyright Notice, and the following Disclaimer and Export Compliance
691.1.1.16Schristos * provision in the documentation and/or other materials provided with the
701.1.1.16Schristos * distribution.
711.1.1.16Schristos *
721.1.1.16Schristos * 3.4. Intel retains all right, title, and interest in and to the Original
731.1.1.16Schristos * Intel Code.
741.1.1.16Schristos *
751.1.1.16Schristos * 3.5. Neither the name Intel nor any other trademark owned or controlled by
761.1.1.16Schristos * Intel shall be used in advertising or otherwise to promote the sale, use or
771.1.1.16Schristos * other dealings in products derived from or relating to the Covered Code
781.1.1.16Schristos * without prior written authorization from Intel.
791.1.1.16Schristos *
801.1.1.16Schristos * 4. Disclaimer and Export Compliance
811.1.1.16Schristos *
821.1.1.16Schristos * 4.1. INTEL MAKES NO WARRANTY OF ANY KIND REGARDING ANY SOFTWARE PROVIDED
831.1.1.16Schristos * HERE. ANY SOFTWARE ORIGINATING FROM INTEL OR DERIVED FROM INTEL SOFTWARE
841.1.1.16Schristos * IS PROVIDED "AS IS," AND INTEL WILL NOT PROVIDE ANY SUPPORT, ASSISTANCE,
851.1.1.16Schristos * INSTALLATION, TRAINING OR OTHER SERVICES. INTEL WILL NOT PROVIDE ANY
861.1.1.16Schristos * UPDATES, ENHANCEMENTS OR EXTENSIONS. INTEL SPECIFICALLY DISCLAIMS ANY
871.1.1.16Schristos * IMPLIED WARRANTIES OF MERCHANTABILITY, NONINFRINGEMENT AND FITNESS FOR A
881.1.1.16Schristos * PARTICULAR PURPOSE.
891.1.1.16Schristos *
901.1.1.16Schristos * 4.2. IN NO EVENT SHALL INTEL HAVE ANY LIABILITY TO LICENSEE, ITS LICENSEES
911.1.1.16Schristos * OR ANY OTHER THIRD PARTY, FOR ANY LOST PROFITS, LOST DATA, LOSS OF USE OR
921.1.1.16Schristos * COSTS OF PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES, OR FOR ANY INDIRECT,
931.1.1.16Schristos * SPECIAL OR CONSEQUENTIAL DAMAGES ARISING OUT OF THIS AGREEMENT, UNDER ANY
941.1.1.16Schristos * CAUSE OF ACTION OR THEORY OF LIABILITY, AND IRRESPECTIVE OF WHETHER INTEL
951.1.1.16Schristos * HAS ADVANCE NOTICE OF THE POSSIBILITY OF SUCH DAMAGES. THESE LIMITATIONS
961.1.1.16Schristos * SHALL APPLY NOTWITHSTANDING THE FAILURE OF THE ESSENTIAL PURPOSE OF ANY
971.1.1.16Schristos * LIMITED REMEDY.
981.1.1.16Schristos *
991.1.1.16Schristos * 4.3. Licensee shall not export, either directly or indirectly, any of this
1001.1.1.16Schristos * software or system incorporating such software without first obtaining any
1011.1.1.16Schristos * required license or other approval from the U. S. Department of Commerce or
1021.1.1.16Schristos * any other agency or department of the United States Government. In the
1031.1.1.16Schristos * event Licensee exports any such software from the United States or
1041.1.1.16Schristos * re-exports any such software from a foreign destination, Licensee shall
1051.1.1.16Schristos * ensure that the distribution and export/re-export of the software is in
1061.1.1.16Schristos * compliance with all laws, regulations, orders, or other restrictions of the
1071.1.1.16Schristos * U.S. Export Administration Regulations. Licensee agrees that neither it nor
1081.1.1.16Schristos * any of its subsidiaries will export/re-export any technical data, process,
1091.1.1.16Schristos * software, or service, directly or indirectly, to any country for which the
1101.1.1.16Schristos * United States government or any agency thereof requires an export license,
1111.1.1.16Schristos * other governmental approval, or letter of assurance, without first obtaining
1121.1.1.16Schristos * such license, approval or letter.
1131.1.1.16Schristos *
1141.1.1.16Schristos *****************************************************************************
1151.1.1.16Schristos *
1161.1.1.16Schristos * Alternatively, you may choose to be licensed under the terms of the
1171.1.1.16Schristos * following license:
1181.1.1.16Schristos *
1191.1.1.2Sjruoho * Redistribution and use in source and binary forms, with or without
1201.1.1.2Sjruoho * modification, are permitted provided that the following conditions
1211.1.1.2Sjruoho * are met:
1221.1.1.2Sjruoho * 1. Redistributions of source code must retain the above copyright
1231.1.1.2Sjruoho *    notice, this list of conditions, and the following disclaimer,
1241.1.1.2Sjruoho *    without modification.
1251.1.1.2Sjruoho * 2. Redistributions in binary form must reproduce at minimum a disclaimer
1261.1.1.2Sjruoho *    substantially similar to the "NO WARRANTY" disclaimer below
1271.1.1.2Sjruoho *    ("Disclaimer") and any redistribution must be conditioned upon
1281.1.1.2Sjruoho *    including a substantially similar Disclaimer requirement for further
1291.1.1.2Sjruoho *    binary redistribution.
1301.1.1.2Sjruoho * 3. Neither the names of the above-listed copyright holders nor the names
1311.1.1.2Sjruoho *    of any contributors may be used to endorse or promote products derived
1321.1.1.2Sjruoho *    from this software without specific prior written permission.
1331.1.1.2Sjruoho *
1341.1.1.2Sjruoho * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
1351.1.1.2Sjruoho * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
1361.1.1.13Schristos * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
1371.1.1.2Sjruoho * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
1381.1.1.16Schristos * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
1391.1.1.16Schristos * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
1401.1.1.16Schristos * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
1411.1.1.16Schristos * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
1421.1.1.16Schristos * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
1431.1.1.16Schristos * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
1441.1.1.16Schristos * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
1451.1.1.16Schristos *
1461.1.1.16Schristos * Alternatively, you may choose to be licensed under the terms of the
1471.1.1.16Schristos * GNU General Public License ("GPL") version 2 as published by the Free
1481.1.1.16Schristos * Software Foundation.
1491.1.1.16Schristos *
1501.1.1.16Schristos *****************************************************************************/
1511.1Sjruoho
1521.1Sjruoho#ifndef __ACCYGWIN_H__
1531.1Sjruoho#define __ACCYGWIN_H__
1541.1Sjruoho
1551.1Sjruoho/*
1561.1Sjruoho * ACPICA configuration
1571.1Sjruoho */
1581.1.1.7Schristos#define ACPI_USE_STANDARD_HEADERS
1591.1Sjruoho#define ACPI_USE_SYSTEM_CLIBRARY
1601.1Sjruoho#define ACPI_USE_DO_WHILE_0
1611.1Sjruoho#define ACPI_FLUSH_CPU_CACHE()
1621.1.1.3Schristos
1631.1Sjruoho/*
1641.1Sjruoho * This is needed since sem_timedwait does not appear to work properly
1651.1Sjruoho * on cygwin (always hangs forever).
1661.1Sjruoho */
1671.1Sjruoho#define ACPI_USE_ALTERNATE_TIMEOUT
1681.1Sjruoho
1691.1Sjruoho
1701.1.1.7Schristos#ifdef ACPI_USE_STANDARD_HEADERS
1711.1Sjruoho#include <unistd.h>
1721.1.1.7Schristos#endif
1731.1Sjruoho
1741.1Sjruoho#if defined(__ia64__) || defined(__x86_64__)
1751.1Sjruoho#define ACPI_MACHINE_WIDTH          64
1761.1Sjruoho#define COMPILER_DEPENDENT_INT64    long
1771.1Sjruoho#define COMPILER_DEPENDENT_UINT64   unsigned long
1781.1Sjruoho#else
1791.1Sjruoho#define ACPI_MACHINE_WIDTH          32
1801.1Sjruoho#define COMPILER_DEPENDENT_INT64    long long
1811.1Sjruoho#define COMPILER_DEPENDENT_UINT64   unsigned long long
1821.1Sjruoho#define ACPI_USE_NATIVE_DIVIDE
1831.1.1.9Schristos#define ACPI_USE_NATIVE_MATH64
1841.1Sjruoho#endif
1851.1Sjruoho
1861.1Sjruoho#ifndef __cdecl
1871.1Sjruoho#define __cdecl
1881.1Sjruoho#endif
1891.1Sjruoho
1901.1Sjruoho#define ACPI_ACQUIRE_GLOBAL_LOCK(GLptr, Acq) if (GLptr) Acq=1; else Acq=0;
1911.1Sjruoho#define ACPI_RELEASE_GLOBAL_LOCK(GLptr, Pending) Pending = 1
1921.1Sjruoho
1931.1.1.2Sjruoho/* On Cygwin, pthread_t is a pointer */
1941.1.1.2Sjruoho
1951.1.1.2Sjruoho#define ACPI_CAST_PTHREAD_T(pthread) ((ACPI_THREAD_ID) ACPI_TO_INTEGER (pthread))
1961.1Sjruoho
1971.1.1.3Schristos
1981.1.1.3Schristos/*
1991.1.1.4Schristos * The vsnprintf/snprintf functions are defined by c99, but cygwin/gcc
2001.1.1.4Schristos * does not enable this prototype when the -ansi flag is set. Also related
2011.1.1.4Schristos * to __STRICT_ANSI__. So, we just declare the prototype here.
2021.1.1.3Schristos */
2031.1.1.3Schristosint
2041.1.1.3Schristosvsnprintf (char *s, size_t n, const char *format, va_list ap);
2051.1.1.3Schristos
2061.1.1.4Schristosint
2071.1.1.4Schristossnprintf (char *s, size_t n, const char *format, ...);
2081.1.1.4Schristos
2091.1Sjruoho#endif /* __ACCYGWIN_H__ */
210