File tree Expand file tree Collapse file tree 6 files changed +34
-18
lines changed
nanoFramework.Runtime.Native Expand file tree Collapse file tree 6 files changed +34
-18
lines changed Original file line number Diff line number Diff line change @@ -294,19 +294,25 @@ HRESULT CLR_RT_ExecutionEngine::StartHardware()
294
294
NANOCLR_NOCLEANUP ();
295
295
}
296
296
297
- void CLR_RT_ExecutionEngine::Reboot (bool fHard )
297
+ void CLR_RT_ExecutionEngine::Reboot (uint16_t rebootOptions )
298
298
{
299
299
NATIVE_PROFILE_CLR_CORE ();
300
300
301
- if (fHard )
301
+ if (CLR_DBG_Commands::Monitor_Reboot::c_EnterNanoBooter ==
302
+ (rebootOptions & CLR_DBG_Commands::Monitor_Reboot::c_EnterNanoBooter))
302
303
{
303
- ::CPU_Reset ( );
304
+ RequestToLaunchNanoBooter ( 0 );
304
305
}
305
- else
306
+ else if (
307
+ CLR_DBG_Commands::Monitor_Reboot::c_EnterProprietaryBooter ==
308
+ (rebootOptions & CLR_DBG_Commands::Monitor_Reboot::c_EnterProprietaryBooter))
306
309
{
307
- CLR_EE_REBOOT_CLR;
308
- CLR_EE_DBG_SET (RebootPending);
310
+ RequestToLaunchProprietaryBootloader ();
309
311
}
312
+
313
+ // apply reboot options and set reboot pending flag
314
+ g_CLR_RT_ExecutionEngine.m_iReboot_Options = rebootOptions;
315
+ CLR_EE_DBG_SET (RebootPending);
310
316
}
311
317
312
318
CLR_INT64 CLR_RT_ExecutionEngine::GetUptime ()
Original file line number Diff line number Diff line change @@ -52,6 +52,7 @@ struct CLR_DBG_Commands
52
52
53
53
// ///////////////////////////////////////////////////////////////////////////////////////////////////////
54
54
// !!! KEEP IN SYNC WITH nanoFramework.Tools.Debugger.WireProtocol.RebootOptions (in managed code) !!! //
55
+ // !!! KEEP IN SYNC WITH nanoFramework.Runtime.Native.WireProtocol.RebootOption (in managed code) !!! //
55
56
// CONSTANTS VALUES NEED TO BE 'FLAG' TYPE //
56
57
// ///////////////////////////////////////////////////////////////////////////////////////////////////////
57
58
struct Monitor_Reboot
Original file line number Diff line number Diff line change @@ -3688,7 +3688,7 @@ struct CLR_RT_ExecutionEngine
3688
3688
3689
3689
HRESULT StartHardware ();
3690
3690
3691
- static void Reboot (bool fHard );
3691
+ static void Reboot (uint16_t rebootOptions );
3692
3692
3693
3693
void JoinAllThreadsAndExecuteFinalizer ();
3694
3694
Original file line number Diff line number Diff line change @@ -19,7 +19,7 @@ static const CLR_RT_MethodHandler method_lookup[] =
19
19
NULL ,
20
20
NULL ,
21
21
NULL ,
22
- Library_nf_rt_native_nanoFramework_Runtime_Native_Power::NativeReboot___STATIC__VOID ,
22
+ Library_nf_rt_native_nanoFramework_Runtime_Native_Power::NativeReboot___STATIC__VOID__nanoFrameworkRuntimeNativeRebootOption ,
23
23
NULL ,
24
24
NULL ,
25
25
NULL ,
@@ -42,9 +42,9 @@ static const CLR_RT_MethodHandler method_lookup[] =
42
42
const CLR_RT_NativeAssemblyData g_CLR_AssemblyNative_nanoFramework_Runtime_Native =
43
43
{
44
44
" nanoFramework.Runtime.Native" ,
45
- 0x109F6F22 ,
45
+ 0x0EAE898B ,
46
46
method_lookup,
47
- { 100 , 0 , 9 , 0 }
47
+ { 100 , 0 , 10 , 0 }
48
48
};
49
49
50
50
// clang-format on
Original file line number Diff line number Diff line change 10
10
#include <nanoCLR_Interop.h>
11
11
#include <nanoCLR_Runtime.h>
12
12
13
+ typedef enum __nfpack RebootOption
14
+ {
15
+ RebootOption_NormalReboot = 0 ,
16
+ RebootOption_EnterNanoBooter = 1 ,
17
+ RebootOption_ClrOnly = 2 ,
18
+ RebootOption_EnterProprietaryBooter = 8 ,
19
+ } RebootOption ;
20
+
13
21
typedef enum __nfpack SystemInfo_FloatingPoint
14
22
{
15
23
SystemInfo_FloatingPoint_None = 0 ,
@@ -38,7 +46,7 @@ struct Library_nf_rt_native_nanoFramework_Runtime_Native_Power
38
46
{
39
47
static const int FIELD_STATIC__OnRebootEvent = 0 ;
40
48
41
- NANOCLR_NATIVE_DECLARE (NativeReboot___STATIC__VOID );
49
+ NANOCLR_NATIVE_DECLARE (NativeReboot___STATIC__VOID__nanoFrameworkRuntimeNativeRebootOption );
42
50
43
51
//--//
44
52
};
Original file line number Diff line number Diff line change 3
3
// See LICENSE file in the project root for full license information.
4
4
//
5
5
6
-
7
6
#include " nf_rt_native.h"
7
+ #include < nanoCLR_Debugging.h>
8
8
9
- HRESULT Library_nf_rt_native_nanoFramework_Runtime_Native_Power::NativeReboot___STATIC__VOID ( CLR_RT_StackFrame& stack )
9
+ HRESULT Library_nf_rt_native_nanoFramework_Runtime_Native_Power::
10
+ NativeReboot___STATIC__VOID__nanoFrameworkRuntimeNativeRebootOption (CLR_RT_StackFrame &stack)
10
11
{
11
- (void )stack;
12
-
13
12
NANOCLR_HEADER ();
14
- {
15
- g_CLR_RT_ExecutionEngine.Reboot (true );
16
- }
13
+
14
+ RebootOption rebootOption = (RebootOption)stack.Arg0 ().NumericByRef ().u4 ;
15
+
16
+ g_CLR_RT_ExecutionEngine.Reboot (rebootOption);
17
+
17
18
NANOCLR_NOCLEANUP_NOLABEL ();
18
19
}
You can’t perform that action at this time.
0 commit comments