clean up AC'97 functions
rinusser opened this issue · 0 comments
rinusser commented
Currently the AC'97 audio output works but the code could be improved:
- the command-line sample rate isn't being validated thoroughly, currently it only checks for any unsigned integer below 2^16-1. See if that can be improved, maybe check for multiples of 11025 and 12000.
- init_buffers() currently both accepts a buffer count in the arguments list and has the number 32 hard-coded. This seems wrong: AC'97 requires 32 buffers either way, might as well use a #define.
- the allocated buffer memory currently isn't being limited to 32 bits. The buffer memory needs to fit into a 32 bit address for the PCI DMA. Use the UEFI memory page allocation mode that enforces an upper boundary, probably restrict the audio buffer to
2^32-bufsize
.