Newer
Older
#include <syscall.h>
#include <context-switch.h>
#include <bwio.h>
int RecordNameServer(AP* Args){
asm volatile("swi 8\n\t");
register int RetVal asm("r0");
int Return = RetVal;
return Return;
}
register int RetVal asm("r0");
int Return = RetVal;
return Return;
}
int MyTid() {
int Address = (int )(&MyTid);
//bwprintf(COM2,"MyTid Address: %d\n\r",Address);
asm volatile ("swi 1\n\t");
register int RetVal asm("r0");
int R = RetVal;
//bwprintf(COM2,"Back to MyTid, my tid is %d, My Address is %d\n\r",R);
return RetVal;
}
int MyParentTid() {
register int RetVal asm("r0");
return RetVal;
}
void Pass() {
}
void Exit() {
// tid is that of the one its sending to
int Send (int TaskID, void* Msg, int MsgLen, void* Reply, int ReplyLen) {
asm volatile ("swi 5\n\t");
register int RetVal asm("r0");
int Return = RetVal;
return Return;
int Receive (int TaskID, void* Msg, int MsgLen) {
asm volatile ("swi 6\n\t");
register int RetVal asm("r0");
int Return = RetVal;
return Return;
/*
The calling task and the sender return at the same logical time. If they are of the same priority the sender runs first.
*/
asm volatile ("swi 7\n\t");
register int RetVal asm("r0");
int Return = RetVal;
return Return;