1 /* -*- Mode: C; indent-tabs-mode: t; tab-width: 4 -*-
2 // ---------------------------------------------------------------------------
4 // Copyright (C) Stephanie Gawroriski <xer@multiphasicapps.net>
5 // ---------------------------------------------------------------------------
6 // SquirrelJME is under the Mozilla Public License Version 2.0.
7 // See license.mkd for licensing and copyright information.
8 // -------------------------------------------------------------------------*/
10 #include "sjme/nvm/rom.h"
11 #include "sjme/nvm/boot.h"
12 #include "sjme/nvm/allocSizeOf.h"
14 sjme_errorCode
sjme_alloc_sizeOf(
15 sjme_alloc_sizeOfId id
, sjme_jint count
,
19 return SJME_ERROR_NULL_ARGUMENTS
;
21 if (id
<= SJME_ALLOC_SIZEOF_UNKNOWN
|| id
>= SJME_NUM_ALLOC_TYPE_SIZEOF
)
22 return SJME_ERROR_INVALID_ARGUMENT
;
27 case SJME_ALLOC_SIZEOF_ROM_SUITE_FUNCTIONS
:
28 *outSize
= sizeof(sjme_rom_suiteFunctions
);
31 case SJME_ALLOC_SIZEOF_RESERVED_POOL
:
35 case SJME_ALLOC_SIZEOF_NVM_BOOT_PARAM
:
36 *outSize
= sizeof(sjme_nvm_bootParam
);
39 case SJME_ALLOC_SIZEOF_POINTER
:
40 *outSize
= sizeof(sjme_pointer
);
43 #if defined(SJME_CONFIG_HAS_LITTLE_ENDIAN)
44 case SJME_ALLOC_SIZEOF_IS_LITTLE_ENDIAN
:
48 case SJME_ALLOC_SIZEOF_IS_BIG_ENDIAN
:
51 #elif defined(SJME_CONFIG_HAS_BIG_ENDIAN)
52 case SJME_ALLOC_SIZEOF_IS_LITTLE_ENDIAN
:
56 case SJME_ALLOC_SIZEOF_IS_BIG_ENDIAN
:
62 return SJME_ERROR_INVALID_ARGUMENT
;
66 return SJME_ERROR_NONE
;