-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathmemalloc.h
80 lines (72 loc) · 2.53 KB
/
memalloc.h
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
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
/*
* Memalloc, encoder memory allocation driver (kernel module headers)
*
* Copyright (C) 2009 Hantro Products Oy.
*
* This program is free software; you can redistribute it and/or
* modify it under the terms of the GNU General Public License
* as published by the Free Software Foundation; either version 2
* of the License, or (at your option) any later version.
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program; if not, write to the Free Software
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
*
--------------------------------------------------------------------------------
--
-- Abstract :
--
--------------------------------------------------------------------------------
--
-- Version control information, please leave untouched.
--
-- $RCSfile: memalloc.h,v $
-- $Date: 2009/12/22 12:20:20 $
-- $Revision: 1.1 $
--
------------------------------------------------------------------------------*/
#ifndef _HMP4ENC_H_
#define _HMP4ENC_H_
#include <linux/ioctl.h> /* needed for the _IOW etc stuff used later */
/*
* Macros to help debugging
*/
#undef PDEBUG /* undef it, just in case */
#ifdef MEMALLOC_DEBUG
# ifdef __KERNEL__
/* This one if debugging is on, and kernel space */
# define PDEBUG(fmt, args...) printk( KERN_INFO "memalloc: " fmt, ## args)
# else
/* This one for user space */
# define PDEBUG(fmt, args...) fprintf(stderr, fmt, ## args)
# endif
#else
# define PDEBUG(fmt, args...) /* not debugging: nothing */
#endif
/*
* Ioctl definitions
*/
/* Use 'k' as magic number */
#define MEMALLOC_IOC_MAGIC 'k'
/*
* S means "Set" through a ptr,
* T means "Tell" directly with the argument value
* G means "Get": reply by setting through a pointer
* Q means "Query": response is on the return value
* X means "eXchange": G and S atomically
* H means "sHift": T and Q atomically
*/
#define MEMALLOC_IOCXGETBUFFER _IOWR(MEMALLOC_IOC_MAGIC, 1, unsigned long)
#define MEMALLOC_IOCSFREEBUFFER _IOW(MEMALLOC_IOC_MAGIC, 2, unsigned long)
/* ... more to come */
#define MEMALLOC_IOCHARDRESET _IO(MEMALLOC_IOC_MAGIC, 15) /* debugging tool */
#define MEMALLOC_IOC_MAXNR 15
typedef struct {
unsigned busAddress;
unsigned size;
}MemallocParams;
#endif /* _HMP4ENC_H_ */