OpenCores
URL https://opencores.org/ocsvn/pcie_ds_dma/pcie_ds_dma/trunk

Subversion Repositories pcie_ds_dma

[/] [pcie_ds_dma/] [trunk/] [soft/] [linux/] [driver/] [pexdrv/] [memory.h] - Blame information for rev 33

Go to most recent revision | Details | Compare with Previous | View Log

Line No. Rev Author Line
1 7 v.karak
 
2
#ifndef _MEMORY_H_
3
#define _MEMORY_H_
4
 
5
//-----------------------------------------------------------------------------
6
 
7
struct address_t {
8
 
9
    size_t physical_address;
10
    void  *virtual_address;
11
    size_t size;
12
 
13
};
14
 
15
//-----------------------------------------------------------------------------
16
 
17
struct mem_t {
18
 
19
    struct list_head list;
20
    dma_addr_t dma_handle;
21
    void  *cpu_addr;
22
    size_t size;
23
 
24
};
25
 
26
//-----------------------------------------------------------------------------
27
 
28
struct dma_channel {
29
    int                     m_Number;
30
    int                     m_Use;
31
    struct pci_dev         *m_pci;
32
    spinlock_t              m_MemListLock;
33
    atomic_t                m_MemListCount;
34
    struct list_head        m_MemList;
35
    struct mem_t            m_MemStub;
36
};
37
 
38
//-----------------------------------------------------------------------------
39
struct pex_device;
40
struct memory_block;
41
//-----------------------------------------------------------------------------
42
 
43
int lock_pages( void *va, u32 size );
44
int unlock_pages( void *va, u32 size );
45
void* allocate_memory_block(struct pex_device *brd, size_t block_size, dma_addr_t *dma_addr);
46
int free_memory_block(struct pex_device *brd, struct memory_block mb);
47
 
48
//--------------------------------------------------------------------
49
 
50
#endif //_MEMORY_H_

powered by: WebSVN 2.1.0

© copyright 1999-2024 OpenCores.org, equivalent to Oliscience, all rights reserved. OpenCores®, registered trademark.