/* * rtmk - A free real-time micro-kernel. * Copyright (c) 1999, 2000 Johan Rydberg. * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by * the Free Software Foundation; either version 2, or (at your option) * any later version. * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License * along with this program; if not, write to the Free Software * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA * 02111-1307, USA. */ /* * $Id: rig-in.h,v 1.1 2001/12/13 02:09:38 jrydberg Exp $ */ #ifndef _RIG_H #define _RIG_H #include #include /* Size of the temporary dynamic buffer that `__rig_allocate_buffer' allocates. */ #define __RIG_DYNAMIC_BUFFER_SIZE (4096) /* `__rig_allocate_buffer' allocates a temporary dynamic buffer that will be used for raw message fields. To use static buffers, use the `use-static-buffers' flag with the RiG program. */ char *__rig_allocate_buffer (); /* `__rig_deallocate_buffer' deallocates a temporary buffer that has been allocated with `__rig_allocate_buffer'. */ void __rig_dellocate_buffer (char *); /* `__rig_rpc' does the IPC action. If REPLY is set to 0, it will send the message and not wait for a reply. */ void __rig_rpc (struct rtmk_msg_header *, struct rtmk_msg_header *, msg_size_t, rtmk_portal_t, rtmk_portal_t); /* This macro encode parts of the message header. MSGT is a pointer to the NEXT raw message field. This argument is used to calculate the length of the message. OFFSET is the message id. */ #define __rig_msgh_encode(hdr, msgt, offset) \ ({ (hdr)->msgh_id = (offset); \ (hdr)->msgh_length = (int) ((int) (msgt) - (int) (hdr)); \ (hdr)->msgh_seqno = 0; \ (hdr)->msgh_bits = RTMK_MSG_BITS_COMPLEX; \ }) typedef kern_return_t (*__rig_demux_function_t) (struct rtmk_msg_header *, struct rtmk_msg_header *); #define __rig_strlen strlen #define __rig_memcpy memcpy #define __rig_strncpy strncpy #define RIG_RESULT_SUCCESS ((kern_return_t) 0) #define RIG_RESULT_NOTIFY ((kern_return_t) 1) #define RIG_RESULT_FAILURE ((kern_return_t) 2) #endif /* _RIG_H */