[RPI BSP] zero length array in kernel and refactor of video char output
QIAO YANG
yangqiao0505 at me.com
Tue Jun 23 11:43:29 UTC 2015
Hi,
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:
https://github.com/yangqiao/rtems/commit/3ed7e9bde493bdc8e644fcefa285d99255201ada
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
https://github.com/yangqiao/rtems/commit/858a9b091025acc4bfe912f41d70c9a73b99d773
Thanks in advance.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.rtems.org/pipermail/devel/attachments/20150623/a9484a5f/attachment.html>
More information about the devel
mailing list