xref: /freebsd/sys/contrib/ncsw/etc/mem.h (revision 0aeed3e9)
10aeed3e9SJustin Hibbits /******************************************************************************
20aeed3e9SJustin Hibbits 
30aeed3e9SJustin Hibbits  � 1995-2003, 2004, 2005-2011 Freescale Semiconductor, Inc.
40aeed3e9SJustin Hibbits  All rights reserved.
50aeed3e9SJustin Hibbits 
60aeed3e9SJustin Hibbits  This is proprietary source code of Freescale Semiconductor Inc.,
70aeed3e9SJustin Hibbits  and its use is subject to the NetComm Device Drivers EULA.
80aeed3e9SJustin Hibbits  The copyright notice above does not evidence any actual or intended
90aeed3e9SJustin Hibbits  publication of such source code.
100aeed3e9SJustin Hibbits 
110aeed3e9SJustin Hibbits  ALTERNATIVELY, redistribution and use in source and binary forms, with
120aeed3e9SJustin Hibbits  or without modification, are permitted provided that the following
130aeed3e9SJustin Hibbits  conditions are met:
140aeed3e9SJustin Hibbits      * Redistributions of source code must retain the above copyright
150aeed3e9SJustin Hibbits        notice, this list of conditions and the following disclaimer.
160aeed3e9SJustin Hibbits      * Redistributions in binary form must reproduce the above copyright
170aeed3e9SJustin Hibbits        notice, this list of conditions and the following disclaimer in the
180aeed3e9SJustin Hibbits        documentation and/or other materials provided with the distribution.
190aeed3e9SJustin Hibbits      * Neither the name of Freescale Semiconductor nor the
200aeed3e9SJustin Hibbits        names of its contributors may be used to endorse or promote products
210aeed3e9SJustin Hibbits        derived from this software without specific prior written permission.
220aeed3e9SJustin Hibbits 
230aeed3e9SJustin Hibbits  THIS SOFTWARE IS PROVIDED BY Freescale Semiconductor ``AS IS'' AND ANY
240aeed3e9SJustin Hibbits  EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
250aeed3e9SJustin Hibbits  WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
260aeed3e9SJustin Hibbits  DISCLAIMED. IN NO EVENT SHALL Freescale Semiconductor BE LIABLE FOR ANY
270aeed3e9SJustin Hibbits  DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
280aeed3e9SJustin Hibbits  (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
290aeed3e9SJustin Hibbits  LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
300aeed3e9SJustin Hibbits  ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
310aeed3e9SJustin Hibbits  (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
320aeed3e9SJustin Hibbits  SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
330aeed3e9SJustin Hibbits  *
340aeed3e9SJustin Hibbits 
350aeed3e9SJustin Hibbits  **************************************************************************/
360aeed3e9SJustin Hibbits #ifndef __MEM_H
370aeed3e9SJustin Hibbits #define __MEM_H
380aeed3e9SJustin Hibbits 
390aeed3e9SJustin Hibbits #include "error_ext.h"
400aeed3e9SJustin Hibbits #include "std_ext.h"
410aeed3e9SJustin Hibbits #include "list_ext.h"
420aeed3e9SJustin Hibbits 
430aeed3e9SJustin Hibbits 
440aeed3e9SJustin Hibbits #define __ERR_MODULE__  MODULE_MEM
450aeed3e9SJustin Hibbits 
460aeed3e9SJustin Hibbits 
470aeed3e9SJustin Hibbits 
480aeed3e9SJustin Hibbits 
490aeed3e9SJustin Hibbits /**************************************************************************//**
500aeed3e9SJustin Hibbits  @Description   Memory allocation owner.
510aeed3e9SJustin Hibbits *//***************************************************************************/
520aeed3e9SJustin Hibbits typedef enum e_MemAllocOwner
530aeed3e9SJustin Hibbits {
540aeed3e9SJustin Hibbits     e_MEM_ALLOC_OWNER_LOCAL,
550aeed3e9SJustin Hibbits     e_MEM_ALLOC_OWNER_LOCAL_SMART,
560aeed3e9SJustin Hibbits     e_MEM_ALLOC_OWNER_EXTERNAL
570aeed3e9SJustin Hibbits } e_MemAllocOwner;
580aeed3e9SJustin Hibbits 
590aeed3e9SJustin Hibbits 
600aeed3e9SJustin Hibbits #ifdef DEBUG_MEM_LEAKS
610aeed3e9SJustin Hibbits 
620aeed3e9SJustin Hibbits /**************************************************************************//**
630aeed3e9SJustin Hibbits  @Description   MEM block information for leaks detection.
640aeed3e9SJustin Hibbits *//***************************************************************************/
650aeed3e9SJustin Hibbits typedef struct t_MemDbg
660aeed3e9SJustin Hibbits {
670aeed3e9SJustin Hibbits     uintptr_t   ownerAddress;
680aeed3e9SJustin Hibbits 
690aeed3e9SJustin Hibbits } t_MemDbg;
700aeed3e9SJustin Hibbits 
710aeed3e9SJustin Hibbits #endif /* DEBUG_MEM_LEAKS */
720aeed3e9SJustin Hibbits 
730aeed3e9SJustin Hibbits 
740aeed3e9SJustin Hibbits #endif /* __MEM_H */
75