00001
00002
00022
00023
00024
00025
00026
00027
00028
00029
00030
00031
00032
00033
00034
00035 #ifndef _CFG_TREE_H_
00036 #define _CFG_TREE_H_
00037
00038 #include <cfgdef.h>
00039
00040
00041
00042
00043 #define MAX_FRAGMENTS 64
00044
00045 typedef struct _cfg_mem_frag_defs {
00046 uint64 type;
00047 uint64 id;
00048 uint64 flags;
00049 uint64 pa;
00050 uint64 size;
00051 } CFG_MEM_FRAG_DEFS;
00052
00053
00054
00055
00056 #define CFG__DEBUG_ALLOCATE_NODE 0x001
00057 #define CFG__DEBUG_INIT 0x002
00058 #define CFG__DEBUG_LOOKUP_NODE 0x004
00059 #define CFG__DEBUG_CREATE_GALAXY 0x008
00060 #define CFG__DEBUG_ASSIGN_HW_COMMUNITY 0x010
00061 #define CFG__DEBUG_ASSIGN_HW_PARTITION 0x020
00062 #define CFG__DEBUG_INSERT_NODE 0x040
00063 #define CFG__DEBUG_CREATE_PARTITION_ID 0x080
00064 #define CFG__DEBUG_CREATE_COMMUNITY_ID 0x100
00065 #define CFG__DEBUG_BIND_NODE 0x200
00066 #define CFG__DEBUG_INIT_FRAGS 0x400
00067 #define CFG__DEBUG_DEASSIGN_HW 0x800
00068 #define CFG__DEBUG_ASSIGN_MEM_FRAG 0x1000
00069 #define CFG__DEBUG_DEASSIGN_MEM_FRAG 0x2000
00070 #define CFG__DEBUG_GET_MAX_PARTITIONS 0x4000
00071 #define CFG__DEBUG_VALIDATE_PARTITIONS 0x8000
00072
00073 #ifndef CFG__DEBUG_FLAGS
00074 #define CFG__DEBUG_FLAGS 0
00075 #endif
00076
00077 #ifdef VMS$GLX
00078 #define CFG_POINTER_TO_ROOT glx$gpq_config_tree
00079 #pragma __required_pointer_size save
00080 #pragma __required_pointer_size long
00081 extern CFG_NODE *glx$gpq_config_tree;
00082 #define CFG__EXTERNAL_ROOT
00083 #pragma __required_pointer_size restore
00084 #endif
00085
00086
00087
00088
00089 #ifndef CFG_POINTER_TO_ROOT
00090 #define CFG_POINTER_TO_ROOT cfg_root
00091 extern CFG_NODE *cfg_root;
00092 #endif
00093
00094 #ifdef CFG__DEBUG
00095 extern int32 cfg_debug;
00096 #endif
00097
00098
00099
00100
00101 CFG_HANDLE cfg__alloc_node(char nodeType, char nodeSubType, uint64 flags, int32 extra_size, void *type_specific);
00102 #ifdef V5_MEMORY
00103 CFG_HANDLE cfg__create_mem_desc(char nodeType, char nodeSubType, uint64 flags, int32 extra_size, void *type_specific);
00104 #endif
00105 CFG_HANDLE cfg__create_mem_sub(char nodeType, char nodeSubType, uint64 flags, int32 extra_size, void *type_specific);
00106
00107
00108
00109
00110 void cfg__delete_node(CFG_HANDLE node);
00111
00112
00113
00114
00115 #ifdef V5_MEMORY
00116 int32 cfg__mem_frag_init(CFG_HANDLE node, CFG_HANDLE community, CFG_HANDLE partition, void *type_specific);
00117 #endif
00118 int32 cfg__partition_init(CFG_HANDLE node, CFG_HANDLE community, CFG_HANDLE partition, void *type_specific);
00119 int32 cfg__cpu_init(CFG_HANDLE node, CFG_HANDLE community, CFG_HANDLE partition, void *type_specific);
00120
00121 extern void cfg__insert_node(CFG_HANDLE current, CFG_HANDLE newNode, int ins_type);
00122
00123 typedef struct _cfg_node_info {
00124 int32 size;
00125 CFG_HANDLE (*create_node)(char nodeType, char nodeSubType, uint64 flags, int32 extra_size, void *type_specific);
00126 void (*delete_node)(CFG_HANDLE handle);
00127 int32 (*galaxy_init)(CFG_HANDLE node, CFG_HANDLE community, CFG_HANDLE partition, void *type_specific);
00128 } CFG_NODE_INFO;
00129
00130
00131
00132
00133
00134
00135
00136
00137
00138
00139
00140
00141
00142
00143
00144
00145
00146
00147 static CFG_NODE_INFO cfg_node_info[CFG$K_NODE_LAST+1] = {
00148 {0, 0, 0, 0},
00149 {sizeof(CFG_ROOT_NODE), 0, 0, 0},
00150 {sizeof(CFG_HW_ROOT_NODE), cfg__alloc_node, cfg__delete_node, 0},
00151 {sizeof(CFG_SW_ROOT_NODE), cfg__alloc_node, cfg__delete_node, 0},
00152 {sizeof(CFG_TEMPLATE_ROOT_NODE), cfg__alloc_node, cfg__delete_node, 0},
00153 {sizeof(CFG_COMMUNITY_NODE), cfg__alloc_node, cfg__delete_node, 0},
00154 {sizeof(CFG_PARTITION_NODE), cfg__alloc_node, cfg__delete_node, cfg__partition_init},
00155 {sizeof(CFG_SBB_NODE), cfg__alloc_node, cfg__delete_node, 0},
00156 {sizeof(CFG_PSEUDO_NODE), cfg__alloc_node, cfg__delete_node, 0},
00157 {sizeof(CFG_CPU_NODE), cfg__alloc_node, cfg__delete_node, cfg__cpu_init},
00158 {sizeof(CFG_MEMORY_SUB_NODE), cfg__create_mem_sub, cfg__delete_node, 0},
00159 #ifdef V5_MEMORY
00160 {sizeof(CFG_MEM_DESC_NODE), cfg__create_mem_desc,cfg__delete_node, cfg__mem_frag_init},
00161 #else
00162 {0, 0, 0, 0},
00163 #endif
00164 {sizeof(CFG_MEMORY_CTRL_NODE), cfg__alloc_node, cfg__delete_node, 0},
00165 {sizeof(CFG_IOP_NODE), cfg__alloc_node, cfg__delete_node, 0},
00166 {sizeof(CFG_HOSE_NODE), cfg__alloc_node, cfg__delete_node, 0},
00167 {sizeof(CFG_BUS_NODE), cfg__alloc_node, cfg__delete_node, 0},
00168 {sizeof(CFG_IO_CTRL_NODE), cfg__alloc_node, cfg__delete_node, 0},
00169 {sizeof(CFG_SLOT_NODE), cfg__alloc_node, cfg__delete_node, 0},
00170 {sizeof(CFG_CPU_MODULE_NODE), cfg__alloc_node, cfg__delete_node, 0},
00171 {0, cfg__alloc_node, cfg__delete_node, 0},
00172 };
00173
00174
00175
00176
00177
00178
00179 #define CFG__BUFFER_HEADER_SIZE 64
00180
00181
00182
00183
00184 #define CFG__INSERT_NEXT_SIBLING 1
00185 #define CFG__INSERT_CHILD 2
00186 #define CFG__INSERT_CHILD_LAST_SIB 3
00187 #define CFG__INSERT_LAST_SIBLING 4
00188
00189 #endif