GLAST / LAT > DAQ and FSW > FSW > Doxygen Index> RIM / V3-1-2 > rim / linux-gcc


Interface   Data Structures   File List   Data Fields   Globals  

RIM_data.c File Reference

Functions manipulating the data attached to a configuration tree. More...

#include <RIM_p.h>
#include <RIM/RIM_msgs.h>
#include <RIM_data.ic>
#include <RIM_number.ic>
#include <RIM_descriptions.ic>
#include <RIM_AG_init_p.h>

Defines

#define CHECK_TYPE(t_)
 Check that the type is valid.

Functions

int RIM_compare (const RIM *rim1, const RIM *rim2, RIM_map *map)
 Compare all the nodes of rim1 and rim2, marking differences in map.
unsigned RIM_contrast (const RIM *rim1, const RIM *rim2, const RIM_map *ign, RIM_type *r_type, RIM_addr *r_addr)
 Compare all the nodes of rim1 and rim2, that are not marked to be ignored.
unsigned RIM_get (const RIM *rim, RIM_type type, const RIM_addr *addr, int regId, void *value)
 Put the contents of the requested register and field into value.
unsigned RIM_set (RIM *rim, RIM_type type, const RIM_addr *addr, int regId, const void *value)
 Set the value of a register.
unsigned RIM_deleteData (RIM *rim, RIM_type type, const RIM_addr *addr)
 Delete all the register field settings for the targeted component and clear the corresponding bit in the map.
void RIM_setReg (void *cpt, RIM_type type, int regId, const void *value)
 Set the regId register of cpt structure to value.
int RIM_setFld (void *cpt, RIM_type type, int regId, int fldId, const void *value)
 Sets the tgtId field of the regId register of cpt structure to value.
void RIM_getReg (const void *cpt, RIM_type type, int regId, void *value)
 Puts the contents of the target register regId into value.
void RIM_getFld (const void *cpt, RIM_type type, int regId, int fldId, void *value)
 Puts the contents of the fldId field of register regId into value.
int RIM_regEnum (RIM_type type, int regId)
 Convert the public register ID in to the RIM internal register ID.


Detailed Description

Functions manipulating the data attached to a configuration tree.

Author:
James Swain & Owen Saxton
$Id: RIM_data.c,v 1.5 2011/03/27 06:53:19 saxton Exp $

Define Documentation

#define CHECK_TYPE ( t_   ) 

Value:

{ \
    if (N_RIM_TYPES <= t_)   return RIM_TYPEUNKN;  \
    if (!RIM_cptDesc(t_)) return RIM_CPTNONE;   \
}
Check that the type is valid.

Referenced by RIM_deleteData(), RIM_get(), and RIM_set().


Function Documentation

int RIM_compare ( const RIM rim1,
const RIM rim2,
RIM_map map 
)

Compare all the nodes of rim1 and rim2, marking differences in map.

If a node is NULL, then the default node is used.

Parameters:
rim1 First in-memory configuration structure
rim2 Second in-memory configuration structure
map Indicates which nodes are different
Returns:
Number of different nodes

References checkBit(), compareCpt(), RIM_cptDesc(), RIM_number(), and setBit().

unsigned RIM_contrast ( const RIM rim1,
const RIM rim2,
const RIM_map ign,
RIM_type r_type,
RIM_addr r_addr 
)

Compare all the nodes of rim1 and rim2, that are not marked to be ignored.

If a node is NULL then the default node is used.

Parameters:
rim1 First in memory configuration model
rim2 Second in memory configuration model
ign Pointer to a bit-map of sections of the LAT to ignore
r_type Location to fill with the type of the first different node (can be NULL if not interested)
r_addr Pointer to an address structure to populate with the first different node (can be NULL if not interested)
Return values:
RIM_SUCCESS If the two in-memory models are functionally identical
RIM_DIFFER If the two in-memory models are different

References checkBit(), compareCpt(), RIM_cptDesc(), RIM_getAddress(), and RIM_number().

unsigned RIM_deleteData ( RIM rim,
RIM_type  type,
const RIM_addr addr 
)

Delete all the register field settings for the targeted component and clear the corresponding bit in the map.

Parameters:
rim In memory configuration structure to be manipulated
type Type of data sought
addr Address of the leaf to delete
Return values:
RIM_SUCCESS if all the parameters are in bounds and the data is successfully retrieved.
RIM_TYPEUNKN if type is not a valid RIM_type

References CHECK_TYPE, clearBit(), RIM_cptDesc(), RIM_getIndex(), RIM_number(), and sizeofCpt().

unsigned RIM_get ( const RIM rim,
RIM_type  type,
const RIM_addr addr,
int  regId,
void *  value 
)

