2 * Copyright (c) 2012, Intel Corporation
4 * Redistribution and use in source and binary forms, with or without
5 * modification, are permitted provided that the following conditions are
8 * * Redistributions of source code must retain the above copyright notice,
9 * this list of conditions and the following disclaimer.
10 * * Redistributions in binary form must reproduce the above copyright
11 * notice, this list of conditions and the following disclaimer in the
12 * documentation and/or other materials provided with the distribution.
13 * * Neither the name of Intel Corporation nor the names of its contributors
14 * may be used to endorse or promote products derived from this software
15 * without specific prior written permission.
17 * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
18 * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
19 * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
20 * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
21 * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
22 * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
23 * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
24 * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
25 * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
26 * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
27 * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
30 #ifndef __MURPHY_DATA_TYPES_H__
31 #define __MURPHY_DATA_TYPES_H__
36 #include <murphy-db/mqi-types.h>
38 #define MRP_ZONE_MAX 8
40 #define MRP_KEY_STAMP_BITS 27
41 #define MRP_KEY_STATE_BITS 1
42 #define MRP_KEY_USAGE_BITS 1
43 #define MRP_KEY_PRIORITY_BITS 3
45 #define MRP_ZONE_ID_INVALID (~(uint32_t)0)
46 #define MRP_RESOURCE_ID_INVALID (~(uint32_t)0)
47 #define MRP_RESOURCE_REQNO_INVALID (~(uint32_t)0)
49 #define MRP_RESOURCE_MAX (sizeof(mrp_resource_mask_t) * 8)
50 #define MRP_ATTRIBUTE_MAX (sizeof(mrp_attribute_mask_t) * 8)
52 typedef enum mrp_resource_state_e mrp_resource_state_t;
53 typedef enum mrp_resource_order_e mrp_resource_order_t;
54 typedef enum mrp_resource_access_e mrp_resource_access_t;
56 typedef struct mrp_resource_client_s mrp_resource_client_t;
57 typedef union mrp_attr_value_u mrp_attr_value_t;
58 typedef struct mrp_attr_def_s mrp_attr_def_t;
59 typedef struct mrp_attr_s mrp_attr_t;
60 typedef struct mrp_zone_def_s mrp_zone_def_t;
61 typedef struct mrp_zone_s mrp_zone_t;
62 typedef struct mrp_application_class_s mrp_application_class_t;
63 typedef struct mrp_resource_owner_s mrp_resource_owner_t;
64 typedef struct mrp_resource_set_s mrp_resource_set_t;
65 typedef struct mrp_resource_def_s mrp_resource_def_t;
66 typedef struct mrp_resource_s mrp_resource_t;
67 typedef struct mrp_resource_mgr_ftbl_s mrp_resource_mgr_ftbl_t;
68 typedef struct mrp_resource_mgr_s mrp_resource_mgr_t;
70 typedef struct mrp_resource_ownersref_s mrp_resource_ownersref_t;
71 typedef struct mrp_resource_setref_s mrp_resource_setref_t;
73 typedef uint32_t mrp_resource_mask_t;
74 typedef uint32_t mrp_attribute_mask_t;
77 enum mrp_resource_state_e {
78 mrp_resource_no_request = 0,
84 enum mrp_resource_access_e {
85 MRP_RESOURCE_ACCESS_NONE = 0,
86 MRP_RESOURCE_READ = 1,
87 MRP_RESOURCE_WRITE = 2,
88 MRP_RESOURCE_RW = (MRP_RESOURCE_READ | MRP_RESOURCE_WRITE)
91 enum mrp_resource_order_e {
92 MRP_RESOURCE_ORDER_UNKNOWN = 0,
93 MRP_RESOURCE_ORDER_FIFO,
94 MRP_RESOURCE_ORDER_LIFO
97 union mrp_attr_value_u {
104 struct mrp_attr_def_s {
106 mrp_resource_access_t access;
107 mqi_data_type_t type;
108 mrp_attr_value_t value;
113 mqi_data_type_t type;
114 mrp_attr_value_t value;
118 typedef void (*mrp_resource_event_cb_t)(uint32_t, mrp_resource_set_t *, void*);
120 typedef void (*mrp_manager_init_func_t)(mrp_zone_t *, void *);
121 typedef bool (*mrp_manager_alloc_func_t)(mrp_zone_t *,mrp_resource_t *,void*);
122 typedef void (*mrp_manager_free_func_t)(mrp_zone_t *,mrp_resource_t *,void *);
123 typedef bool (*mrp_manager_advice_func_t)(mrp_zone_t *,mrp_resource_t*,void *);
124 typedef void (*mrp_manager_commit_func_t)(mrp_zone_t *, void *);
126 struct mrp_resource_mgr_ftbl_s {
127 mrp_manager_init_func_t init;
128 mrp_manager_alloc_func_t allocate;
129 mrp_manager_free_func_t free;
130 mrp_manager_advice_func_t advice;
131 mrp_manager_commit_func_t commit;
136 #endif /* __MURPHY_DATA_TYPES_H__ */
141 * indent-tabs-mode: nil