2 * Copyright (c) 2007 Atheros Communications, Inc. All rights reserved.
5 #ifndef __ALLOCRAM_API_H__
6 #define __ALLOCRAM_API_H__
8 /* API for Target-side startup-time RAM allocations */
12 * Initialize allocram, providing it with a block of RAM
13 * (an "arena") from which to allocate.
15 * If arena_start is 0, a default start -- the end of
16 * the application's text & data -- is used.
18 * If arena_sz is 0, a default size -- which uses most
19 * of physical RAM beyond arena_start -- is used.
21 * Return value is reserved for future use -- it's an arena handle.
23 void *(* cmnos_allocram_init)(void *arena_start, A_UINT32 arena_sz);
26 * Allocate nbytes of memory, returning a pointer to the start
27 * of the allocated block. Allocation size is rounded up to the
28 * nearest A_CACHE_LINE_SIZE and the returned address similarly
31 * There is no need to check the return value from this function.
32 * A failure to satisfy a RAM allocation request is treated as a
35 * Allocations are expected to occur only during startup; this
36 * API does not, for instance, guarantee atomicity with respect
37 * to allocations that might (foolishly) be attempted from
40 * The "which_arena" parameter is currently unused, and should
41 * be set to 0 -- only a single arena is currently supported.
43 void *(* cmnos_allocram)(void *which_arena, A_UINT32 nbytes);
45 void (* cmnos_allocram_debug)(void);
48 extern void allocram_module_install(struct allocram_api *api);
51 #endif /* __ALLOCRAM_API_H__ */