ReactOS Fundraising Campaign 2012
 
€ 4,410 / € 30,000

Information | Donate

Home | Info | Community | Development | myReactOS | Contact Us

  1. Home
  2. Community
  3. Development
  4. myReactOS
  5. Fundraiser 2012

  1. Main Page
  2. Alphabetical List
  3. Data Structures
  4. Directories
  5. File List
  6. Data Fields
  7. Globals
  8. Related Pages

ReactOS Development > Doxygen

aclinux.h
Go to the documentation of this file.
00001 /******************************************************************************
00002  *
00003  * Name: aclinux.h - OS specific defines, etc. for Linux
00004  *
00005  *****************************************************************************/
00006 
00007 /******************************************************************************
00008  *
00009  * 1. Copyright Notice
00010  *
00011  * Some or all of this work - Copyright (c) 1999 - 2011, Intel Corp.
00012  * All rights reserved.
00013  *
00014  * 2. License
00015  *
00016  * 2.1. This is your license from Intel Corp. under its intellectual property
00017  * rights.  You may have additional license terms from the party that provided
00018  * you this software, covering your right to use that party's intellectual
00019  * property rights.
00020  *
00021  * 2.2. Intel grants, free of charge, to any person ("Licensee") obtaining a
00022  * copy of the source code appearing in this file ("Covered Code") an
00023  * irrevocable, perpetual, worldwide license under Intel's copyrights in the
00024  * base code distributed originally by Intel ("Original Intel Code") to copy,
00025  * make derivatives, distribute, use and display any portion of the Covered
00026  * Code in any form, with the right to sublicense such rights; and
00027  *
00028  * 2.3. Intel grants Licensee a non-exclusive and non-transferable patent
00029  * license (with the right to sublicense), under only those claims of Intel
00030  * patents that are infringed by the Original Intel Code, to make, use, sell,
00031  * offer to sell, and import the Covered Code and derivative works thereof
00032  * solely to the minimum extent necessary to exercise the above copyright
00033  * license, and in no event shall the patent license extend to any additions
00034  * to or modifications of the Original Intel Code.  No other license or right
00035  * is granted directly or by implication, estoppel or otherwise;
00036  *
00037  * The above copyright and patent license is granted only if the following
00038  * conditions are met:
00039  *
00040  * 3. Conditions
00041  *
00042  * 3.1. Redistribution of Source with Rights to Further Distribute Source.
00043  * Redistribution of source code of any substantial portion of the Covered
00044  * Code or modification with rights to further distribute source must include
00045  * the above Copyright Notice, the above License, this list of Conditions,
00046  * and the following Disclaimer and Export Compliance provision.  In addition,
00047  * Licensee must cause all Covered Code to which Licensee contributes to
00048  * contain a file documenting the changes Licensee made to create that Covered
00049  * Code and the date of any change.  Licensee must include in that file the
00050  * documentation of any changes made by any predecessor Licensee.  Licensee
00051  * must include a prominent statement that the modification is derived,
00052  * directly or indirectly, from Original Intel Code.
00053  *
00054  * 3.2. Redistribution of Source with no Rights to Further Distribute Source.
00055  * Redistribution of source code of any substantial portion of the Covered
00056  * Code or modification without rights to further distribute source must
00057  * include the following Disclaimer and Export Compliance provision in the
00058  * documentation and/or other materials provided with distribution.  In
00059  * addition, Licensee may not authorize further sublicense of source of any
00060  * portion of the Covered Code, and must include terms to the effect that the
00061  * license from Licensee to its licensee is limited to the intellectual
00062  * property embodied in the software Licensee provides to its licensee, and
00063  * not to intellectual property embodied in modifications its licensee may
00064  * make.
00065  *
00066  * 3.3. Redistribution of Executable. Redistribution in executable form of any
00067  * substantial portion of the Covered Code or modification must reproduce the
00068  * above Copyright Notice, and the following Disclaimer and Export Compliance
00069  * provision in the documentation and/or other materials provided with the
00070  * distribution.
00071  *
00072  * 3.4. Intel retains all right, title, and interest in and to the Original
00073  * Intel Code.
00074  *
00075  * 3.5. Neither the name Intel nor any other trademark owned or controlled by
00076  * Intel shall be used in advertising or otherwise to promote the sale, use or
00077  * other dealings in products derived from or relating to the Covered Code
00078  * without prior written authorization from Intel.
00079  *
00080  * 4. Disclaimer and Export Compliance
00081  *
00082  * 4.1. INTEL MAKES NO WARRANTY OF ANY KIND REGARDING ANY SOFTWARE PROVIDED
00083  * HERE.  ANY SOFTWARE ORIGINATING FROM INTEL OR DERIVED FROM INTEL SOFTWARE
00084  * IS PROVIDED "AS IS," AND INTEL WILL NOT PROVIDE ANY SUPPORT,  ASSISTANCE,
00085  * INSTALLATION, TRAINING OR OTHER SERVICES.  INTEL WILL NOT PROVIDE ANY
00086  * UPDATES, ENHANCEMENTS OR EXTENSIONS.  INTEL SPECIFICALLY DISCLAIMS ANY
00087  * IMPLIED WARRANTIES OF MERCHANTABILITY, NONINFRINGEMENT AND FITNESS FOR A
00088  * PARTICULAR PURPOSE.
00089  *
00090  * 4.2. IN NO EVENT SHALL INTEL HAVE ANY LIABILITY TO LICENSEE, ITS LICENSEES
00091  * OR ANY OTHER THIRD PARTY, FOR ANY LOST PROFITS, LOST DATA, LOSS OF USE OR
00092  * COSTS OF PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES, OR FOR ANY INDIRECT,
00093  * SPECIAL OR CONSEQUENTIAL DAMAGES ARISING OUT OF THIS AGREEMENT, UNDER ANY
00094  * CAUSE OF ACTION OR THEORY OF LIABILITY, AND IRRESPECTIVE OF WHETHER INTEL
00095  * HAS ADVANCE NOTICE OF THE POSSIBILITY OF SUCH DAMAGES.  THESE LIMITATIONS
00096  * SHALL APPLY NOTWITHSTANDING THE FAILURE OF THE ESSENTIAL PURPOSE OF ANY
00097  * LIMITED REMEDY.
00098  *
00099  * 4.3. Licensee shall not export, either directly or indirectly, any of this
00100  * software or system incorporating such software without first obtaining any
00101  * required license or other approval from the U. S. Department of Commerce or
00102  * any other agency or department of the United States Government.  In the
00103  * event Licensee exports any such software from the United States or
00104  * re-exports any such software from a foreign destination, Licensee shall
00105  * ensure that the distribution and export/re-export of the software is in
00106  * compliance with all laws, regulations, orders, or other restrictions of the
00107  * U.S. Export Administration Regulations. Licensee agrees that neither it nor
00108  * any of its subsidiaries will export/re-export any technical data, process,
00109  * software, or service, directly or indirectly, to any country for which the
00110  * United States government or any agency thereof requires an export license,
00111  * other governmental approval, or letter of assurance, without first obtaining
00112  * such license, approval or letter.
00113  *
00114  *****************************************************************************/
00115 
00116 #ifndef __ACLINUX_H__
00117 #define __ACLINUX_H__
00118 
00119 /* Common (in-kernel/user-space) ACPICA configuration */
00120 
00121 #define ACPI_USE_SYSTEM_CLIBRARY
00122 #define ACPI_USE_DO_WHILE_0
00123 #define ACPI_MUTEX_TYPE             ACPI_BINARY_SEMAPHORE
00124 
00125 
00126 #ifdef __KERNEL__
00127 
00128 #include <linux/string.h>
00129 #include <linux/kernel.h>
00130 #include <linux/module.h>
00131 #include <linux/ctype.h>
00132 #include <linux/sched.h>
00133 #include <asm/system.h>
00134 #include <asm/atomic.h>
00135 #include <asm/div64.h>
00136 #include <asm/acpi.h>
00137 #include <linux/slab.h>
00138 #include <linux/spinlock_types.h>
00139 #include <asm/current.h>
00140 
00141 /* Host-dependent types and defines for in-kernel ACPICA */
00142 
00143 #define ACPI_MACHINE_WIDTH          BITS_PER_LONG
00144 #define ACPI_EXPORT_SYMBOL(symbol)  EXPORT_SYMBOL(symbol);
00145 #define strtoul                     simple_strtoul
00146 
00147 #define ACPI_CACHE_T                struct kmem_cache
00148 #define ACPI_SPINLOCK               spinlock_t *
00149 #define ACPI_CPU_FLAGS              unsigned long
00150 
00151 #else /* !__KERNEL__ */
00152 
00153 #include <stdarg.h>
00154 #include <string.h>
00155 #include <stdlib.h>
00156 #include <ctype.h>
00157 #include <unistd.h>
00158 
00159 /* Host-dependent types and defines for user-space ACPICA */
00160 
00161 #define ACPI_FLUSH_CPU_CACHE()
00162 
00163 #if defined(__ia64__) || defined(__x86_64__)
00164 #define ACPI_MACHINE_WIDTH          64
00165 #define COMPILER_DEPENDENT_INT64    long
00166 #define COMPILER_DEPENDENT_UINT64   unsigned long
00167 #define ACPI_CAST_PTHREAD_T(pthread) ((ACPI_THREAD_ID) (pthread))
00168 #else
00169 #define ACPI_MACHINE_WIDTH          32
00170 #define COMPILER_DEPENDENT_INT64    long long
00171 #define COMPILER_DEPENDENT_UINT64   unsigned long long
00172 #define ACPI_USE_NATIVE_DIVIDE
00173 #define ACPI_CAST_PTHREAD_T(pthread) ((ACPI_THREAD_ID) (UINT32) (void *) (pthread))
00174 #endif
00175 
00176 #ifndef __cdecl
00177 #define __cdecl
00178 #endif
00179 
00180 #endif /* __KERNEL__ */
00181 
00182 /* Linux uses GCC */
00183 
00184 #include "acgcc.h"
00185 
00186 
00187 #ifdef __KERNEL__
00188 /*
00189  * Overrides for in-kernel ACPICA
00190  */
00191 static inline acpi_thread_id acpi_os_get_thread_id(void)
00192 {
00193     return current;
00194 }
00195 
00196 /*
00197  * The irqs_disabled() check is for resume from RAM.
00198  * Interrupts are off during resume, just like they are for boot.
00199  * However, boot has  (system_state != SYSTEM_RUNNING)
00200  * to quiet __might_sleep() in kmalloc() and resume does not.
00201  */
00202 #include <acpi/actypes.h>
00203 static inline void *acpi_os_allocate(acpi_size size)
00204 {
00205     return kmalloc(size, irqs_disabled() ? GFP_ATOMIC : GFP_KERNEL);
00206 }
00207 
00208 static inline void *acpi_os_allocate_zeroed(acpi_size size)
00209 {
00210     return kzalloc(size, irqs_disabled() ? GFP_ATOMIC : GFP_KERNEL);
00211 }
00212 
00213 static inline void *acpi_os_acquire_object(acpi_cache_t * cache)
00214 {
00215     return kmem_cache_zalloc(cache,
00216         irqs_disabled() ? GFP_ATOMIC : GFP_KERNEL);
00217 }
00218 
00219 #define ACPI_ALLOCATE(a)        acpi_os_allocate(a)
00220 #define ACPI_ALLOCATE_ZEROED(a) acpi_os_allocate_zeroed(a)
00221 #define ACPI_FREE(a)            kfree(a)
00222 
00223 /* Used within ACPICA to show where it is safe to preempt execution */
00224 
00225 #define ACPI_PREEMPTION_POINT() \
00226     do { \
00227         if (!irqs_disabled()) \
00228             cond_resched(); \
00229     } while (0)
00230 
00231 #endif /* __KERNEL__ */
00232 
00233 #endif /* __ACLINUX_H__ */

Generated on Sat May 26 2012 04:25:53 for ReactOS by doxygen 1.7.6.1

ReactOS is a registered trademark or a trademark of ReactOS Foundation in the United States and other countries.