1 /*---------------------------------------------------------------------------*
2   Project:     MEM library
3   File:        arena.h
4 
5   Copyright (C) 2010-2011 Nintendo. All Rights Reserved.
6 
7   These coded instructions, statements, and computer programs contain
8   proprietary information of Nintendo of America Inc. and/or Nintendo
9   Company Ltd., and are protected by Federal copyright law.  They may
10   not be disclosed to third parties or copied or duplicated in any form,
11   in whole or in part, without the prior written consent of Nintendo.
12  *---------------------------------------------------------------------------*/
13 
14 #ifndef _MEM_ARENA_H_INCLUDED_
15 #define _MEM_ARENA_H_INCLUDED_
16 
17 #include <cafe/mem/heapCommon.h>
18 
19 #ifdef __cplusplus
20 extern "C" {
21 #endif
22 
23 // These are logical not physical.  For flexibility, may not be a one-to-one
24 // mapping to physical devices such as MEM1/MEM2. For example, at OS-level
25 // we could split physical MEM2 into disjoint logical arenas to present to
26 // the application.
27 typedef enum MEMArena {
28     MEM_ARENA_1,            // MEM1
29     MEM_ARENA_2,            // MEM2
30     MEM_ARENA_3,
31     MEM_ARENA_4,
32     MEM_ARENA_5,
33     MEM_ARENA_6,
34     MEM_ARENA_7,
35     MEM_ARENA_8,
36     MEM_ARENA_FG,           // Foreground bucket
37     MEM_ARENA_MAX,
38     MEM_ARENA_INVALID       // invalid arena id
39 } MEMArena;
40 
41 // Private functions.  Remove from public later.
42 void          MEMInitArenaLibrary (void);
43 
44 // Public functions.
45 MEMHeapHandle MEMGetBaseHeapHandle (MEMArena arena);
46 MEMHeapHandle MEMSetBaseHeapHandle (MEMArena arena, MEMHeapHandle heap);
47 MEMArena      MEMGetArena (MEMHeapHandle heap);
48 
49 #ifdef __cplusplus
50 } /* extern "C" */
51 #endif
52 
53 #endif  /* _MEM_ARENA_H_INCLUDED_ */
54