#131292 - masscat - Wed Jun 13, 2007 11:46 pm
I was reading the devkitpro mailing list and saw that wintermute was looking for a flexible fifo handler so that system and user code can share the ARM to ARM FIFO for message passing. So I thought I would implement something.
libfifohandler_20070613.tar.bz2
It is not complete (I have not implemented asynchronous send yet amongst other things) but demonstrates the idea.
A fifo message comprises a word (32bit) command followed by zero or more data bytes (padded to the next word if needed).
Command handlers are installed on the receive side. Each command handler has a mask and command value associated with it. When a command word is received each command handler is examined in turn. If the command word anded with the mask equals the command value then that handler is called. This masking allows some information to be passed along with the command (number of characters in the example application).
The command handlers can then read additional data bytes from the fifo using the library.
The tarball includes an example application that uses the fifo to pass up stdout and stderr output from the ARM7 to the ARM9 that then prints it to the screen.
libfifohandler_20070613.tar.bz2
It is not complete (I have not implemented asynchronous send yet amongst other things) but demonstrates the idea.
A fifo message comprises a word (32bit) command followed by zero or more data bytes (padded to the next word if needed).
Command handlers are installed on the receive side. Each command handler has a mask and command value associated with it. When a command word is received each command handler is examined in turn. If the command word anded with the mask equals the command value then that handler is called. This masking allows some information to be passed along with the command (number of characters in the example application).
The command handlers can then read additional data bytes from the fifo using the library.
The tarball includes an example application that uses the fifo to pass up stdout and stderr output from the ARM7 to the ARM9 that then prints it to the screen.