Loading...
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 | /* * * Copyright (C) Eicon Technology Corporation, 2000. * * This source file is supplied for the exclusive use with Eicon * Technology Corporation's range of DIVA Server Adapters. * * Eicon File Revision : 1.2 * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by * the Free Software Foundation; either version 2, or (at your option) * any later version. * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY OF ANY KIND WHATSOEVER INCLUDING ANY * implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. * See the GNU General Public License for more details. * * You should have received a copy of the GNU General Public License * along with this program; if not, write to the Free Software * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. * */ /* Environment provided by system and miscellaneous definitions */ #if !defined(SYS_H) #define SYS_H /* abreviations for unsigned types */ typedef int boolean_t; typedef unsigned char byte; typedef unsigned long dword; typedef unsigned short word; /* abreviations for volatile types */ typedef volatile byte vbyte; typedef volatile word vword; typedef volatile dword vdword; /* Booleans */ #if !defined(TRUE) #define TRUE (1) #define FALSE (0) #endif /* NULL pointer */ #if !defined(NULL) #define NULL ((void *) 0) #endif /* MIN and MAX */ #if !defined(MIN) #define MIN(a,b) ((a)>(b) ? (b) : (a)) #endif #if !defined(MAX) #define MAX(a,b) ((a)>(b) ? (a) : (b)) #endif /* Return the dimension of an array */ #if !defined(DIM) #define DIM(array) (sizeof (array)/sizeof ((array)[0])) #endif /* * Return the number of milliseconds since last boot */ extern dword UxTimeGet(void); extern void DivasSprintf(char *buffer, char *format, ...); extern void DivasPrintf(char *format, ...); /* fatal errors, asserts and tracing */ void HwFatalErrorFrom(char *file, int line); void HwFatalError(void); /* void HwAssert(char *file, int line, char *condition); */ #include <linux/kernel.h> #define _PRINTK printk #define _PRINTF DivasPrintf void _PRINTF(char *format, ...); #define PRINTF(arg_list) _PRINTF arg_list #if defined DTRACE # define DPRINTF(arg_list) _PRINTF arg_list # define KDPRINTF(arg_list) _PRINTF arg_list ; _PRINTK arg_list ; _PRINTK("\n"); #else # define DPRINTF(arg_list) (void)0 # define KDPRINTF(arg_list) _PRINTK arg_list ; _PRINTK("\n"); #endif #if !defined(ASSERT) #if defined DEBUG || defined DBG # define HwFatalError() HwFatalErrorFrom(__FILE__, __LINE__) # define ASSERT(cond) \ if (!(cond)) \ { \ /* HwAssert(__FILE__, __LINE__, #cond);*/ \ } #else # define ASSERT(cond) ((void)0) #endif #endif /* !defined(ASSERT) */ #define TRACE (_PRINTF(__FILE__"@%d\n", __LINE__)) #endif /* SYS_H */ |