11.1Schristos/****************************************************************************** 21.1Schristos * 31.1Schristos * Module Name: aczephyr.h - OS specific defines, etc. 41.1Schristos * 51.1Schristos *****************************************************************************/ 61.1Schristos 71.1.1.3Schristos/****************************************************************************** 81.1.1.3Schristos * 91.1.1.3Schristos * 1. Copyright Notice 101.1.1.3Schristos * 111.1.1.4Schristos * Some or all of this work - Copyright (c) 1999 - 2025, Intel Corp. 121.1Schristos * All rights reserved. 131.1Schristos * 141.1.1.3Schristos * 2. License 151.1.1.3Schristos * 161.1.1.3Schristos * 2.1. This is your license from Intel Corp. under its intellectual property 171.1.1.3Schristos * rights. You may have additional license terms from the party that provided 181.1.1.3Schristos * you this software, covering your right to use that party's intellectual 191.1.1.3Schristos * property rights. 201.1.1.3Schristos * 211.1.1.3Schristos * 2.2. Intel grants, free of charge, to any person ("Licensee") obtaining a 221.1.1.3Schristos * copy of the source code appearing in this file ("Covered Code") an 231.1.1.3Schristos * irrevocable, perpetual, worldwide license under Intel's copyrights in the 241.1.1.3Schristos * base code distributed originally by Intel ("Original Intel Code") to copy, 251.1.1.3Schristos * make derivatives, distribute, use and display any portion of the Covered 261.1.1.3Schristos * Code in any form, with the right to sublicense such rights; and 271.1.1.3Schristos * 281.1.1.3Schristos * 2.3. Intel grants Licensee a non-exclusive and non-transferable patent 291.1.1.3Schristos * license (with the right to sublicense), under only those claims of Intel 301.1.1.3Schristos * patents that are infringed by the Original Intel Code, to make, use, sell, 311.1.1.3Schristos * offer to sell, and import the Covered Code and derivative works thereof 321.1.1.3Schristos * solely to the minimum extent necessary to exercise the above copyright 331.1.1.3Schristos * license, and in no event shall the patent license extend to any additions 341.1.1.3Schristos * to or modifications of the Original Intel Code. No other license or right 351.1.1.3Schristos * is granted directly or by implication, estoppel or otherwise; 361.1.1.3Schristos * 371.1.1.3Schristos * The above copyright and patent license is granted only if the following 381.1.1.3Schristos * conditions are met: 391.1.1.3Schristos * 401.1.1.3Schristos * 3. Conditions 411.1.1.3Schristos * 421.1.1.3Schristos * 3.1. Redistribution of Source with Rights to Further Distribute Source. 431.1.1.3Schristos * Redistribution of source code of any substantial portion of the Covered 441.1.1.3Schristos * Code or modification with rights to further distribute source must include 451.1.1.3Schristos * the above Copyright Notice, the above License, this list of Conditions, 461.1.1.3Schristos * and the following Disclaimer and Export Compliance provision. In addition, 471.1.1.3Schristos * Licensee must cause all Covered Code to which Licensee contributes to 481.1.1.3Schristos * contain a file documenting the changes Licensee made to create that Covered 491.1.1.3Schristos * Code and the date of any change. Licensee must include in that file the 501.1.1.3Schristos * documentation of any changes made by any predecessor Licensee. Licensee 511.1.1.3Schristos * must include a prominent statement that the modification is derived, 521.1.1.3Schristos * directly or indirectly, from Original Intel Code. 531.1.1.3Schristos * 541.1.1.3Schristos * 3.2. Redistribution of Source with no Rights to Further Distribute Source. 551.1.1.3Schristos * Redistribution of source code of any substantial portion of the Covered 561.1.1.3Schristos * Code or modification without rights to further distribute source must 571.1.1.3Schristos * include the following Disclaimer and Export Compliance provision in the 581.1.1.3Schristos * documentation and/or other materials provided with distribution. In 591.1.1.3Schristos * addition, Licensee may not authorize further sublicense of source of any 601.1.1.3Schristos * portion of the Covered Code, and must include terms to the effect that the 611.1.1.3Schristos * license from Licensee to its licensee is limited to the intellectual 621.1.1.3Schristos * property embodied in the software Licensee provides to its licensee, and 631.1.1.3Schristos * not to intellectual property embodied in modifications its licensee may 641.1.1.3Schristos * make. 651.1.1.3Schristos * 661.1.1.3Schristos * 3.3. Redistribution of Executable. Redistribution in executable form of any 671.1.1.3Schristos * substantial portion of the Covered Code or modification must reproduce the 681.1.1.3Schristos * above Copyright Notice, and the following Disclaimer and Export Compliance 691.1.1.3Schristos * provision in the documentation and/or other materials provided with the 701.1.1.3Schristos * distribution. 711.1.1.3Schristos * 721.1.1.3Schristos * 3.4. Intel retains all right, title, and interest in and to the Original 731.1.1.3Schristos * Intel Code. 741.1.1.3Schristos * 751.1.1.3Schristos * 3.5. Neither the name Intel nor any other trademark owned or controlled by 761.1.1.3Schristos * Intel shall be used in advertising or otherwise to promote the sale, use or 771.1.1.3Schristos * other dealings in products derived from or relating to the Covered Code 781.1.1.3Schristos * without prior written authorization from Intel. 791.1.1.3Schristos * 801.1.1.3Schristos * 4. Disclaimer and Export Compliance 811.1.1.3Schristos * 821.1.1.3Schristos * 4.1. INTEL MAKES NO WARRANTY OF ANY KIND REGARDING ANY SOFTWARE PROVIDED 831.1.1.3Schristos * HERE. ANY SOFTWARE ORIGINATING FROM INTEL OR DERIVED FROM INTEL SOFTWARE 841.1.1.3Schristos * IS PROVIDED "AS IS," AND INTEL WILL NOT PROVIDE ANY SUPPORT, ASSISTANCE, 851.1.1.3Schristos * INSTALLATION, TRAINING OR OTHER SERVICES. INTEL WILL NOT PROVIDE ANY 861.1.1.3Schristos * UPDATES, ENHANCEMENTS OR EXTENSIONS. INTEL SPECIFICALLY DISCLAIMS ANY 871.1.1.3Schristos * IMPLIED WARRANTIES OF MERCHANTABILITY, NONINFRINGEMENT AND FITNESS FOR A 881.1.1.3Schristos * PARTICULAR PURPOSE. 891.1.1.3Schristos * 901.1.1.3Schristos * 4.2. IN NO EVENT SHALL INTEL HAVE ANY LIABILITY TO LICENSEE, ITS LICENSEES 911.1.1.3Schristos * OR ANY OTHER THIRD PARTY, FOR ANY LOST PROFITS, LOST DATA, LOSS OF USE OR 921.1.1.3Schristos * COSTS OF PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES, OR FOR ANY INDIRECT, 931.1.1.3Schristos * SPECIAL OR CONSEQUENTIAL DAMAGES ARISING OUT OF THIS AGREEMENT, UNDER ANY 941.1.1.3Schristos * CAUSE OF ACTION OR THEORY OF LIABILITY, AND IRRESPECTIVE OF WHETHER INTEL 951.1.1.3Schristos * HAS ADVANCE NOTICE OF THE POSSIBILITY OF SUCH DAMAGES. THESE LIMITATIONS 961.1.1.3Schristos * SHALL APPLY NOTWITHSTANDING THE FAILURE OF THE ESSENTIAL PURPOSE OF ANY 971.1.1.3Schristos * LIMITED REMEDY. 981.1.1.3Schristos * 991.1.1.3Schristos * 4.3. Licensee shall not export, either directly or indirectly, any of this 1001.1.1.3Schristos * software or system incorporating such software without first obtaining any 1011.1.1.3Schristos * required license or other approval from the U. S. Department of Commerce or 1021.1.1.3Schristos * any other agency or department of the United States Government. In the 1031.1.1.3Schristos * event Licensee exports any such software from the United States or 1041.1.1.3Schristos * re-exports any such software from a foreign destination, Licensee shall 1051.1.1.3Schristos * ensure that the distribution and export/re-export of the software is in 1061.1.1.3Schristos * compliance with all laws, regulations, orders, or other restrictions of the 1071.1.1.3Schristos * U.S. Export Administration Regulations. Licensee agrees that neither it nor 1081.1.1.3Schristos * any of its subsidiaries will export/re-export any technical data, process, 1091.1.1.3Schristos * software, or service, directly or indirectly, to any country for which the 1101.1.1.3Schristos * United States government or any agency thereof requires an export license, 1111.1.1.3Schristos * other governmental approval, or letter of assurance, without first obtaining 1121.1.1.3Schristos * such license, approval or letter. 1131.1.1.3Schristos * 1141.1.1.3Schristos ***************************************************************************** 1151.1.1.3Schristos * 1161.1.1.3Schristos * Alternatively, you may choose to be licensed under the terms of the 1171.1.1.3Schristos * following license: 1181.1.1.3Schristos * 1191.1Schristos * Redistribution and use in source and binary forms, with or without 1201.1Schristos * modification, are permitted provided that the following conditions 1211.1Schristos * are met: 1221.1Schristos * 1. Redistributions of source code must retain the above copyright 1231.1Schristos * notice, this list of conditions, and the following disclaimer, 1241.1Schristos * without modification. 1251.1Schristos * 2. Redistributions in binary form must reproduce at minimum a disclaimer 1261.1Schristos * substantially similar to the "NO WARRANTY" disclaimer below 1271.1Schristos * ("Disclaimer") and any redistribution must be conditioned upon 1281.1Schristos * including a substantially similar Disclaimer requirement for further 1291.1Schristos * binary redistribution. 1301.1Schristos * 3. Neither the names of the above-listed copyright holders nor the names 1311.1Schristos * of any contributors may be used to endorse or promote products derived 1321.1Schristos * from this software without specific prior written permission. 1331.1Schristos * 1341.1Schristos * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS 1351.1Schristos * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT 1361.1Schristos * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR 1371.1Schristos * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT 1381.1.1.3Schristos * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, 1391.1.1.3Schristos * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT 1401.1.1.3Schristos * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, 1411.1.1.3Schristos * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY 1421.1.1.3Schristos * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT 1431.1.1.3Schristos * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE 1441.1.1.3Schristos * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 1451.1.1.3Schristos * 1461.1.1.3Schristos * Alternatively, you may choose to be licensed under the terms of the 1471.1.1.3Schristos * GNU General Public License ("GPL") version 2 as published by the Free 1481.1.1.3Schristos * Software Foundation. 1491.1.1.3Schristos * 1501.1.1.3Schristos *****************************************************************************/ 1511.1Schristos 1521.1Schristos#ifndef __ACZEPHYR_H__ 1531.1Schristos#define __ACZEPHYR_H__ 1541.1Schristos 1551.1.1.2Schristos#if defined(__x86_64__) 1561.1.1.2Schristos#define ACPI_MACHINE_WIDTH 64 1571.1.1.2Schristos#else 1581.1.1.2Schristos#define ACPI_32BIT_PHYSICAL_ADDRESS 1591.1.1.2Schristos#define ACPI_MACHINE_WIDTH 32 1601.1.1.2Schristos#define ACPI_USE_NATIVE_DIVIDE 1611.1.1.2Schristos#define ACPI_USE_NATIVE_MATH64 1621.1.1.2Schristos#endif 1631.1.1.2Schristos 1641.1.1.2Schristos#define COMPILER_DEPENDENT_INT64 long long 1651.1.1.2Schristos#define COMPILER_DEPENDENT_UINT64 unsigned long long 1661.1Schristos 1671.1Schristos#define ACPI_NO_ERROR_MESSAGES 1681.1Schristos#undef ACPI_DEBUG_OUTPUT 1691.1Schristos#define ACPI_USE_SYSTEM_CLIBRARY 1701.1Schristos#undef ACPI_DBG_TRACK_ALLOCATIONS 1711.1Schristos#define ACPI_SINGLE_THREADED 1721.1Schristos#define ACPI_USE_NATIVE_RSDP_POINTER 1731.1Schristos 1741.1Schristos#include <zephyr/kernel.h> 1751.1Schristos#include <zephyr/device.h> 1761.1Schristos#include <stdio.h> 1771.1Schristos#include <stdlib.h> 1781.1Schristos#include <string.h> 1791.1Schristos#include <ctype.h> 1801.1Schristos#include <zephyr/fs/fs.h> 1811.1Schristos#include <zephyr/sys/printk.h> 1821.1Schristos#include <zephyr/sys/__assert.h> 1831.1Schristos 1841.1Schristos 1851.1Schristos/****************************************************************************** 1861.1Schristos * 1871.1Schristos * FUNCTION: AcpiEnableDbgPrint 1881.1Schristos * 1891.1Schristos * PARAMETERS: Enable, - Enable/Disable debug print 1901.1Schristos * 1911.1Schristos * RETURN: None 1921.1Schristos * 1931.1Schristos * DESCRIPTION: Enable/disable debug print 1941.1Schristos * 1951.1Schristos *****************************************************************************/ 1961.1Schristos 1971.1Schristosvoid AcpiEnableDbgPrint ( 1981.1Schristos bool Enable); 1991.1Schristos#endif 200