Skip to contentSkip to conversation

[Fwd: Re: Allocating a cache-safe buffer for DMA devices and drivers]

Fwd: Re: Allocating a cache-safe buffer for DMA devices and drivers Xavier Grave 1 participant 1 message Aug 29, 2005

lore
Share & tools
lore
#0 lore raw

Sorry, forgot to cc...

Hi,

Something like that maybe :

virtual_ad = (unsigned long *) kmalloc(sizeof(long)*taille_dma,

                                         GFP_KERNEL|GFP_DMA|GFP_ATOMIC);

O+ xavier

Quoted 27 lines · Garcia Jérémie

Hi everybody, I have to port a vxWorks appz to Linux Montavista running on a powerPC 405EP based architecture. In this one, we use the following vxWorks system call: cacheDmaMalloc( ) whose man page is :

NAME
cacheDmaMalloc( ) - allocate a cache-safe buffer for DMA devices and drivers

SYNOPSIS
void * cacheDmaMalloc

    (
    size_t bytes              /* number of bytes to allocate */
    )

DESCRIPTION
This routine returns a pointer to a section of memory that will not experience any cache coherency problems. Function pointers in the CACHE_FUNCS structure provide access to DMA support routines.

RETURNS
A pointer to the cache-safe buffer, or NULL.

I need to handle the given amount of memory from the user space.
So could anyone told how to achieve the same goal on Linux with these constraints?

Tks a lot for your precious help!
_______________________________________________
Linuxppc-dev mailing list
[email protected]
https://ozlabs.org/mailman/listinfo/linuxppc-dev