[RPI BSP] zero length array in kernel and refactor of video char output
yangqiao0505 at me.com
Tue Jun 23 11:43:29 UTC 2015
As suggested by gedare, I think using zero length array to represent the mailbox buffer and tag data is a good way, much readable, clearer to abstract the structure of mailbox buffer, tag.
I've done an attemp, here is the scratch:
The construction of a buffer is then decomposed by the following procedure:
1. Calculate the total length of buffer
2. Allocate and inite the buffer
3. Pack the request data into buffer
4. send the buffer by mailbox, then read the responce
5. Unpack the responce data into variables
I've tested it in userspace it works well but in kernel space I cannot allocate the memory by malloc. Is there any alternative way to let us use zero length array in the kernel driver?
Secondly, since part of functions in outch is considered sharable between bsps. If my implementation is acceptable, I'll push the refactor code for review. Here is my implementation
Thanks in advance.
-------------- next part --------------
An HTML attachment was scrubbed...
More information about the devel