# rtai_msg.h

    00001 /*
    00002  * Copyright (C) 2002 POSEIDON CONTROLS INC <pcloutier@poseidoncontrols.com>
    00003  *                    Paolo Mantegazza <mantegazza@aero.polimi.it>
    00004  *
    00005  * This program is free software; you can redistribute it and/or
    00006  * modify it under the terms of the GNU General Public License as
    00007  * published by the Free Software Foundation; either version 2 of the
    00008  * License, or (at your option) any later version.
    00009  *
    00010  * This program is distributed in the hope that it will be useful,
    00011  * but WITHOUT ANY WARRANTY; without even the implied warranty of
    00012  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
    00013  * GNU General Public License for more details.
    00014  *
    00015  * You should have received a copy of the GNU General Public License
    00016  * along with this program; if not, write to the Free Software
    00017  * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
    00018  */
    00019
    00020 #ifndef _RTAI_MSG_H
    00021 #define _RTAI_MSG_H
    00022
    00023 #include <rtai_types.h>
    00024
    00025 #define MSG_ERR ((RT_TASK *)0xFfff)
    00026
    00027 #define MAX_NAME_LENGTH  32
    00028
    00029 struct rt_task_struct;
    00030 struct QueueBlock;
    00031 struct QueueHook;
    00032
    00033 #ifdef __KERNEL__
    00034
    00035 typedef struct t_msgcb { /* Message control block structure. */
    00036     int  cmd;
    00037     void *sbuf;
    00038     size_t sbytes;
    00039     void *rbuf;
    00040     size_t rbytes;
    00041 } MSGCB;
    00042
    00043 #define PROXY_MIN_STACK_SIZE 2048
    00044
    00045 struct proxy_t {
    00046
    00047     struct rt_task_struct *receiver;
    00048     int nmsgs,
    00049         nbytes;
    00050     char *msg;
    00051 };
    00052
    00053 #define SYNCMSG          0
    00054 #define PROXY           -1
    00055
    00056 #ifdef __cplusplus
    00057 extern "C" {
    00058 #endif /* __cplusplus */
    00059
    00060 int __rtai_msg_init(void);
    00061
    00062 void __rtai_msg_exit(void);
    00063
    00064 struct rt_task_struct *rt_send(struct rt_task_struct *task,
    00065                                unsigned msg);
    00066
    00067 struct rt_task_struct *rt_send_if(struct rt_task_struct *task,
    00068                                   unsigned msg);
    00069
    00070 struct rt_task_struct *rt_send_until(struct rt_task_struct *task,
    00071                                      unsigned msg,
    00072                                      RTIME time);
    00073
    00074 struct rt_task_struct *rt_send_timed(struct rt_task_struct *task,
    00075                                      unsigned msg,
    00076                                      RTIME delay);
    00077
    00078 struct rt_task_struct *rt_evdrp(struct rt_task_struct *task,
    00079                                 unsigned *msg);
    00080
    00081 struct rt_task_struct *rt_receive(struct rt_task_struct *task,
    00082                                   unsigned *msg);
    00083
    00084 struct rt_task_struct *rt_receive_if(struct rt_task_struct *task,
    00085                                      unsigned *msg);
    00086
    00087 struct rt_task_struct *rt_receive_until(struct rt_task_struct *task,
    00088                                         unsigned *msg,
    00089                                         RTIME time);
    00090
    00091 struct rt_task_struct *rt_receive_timed(struct rt_task_struct *task,
    00092                                         unsigned *msg,
    00093                                         RTIME delay);
    00094
    00095 struct rt_task_struct *rt_rpc(struct rt_task_struct *task,
    00096                               unsigned to_do,
    00097                               unsigned *result);
    00098
    00099 struct rt_task_struct *rt_rpc_if(struct rt_task_struct *task,
    00100                                  unsigned to_do,
    00101                                  unsigned *result);
    00102
    00103 struct rt_task_struct *rt_rpc_until(struct rt_task_struct *task,
    00104                                     unsigned to_do,
    00105                                     unsigned *result,
    00106                                     RTIME time);
    00107
    00108 struct rt_task_struct *rt_rpc_timed(struct rt_task_struct *task,
    00109                                     unsigned to_do,
    00110                                     unsigned *result,
    00111                                     RTIME delay);
    00112
    00113 int rt_isrpc(struct rt_task_struct *task);
    00114
    00115 struct rt_task_struct *rt_return(struct rt_task_struct *task,
    00116                                  unsigned result);
    00117
    00118 struct rt_task_struct *rt_rpcx(struct rt_task_struct *task,
    00119                                void *smsg,
    00120                                void *rmsg,
    00121                                int ssize,
    00122                                int rsize);
    00123
    00124 struct rt_task_struct *rt_rpcx_if(struct rt_task_struct *task,
    00125                                   void *smsg,
    00126                                   void *rmsg,
    00127                                   int ssize,
    00128                                   int rsize);
    00129
    00130 struct rt_task_struct *rt_rpcx_until(struct rt_task_struct *task,
    00131                                      void *smsg,
    00132                                      void *rmsg,
    00133                                      int ssize,
    00134                                      int rsize,
    00135                                      RTIME time);
    00136
    00137 struct rt_task_struct *rt_rpcx_timed(struct rt_task_struct *task,
    00138                                      void *smsg,
    00139                                      void *rmsg,
    00140                                      int ssize,
    00141                                      int rsize,
    00142                                      RTIME delay);
    00143
    00144 struct rt_task_struct *rt_sendx(struct rt_task_struct *task,
    00145                                 void *msg,
    00146                                 int size);
    00147
    00148 struct rt_task_struct *rt_sendx_if(struct rt_task_struct *task,
    00149                                    void *msg,
    00150                                    int size);
    00151
    00152 struct rt_task_struct *rt_sendx_until(struct rt_task_struct *task,
    00153                                       void *msg,
    00154                                       int size,
    00155                                       RTIME time);
    00156
    00157 struct rt_task_struct *rt_sendx_timed(struct rt_task_struct *task,
    00158                                       void *msg,
    00159                                       int size,
    00160                                       RTIME delay);
    00161
    00162 struct rt_task_struct *rt_returnx(struct rt_task_struct *task,
    00163                                   void *msg,
    00164                                   int size);
    00165
    00166 #define rt_isrpcx(task) rt_isrpc(task)
    00167
    00168 struct rt_task_struct *rt_evdrpx(struct rt_task_struct *task,
    00169                                  void *msg,
    00170                                  int size,
    00171                                  int *len);
    00172
    00173 struct rt_task_struct *rt_receivex(struct rt_task_struct *task,
    00174                                    void *msg,
    00175                                    int size,
    00176                                    int *len);
    00177
    00178 struct rt_task_struct *rt_receivex_if(struct rt_task_struct *task,
    00179                                       void *msg,
    00180                                       int size,
    00181                                       int *len);
    00182
    00183 struct rt_task_struct *rt_receivex_until(struct rt_task_struct *task,
    00184                                          void *msg,
    00185                                          int size,
    00186                                          int *len,
    00187                                          RTIME time);
    00188
    00189 struct rt_task_struct *rt_receivex_timed(struct rt_task_struct *task,
    00190                                          void *msg,
    00191                                          int size,
    00192                                          int *len,
    00193                                          RTIME delay);
    00194
    00195 struct rt_task_struct *__rt_proxy_attach(void (*func)(int),
    00196                                          struct rt_task_struct *task,
    00197                                          void *msg,
    00198                                          int nbytes,
    00199                                          int priority);
    00200
    00201 struct rt_task_struct *rt_proxy_attach(struct rt_task_struct *task,
    00202                                        void *msg,
    00203                                        int nbytes,
    00204                                        int priority);
    00205
    00206 int rt_proxy_detach(struct rt_task_struct *proxy);
    00207
    00208 struct rt_task_struct *rt_trigger(struct rt_task_struct *proxy);
    00209
    00210 #define exist(name)  rt_get_adr(nam2num(name))
    00211
    00212 int rt_Send(pid_t pid,
    00213             void *smsg,
    00214             void *rmsg,
    00215             size_t ssize,
    00216             size_t rsize);
    00217
    00218 pid_t rt_Receive(pid_t pid,
    00219                  void *msg,
    00220                  size_t maxsize,
    00221                  size_t *msglen);
    00222
    00223 pid_t rt_Creceive(pid_t pid,
    00224                   void *msg,
    00225                   size_t maxsize,
    00226                   size_t *msglen,
    00227                   RTIME delay);
    00228
    00229 int rt_Reply(pid_t pid,
    00230              void *msg,
    00231              size_t size);
    00232
    00233 pid_t rt_Proxy_attach(pid_t pid,
    00234                       void *msg,
    00235                       int nbytes,
    00236                       int priority);
    00237
    00238 int rt_Proxy_detach(pid_t pid);
    00239
    00240 pid_t rt_Trigger(pid_t pid);
    00241
    00242 pid_t rt_Name_attach(const char *name);
    00243
    00244 pid_t rt_Name_locate(const char *host,
    00245                      const char *name);
    00246
    00247 int rt_Name_detach(pid_t pid);
    00248
    00249 #ifdef __cplusplus
    00250 }
    00251 #endif /* __cplusplus */
    00252
    00253 #else /* !__KERNEL__ */
    00254
    00255 #include <rtai_lxrt.h>
    00256
    00257 #ifdef __cplusplus
    00258 extern "C" {
    00259 #endif /* __cplusplus */
    00260
    00261 RTAI_PROTO(struct rt_task_struct *,rt_send,(struct rt_task_struct *task, unsigned msg))
    00262 {
    00263         struct { struct rt_task_struct *task; unsigned msg; } arg = { task, msg };
    00264         return (struct rt_task_struct *)rtai_lxrt(BIDX, SIZARG, SENDMSG, &arg).v[LOW];
    00265 }
    00266
    00267 RTAI_PROTO(struct rt_task_struct *,rt_send_if,(struct rt_task_struct *task, unsigned msg))
    00268 {
    00269         struct { struct rt_task_struct *task; unsigned msg; } arg = { task, msg };
    00270         return (struct rt_task_struct *)rtai_lxrt(BIDX, SIZARG, SEND_IF, &arg).v[LOW];
    00271 }
    00272
    00273 RTAI_PROTO(struct rt_task_struct *,rt_send_until,(struct rt_task_struct *task, unsigned msg, RTIME time))
    00274 {
    00275         struct { struct rt_task_struct *task; unsigned msg; RTIME time; } arg = { task, msg, time };
    00276         return (struct rt_task_struct *)rtai_lxrt(BIDX, SIZARG, SEND_UNTIL, &arg).v[LOW];
    00277 }
    00278
    00279 RTAI_PROTO(struct rt_task_struct *,rt_send_timed,(struct rt_task_struct *task, unsigned msg, RTIME delay))
    00280 {
    00281         struct { struct rt_task_struct *task; unsigned msg; RTIME delay; } arg = { task, msg, delay };
    00282         return (struct rt_task_struct *)rtai_lxrt(BIDX, SIZARG, SEND_TIMED, &arg).v[LOW];
    00283 }
    00284
    00285 RTAI_PROTO(struct rt_task_struct *,rt_evdrp,(struct rt_task_struct *task, unsigned *msg))
    00286 {
    00287         struct { struct rt_task_struct *task; unsigned *msg; } arg = { task, msg };
    00288         return (struct rt_task_struct *)rtai_lxrt(BIDX, SIZARG, EVDRP, &arg).v[LOW];
    00289 }
    00290
    00291 RTAI_PROTO(struct rt_task_struct *,rt_receive,(struct rt_task_struct *task, unsigned *msg))
    00292 {
    00293         struct { struct rt_task_struct *task; unsigned *msg; } arg = { task, msg };
    00294         return (struct rt_task_struct *)rtai_lxrt(BIDX, SIZARG, RECEIVEMSG, &arg).v[LOW];
    00295 }
    00296
    00297 RTAI_PROTO(struct rt_task_struct *,rt_receive_if,(struct rt_task_struct *task, unsigned *msg))
    00298 {
    00299         struct { struct rt_task_struct *task; unsigned *msg; } arg = { task, msg };
    00300         return (struct rt_task_struct *)rtai_lxrt(BIDX, SIZARG, RECEIVE_IF, &arg).v[LOW];
    00301 }
    00302
    00303 RTAI_PROTO(struct rt_task_struct *,rt_receive_until,(struct rt_task_struct *task, unsigned *msg, RTIME time))
    00304 {
    00305         struct { struct rt_task_struct *task; unsigned *msg; RTIME time; } arg = { task, msg, time };
    00306         return (struct rt_task_struct *)rtai_lxrt(BIDX, SIZARG, RECEIVE_UNTIL, &arg).v[LOW];
    00307 }
    00308
    00309 RTAI_PROTO(struct rt_task_struct *,rt_receive_timed,(struct rt_task_struct *task, unsigned *msg, RTIME delay))
    00310 {
    00311         struct { struct rt_task_struct *task; unsigned *msg; RTIME delay; } arg = { task, msg, delay };
    00312         return (struct rt_task_struct *)rtai_lxrt(BIDX, SIZARG, RECEIVE_TIMED, &arg).v[LOW];
    00313 }
    00314
    00315 RTAI_PROTO(struct rt_task_struct *,rt_rpc,(struct rt_task_struct *task, unsigned to_do, unsigned *result))
    00316 {
    00317         struct { struct rt_task_struct *task; unsigned to_do; unsigned *result; } arg = { task, to_do, result };
    00318         return (struct rt_task_struct *)rtai_lxrt(BIDX, SIZARG, RPCMSG, &arg).v[LOW];
    00319 }
    00320
    00321 RTAI_PROTO(struct rt_task_struct *,rt_rpc_if,(struct rt_task_struct *task, unsigned to_do, unsigned *result))
    00322 {
    00323         struct { struct rt_task_struct *task; unsigned to_do; unsigned *result; } arg = { task, to_do, result };
    00324         return (struct rt_task_struct *)rtai_lxrt(BIDX, SIZARG, RPC_IF, &arg).v[LOW];
    00325 }
    00326
    00327 RTAI_PROTO(struct rt_task_struct *,rt_rpc_until,(struct rt_task_struct *task, unsigned to_do, unsigned *result, RTIME time))
    00328 {
    00329         struct { struct rt_task_struct *task; unsigned to_do; unsigned *result; RTIME time; } arg = { task, to_do, result, time };
    00330         return (struct rt_task_struct *)rtai_lxrt(BIDX, SIZARG, RPC_UNTIL, &arg).v[LOW];
    00331 }
    00332
    00333 RTAI_PROTO(struct rt_task_struct *,rt_rpc_timed,(struct rt_task_struct *task, unsigned to_do, unsigned *result, RTIME delay))
    00334 {
    00335         struct { struct rt_task_struct *task; unsigned to_do; unsigned *result; RTIME delay; } arg = { task, to_do, result, delay };
    00336         return (struct rt_task_struct *)rtai_lxrt(BIDX, SIZARG, RPC_TIMED, &arg).v[LOW];
    00337 }
    00338
    00339 RTAI_PROTO(int, rt_isrpc,(struct rt_task_struct *task))
    00340 {
    00341         struct { struct rt_task_struct *task; } arg = { task };
    00342         return (int)rtai_lxrt(BIDX, SIZARG, ISRPC, &arg).i[LOW];
    00343 }
    00344
    00345 RTAI_PROTO(struct rt_task_struct *,rt_return,(struct rt_task_struct *task, unsigned result))
    00346 {
    00347         struct { struct rt_task_struct *task; unsigned result; } arg = { task, result };
    00348         return (struct rt_task_struct *)rtai_lxrt(BIDX, SIZARG, RETURNMSG, &arg).v[LOW];
    00349 }
    00350
    00351 RTAI_PROTO(struct rt_task_struct *,rt_rpcx,(struct rt_task_struct *task, void *smsg, void *rmsg, int ssize, int rsize))
    00352 {
    00353         struct { struct rt_task_struct *task; void *smsg; void *rmsg; int ssize; int rsize; } arg = { task, smsg, rmsg, ssize, rsize };
    00354         return (struct rt_task_struct *)rtai_lxrt(BIDX, SIZARG, RPCX, &arg).v[LOW];
    00355 }
    00356
    00357 RTAI_PROTO(struct rt_task_struct *,rt_rpcx_if,(struct rt_task_struct *task, void *smsg, void *rmsg, int ssize, int rsize))
    00358 {
    00359         struct { struct rt_task_struct *task; void *smsg; void *rmsg; int ssize; int rsize; } arg = { task, smsg, rmsg, ssize, rsize };
    00360         return (struct rt_task_struct *)rtai_lxrt(BIDX, SIZARG, RPCX_IF, &arg).v[LOW];
    00361 }
    00362
    00363 RTAI_PROTO(struct rt_task_struct *,rt_rpcx_until,(struct rt_task_struct *task, void *smsg, void *rmsg, int ssize, int rsize, RTIME time))
    00364 {
    00365         struct { struct rt_task_struct *task; void *smsg; void *rmsg; int ssize; int rsize; RTIME time; } arg = { task, smsg, rmsg, ssize, rsize, time };
    00366         return (struct rt_task_struct *)rtai_lxrt(BIDX, SIZARG, RPCX_UNTIL, &arg).v[LOW];
    00367 }
    00368
    00369 RTAI_PROTO(struct rt_task_struct *,rt_rpcx_timed,(struct rt_task_struct *task, void *smsg, void *rmsg, int ssize, int rsize, RTIME delay))
    00370 {
    00371         struct { struct rt_task_struct *task; void *smsg; void *rmsg; int ssize; int rsize; RTIME delay; } arg = { task, smsg, rmsg, ssize, rsize, delay };
    00372         return (struct rt_task_struct *)rtai_lxrt(BIDX, SIZARG, RPCX_TIMED, &arg).v[LOW];
    00373 }
    00374
    00375 RTAI_PROTO(struct rt_task_struct *,rt_sendx,(struct rt_task_struct *task, void *msg, int size))
    00376 {
    00377         struct { struct rt_task_struct *task; void *msg; int size; } arg = { task, msg, size };
    00378         return (struct rt_task_struct *)rtai_lxrt(BIDX, SIZARG, SENDX, &arg).v[LOW];
    00379 }
    00380
    00381 RTAI_PROTO(struct rt_task_struct *,rt_sendx_if,(struct rt_task_struct *task, void *msg, int size))
    00382 {
    00383         struct { struct rt_task_struct *task; void *msg; int size; } arg = { task, msg, size };
    00384         return (struct rt_task_struct *)rtai_lxrt(BIDX, SIZARG, SENDX_IF, &arg).v[LOW];
    00385 }
    00386
    00387 RTAI_PROTO(struct rt_task_struct *,rt_sendx_until,(struct rt_task_struct *task, void *msg, int size, RTIME time))
    00388 {
    00389         struct { struct rt_task_struct *task; void *msg; int size; RTIME time; } arg = { task, msg, size, time };
    00390         return (struct rt_task_struct *)rtai_lxrt(BIDX, SIZARG, SENDX_UNTIL, &arg).v[LOW];
    00391 }
    00392
    00393 RTAI_PROTO(struct rt_task_struct *,rt_sendx_timed,(struct rt_task_struct *task, void *msg, int size, RTIME delay))
    00394 {
    00395         struct { struct rt_task_struct *task; void *msg; int size; RTIME delay; } arg = { task, msg, size, delay };
    00396         return (struct rt_task_struct *)rtai_lxrt(BIDX, SIZARG, SENDX_TIMED, &arg).v[LOW];
    00397 }
    00398
    00399 RTAI_PROTO(struct rt_task_struct *,rt_returnx,(struct rt_task_struct *task, void *msg, int size))
    00400 {
    00401         struct { struct rt_task_struct *task; void *msg; int size; } arg = { task, msg, size };
    00402         return (struct rt_task_struct *)rtai_lxrt(BIDX, SIZARG, RETURNX, &arg).v[LOW];
    00403 }
    00404
    00405 #define rt_isrpcx(task)  rt_isrpc(task)
    00406
    00407 RTAI_PROTO(struct rt_task_struct *,rt_evdrpx,(struct rt_task_struct *task, void *msg, int size, int *len))
    00408 {
    00409         struct { struct rt_task_struct *task; void *msg; int size, *len; } arg = { task, msg, size, len };
    00410         return (struct rt_task_struct *)rtai_lxrt(BIDX, SIZARG, EVDRPX, &arg).v[LOW];
    00411 }
    00412
    00413 RTAI_PROTO(struct rt_task_struct *,rt_receivex,(struct rt_task_struct *task, void *msg, int size, int *len))
    00414 {
    00415         struct { struct rt_task_struct *task; void *msg; int size, *len; } arg = { task, msg, size, len };
    00416         return (struct rt_task_struct *)rtai_lxrt(BIDX, SIZARG, RECEIVEX, &arg).v[LOW];
    00417 }
    00418
    00419 RTAI_PROTO(struct rt_task_struct *,rt_receivex_if,(struct rt_task_struct *task, void *msg, int size, int *len))
    00420 {
    00421         struct { struct rt_task_struct *task; void *msg; int size, *len; } arg = { task, msg, size, len };
    00422         return (struct rt_task_struct *)rtai_lxrt(BIDX, SIZARG, RECEIVEX_IF, &arg).v[LOW];
    00423 }
    00424
    00425 RTAI_PROTO(struct rt_task_struct *,rt_receivex_until,(struct rt_task_struct *task, void *msg, int size, int *len, RTIME time))
    00426 {
    00427         struct { struct rt_task_struct *task; void *msg; int size, *len; RTIME time; } arg = { task, msg, size, len, time };
    00428         return (struct rt_task_struct *)rtai_lxrt(BIDX, SIZARG, RECEIVEX_UNTIL, &arg).v[LOW];
    00429 }
    00430
    00431 RTAI_PROTO(struct rt_task_struct *,rt_receivex_timed,(struct rt_task_struct *task, void *msg, int size, int *len, RTIME delay))
    00432 {
    00433         struct { struct rt_task_struct *task; void *msg; int size, *len; RTIME delay; } arg = { task, msg, size, len, delay };
    00434         return (struct rt_task_struct *)rtai_lxrt(BIDX, SIZARG, RECEIVEX_TIMED, &arg).v[LOW];
    00435 }
    00436
    00437 RTAI_PROTO(struct rt_task_struct *,rt_proxy_attach,(struct rt_task_struct *proxy, void *msg, int nbytes, int priority))
    00438 {
    00439         struct { struct rt_task_struct *proxy; void *msg; int nbytes, priority;} arg = { proxy, msg, nbytes, priority };
    00440         return (struct rt_task_struct *) rtai_lxrt(BIDX, SIZARG, PROXY_ATTACH, &arg).v[LOW];
    00441 }
    00442
    00443 RTAI_PROTO(int, rt_proxy_detach,(struct rt_task_struct *proxy))
    00444 {
    00445         struct { struct rt_task_struct *proxy; } arg = { proxy };
    00446         return (pid_t) rtai_lxrt(BIDX, SIZARG, PROXY_DETACH, &arg).i[LOW];
    00447 }
    00448
    00449 RTAI_PROTO(struct rt_task_struct *,rt_trigger,(struct rt_task_struct *proxy))
    00450 {
    00451         struct { struct rt_task_struct *proxy; } arg = { proxy };
    00452         return (struct rt_task_struct *) rtai_lxrt(BIDX, SIZARG, PROXY_TRIGGER, &arg).v[LOW];
    00453 }
    00454
    00455 RTAI_PROTO(int, rt_Send,(pid_t pid, void *smsg, void *rmsg, size_t ssize, size_t rsize ))
    00456 {
    00457         struct { pid_t pid; void *smsg; void *rmsg; size_t ssize, rsize;} arg = { pid, smsg, rmsg, ssize, rsize };
    00458         return (pid_t) rtai_lxrt(BIDX, SIZARG, RT_SEND, &arg).i[LOW];
    00459 }
    00460
    00461 RTAI_PROTO(pid_t, rt_Receive,(pid_t pid, void *msg, size_t maxsize, size_t *msglen))
    00462 {
    00463         struct { pid_t pid; void *msg; size_t maxsize, *msglen;}
    00464         arg = { pid, msg, maxsize, msglen };
    00465         return (pid_t) rtai_lxrt(BIDX, SIZARG, RT_RECEIVE, &arg).i[LOW];
    00466 }
    00467
    00468 RTAI_PROTO(pid_t, rt_Creceive,(pid_t pid, void *msg, size_t maxsize, size_t *msglen, RTIME delay))
    00469 {
    00470         struct { pid_t pid; void *msg; size_t maxsize, *msglen; RTIME delay;} arg = { pid, msg, maxsize, msglen, delay };
    00471         return (pid_t) rtai_lxrt(BIDX, SIZARG, RT_CRECEIVE, &arg).i[LOW];
    00472 }
    00473
    00474 RTAI_PROTO(pid_t, rt_Reply,(pid_t pid, void *msg, size_t size))
    00475 {
    00476         struct { pid_t pid; void *msg; size_t size;} arg = { pid, msg, size };
    00477         return (pid_t) rtai_lxrt(BIDX, SIZARG, RT_REPLY, &arg).i[LOW];
    00478 }
    00479
    00480 RTAI_PROTO(pid_t, rt_Proxy_attach,(pid_t pid, void *msg, int nbytes, int priority))
    00481 {
    00482         struct { pid_t pid; void *msg; int nbytes, priority;} arg = { pid, msg, nbytes, priority };
    00483         return (pid_t) rtai_lxrt(BIDX, SIZARG, RT_PROXY_ATTACH, &arg).i[LOW];
    00484 }
    00485
    00486 RTAI_PROTO(pid_t, rt_Proxy_detach,(pid_t pid))
    00487 {
    00488         struct { pid_t pid; } arg = { pid };
    00489         return (pid_t) rtai_lxrt(BIDX, SIZARG, RT_PROXY_DETACH, &arg).i[LOW];
    00490 }
    00491
    00492 RTAI_PROTO(pid_t, rt_Trigger,(pid_t pid))
    00493 {
    00494         struct { pid_t pid; } arg = { pid };
    00495         return (pid_t) rtai_lxrt(BIDX, SIZARG, RT_TRIGGER, &arg).i[LOW];
    00496 }
    00497
    00498 RTAI_PROTO(pid_t, rt_Alias_attach,(const char *name))
    00499 {
    00500         struct { const char *name; } arg = { name};
    00501         return (pid_t) rtai_lxrt(BIDX, SIZARG, RT_NAME_ATTACH, &arg).i[LOW];
    00502 }
    00503
    00504 RTAI_PROTO(pid_t, rt_Name_locate,(const char *host, const char *name))
    00505 {
    00506         struct { const char *host, *name; } arg = { host, name };
    00507         return (pid_t) rtai_lxrt(BIDX, SIZARG, RT_NAME_LOCATE, &arg).i[LOW];
    00508 }
    00509
    00510 RTAI_PROTO(int, rt_Name_detach,(pid_t pid))
    00511 {
    00512         struct { pid_t pid; } arg = { pid };
    00513         return (pid_t) rtai_lxrt(BIDX, SIZARG, RT_NAME_DETACH, &arg).i[LOW];
    00514 }
    00515
    00516 RTAI_PROTO(int, rt_InitTickQueue,(void))
    00517 {
    00518         struct { unsigned long dummy; } arg;
    00519         return (pid_t) rtai_lxrt(BIDX, SIZARG, RT_INITTICKQUEUE, &arg).i[LOW];
    00520 }
    00521
    00522 RTAI_PROTO(void, rt_ReleaseTickQueue,(void))
    00523 {
    00524         struct { unsigned long dummy; } arg;
    00525         rtai_lxrt(BIDX, SIZARG, RT_RELEASETICKQUEUE, &arg);
    00526 }
    00527
    00528 RTAI_PROTO(unsigned, rt_qDynAlloc,(unsigned n))
    00529 {
    00530         struct { unsigned n; } arg = { n };
    00531         return (unsigned) rtai_lxrt(BIDX, SIZARG, RT_QDYNALLOC, &arg).i[LOW];
    00532 }
    00533
    00534 RTAI_PROTO(unsigned, rt_qDynFree,(int n))
    00535 {
    00536         struct { unsigned n; } arg = { n };
    00537         return (unsigned) rtai_lxrt(BIDX, SIZARG, RT_QDYNFREE, &arg).i[LOW];
    00538 }
    00539
    00540 RTAI_PROTO(struct QueueBlock *,rt_qDynInit,(struct QueueBlock **q, void (*fun)(void *, int), void *data, int evn ))
    00541 {
    00542         struct QueueBlock *r;
    00543
    00544         struct { struct QueueBlock **q; void (*fun)(void *, int), *data; int evn; } arg = { 0, fun, data, evn };
    00545         r  = (struct QueueBlock *) rtai_lxrt(BIDX, SIZARG, RT_QDYNINIT, &arg).v[LOW];
    00546         if (q) *q = r;
    00547         return r;
    00548 }
    00549
    00550 RTAI_PROTO(void, rt_qBlkWait,(struct QueueBlock *q, RTIME t))
    00551 {
    00552         struct { struct QueueBlock *q; RTIME t; } arg = { q, t } ;
    00553         rtai_lxrt(BIDX, SIZARG, RT_QBLKWAIT, &arg);
    00554 }
    00555
    00556 RTAI_PROTO(void, rt_qBlkRepeat,(struct QueueBlock *q, RTIME t))
    00557 {
    00558         struct { struct QueueBlock *q; RTIME t; } arg = { q, t } ;
    00559         rtai_lxrt(BIDX, SIZARG, RT_QBLKREPEAT, &arg);
    00560 }
    00561
    00562 RTAI_PROTO(void, rt_qBlkSoon,(struct QueueBlock *q))
    00563 {
    00564         struct { struct QueueBlock *q; } arg = { q };
    00565         rtai_lxrt(BIDX, SIZARG, RT_QBLKSOON, &arg);
    00566 }
    00567
    00568 RTAI_PROTO(void, rt_qBlkDequeue,(struct QueueBlock *q))
    00569 {
    00570         struct { struct QueueBlock *q; } arg = { q };
    00571         rtai_lxrt(BIDX, SIZARG, RT_QBLKDEQUEUE, &arg);
    00572 }
    00573
    00574 RTAI_PROTO(void, rt_qBlkCancel,(struct QueueBlock *q))
    00575 {
    00576         struct { struct QueueBlock *q; } arg = { q };
    00577         rtai_lxrt(BIDX, SIZARG, RT_QBLKCANCEL, &arg);
    00578 }
    00579
    00580 RTAI_PROTO(void, rt_qBlkBefore,(struct QueueBlock *cur, struct QueueBlock *nxt))
    00581 {
    00582         struct { struct QueueBlock *cur, *nxt; } arg = { cur, nxt };
    00583         rtai_lxrt(BIDX, SIZARG, RT_QBLKBEFORE, &arg);
    00584 }
    00585
    00586 RTAI_PROTO(void, rt_qBlkAfter,(struct QueueBlock *cur, struct QueueBlock *prv))
    00587 {
    00588         struct { struct QueueBlock *cur, *prv; } arg = { cur, prv };
    00589         rtai_lxrt(BIDX, SIZARG, RT_QBLKAFTER, &arg);
    00590 }
    00591
    00592 RTAI_PROTO(struct QueueBlock *,rt_qBlkUnhook,(struct QueueBlock *q))
    00593 {
    00594         struct { struct QueueBlock *q; } arg = { q };
    00595         return (struct QueueBlock *) rtai_lxrt(BIDX, SIZARG, RT_QBLKUNHOOK, &arg).v[LOW];
    00596 }
    00597
    00598 RTAI_PROTO(void, rt_qBlkRelease,(struct QueueBlock *q))
    00599 {
    00600         struct { struct QueueBlock *q; } arg = { q };
    00601         rtai_lxrt(BIDX, SIZARG, RT_QBLKRELEASE, &arg);
    00602 }
    00603
    00604 RTAI_PROTO(void, rt_qBlkComplete,(struct QueueBlock *q))
    00605 {
    00606         struct { struct QueueBlock *q; } arg = { q };
    00607         rtai_lxrt(BIDX, SIZARG, RT_QBLKCOMPLETE, &arg);
    00608 }
    00609
    00610 RTAI_PROTO(int, rt_qSync,(void))
    00611 {
    00612         struct { unsigned long dummy; } arg;
    00613         return rtai_lxrt(BIDX, SIZARG, RT_QSYNC, &arg).i[LOW];
    00614 }
    00615
    00616 RTAI_PROTO(pid_t, rt_qReceive,(pid_t target, void *buf, size_t maxlen, size_t *msglen))
    00617 {
    00618         struct {pid_t target; void *buf; size_t maxlen, *msglen; } arg = { target, buf, maxlen, msglen };
    00619         return (pid_t) rtai_lxrt(BIDX, SIZARG, RT_QRECEIVE, &arg).i[LOW];
    00620 }
    00621
    00622 RTAI_PROTO(void, rt_qLoop,(void))
    00623 {
    00624         struct { unsigned long dummy; } arg;
    00625         rtai_lxrt(BIDX, SIZARG, RT_QLOOP, &arg);
    00626 }
    00627
    00628 RTAI_PROTO(RTIME, rt_qStep,(void))
    00629 {
    00630         struct { unsigned long dummy; } arg;
    00631         return rtai_lxrt(BIDX, SIZARG, RT_QSTEP, &arg).rt;
    00632 }
    00633
    00634 RTAI_PROTO(void, rt_qHookFlush,(struct QueueHook *h))
    00635 {
    00636         struct { struct QueueHook *h; } arg = { h };
    00637         rtai_lxrt(BIDX, SIZARG, RT_QHOOKFLUSH, &arg);
    00638 }
    00639
    00640 RTAI_PROTO(void, rt_qBlkAtHead,(struct QueueBlock *q, struct QueueHook *h))
    00641 {
    00642         struct { struct QueueBlock *q; struct QueueHook *h; } arg = { q, h };
    00643         rtai_lxrt(BIDX, SIZARG, RT_QBLKATHEAD, &arg);
    00644 }
    00645
    00646 RTAI_PROTO(void, rt_qBlkAtTail,(struct QueueBlock *q, struct QueueHook *h))
    00647 {
    00648         struct { struct QueueBlock *q; struct QueueHook *h; } arg = { q, h };
    00649         rtai_lxrt(BIDX, SIZARG, RT_QBLKATTAIL, &arg);
    00650 }
    00651
    00652 RTAI_PROTO(struct QueueHook *,rt_qHookInit,(struct QueueHook **h, void (*c)(void *, struct QueueBlock *), void *a))
    00653 {
    00654         struct QueueHook *r;
    00655         struct { struct QueueHook **h; void (*c)(void *, struct QueueBlock *), *a;} arg = { 0, c, a };
    00656         r = (struct QueueHook *) rtai_lxrt(BIDX, SIZARG, RT_QHOOKINIT, &arg).v[LOW];
    00657         if (h) *h = r;
    00658         return r;
    00659 }
    00660
    00661 RTAI_PROTO(void, rt_qHookRelease,(struct QueueHook *h))
    00662 {
    00663         struct { struct QueueHook *h; } arg = { h };
    00664         rtai_lxrt(BIDX, SIZARG, RT_QHOOKRELEASE, &arg);
    00665 }
    00666
    00667 RTAI_PROTO(void, rt_qBlkSchedule,(struct QueueBlock *q, RTIME t))
    00668 {
    00669         struct { struct QueueBlock *q; RTIME t; } arg = { q, t } ;
    00670         rtai_lxrt(BIDX, SIZARG, RT_QBLKSCHEDULE, &arg);
    00671 }
    00672
    00673 RTAI_PROTO(struct QueueHook *,rt_GetTickQueueHook,(void))
    00674 {
    00675         struct { unsigned long dummy; } arg;
    00676         return (struct QueueHook *) rtai_lxrt(BIDX, SIZARG, RT_GETTICKQUEUEHOOK, &arg).v[LOW];
    00677 }
    00678
    00679 RTAI_PROTO(pid_t, rt_vc_reserve,( void ))
    00680 {
    00681         struct { unsigned long dummy; } arg;
    00682         return (pid_t) rtai_lxrt(BIDX, SIZARG, RT_VC_RESERVE, &arg).i[LOW];
    00683 }
    00684
    00685 RTAI_PROTO(int, rt_vc_attach,(pid_t pid))
    00686 {
    00687         struct { pid_t pid; } arg = { pid };
    00688         return rtai_lxrt(BIDX, SIZARG, RT_VC_ATTACH, &arg).i[LOW];
    00689 }
    00690
    00691 RTAI_PROTO(int, rt_vc_release,(pid_t pid))
    00692 {
    00693         struct { pid_t pid; } arg = { pid };
    00694         return rtai_lxrt(BIDX, SIZARG, RT_VC_RELEASE, &arg).i[LOW];
    00695 }
    00696
    00697 #ifdef __cplusplus
    00698 }
    00699 #endif /* __cplusplus */
    00700
    00701 #endif /* __KERNEL__ */
    00702
    00703 #if !defined(__KERNEL__) || defined(__cplusplus)
    00704
    00705 typedef struct t_msgcb {
    00706     int opaque;
    00707 } MSGCB;
    00708
    00709 #endif /* !__KERNEL__ || __cplusplus */
    00710
    00711 #endif /* !_RTAI_MSG_H */