/************************************************************************************ * primFuncts.h * * synopsis: Declares the PrimData structure tag used to exchange information with * the primitive routines in msgBuff.c and the primitive execution routines * which are in primFuncts.c * * related files: * listManager.c: Routines which manage the execution of a primitive list and * writing the reply data. The primitive execution functions in * primFuncts.c are called from listManager.c. * primFuncts.c: Primitive execution functions and function which initializes the * primParameters array of structures. * primParams.h: Defines primitive ids which are used to index the array of pointers * to primitive functions, structure tags for primitive data and reply * data, and prototypes of primitive functions. * * Damon Fasching, UW Madison (510)486-5230 fasching@wisconsin.cern.ch ************************************************************************************/ /* * For comments and a description of how to add a primitive, complete with an * example, see primParams.h. */ #ifndef PRIM_FUNCTS #define PRIM_FUNCTS #include "processor.h" #define UNINITIALIZED_PRIM (0xFFFFFFFF) /* * The PrimData structure includes items: * set by execPrim(), the routine which calls the primitive routines * priBodyPtr - pointer to the body of the primitive being executed * priBodyLength - length of the primitive body * repBodyPtr - pointer to location where reply data should be written * repBuffEnd - last address of the reply buffer * set by the primitive routine * repBodyLength - length of the reply message body */ typedef struct { UINT32 *priBodyPtr; UINT32 priBodyLength; UINT32 *repBodyPtr; UINT32 repBodyLength; UINT32 *repBuffEnd; } PrimData; /* * The two members of the PrimParameters structure are a pointer to a primitive * function of type INT32 which takes a pointer a PRIM_DATA structure as a * parameter, and the revision number of the primitive. */ struct PRIM_PARAMETERS { UINT32 primRevision; INT32 (*fxnValidate)(UINT32 revision, PrimData *primData); INT32 (*primFunction)(PrimData *); }; typedef struct { UINT32 primID; UINT32 primRevision; INT32 (*fxnValidate)(UINT32 revision, PrimData *primData); INT32 (*primFunction)(PrimData *primData); } PrimParameters; #endif