Subversion Repositories Kolibri OS

Rev

Rev 1631 | Rev 6295 | Go to most recent revision | Show entire file | Regard whitespace | Details | Blame | Last modification | View Log | RSS feed

Rev 1631 Rev 5270
Line 22... Line 22...
22
 * keep a count of how many are currently allocated from each page.
22
 * keep a count of how many are currently allocated from each page.
23
 */
23
 */
Line 24... Line 24...
24
 
24
 
-
 
25
 
25
 
26
#include 
26
#include 
27
#include 
27
#include 
28
#include 
-
 
29
#include 
28
#include 
30
#include 
Line 29... Line 31...
29
#include 
31
#include 
30
#include 
32
#include 
Line 140... Line 142...
140
 
142
 
141
static struct dma_page *pool_alloc_page(struct dma_pool *pool)
143
static struct dma_page *pool_alloc_page(struct dma_pool *pool)
142
{
144
{
Line 143... Line 145...
143
    struct dma_page *page;
145
    struct dma_page *page;
144
 
146
 
145
    page = malloc(sizeof(*page));
147
    page = __builtin_malloc(sizeof(*page));
146
    if (!page)
148
    if (!page)
Line 147... Line 149...
147
        return NULL;
149
        return NULL;
Line 226... Line 228...
226
 * If such a memory block can't be allocated, %NULL is returned.
228
 * If such a memory block can't be allocated, %NULL is returned.
227
 */
229
 */
228
void *dma_pool_alloc(struct dma_pool *pool, gfp_t mem_flags,
230
void *dma_pool_alloc(struct dma_pool *pool, gfp_t mem_flags,
229
             dma_addr_t *handle)
231
             dma_addr_t *handle)
230
{
232
{
231
    u32_t   efl;
233
    u32   efl;
232
    struct  dma_page *page;
234
    struct  dma_page *page;
233
    size_t  offset;
235
    size_t  offset;
234
    void   *retval;
236
    void   *retval;
Line 235... Line 237...
235
 
237
 
Line 260... Line 262...
260
 
262
 
261
 
263
 
262
static struct dma_page *pool_find_page(struct dma_pool *pool, dma_addr_t dma)
264
static struct dma_page *pool_find_page(struct dma_pool *pool, dma_addr_t dma)
263
{
265
{
Line 264... Line 266...
264
    struct dma_page *page;
266
    struct dma_page *page;
Line 265... Line 267...
265
    u32_t  efl;
267
    u32  efl;
266
 
268
 
Line 292... Line 294...
292
{
294
{
293
    struct dma_page *page;
295
    struct dma_page *page;
294
    unsigned long flags;
296
    unsigned long flags;
295
    unsigned int offset;
297
    unsigned int offset;
Line 296... Line 298...
296
 
298
 
Line 297... Line 299...
297
    u32_t efl;
299
    u32 efl;
298
 
300
 
299
    page = pool_find_page(pool, dma);
301
    page = pool_find_page(pool, dma);
300
    if (!page) {
302
    if (!page) {