00001 /* kernelc.hpp 00002 * 00003 * Copyright (C) 2003 Sawtooth Consulting Ltd. 00004 * 00005 * This file is part of yaSSL. 00006 * 00007 * yaSSL is free software; you can redistribute it and/or modify 00008 * it under the terms of the GNU General Public License as published by 00009 * the Free Software Foundation; either version 2 of the License, or 00010 * (at your option) any later version. 00011 * 00012 * There are special exceptions to the terms and conditions of the GPL as it 00013 * is applied to yaSSL. View the full text of the exception in the file 00014 * FLOSS-EXCEPTIONS in the directory of this software distribution. 00015 * 00016 * yaSSL is distributed in the hope that it will be useful, 00017 * but WITHOUT ANY WARRANTY; without even the implied warranty of 00018 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 00019 * GNU General Public License for more details. 00020 * 00021 * You should have received a copy of the GNU General Public License 00022 * along with this program; if not, write to the Free Software 00023 * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA 00024 */ 00025 00026 /* kernelc.hpp provides support for C std lib when compiled in kernel mode 00027 */ 00028 00029 #ifndef TAOCRYPT_KERNELC_HPP 00030 #define TAOCRYPT_KERNELC_HPP 00031 00032 #include <linux/types.h> // get right size_t 00033 00034 // system functions that c++ doesn't like headers for 00035 00036 extern "C" void* memcpy(void*, const void*, size_t); 00037 extern "C" void* memset(void*, int, size_t); 00038 extern "C" void printk(char *fmt, ...); 00039 00040 #define KERN_ERR "<3>" /* error conditions */ 00041 00042 #if defined(NDEBUG) 00043 #define assert(p) ((void)0) 00044 #else 00045 #define assert(expr) \ 00046 if (!(expr)) { \ 00047 printk(KERN_ERR "Assertion failed! %s,%s,%s,line=%d\n", \ 00048 #expr,__FILE__,__FUNCTION__,__LINE__); } 00049 #endif 00050 00051 00052 00053 #endif // TAOCRYPT_KERNELC_HPP
1.4.7

