1219820Sjeff/* 2219820Sjeff This software is available to you under a choice of one of two 3219820Sjeff licenses. You may choose to be licensed under the terms of the GNU 4219820Sjeff General Public License (GPL) Version 2, available at 5219820Sjeff <http://www.fsf.org/copyleft/gpl.html>, or the OpenIB.org BSD 6219820Sjeff license, available in the LICENSE.TXT file accompanying this 7219820Sjeff software. These details are also available at 8219820Sjeff <http://openib.org/license.html>. 9219820Sjeff 10219820Sjeff THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, 11219820Sjeff EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF 12219820Sjeff MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND 13219820Sjeff NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS 14219820Sjeff BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN 15219820Sjeff ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN 16219820Sjeff CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE 17219820Sjeff SOFTWARE. 18219820Sjeff 19219820Sjeff Copyright (c) 2004 Mellanox Technologies Ltd. All rights reserved. 20219820Sjeff*/ 21219820Sjeff 22219820Sjeff#ifndef H_MEMTRACK_H 23219820Sjeff#define H_MEMTRACK_H 24219820Sjeff 25219820Sjefftypedef enum { 26219820Sjeff MEMTRACK_KMALLOC, 27219820Sjeff MEMTRACK_VMALLOC, 28219820Sjeff MEMTRACK_KMEM_OBJ, 29219820Sjeff MEMTRACK_NUM_OF_MEMTYPES 30219820Sjeff} memtrack_memtype_t; 31219820Sjeff 32219820Sjeff/* Invoke on memory allocation */ 33219820Sjeffvoid memtrack_alloc(memtrack_memtype_t memtype, unsigned long addr, 34219820Sjeff unsigned long size, const char *filename, 35219820Sjeff const unsigned long line_num, int alloc_flags); 36219820Sjeff 37219820Sjeff/* Invoke on memory free */ 38219820Sjeffvoid memtrack_free(memtrack_memtype_t memtype, unsigned long addr, 39219820Sjeff const char *filename, const unsigned long line_num); 40219820Sjeff 41219820Sjeff/* Report current allocations status (for all memory types) */ 42219820Sjeff/* we do not export this function since it is used by cleanup_module only */ 43219820Sjeff/* void memtrack_report(void); */ 44219820Sjeff 45219820Sjeff#endif 46