gct_tree.h

Go to the documentation of this file.
00001 /*** MODULE GCT_TREE ***/
00002 /******************************************************************************/
00022 /******************************************************************************/
00023 /*
00024 * Author: Fred Kleinsorge
00025 *
00026 *   Modified by:
00027 *
00028 *       X-2     Andy Kuehnel                            13-Nov-1997
00029 *               Add standard header; adopt for VMS build environment.
00030 */
00031 #ifndef _GCT_TREE_H_
00032 #define _GCT_TREE_H_
00033 
00034 #include "src$:gct.h"
00035 
00036 /*
00037  *  This is the internal max fragments supported
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  *   DEBUG flags
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  *   Extern data
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  *  Node creation routines
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  *  Node deletion routines
00103  */
00104 void       gct__delete_node(GCT_HANDLE node);
00105 
00106 /*
00107  *  Node initialization routines
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  *  This array is used to create, init, and delete nodes, it is indexed by
00124  *  the node type.  The first entry is the base size of the node.  The next
00125  *  is the routine used to create the node.  Then the routine to delete the
00126  *  node, and finally a Galaxy initialization routine.
00127  *
00128  *  The normal node creation is gct__alloc_node, but if there is special
00129  *  processing - like some initialization data from the HW definition, or
00130  *  the size needs to be dynamically set - then a private creation routine
00131  *  can be implemented (they will typically call gct__alloc_node to do the
00132  *  actual creation).  Deletion is the same.  If special things need to be
00133  *  done as part of the deletion, this is where to hook it.
00134  *
00135  *  The galaxy initialization routine is a type specific initialization that
00136  *  will be done when the galaxy software configuration is completed.
00137  *
00138  */
00139 static GCT_NODE_INFO gct_node_info[NODE_LAST+1] = {
00140   {0,                              0,               0,                 0},      /* N/A  */
00141   {sizeof(GCT_ROOT_NODE),          0,               0,                 0},      /* Galaxy Root  */
00142   {sizeof(GCT_HW_ROOT_NODE),       gct__alloc_node, gct__delete_node,  0},      /* Hardware Root  */
00143   {sizeof(GCT_SW_ROOT_NODE),       gct__alloc_node, gct__delete_node,  0},      /* Software Root  */
00144   {sizeof(GCT_TEMPLATE_ROOT_NODE), gct__alloc_node, gct__delete_node,  0},      /* Temlplate Root  */
00145   {sizeof(GCT_COMMUNITY_NODE),     gct__alloc_node, gct__delete_node,  0},      /* Community  */
00146   {sizeof(GCT_PARTITION_NODE),     gct__alloc_node, gct__delete_node,  gct__partition_init}, /* Partition  */
00147   {sizeof(GCT_SBB_NODE),           gct__alloc_node, gct__delete_node,  0},      /* System Building Block  */
00148   {sizeof(GCT_PSEUDO_NODE),        gct__alloc_node, gct__delete_node,  0},      /* Pseudo  */
00149   {sizeof(GCT_CPU_NODE),           gct__alloc_node, gct__delete_node,  gct__cpu_init}, /* CPU  */
00150   {sizeof(GCT_MEMORY_SUB_NODE),    gct__create_mem_sub, gct__delete_node, 0},   /* Memory Subsystem  */
00151   {sizeof(GCT_MEM_DESC_NODE),      gct__create_mem_desc,gct__delete_node, gct__mem_frag_init}, /* Memory Description  */
00152   {sizeof(GCT_MEMORY_CTRL_NODE),   gct__alloc_node, gct__delete_node,  0},      /* Memory Control  */
00153   {sizeof(GCT_IOP_NODE),           gct__alloc_node, gct__delete_node,  0},      /* IO Processor  */
00154   {sizeof(GCT_HOSE_NODE),          gct__alloc_node, gct__delete_node,  0},      /* Hose  */
00155   {sizeof(GCT_BUS_NODE),           gct__alloc_node, gct__delete_node,  0},      /* Bus  */
00156   {sizeof(GCT_IO_CTRL_NODE),       gct__alloc_node, gct__delete_node,  0},      /* IO Controller  */
00157   {sizeof(GCT_SLOT_NODE),          gct__alloc_node, gct__delete_node,  0},      /* Slot  */
00158   {sizeof(GCT_CPU_MODULE_NODE),    gct__alloc_node, gct__delete_node,  0},      /* CPU Module Card  */
00159   {0,                              gct__alloc_node, gct__delete_node,  0},      /* NODE_LAST  */
00160 };
00161 
00162 /*
00163  *   The actual config buffer has a two quadword header.  The first quadword
00164  *   is the total size in bytes of the buffer, and the second is architected
00165  *   as the checksum.
00166  */
00167 #define GCT__BUFFER_HEADER_SIZE 64
00168 
00169 /*
00170  *   The node insertion can be sibling (next) or child
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  /* _GCT_TREE_H_ */

SourceForge.net Logo
Project space on SourceForge.net