summaryrefslogtreecommitdiff
path: root/src/kernel/ipc/request.h
diff options
context:
space:
mode:
authorAlexis211 <alexis211@gmail.com>2010-03-24 15:40:16 +0100
committerAlexis211 <alexis211@gmail.com>2010-03-24 15:40:16 +0100
commitdbfa8cae66811247e5110e2e17f1c6ae5d1b2bcd (patch)
tree793b49a6b89c1113c74ae3ee97d197f6070cb7a7 /src/kernel/ipc/request.h
parentcbadacbb881200b601c7b53b29aa0c1b78747692 (diff)
downloadTCE-dbfa8cae66811247e5110e2e17f1c6ae5d1b2bcd.tar.gz
TCE-dbfa8cae66811247e5110e2e17f1c6ae5d1b2bcd.zip
IPC not tested but suposedly working.
Diffstat (limited to 'src/kernel/ipc/request.h')
-rw-r--r--src/kernel/ipc/request.h35
1 files changed, 24 insertions, 11 deletions
diff --git a/src/kernel/ipc/request.h b/src/kernel/ipc/request.h
index 4a35dc3..0b60a5c 100644
--- a/src/kernel/ipc/request.h
+++ b/src/kernel/ipc/request.h
@@ -3,16 +3,23 @@
#include "object.h"
-#define A_STILLRUNNING 0
-#define A_NUMBER 1
-#define A_OBJDESCRIPTOR 2
-#define A_VOID 3
+#define RS_PENDING 0
+#define RS_PROCESSED 1
+#define RS_FINISHED 2
+#define RS_INTERRUPTED 3
+
+#define PT_VOID 0
+#define PT_OBJDESC 1
+#define PT_LONG 2
+#define PT_LONGLONG 3 //for return values
+#define PT_SHM 3 //for parameters
struct request {
struct object *obj;
struct thread *requester; //0 if nonblocking message
- uint32_t func, params[3];
- struct seg_map *shm_srv[3], *shm_cli[3];
+ uint32_t func, params[3], obj_close[3]; //obj_close : object descriptors to close when requests yields an answer
+ struct segment_map *shm_sndr[3], *shm_rcv[3];
+ int acknowledged; // (only for blocking requests) 0 : request is pending, 1 : request is being processes, 2 : finished, 3 : interrupted
union {
int64_t ll;
uint32_t n;
@@ -20,18 +27,24 @@ struct request {
};
struct user_request {
- uint32_t func, param1, param2, param3;
- int hasShm;
+ uint32_t func, params[3];
+ int isBlocking; // 1 : blocking request, 0 : nonblocking request (message)
+};
+
+struct user_sendrequest {
+ uint32_t func, a, b, c;
+ uint32_t answeri;
+ int64_t answerll;
};
//syscalls
int request_get(int obj, uint32_t ptr, int wait);
int request_has(int obj);
-void request_answer(int obj, uint32_t answer);
+void request_answer(int obj, uint32_t answer, uint32_t answer2); //answer2 used for long long.
int request_mapShm(int obj, uint32_t pos, int number);
-int request(int obj, uint32_t func, uint32_t a, uint32_t b, uint32_t c, uint32_t answerptr);
-int send_msg(int obj, uint32_t func, uint32_t a, uint32_t b, uint32_t c);
+int request(int obj, uint32_t rq_ptr);
+int send_msg(int obj, uint32_t rq_ptr);
#endif