1/*
2  This software is available to you under a choice of one of two
3  licenses.  You may choose to be licensed under the terms of the GNU
4  General Public License (GPL) Version 2, available at
5  <http://www.fsf.org/copyleft/gpl.html>, or the OpenIB.org BSD
6  license, available in the LICENSE.TXT file accompanying this
7  software.  These details are also available at
8  <http://openib.org/license.html>.
9
10  THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
11  EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
12  MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
13  NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS
14  BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN
15  ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
16  CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
17  SOFTWARE.
18
19  Copyright (c) 2004 Mellanox Technologies Ltd.  All rights reserved.
20*/
21
22#ifndef H_MEMTRACK_H
23#define H_MEMTRACK_H
24
25typedef enum {
26        MEMTRACK_KMALLOC,
27        MEMTRACK_VMALLOC,
28        MEMTRACK_KMEM_OBJ,
29        MEMTRACK_NUM_OF_MEMTYPES
30} memtrack_memtype_t;
31
32/* Invoke on memory allocation */
33void memtrack_alloc(memtrack_memtype_t memtype, unsigned long addr,
34                    unsigned long size, const char *filename,
35                    const unsigned long line_num, int alloc_flags);
36
37/* Invoke on memory free */
38void memtrack_free(memtrack_memtype_t memtype, unsigned long addr,
39                   const char *filename, const unsigned long line_num);
40
41/* Report current allocations status (for all memory types) */
42/* we do not export this function since it is used by cleanup_module only */
43/* void memtrack_report(void); */
44
45#endif
46