Initial cut of the open ath9k htc firmware.
[open-ath9k-htc-firmware.git] / target_firmware / magpie_fw_dev / target / adf / adf_os_mem_pvt.h
1 #ifndef ADF_OS_MEM_PVT_H
2 #define ADF_OS_MEM_PVT_H
3
4 #include "cmnos_api.h"
5 #include "Magpie_api.h"
6
7 static inline void *    __adf_os_mem_alloc(adf_os_size_t size)
8 {
9 //    return (malloc(size,M_DEVBUF,M_DONTWAIT | M_ZERO));
10     return A_ALLOCRAM(size);
11 }
12
13 static inline void              __adf_os_mem_free(void *buf)
14 {
15     //Should not be called in FW!
16     //free(buf,M_DEVBUF);
17 }
18
19 /* move a memory buffer */
20 static inline void              __adf_os_mem_copy(void *dst, void *src, adf_os_size_t size)
21 {
22     A_MEMCPY(dst,src,size);    
23 }
24
25 /* set a memory buffer */
26 static inline void
27 __adf_os_mem_set(void *buf, a_uint8_t b, adf_os_size_t size)
28 {
29         A_MEMSET(buf, b, size);
30 }
31 static inline void
32 __adf_os_mem_move(void *dst, void *src, adf_os_size_t size)
33 {
34         A_MEMMOVE(dst, src, size);
35 }
36 /* zero a memory buffer */
37 static inline void
38 __adf_os_mem_zero(void *buf, adf_os_size_t size)
39 {
40     A_MEMZERO(buf,size);
41 }
42 /* compare two memory buffers */
43 static inline int
44 __adf_os_mem_cmp(void *buf1, void *buf2, adf_os_size_t size)
45 {
46     return (A_MEMCMP (buf1, buf2, size) == 0) ? 0 : 1;
47 }
48 #endif