Kernel - Added another event and allowed clearing of events
authorJohn Hodge <[email protected]>
Sun, 26 Feb 2012 13:25:07 +0000 (21:25 +0800)
committerJohn Hodge <[email protected]>
Sun, 26 Feb 2012 13:25:07 +0000 (21:25 +0800)
- Also allowed Proc_GetCurThread to be accessed outside
 > It's needed for events

KernelLand/Kernel/events.c
KernelLand/Kernel/include/events.h
KernelLand/Kernel/include/threads.h
KernelLand/Kernel/include/threads_int.h
KernelLand/Kernel/vfs/select.c

index a9eab78..da095e9 100644 (file)
@@ -41,6 +41,14 @@ void Threads_PostEvent(tThread *Thread, Uint32 EventMask)
        LEAVE('-');
 }
 
+/**
+ * \brief Clear an event without waiting
+ */
+void Threads_ClearEvent(Uint32 EventMask)
+{
+       Proc_GetCurThread()->EventState &= ~EventMask;
+}
+
 /**
  * \brief Wait for an event to occur
  */
index 675c3db..5770940 100644 (file)
 #define THREAD_EVENT_IPCMSG    0x00000002
 #define THREAD_EVENT_SIGNAL    0x00000004
 #define THREAD_EVENT_TIMER     0x00000008
+#define THREAD_EVENT_SHORTWAIT 0x00000010
 
 // === FUNCTIONS ===
 extern void    Threads_PostEvent(tThread *Thread, Uint32 EventMask);
+extern void    Threads_ClearEvent(Uint32 EventMask);
 extern Uint32  Threads_WaitEvents(Uint32 EventMask);
 
 #endif
index 9ff7b62..0362cdb 100644 (file)
@@ -23,6 +23,8 @@ enum eFaultNumbers
 typedef struct sThread tThread;
 
 // === FUNCTIONS ===
+extern tThread *Proc_GetCurThread(void);
+
 extern void    Threads_SetFaultHandler(Uint Handler);
 
 extern int     Threads_SetUID(tUID ID);
index 66bb8c1..515ab0a 100644 (file)
@@ -125,8 +125,6 @@ extern BOOL gaThreads_NoTaskSwitch[MAX_CPUS];
 extern tShortSpinlock  glThreadListLock;
 
 // === FUNCTIONS ===
-extern tThread *Proc_GetCurThread(void);
-
 extern tThread *Threads_GetThread(Uint TID);
 extern void    Threads_SetPriority(tThread *Thread, int Pri);
 extern int     Threads_Wake(tThread *Thread);
index 439afc0..d2ef808 100644 (file)
@@ -20,9 +20,6 @@
 // === CONSTANTS ===
 #define        NUM_THREADS_PER_ALLOC   4
 
-// === IMPORTS ===
-extern tThread *Proc_GetCurThread(void);
-
 // === TYPES ===
 typedef struct sVFS_SelectListEnt      tVFS_SelectListEnt;
 

UCC git Repository :: git.ucc.asn.au