(file) Return to emlog.h CVS log (file) Jump to this file's LXR Page (dir) Up to [CENS] / misc / emlog

 1 jelson 1.1 /*
 2             * EMLOG: the EMbedded-device LOGger
 3             *
 4             * Jeremy Elson
 5             * USC/ISI
 6             *
 7 jelson 1.4  * $Id: emlog.h,v 1.3 2001/03/01 09:27:47 jelson Exp $
 8 jelson 1.1  */
 9            
10            #define EMLOG_MAJOR_NUMBER   241
11            #define EMLOG_MAX_SIZE       128 /* max size in kilobytes of a buffer */
12            
13            
14            /************************ Private Definitions *****************************/
15            
16            struct emlog_info {
17 jelson 1.2 
18            #if defined(DECLARE_WAIT_QUEUE_HEAD)
19              wait_queue_head_t read_q;
20            #else
21 jelson 1.3   struct wait_queue *read_q;
22 jelson 1.2 #endif
23 jelson 1.1   
24 jelson 1.4   unsigned long i_ino;		/* Inode number of this emlog buffer */
25              char *data;			/* The circular buffer data */
26              int size;			/* Size of the buffer pointed to by 'data' */
27              int refcount;			/* Files that have this buffer open */
28              int read_point;		/* Offset in circ. buffer of oldest data */
29              int write_point;		/* Offset in circ. buffer of newest data */
30              int offset;			/* Byte number of read_point in the stream */
31 jelson 1.1   struct emlog_info *next;
32            };
33            
34 jelson 1.4 
35            /* amount of data in the queue */
36            #define EMLOG_QLEN(einfo) ( (einfo)->write_point >= (einfo)->read_point ? \
37 jelson 1.1          (einfo)->write_point - (einfo)->read_point : \
38                     (einfo)->size - (einfo)->read_point + (einfo)->write_point)
39            			
40 jelson 1.4 #define EMLOG_EMPTY(einfo) (((einfo)->read_point) == ((einfo)->write_point))
41 jelson 1.2 #define EMLOG_READQ(einfo) (&((einfo)->read_q))
42 jelson 1.1 

CENS CVS Mailing List
Powered by
ViewCVS 0.9.2