]> git.mdlowis.com Git - proto/cerise-os.git/commitdiff
minor rework
authorMichael D. Lowis <mike@mdlowis.com>
Tue, 13 Sep 2022 03:14:45 +0000 (23:14 -0400)
committerMichael D. Lowis <mike@mdlowis.com>
Tue, 13 Sep 2022 03:14:45 +0000 (23:14 -0400)
Kernel.c

index 4b0acb55b3898a4d7b9e768923d300c6dde8b4e2..9a8fd27c62a15461a6f3c181f62777e4a989045f 100644 (file)
--- a/Kernel.c
+++ b/Kernel.c
 
 */
 
-#define COND_WAIT_TIMEOUT_MS    100u
-#define WORD_SIZE               sizeof(void*)
-#define WORD_ALIGN(x)           (((x) + WORD_SIZE) & ~(WORD_SIZE))
+#define WAIT_TIMEOUT_MS     100u
+#define WORD_SIZE           sizeof(void*)
+
+#define WORD_ALIGN(x) \
+    (((x) + WORD_SIZE) & ~(WORD_SIZE))
 
 typedef struct Task_T {
     long* stack_top;     // top of task's stack
@@ -267,7 +269,7 @@ static void CpuIdle(void* arg)
     {
         Kernel_Yield();
         AcquireLock();
-        WaitForCondition(&ScheduleCond, &ScheduleLock, COND_WAIT_TIMEOUT_MS);
+        WaitForCondition(&ScheduleCond, &ScheduleLock, WAIT_TIMEOUT_MS);
         ReleaseLock();
     }
 }
@@ -298,7 +300,7 @@ void Kernel_Run(void)
     while(1)
     {
         AcquireLock();
-        WaitForCondition(&ScheduleCond, &ScheduleLock, COND_WAIT_TIMEOUT_MS);
+        WaitForCondition(&ScheduleCond, &ScheduleLock, WAIT_TIMEOUT_MS);
         if (!ReadyQueue.head)
         {
             bool done = true;
@@ -327,6 +329,20 @@ void* Kernel_Allocate(size_t sz)
     return ptr;
 }
 
+#if 0
+long Kernel_MsgSend(Task_T* task, const void* sdata, size_t nsdata, void* rdata, size_t nrdata)
+{
+}
+
+long Kernel_MsgReceive(void* rdata, size_t nrdata)
+{
+}
+
+long Kernel_MsgReply(long status, void* sdata, size_t nsdata)
+{
+}
+#endif
+
 /***************************************
     Main Routine
 ***************************************/