]> rtime.felk.cvut.cz Git - l4.git/blob - l4/pkg/ferret/include/types.h
update
[l4.git] / l4 / pkg / ferret / include / types.h
1 /**
2  * \file   ferret/include/types.h
3  * \brief  Global types for ferret.
4  *
5  * \date   04/11/2005
6  * \author Martin Pohlack  <mp26@os.inf.tu-dresden.de>
7  */
8 /*
9  * (c) 2005-2009 Technische Universität Dresden
10  * This file is part of TUD:OS and distributed under the terms of the
11  * GNU General Public License 2.
12  * Please see the COPYING-GPL-2 file for details.
13  */
14 #ifndef __FERRET_INCLUDE_TYPES_H_
15 #define __FERRET_INCLUDE_TYPES_H_
16
17 #include <l4/ferret/maj_min.h>
18 #include <l4/re/c/dataspace.h>
19
20 #ifdef __cplusplus
21 #define __STDC_LIMIT_MACROS
22 #endif
23
24 #if defined (__KERNEL__)
25 #include <linux/types.h>
26 #else
27 #include <stdint.h>
28 #include <sys/types.h>
29 #endif
30
31 EXTERN_C_BEGIN
32 /*********************************************************************
33  * Simple types
34  *********************************************************************/
35
36 typedef struct
37 {
38     uint32_t low;  ///< Low 32 Bits
39     uint32_t high; ///< High 32 Bits
40 } low_high_t;
41
42 typedef int64_t  ferret_time_t;
43 typedef uint64_t ferret_utime_t;
44
45 #ifndef __KERNEL__
46 // XXX: This is only used by histogram code _and_ the MAX/MIN macros are
47 //      missing in Linux kernel code - why not move this somewhere else?
48 static const ferret_time_t FERRET_TIME_MIN = INT64_MIN;
49 static const ferret_time_t FERRET_TIME_MAX = INT64_MAX;
50 #endif
51
52 #define FERRET_DIR_NAME "FerretDir"
53
54 #define FERRET_ROOT_INSTANCE 0
55
56 /*********************************************************************
57  * Structure types
58  *********************************************************************/
59
60 enum SensorType
61 {
62         FERRET_UNDEFINED = 0,
63         FERRET_SCALAR    = 1,
64         FERRET_HISTO     = 2,
65         FERRET_HISTO_2D  = 3,
66         FERRET_LIST      = 4,
67         FERRET_TBUF      = 5,
68         FERRET_HISTO64   = 6,
69         /* XXX BjoernD, 2009-03-02: We turn off these special kinds of sensors for now
70          *                          until we know which of these we really want.
71          *                          (Suppose, this was only for Martin's measurements.)
72          */
73 #if 0
74         FERRET_DPLIST    = 7,  // list protected with Delayed Preemption
75         FERRET_SLIST     = 8,  // list protected with L4Env Semaphores
76         FERRET_ULIST     = 9,  // list protected with Fiasco's User Semaphores
77         FERRET_ALIST     = 10, // list protected with Fiasco-supported
78                                   // atomic roll-back sections
79         FERRET_VLIST     = 11, // list protected with Fiasco-supported
80                                // atomic roll-back sections, supports
81                                // variable element sizes
82 #endif
83 };
84
85 /*********************************************************************
86  * Flags
87  *********************************************************************/
88
89 enum
90 {
91         FERRET_PERMANENT  = 0x00000001, // keep this sensor in the
92                                         // directory, even if its usage
93                                         // count drops to zero
94         FERRET_SUPERPAGES = 0x00010000, // use superpages for sensor
95                                         // dataspace if it would be
96                                         // larger than one page
97 };
98
99 EXTERN_C_END
100 #endif