blob: 0f106016e1f7172b96516e6293a96e93bf6f01a5 (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
|
/*
* OSKA Linux implementation -- memory allocation
*
* Copyright (C) 2007 Cambridge Silicon Radio Ltd.
*
* Refer to LICENSE.txt included with this source code for details on
* the license terms.
*/
#ifndef __OSKA_LINUX_ALLOC_H
#define __OSKA_LINUX_ALLOC_H
#include <linux/kernel.h>
#include <linux/slab.h>
#include <linux/vmalloc.h>
static inline void *os_alloc(size_t size)
{
return kzalloc(size, GFP_ATOMIC);
}
static inline void *os_alloc_nonzeroed(size_t size)
{
return kmalloc(size, GFP_KERNEL);
}
static inline void os_free(void *ptr)
{
kfree(ptr);
}
static inline void *os_alloc_big(size_t size)
{
return vmalloc(size);
}
static inline void os_free_big(void *ptr)
{
vfree(ptr);
}
#endif /* #ifndef __OSKA_LINUX_ALLOC_H */
|