mFrame
載入中...
搜尋中...
無符合項目
System.h
1
8#ifndef MFRAME_DB2618AE_F498_4792_900C_A4BD1DC2E35C
9#define MFRAME_DB2618AE_F498_4792_900C_A4BD1DC2E35C
10
11/* ***************************************************************************************
12 * Include
13 */
14
15//----------------------------------------------------------------------------------------
16
17//----------------------------------------------------------------------------------------
18#include "./../func/Runnable.h"
19#include "./../io/PrintBuffer.h"
20#include "./../io/RingBuffer.h"
21#include "./../sys/ErrorCode.h"
22#include "./../sys/Kernel.h"
23#include "./../sys/Svchost.h"
24#include "./../sys/SystemConfig.h"
25#include "./../sys/SystemControl.h"
26#include "./../sys/Thread.h"
27
28/* ***************************************************************************************
29 * Macro
30 */
31#ifdef MFRAME_DEBUG
32#define MFRAME_THROW(message, code) \
33 mframe::lang::System::throwError(message, __PRETTY_FUNCTION__, code)
34#else
35#define MFRAME_THROW(message, code) \
36 mframe::lang::System::throwError("", "", code)
37#endif
38
39/* ***************************************************************************************
40 * Namespace
41 */
42namespace mframe::lang {
43 class System;
44} // namespace mframe::lang
45
46/* ***************************************************************************************
47 * Class/struct/Struct
48 */
50 friend Object;
51
52 /* *************************************************************************************
53 * Variable
54 */
55
56 /* *************************************************************************************
57 * Abstract Method
58 */
59
60 /* *************************************************************************************
61 * Construct Method
62 */
63 private:
68 System(void);
69
74 virtual ~System(void) override;
75
76 /* *************************************************************************************
77 * Operator Method
78 */
79
80 /* *************************************************************************************
81 * Public Method <Override>
82 */
83
84 /* *************************************************************************************
85 * Public Method
86 */
87
88 /* *************************************************************************************
89 * Protected Method
90 */
91
92 /* *************************************************************************************
93 * Private Method
94 */
95
96 /* *************************************************************************************
97 * Static Variable
98 */
99 public:
100 static mframe::sys::Svchost* mSvchost;
101 static mframe::sys::Allocator* mAllocator;
102 static mframe::sys::Kernel* mKernel;
103 static mframe::sys::HardwareInfo* mHardwareInfo;
104
105 /* *************************************************************************************
106 * Static Method
107 */
108 public:
115
122
127 static void reboot(void);
128
134 static void setup(mframe::sys::SystemConfig& systemConfig);
135
141 static void start(mframe::func::Runnable& task, int stackSize);
142
149 static void error(const void* address, mframe::sys::ErrorCode code);
150
158 static void throwError(const char* message, const char* path,
160
166 static int getCoreClock(void);
167
173 static void lowerDelay(uint32 times);
174
184 static bool delay(int milliseconds);
185
229 static void wait(void);
230
274 static bool wait(int timeout);
275
294 static bool yield(void);
295
301 static int lock(void);
302
308 static int unlock(void);
309
317
325 static void execute(mframe::func::Runnable& runnable);
326
335 int stackSize);
336
345 mframe::lang::Data& stackMemory);
346
353
360};
361
362/* ***************************************************************************************
363 * End of file
364 */
365
366#endif /* MFRAME_DB2618AE_F498_4792_900C_A4BD1DC2E35C */
Definition PrintBuffer.h:32
Definition Data.h:30
Definition Object.h:34
Definition System.h:49
static void reboot(void)
設備重新啟動
static int lock(void)
核心鎖定,在調用systemUnlock以前將不會進行執行緒切換
static void wait(void)
導致當前線程等待,直到另一個線程調用此對象的 notify()方法或 notifyAll()方法,或其他一些線 程中斷當前線程,或一定量的實時時間。
static int unlock(void)
static bool delay(int milliseconds)
函數 delay 等待內核滴答中指定的時間段。 對於1的值,系統等待直到下一個計時器滴答發生。 實際時間延遲最多可能比指定時間少一個計時器滴答聲,即在下一個系統滴答聲發生之前立即調用 osDelay(1...
static void start(mframe::func::Runnable &task, int stackSize)
系統初始化核心
static mframe::sys::SystemControl & getControl(void)
取得系統層控制項目。
static void execute(mframe::func::Runnable &runnable)
static void setup(mframe::sys::SystemConfig &systemConfig)
static void lowerDelay(uint32 times)
static void throwError(const char *message, const char *path, mframe::sys::ErrorCode code)
拋出錯誤
static bool wait(int timeout)
導致當前線程等待,直到另一個線程調用此對象的notify()方法或notifyAll()方法,或指定的時間已 過。
static bool yield(void)
函數yield()將控制權傳遞給處於READY狀態且具有相同優先級的下一個線程。 如果在READY狀態下沒有其他優先級相同的線程,則當前線程繼續執行,不會發生線程切換。
static int getCoreClock(void)
Get the Core Clock object.
static mframe::lang::Readable & in(void)
static mframe::sys::Allocator * getAllocator(void)
Get the Allocator object.
static void error(const void *address, mframe::sys::ErrorCode code)
錯誤拋出
static mframe::io::PrintBuffer & out(void)
static mframe::sys::Thread * currentThread(void)
取得當前的執行緒
static mframe::sys::Thread & allocThread(mframe::func::Runnable &runnable, mframe::lang::Data &stackMemory)
static mframe::sys::Thread & allocThread(mframe::func::Runnable &runnable, int stackSize)
Definition Svchost.h:43
Definition Thread.h:33
Definition Appendable.h:23
ErrorCode
Definition ErrorCode.h:29
Definition Runnable.h:29
Definition Readable.h:31
Definition Allocator.h:30
Definition HardwareInfo.h:29
Definition Kernel.h:33
Definition SystemConfig.h:34
Definition SystemControl.h:31