1 /*---------------------------------------------------------------------------*
2   Project:  Horizon
3   File:     init_StartUp.cpp
4 
5   Copyright (C)2009 Nintendo Co., Ltd.  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   $Rev: 27849 $
14  *---------------------------------------------------------------------------*/
15 
16 //---------------------------------------------------------------------------
17 
18 #include <nn/config.h>
19 #include <nn/init.h>
20 #include <nn/os/os_Initialize.h>
21 
22 #define NN_SYSTEM_DEFAULT_HEAP_SIZE     0x00800000
23 
24 extern "C" nninitStaticInitFunc Image$$STATIC_INIT$$RO$$Base[];
25 extern "C" nninitStaticInitFunc Image$$STATIC_INIT$$RO$$Limit[];
26 
27 #if NN_PLATFORM_HAS_MMU
28 #include <nn/applet/CTR/applet_API.h>
29 namespace nn {
30 namespace applet {
31 namespace CTR {
32 namespace detail {
33     // libnn_applet.a をリンクしていない場合はこちらが nninitSetup() で使用されます
Initialize(AppletAttr appletAttr)34     __declspec(noinline) Result Initialize( AppletAttr appletAttr )
35     {
36         return ResultSuccess();
37     }
38 }}}}
39 #endif
40 
nninitSystem(void)41 extern "C" NN_WEAK_SYMBOL void nninitSystem(void)
42 {
43     // OS ライブラリの初期化
44     nn::os::Initialize();
45 }
46 
nninitStartUp(void)47 extern "C" NN_WEAK_SYMBOL void nninitStartUp(void)
48 {
49     nninitStartUpDefault();
50 }
51 
nninitCallStaticInitializers(void)52 extern "C" void nninitCallStaticInitializers(void)
53 {
54     for( nninitStaticInitFunc* f = Image$$STATIC_INIT$$RO$$Base;
55          f < Image$$STATIC_INIT$$RO$$Limit;
56          ++f )
57     {
58         (*f)();
59     }
60 }
61 
nninitSetup(void)62 extern "C" NN_WEAK_SYMBOL void nninitSetup(void)
63 {
64     nninitSetupDefault();
65 
66 #if NN_PLATFORM_HAS_MMU
67     nn::applet::CTR::detail::Initialize();
68 #endif
69 }
70 
71