1 //==========================================================================
3 // include/sys/malloc.h
5 //==========================================================================
6 //####BSDCOPYRIGHTBEGIN####
8 // -------------------------------------------
10 // Portions of this software may have been derived from OpenBSD,
11 // FreeBSD or other sources, and are covered by the appropriate
12 // copyright disclaimers included herein.
14 // Portions created by Red Hat are
15 // Copyright (C) 2002 Red Hat, Inc. All Rights Reserved.
17 // -------------------------------------------
19 //####BSDCOPYRIGHTEND####
20 //==========================================================================
22 #ifndef _SYS_MALLOC_H_
23 #define _SYS_MALLOC_H_
26 #warn This file is only suitable for kernel level code in a network stack!
32 #define M_WAITOK 0x0000
33 #define M_NOWAIT 0x0001
34 #define M_ZERO 0x0008 // bzero (clear) allocated area
36 externC void *cyg_net_malloc(u_long size, int type, int flags);
37 externC void cyg_net_free(caddr_t addr, int type);
38 #define MALLOC(space, cast, size, type, flags) \
39 (space) = (cast)cyg_net_malloc((u_long)(size), (int)type, flags)
40 #define malloc(size, type, flags) cyg_net_malloc((u_long)size, (int)type, flags)
41 #define FREE(addr, type) cyg_net_free((caddr_t)(addr), (int)type)
42 #define free(addr, type) FREE(addr, (int)type)
46 #define M_PCB (void *)4 /* protocol control block */
47 #define M_RTABLE 5 /* routing tables */
48 #define M_IFADDR 9 /* interface address */
49 #define M_IFMADDR 55 /* link-level multicast address */
50 #define M_IPMADDR 66 /* link-level multicast address */
51 #define M_IGMP 99 /* gateway info */
55 #define M_ACCF 95 /* accept filter data */
56 #define M_TEMP 94 /* misc temp buffers */
63 #define M_SYSCTLOID 100
67 #endif // _SYS_MALLOC_H_