git.ucc.asn.au
/
tpg
/
acess2.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
Usermode/AxWin3 - Debugging IPC
[tpg/acess2.git]
/
Kernel
/
messages.c
diff --git
a/Kernel/messages.c
b/Kernel/messages.c
index
45b5dfa
..
b70e078
100644
(file)
--- a/
Kernel/messages.c
+++ b/
Kernel/messages.c
@@
-2,6
+2,7
@@
* AcessOS Microkernel Version
* messages.c
*/
* AcessOS Microkernel Version
* messages.c
*/
+#define DEBUG 1
#include <acess.h>
#include <threads.h>
#include <threads_int.h>
#include <acess.h>
#include <threads.h>
#include <threads_int.h>
@@
-24,18
+25,18
@@
int Proc_SendMessage(Uint *Err, Uint Dest, int Length, void *Data)
tThread *thread;
tMsg *msg;
tThread *thread;
tMsg *msg;
-
Log("Proc_SendMessage: (Err=%p, Dest=%i, Length=%i, Data=%p)
", Err, Dest, Length, Data);
+
ENTER("pErr iDest iLength pData
", Err, Dest, Length, Data);
if(Length <= 0 || !Data) {
*Err = -EINVAL;
if(Length <= 0 || !Data) {
*Err = -EINVAL;
-
return -1
;
+
LEAVE_RET('i', -1)
;
}
// Get thread
thread = Threads_GetThread( Dest );
// Error check
}
// Get thread
thread = Threads_GetThread( Dest );
// Error check
- if(!thread)
{ return -1; }
+ if(!thread)
LEAVE_RET('i', -1);
// Get Spinlock
SHORTLOCK( &thread->IsLocked );
// Get Spinlock
SHORTLOCK( &thread->IsLocked );
@@
-43,7
+44,7
@@
int Proc_SendMessage(Uint *Err, Uint Dest, int Length, void *Data)
// Check if thread is still alive
if(thread->Status == THREAD_STAT_DEAD) {
SHORTREL( &thread->IsLocked );
// Check if thread is still alive
if(thread->Status == THREAD_STAT_DEAD) {
SHORTREL( &thread->IsLocked );
-
return -1
;
+
LEAVE_RET('i', -1)
;
}
// Create message
}
// Create message
@@
-65,10
+66,11
@@
int Proc_SendMessage(Uint *Err, Uint Dest, int Length, void *Data)
SHORTREL(&thread->IsLocked);
SHORTLOCK(&glThreadListLock);
SHORTREL(&thread->IsLocked);
SHORTLOCK(&glThreadListLock);
+ LOG("Waking %p (%i %s)", thread, thread->TID, thread->ThreadName);
Threads_Wake( thread );
SHORTREL(&glThreadListLock);
Threads_Wake( thread );
SHORTREL(&glThreadListLock);
-
return 0
;
+
LEAVE_RET('i', 0)
;
}
/**
}
/**
UCC
git Repository :: git.ucc.asn.au