Put the contents of the requested register and field into value.

Parameters:
rim In memory configuration structure to be interogated
type Type of data sought
addr Address of the leaf requested
regId Register to get, as LAT hardware ID
value Location to put the contents of the target field
Return values:
RIM_SUCCESS if all the parameters are in bounds and the data is successfully retrieved.
RIM_TYPEUNKN if type is not a valid RIM_type
RIM_CPTNONE if the requested type has no real data
RIM_ADDRBCST if the address contains a mixture of broadcast and unicast components
RIM_ADDRRNGE if any component of the address is outside the allowable range for this type
RIM_BADREGID if regId is outside the acceptable range of register IDs for this type
RIM_NOTSET if the requested node has not been previously set
RIM_BADREGID The register ID was unrecognized

References CHECK_TYPE, checkBit(), RIM_getIndex(), RIM_getReg(), RIM_number(), and RIM_regEnum().

void RIM_getFld ( const void *  cpt,
RIM_type  type,
int  regId,
int  fldId,
void *  value 
)

Puts the contents of the fldId field of register regId into value.

Parameters:
type Type of data sought
cpt Pointer to start of the component data.
regId Enumerated ID of the register
fldId Target field
value Location to put the contents of the target field

References RegDescription::fd, getLngLngFld(), getLongFld(), getShortFld(), CptDescription::rd, RIM_cptDesc(), and CptDescription::width.

void RIM_getReg ( const void *  cpt,
RIM_type  type,
int  regId,
void *  value 
)

Puts the contents of the target register regId into value.

Parameters:
cpt Pointer to start of the component data.
type Type of data sought
regId Enumerated ID of the register
value Location to put the contents of the target reg

References getLngLngReg(), getLongReg(), getShortReg(), RIM_cptDesc(), and CptDescription::width.

Referenced by RIM_correct(), RIM_get(), RIM_loadAfeConfig(), RIM_loadCfeConfig0(), RIM_loadCfeConfig1(), RIM_loadSplit(), and RIM_loadTfeDac().

int RIM_regEnum ( RIM_type  type,
int  regId 
)

Convert the public register ID in to the RIM internal register ID.

Parameters:
type Component type
regId Register ID in terms of hardware numbering (the Huffer docs and LEM)
Returns:
The index of the register in the array of register descriptions within the component description, or -1 if the register ID is not recognized.

References CptDescription::nregs, CptDescription::rd, RegDescription::regId, and RIM_cptDesc().

Referenced by RIM_get(), and RIM_set().

unsigned RIM_set ( RIM rim,
RIM_type  type,
const RIM_addr addr,
int  regId,
const void *  value 
)

Set the value of a register.

Parameters:
rim In memory configuration structure to manipulated
type Type of data sought
addr Address of the leaf requested
regId Register to set, as a LAT hardware ID
value Ptr to value to set the register field to
Return values:
RIM_SUCCESS if all the parameters are in bounds and the data is successfully retrieved.
RIM_TYPEUNKN if type is not a valid RIM_type
RIM_CPTNONE if the requested type has no real data
RIM_ADDRBCST if the address contains a mixture of broadcast and unicast components
RIM_ADDRRNGE if any component of the address is outside the allowable range for this type
RIM_BADREGID if regId is outside the acceptable range of register IDs for this type

References CHECK_TYPE, RIM_getIndex(), RIM_number(), RIM_regEnum(), RIM_setReg(), and setBit().

int RIM_setFld ( void *  cpt,
RIM_type  type,
int  regId,
int  fldId,
const void *  value 
)

Sets the tgtId field of the regId register of cpt structure to value.

Parameters:
cpt Pointer to start of the component data.
type Type of component
regId Enum specifying register to write to
fldId Enum specifying field to write to
value Value to set the field to.
Return values:
RIM_SUCCESS If all goes well
RIM_FLDRANGE if the value is too big for the field

References RegDescription::fd, CptDescription::rd, RIM_cptDesc(), setLngLngFld(), setLongFld(), setShortFld(), and CptDescription::width.

void RIM_setReg ( void *  cpt,
RIM_type  type,
int  regId,
const void *  value 
)

Set the regId register of cpt structure to value.

Parameters:
cpt Pointer to start of the component data.
type Type of data sought
regId Enum specifing register to write to
value Value to set register to

References RIM_cptDesc(), setLngLngReg(), setLongReg(), setShortReg(), and CptDescription::width.

Referenced by RIM_clear(), RIM_construct(), RIM_correct(), and RIM_set().


Generated on Fri Sep 30 18:27:31 2011 by  doxygen 1.5.8