]> git.karo-electronics.de Git - karo-tx-redboot.git/blob - packages/net/bsd_tcpip/v2_0/include/sys/malloc.h
Initial revision
[karo-tx-redboot.git] / packages / net / bsd_tcpip / v2_0 / include / sys / malloc.h
1 //==========================================================================
2 //
3 //      include/sys/malloc.h
4 //
5 //==========================================================================
6 //####BSDCOPYRIGHTBEGIN####
7 //
8 // -------------------------------------------
9 //
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.
13 //
14 // Portions created by Red Hat are
15 // Copyright (C) 2002 Red Hat, Inc. All Rights Reserved.
16 //
17 // -------------------------------------------
18 //
19 //####BSDCOPYRIGHTEND####
20 //==========================================================================
21
22 #ifndef _SYS_MALLOC_H_
23 #define _SYS_MALLOC_H_
24
25 #ifndef _KERNEL
26 #warn This file is only suitable for kernel level code in a network stack!
27 #endif
28
29 /*
30  * flags to malloc
31  */
32 #define M_WAITOK        0x0000
33 #define M_NOWAIT        0x0001
34 #define M_ZERO          0x0008    // bzero (clear) allocated area
35
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)
43
44 // Memory types
45 #define M_DEVBUF        3
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 */
52 #define M_SONAME        98
53 #define M_IPMOPTS       97
54 #define M_TSEGQ         96
55 #define M_ACCF          95      /* accept filter data */
56 #define M_TEMP          94      /* misc temp buffers */
57 #define M_IPFLOW        93
58 #define M_NETADDR       92
59 #define M_IP6OPT        91
60 #define M_IP6NDP        90
61 #define M_MRTABLE       89
62 #define M_FTABLE        88
63 #define M_SYSCTLOID    100     
64 #define M_SYSCTL       101     
65 #define M_SECA         102
66
67 #endif // _SYS_MALLOC_H_