Fifo.h

00001 /*Fifo.h
00002 Kernel Fifo functions
00003 */
00004 #ifndef FIFO_H
00005 #define FIFO_H
00006 
00007 #include <GNU_defs.h>
00008 #include <stdlib.h>
00009 
00018 
00022 struct KFifo{
00023 volatile u8 *firstin;
00024 volatile u8 *lastin;
00025 void *top;
00026 void *bottom;
00027 volatile size_t mem_avail; 
00028 size_t size;
00029 int lock;
00030 //int executions;
00031 };
00032 
00033 typedef struct KFifo KFifo;
00034 
00035 #define FIFOEMPTY(fifo) (fifo->mem_avail==fifo->size)
00036 #define FIFOPRNTSTATS(fifo) {GENDEBUG("top = %d\r\n",(long)fifo->top);GENDEBUG("bottom = %d\r\n",(long)fifo->bottom); GENDEBUG("mem_avail = %d\r\n",(long)fifo->mem_avail);GENDEBUG("size = %d\r\n",(long)fifo->size);}
00037 
00038 
00046 int __attribute__((far))InitFifo(KFifo *Fifo, size_t size, u8 *array);
00047 
00048 
00054 int __attribute__((far))FifoPush(KFifo *Fifo, const char data);
00055 
00062 ssize_t __attribute__((far))FifoPushBlock(KFifo *Fifo, const char *buffer, size_t count);
00063 
00072 char __attribute__((far))FifoPull(KFifo *Fifo);
00073 
00080 ssize_t __attribute__((far))FifoPullBlock(KFifo *Fifo, char *buffer, size_t count);
00081 
00088 int __attribute__((far))DestroyFifo(KFifo *Fifo);
00089 
00092 #endif
00093 

Generated on Fri Mar 3 17:25:45 2006 for EMAC-HCS12-SDK by  doxygen 1.4.6