A method for transferring data between a host processor and a peripheral processor using a virtual FIFO peripheral interface, said virtual FIFO peripheral interface including at least one virtual FIFO data structure for storing data and a control addresses block associated with said at least one virtual FIFO data structure, wherein said control addresses block contains start and end address pointers indicating the location of data stored within said at least one virtual FIFO data structure, said method comprising the steps of:
- (1) initializing said start and end address pointers;
- (2) selecting one of said at least one virtual FIFO data structures;
- (3) storing data in said selected virtual FIFO data structure at a beginning indicated by said start address pointer and changing an end address pointer located in said control addresses block associated with said selected virtual FIFO data structure to indicate the end of said data after said storing;
- (4) transferring a block of data, beginning at said start address pointer, from said selected virtual FIFO data structure into a hardware FIFO and changing said start address pointer to indicate data after said block of data which has not yet been transferred to said hardware FIFO;
- (5) transferring at least a portion of said block of data from said hardware FIFO for use by a peripheral;
- (6) tracking the memory location of unused data in said data block remaining in said hardware FIFO which has not been transferred for use by the peripheral in said transferring step (5), including keeping an unused data start pointer for determining the memory location of unused data items remaining in a said hardware FIFO while said portion of said block of data is transferred from said hardware FIFO to the peripheral;
- and
- (7) updating a start address pointer based on the value of said unused data start pointer at the time of a context switch.