Introduction   User API Reference   DSMlib Reference   IDL Interface   File List   Index  

types.h

Go to the documentation of this file.
00001 /* $Id: types.h 30431 2007-10-24 09:05:58Z sk852421 $ */
00002 /*****************************************************************************/
00010 /*****************************************************************************/
00011 
00012 /* (c) 2003 Technische Universitaet Dresden
00013  * This file is part of DROPS, which is distributed under the terms of the
00014  * GNU General Public License 2. Please see the COPYING file for details.
00015  */
00016 
00017 #ifndef _L4_DM_GENERIC_TYPES_H
00018 #define _L4_DM_GENERIC_TYPES_H
00019 
00020 /* L4 includes */
00021 #include <l4/sys/types.h>
00022 #include <l4/env/cdefs.h>
00023 
00024 /*****************************************************************************
00025  *** Types
00026  *****************************************************************************/
00027 
00032 typedef struct l4dm_dataspace
00033 {
00034   l4_uint32_t   id;
00035   l4_threadid_t manager;
00036 } l4dm_dataspace_t;
00037 
00042 #define L4DM_INVALID_DATASPACE_INITIALIZER \
00043                { (l4_uint32_t)-1, L4_INVALID_ID_INIT }
00044 
00049 #define L4DM_INVALID_DATASPACE \
00050                ((l4dm_dataspace_t)L4DM_INVALID_DATASPACE_INITIALIZER)
00051 
00052 /*****************************************************************************
00053  *** prototypes
00054  *****************************************************************************/
00055 
00056 __BEGIN_DECLS;
00057 
00058 /*****************************************************************************/
00068 /*****************************************************************************/
00069 L4_INLINE int
00070 l4dm_dataspace_equal(l4dm_dataspace_t ds1, l4dm_dataspace_t ds2);
00071 
00072 /*****************************************************************************/
00081 /*****************************************************************************/
00082 L4_INLINE int
00083 l4dm_is_invalid_ds(l4dm_dataspace_t ds);
00084 
00085 __END_DECLS;
00086 
00087 /*****************************************************************************
00088  *** implementation
00089  *****************************************************************************/
00090 
00091 /* l4dm_dataspace_equal */
00092 L4_INLINE int
00093 l4dm_dataspace_equal(l4dm_dataspace_t ds1, l4dm_dataspace_t ds2)
00094 {
00095   if (l4_thread_equal(ds1.manager, ds2.manager) && (ds1.id == ds2.id))
00096     return 1;
00097   else
00098     return 0;
00099 }
00100 
00101 /* l4dm_is_invalid_ds */
00102 L4_INLINE int
00103 l4dm_is_invalid_ds(l4dm_dataspace_t ds)
00104 {
00105   return ((ds.id == L4DM_INVALID_DATASPACE.id) &&
00106           (l4_thread_equal(ds.manager, L4DM_INVALID_DATASPACE.manager)));
00107 }
00108 
00109 #endif /* !_L4_DM_GENERIC_TYPES_H */

DMphys Reference Manual, written by Lars Reuther  © 2000-2003