00001 00008 /* 00009 * The contents of this file are subject to the Mozilla Public License 00010 * Version 1.0 (the "License"); you may not use this file except in 00011 * compliance with the License. You may obtain a copy of the License 00012 * at http://www.mozilla.org/MPL/ 00013 * 00014 * Software distributed under the License is distributed on an "AS IS" 00015 * basis, WITHOUT WARRANTY OF ANY KIND, either express or implied. See 00016 * the License for the specific language governing rights and 00017 * limitations under the License. 00018 * 00019 * The Original Code is legOS code, released October 17, 1999. 00020 * 00021 * The Initial Developer of the Original Code is Markus L. Noga. 00022 * Portions created by Markus L. Noga are Copyright (C) 1999 00023 * Markus L. Noga. All Rights Reserved. 00024 * 00025 * Contributor(s): Joseph A. Woolley <jawoolley@users.sourceforge.net> 00026 */ 00027 00028 #if !defined(__sys_critsec_h__) 00029 #define __sys_critsec_h__ 00030 00031 #if defined(__cplusplus) 00032 extern "C" { 00033 #endif // __cplusplus 00034 00035 #include <config.h> 00036 #include <atomic.h> 00037 00038 #if defined(CONF_TM) 00039 extern atomic_t kernel_critsec_count; 00040 #define INITIALIZE_KERNEL_CRITICAL_SECTION() kernel_critsec_count=0 00041 #define ENTER_KERNEL_CRITICAL_SECTION() atomic_inc(&kernel_critsec_count) 00042 #define LEAVE_KERNEL_CRITICAL_SECTION() atomic_dec(&kernel_critsec_count) 00043 #define DESTROY_KERNEL_CRITICAL_SECTION() 00044 #else // CONF_TM 00045 #define INITIALIZE_KERNEL_CRITICAL_SECTION() 00046 #define ENTER_KERNEL_CRITICAL_SECTION() 00047 #define LEAVE_KERNEL_CRITICAL_SECTION() 00048 #define DESTROY_KERNEL_CRITICAL_SECTION() 00049 #endif // CONF_TM 00050 00051 #if defined(__cplusplus) 00052 } 00053 #endif // __cplusplus 00054 00055 #endif // __sys_critsec_h__ 00056
brickOS is released under the
Mozilla Public License.
Original code copyright 1998-2002 by the authors. |