2 * Copyright (C) 2001-2003 by NBMK Encryption Technologies.
5 * NBMK Encryption Technologies provides no support of any kind for
6 * this software. Questions or concerns about it may be addressed to
7 * the members of the relevant open-source community at
8 * <tech-crypto@netbsd.org>.
10 * Redistribution and use in source and binary forms, with or without
11 * modification, are permitted provided that the following conditions are
14 * 1. Redistributions of source code must retain the above copyright
15 * notice, this list of conditions and the following disclaimer.
17 * 2. Redistributions in binary form must reproduce the above
18 * copyright notice, this list of conditions and the following
19 * disclaimer in the documentation and/or other materials provided
20 * with the distribution.
22 * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
23 * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
24 * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
25 * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
26 * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
27 * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
28 * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
29 * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
30 * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
31 * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
32 * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
35 /*****************************************************************************
36 * @(#) n8_memory.h 1.10@(#)
37 *****************************************************************************/
38 /*****************************************************************************/
40 * @brief This file contains prototypes for kernel space memory allocation.
42 * This file provides a prototypes for function used to allocate and free
43 * memory blocks kernel space. The memory blocks are zero filled on allocation.
45 *****************************************************************************/
47 /*****************************************************************************
49 * 05/08/03 brr Modified user pools to take advantage of the support for
50 * multiple memory banks.
51 * 04/22/03 brr Removed redundant parameter from n8_FreeLargeAllocation.
52 * 04/21/03 brr Added support for multiple memory banks.
53 * 11/26/02 brr Updated prototypes for n8_memoryInit & n8_memoryRelease.
54 * 10/25/02 brr Clean up function prototypes & include files.
55 * 07/02/02 brr Added prototype for N8_QueryMemStatistics.
56 * 06/25/02 brr Rework user pool allocation to only mmap portion used by
57 * the individual process.
58 * 06/11/02 hml Added protos for N8_get/FreeLargeAllocation.
59 * 05/22/02 hml Added MemCtlList_t and MemBankCtl_t structures and
61 * 03/18/02 brr Add sessionID to allocation & free prototypes.
62 * 02/14/02 brr File created.
63 ****************************************************************************/
67 #include "n8_OS_intf.h"
68 #include "n8_manage_memory.h"
70 #define N8_ONE_MEGABYTE 1048576
71 #define N8_ONE_KILOBYTE 1024
80 /* The memory control structure for the basic pool */
81 extern MemBankCtl_t
*memBankCtl_gp
[];
83 void n8_memoryDebug(int enable
);
84 void n8_memoryDisplay(N8_MemoryType_t bank
);
85 void *n8_memoryInit (N8_MemoryType_t bank
,
87 unsigned long granularity
);
88 void n8_memoryRelease(N8_MemoryType_t bank
);
90 void n8_pfreeSessID (N8_MemoryType_t bank
,
91 unsigned long SessionID
);
93 unsigned long n8_GetLargeAllocation ( N8_MemoryType_t bankIndex
,
95 unsigned char debug
);
96 void n8_FreeLargeAllocation ( N8_MemoryType_t bankIndex
,
97 unsigned char debug
);
99 #endif /* N8_MEMORY_H */