00001
00002
00022
00023
00024
00025
00026
00027
00028
00029
00030
00031 #ifndef _GCT_TREE_H_
00032 #define _GCT_TREE_H_
00033
00034 #include "src$:gct.h"
00035
00036
00037
00038
00039 #define MAX_FRAGMENTS 64
00040
00041 typedef struct _gct_mem_frag_defs {
00042 uint64 type;
00043 uint64 id;
00044 uint64 flags;
00045 uint64 pa;
00046 uint64 size;
00047 } GCT_MEM_FRAG_DEFS;
00048
00049
00050
00051
00052 #define GCT__DEBUG_ALLOCATE_NODE 0x001
00053 #define GCT__DEBUG_INIT 0x002
00054 #define GCT__DEBUG_LOOKUP_NODE 0x004
00055 #define GCT__DEBUG_CREATE_GALAXY 0x008
00056 #define GCT__DEBUG_ASSIGN_HW_COMMUNITY 0x010
00057 #define GCT__DEBUG_ASSIGN_HW_PARTITION 0x020
00058 #define GCT__DEBUG_INSERT_NODE 0x040
00059 #define GCT__DEBUG_CREATE_PARTITION_ID 0x080
00060 #define GCT__DEBUG_CREATE_COMMUNITY_ID 0x100
00061 #define GCT__DEBUG_BIND_NODE 0x200
00062 #define GCT__DEBUG_INIT_FRAGS 0x400
00063 #define GCT__DEBUG_DEASSIGN_HW 0x800
00064 #define GCT__DEBUG_ASSIGN_MEM_FRAG 0x1000
00065 #define GCT__DEBUG_DEASSIGN_MEM_FRAG 0x2000
00066 #define GCT__DEBUG_GET_MAX_PARTITIONS 0x4000
00067 #define GCT__DEBUG_VALIDATE_PARTITIONS 0x8000
00068
00069 #ifndef GCT__DEBUG_FLAGS
00070 #define GCT__DEBUG_FLAGS 0
00071 #endif
00072
00073 #ifdef VMS$GLX
00074 #define GCT_POINTER_TO_ROOT glx$gpq_config_tree
00075 #pragma __required_pointer_size save
00076 #pragma __required_pointer_size long
00077 extern GCT_NODE *glx$gpq_config_tree;
00078 #define GCT__EXTERNAL_ROOT
00079 #pragma __required_pointer_size restore
00080 #endif
00081
00082
00083
00084
00085 #ifndef GCT_POINTER_TO_ROOT
00086 #define GCT_POINTER_TO_ROOT gct_root
00087 extern GCT_NODE *gct_root;
00088 #endif
00089
00090 #ifdef GCT__DEBUG
00091 extern int32 gct_debug;
00092 #endif
00093
00094
00095
00096
00097 GCT_HANDLE gct__alloc_node(char nodeType, char nodeSubType, uint64 flags, int32 extra_size, void *type_specific);
00098 GCT_HANDLE gct__create_mem_desc(char nodeType, char nodeSubType, uint64 flags, int32 extra_size, void *type_specific);
00099 GCT_HANDLE gct__create_mem_sub(char nodeType, char nodeSubType, uint64 flags, int32 extra_size, void *type_specific);
00100
00101
00102
00103
00104 void gct__delete_node(GCT_HANDLE node);
00105
00106
00107
00108
00109 int32 gct__mem_frag_init(GCT_HANDLE node, GCT_HANDLE community, GCT_HANDLE partition, void *type_specific);
00110 int32 gct__partition_init(GCT_HANDLE node, GCT_HANDLE community, GCT_HANDLE partition, void *type_specific);
00111 int32 gct__cpu_init(GCT_HANDLE node, GCT_HANDLE community, GCT_HANDLE partition, void *type_specific);
00112
00113 extern void gct__insert_node(GCT_HANDLE current, GCT_HANDLE newNode, int ins_type);
00114
00115 typedef struct _gct_node_info {
00116 int32 size;
00117 GCT_HANDLE (*create_node)(char nodeType, char nodeSubType, uint64 flags, int32 extra_size, void *type_specific);
00118 void (*delete_node)(GCT_HANDLE handle);
00119 int32 (*galaxy_init)(GCT_HANDLE node, GCT_HANDLE community, GCT_HANDLE partition, void *type_specific);
00120 } GCT_NODE_INFO;
00121
00122
00123
00124
00125
00126
00127
00128
00129
00130
00131
00132
00133
00134
00135
00136
00137
00138
00139 static GCT_NODE_INFO gct_node_info[NODE_LAST+1] = {
00140 {0, 0, 0, 0},
00141 {sizeof(GCT_ROOT_NODE), 0, 0, 0},
00142 {sizeof(GCT_HW_ROOT_NODE), gct__alloc_node, gct__delete_node, 0},
00143 {sizeof(GCT_SW_ROOT_NODE), gct__alloc_node, gct__delete_node, 0},
00144 {sizeof(GCT_TEMPLATE_ROOT_NODE), gct__alloc_node, gct__delete_node, 0},
00145 {sizeof(GCT_COMMUNITY_NODE), gct__alloc_node, gct__delete_node, 0},
00146 {sizeof(GCT_PARTITION_NODE), gct__alloc_node, gct__delete_node, gct__partition_init},
00147 {sizeof(GCT_SBB_NODE), gct__alloc_node, gct__delete_node, 0},
00148 {sizeof(GCT_PSEUDO_NODE), gct__alloc_node, gct__delete_node, 0},
00149 {sizeof(GCT_CPU_NODE), gct__alloc_node, gct__delete_node, gct__cpu_init},
00150 {sizeof(GCT_MEMORY_SUB_NODE), gct__create_mem_sub, gct__delete_node, 0},
00151 {sizeof(GCT_MEM_DESC_NODE), gct__create_mem_desc,gct__delete_node, gct__mem_frag_init},
00152 {sizeof(GCT_MEMORY_CTRL_NODE), gct__alloc_node, gct__delete_node, 0},
00153 {sizeof(GCT_IOP_NODE), gct__alloc_node, gct__delete_node, 0},
00154 {sizeof(GCT_HOSE_NODE), gct__alloc_node, gct__delete_node, 0},
00155 {sizeof(GCT_BUS_NODE), gct__alloc_node, gct__delete_node, 0},
00156 {sizeof(GCT_IO_CTRL_NODE), gct__alloc_node, gct__delete_node, 0},
00157 {sizeof(GCT_SLOT_NODE), gct__alloc_node, gct__delete_node, 0},
00158 {sizeof(GCT_CPU_MODULE_NODE), gct__alloc_node, gct__delete_node, 0},
00159 {0, gct__alloc_node, gct__delete_node, 0},
00160 };
00161
00162
00163
00164
00165
00166
00167 #define GCT__BUFFER_HEADER_SIZE 64
00168
00169
00170
00171
00172 #define GCT__INSERT_NEXT_SIBLING 1
00173 #define GCT__INSERT_CHILD 2
00174 #define GCT__INSERT_CHILD_LAST_SIB 3
00175 #define GCT__INSERT_LAST_SIBLING 4
00176
00177 #endif