I had a driver for the linux kernel (2.6.18) in which I used kmalloc (sizeof (my_struct_t), GFP_ATOMIC) to allocate memory, which was later used to transfer data using the DMA controller on some device. Later I had to increase the size of my_struct. It got too big, so the kmalloc () code used a static statement and compiled the __you_cannot_kmalloc_that_much symbol to notify that the chunks of memory were too large to allocate. So I thought that I was declaring my_struct_t as a static variable and I would not allocate it at all.
I defined static my_struct_t my_struct;
but the DMA transaction did not work, and I received invalid DMA'd data in the buffer.
My question is: is it forbidden to use static (global) buffers for dma? And if so, where exactly in the kernel memory card do these buffers sit.
thanks
user206402
source
share