[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [MiNT] USB buffers cache line size aligned
Obviously stack space on our Atari's is limited. So it's probably preferable
to move to a malloc solution for large allocations.
I think small allocations should be ok to stay coming off the stack.
Alan.
On 16/11/14 11:08, David Gálvez wrote:
> Hi,
>
> in USB sources most of the buffers to transfer data between main
> memory and USB host controllers are placed in the stack, this is
> heritage from U-Boot, they prefer it like this because in some booting
> systems some drivers could be used before malloc is available. Those
> buffers should be cache line size aligned just in case the transfer
> between memory and the host controllers is a DMA operation. Right now
> USB MiNT sources doesn't take care of this. We have two choices to fix
> this:
>
> 1) Allocate the buffers with kmalloc as we don't have the U-Boot
> problem regarding the booting systems.
>
> 2) Keep those buffers in the stack and make them aligned with a macro
> imported from U-boot.
>
> Any opinion about what method you preferred?
>
>