GLAST/LAT > DAQ and FSW > FSW > Doxygen Index > MEM / V5-4-1

Constituent: mem     Tag: mv2304


Interface   Data Structures   File List   Data Fields   Globals  

MEM_control.c File Reference

MEM application-level control functions. More...

#include <string.h>
#include "CDM/CDM_pubdefs.h"
#include "ITC/ITC_pubdefs.h"
#include "LCBD/LCBD.h"
#include "MSG/MSG_pubdefs.h"
#include "PBS/FPA.h"
#include "PBS/INT.ih"
#include "PBS/MBA.h"
#include "PBS/MTX.h"
#include "PBS/WUT.h"
#include "MEM/MEM_cmdxtrn.h"
#include "MEM/MEM_dump.h"
#include "MEM/MEM_load.h"
#include "MEM/MEM_map.h"
#include "MEM/MEM_msgs.h"
#include "MEM/MEM_pubdefs.h"
#include "MEM_DB/MEM_DB_schema.h"
#include "MEM_control.h"
#include "Memmap.h"

Include dependency graph for MEM_control.c:

Include dependency graph

Defines

#define INT_FAKE_OK
 Acknowledges that we realize interrupts can't be disabled on host machines.


Functions

unsigned int mem_map_init (MEM_Control *ctl_p)
 Init the memory map for dumps and loads.

unsigned int mem_pool_init (FPA_fcb **fcb_pp, void **buf_pp, int *in_use_p, unsigned int num_pkt, unsigned int pkt_bytes)
 Initialize an FPA pool.

unsigned int mem_pool_free (FPA_fcb **fcb_pp, void **buf_pp, int *in_use_p)
 Free an FPA pool.

unsigned int mem_create_control_block (void)
 Allocate and adopt a MEM control information block.

unsigned int mem_lock_access (MEM_Control *ctl_p)
 Lock access to a MEM control block.

unsigned int mem_unlock_access (MEM_Control *ctl_p, unsigned int status)
 Unlock access to a MEM control block.

unsigned int mem_change_state (MEM_Control *ctl_p, unsigned int valid_states, MEM_Control_State new_state)
 Change the state of the MEM functions.

unsigned int MEM_initialize (ITC_Task *task_p, ITC_TaskID tid)
 Initialize the MEM application-level functions.

unsigned int MEM_init (void)
 Initialize the MEM application-level functions using CDM.

unsigned int MEM_shutdown (void)
 Shutdown the MEM functions.

unsigned int MEM_updateStats (MEM_Control *ctl_p, unsigned int msg_status, unsigned int fcode)
 Common routine to update MEM command statistics.

unsigned int MEM_getInfo (MEM_Info *info_p)
 Get current state of the MEM application-level functions.


Variables

MEM_ControlMem_control_p = NULL
 Pointer to the MEM control information block.

unsigned char mem_sim_ram_buf [1024]
 Buffer of simulated RAM buffer for memory dumps and loads.


Detailed Description

MEM application-level control functions.

**  CVS $Id: MEM_control.c,v 1.20 2005/08/12 15:56:34 dmay Exp $
**  

Control functions for the application-level portion of the MEM package. These functions are used within the context of another task, so they do not actually start and configure a task of their own.


Function Documentation

unsigned int mem_change_state MEM_Control ctl_p,
unsigned int  valid_states,
MEM_Control_State  new_state
[static]
 

Change the state of the MEM functions.

Parameters:
ctl_p Pointer to MEM control block.
valid_states Bitmask of valid current states.
new_state New state.
Returns:
MSG code.

Here is the call graph for this function:

unsigned int mem_create_control_block void   )  [static]
 

Allocate and adopt a MEM control information block.

Returns:
MSG code.

unsigned int MEM_getInfo MEM_Info info_p  ) 
 

Get current state of the MEM application-level functions.

Parameters:
info_p Pointer to location to return state information.
Returns:
MSG code.

Here is the call graph for this function:

unsigned int MEM_init void   ) 
 

Initialize the MEM application-level functions using CDM.

This function is a wrapper for MEM_initialize() that uses CDM to determine its parameters.

Returns:
Zero if successful.

A MSG code if an error occurs.

Here is the call graph for this function:

unsigned int MEM_initialize ITC_Task *  task_p,
ITC_TaskID  tid
 

Initialize the MEM application-level functions.

This function initializes the application-level portion of the MEM package and transitions it to the INITIALIZED state. It should be the first MEM function called when using the MEM package.

At the application level, there is no MEM task. Instead, the handlers for the MEM telecommands are attached to another task. If a valid value is provided for either the task_p or the tid parameter, then this function will attach the MEM command handlers to the corresponding task. If neither parameter is specified (by setting task_p to NULL and tid to -1), then it is assumed that the controlling task will attach the MEM command handlers.

Parameters:
task_p Pointer to controlling task's description block.
tid ID of the controlling task.
Returns:
Zero if successful.

An error MSG code if the MEM package has already been initialized or an error occurs.

Here is the call graph for this function:

unsigned int mem_lock_access MEM_Control ctl_p  )  [static]
 

Lock access to a MEM control block.

Parameters:
ctl_p Pointer to MEM control block.
Returns:
MSG code.

unsigned int mem_map_init MEM_Control ctl_p  )  [static]
 

Init the memory map for dumps and loads.

Parameters:
ctl_p Pointer to memory control block.
Returns:
MSG code.

Here is the call graph for this function:

unsigned int mem_pool_free FPA_fcb **  fcb_pp,
void **  buf_pp,
int *  in_use_p
[static]
 

Free an FPA pool.

Parameters:
fcb_pp Pointer to FPA control block pointer.
buf_pp Pointer to pool data buffer pointer.
in_use_p Pointer to count of packets in use.
Returns:
MSG code.

unsigned int mem_pool_init FPA_fcb **  fcb_pp,
void **  buf_pp,
int *  in_use_p,
unsigned int  num_pkt,
unsigned int  pkt_bytes
[static]
 

Initialize an FPA pool.

Parameters:
fcb_pp Pointer to location to store FPA control block pointer.
buf_pp Pointer to location to store pool data buffer pointer.
in_use_p Pointer to count of packets in use.
num_pkt Number of packets to include in the pool.
pkt_bytes Size of each packet, in bytes.
Returns:
MSG code.

unsigned int MEM_shutdown void   ) 
 

Shutdown the MEM functions.

This function shuts down the MEM package and transitions it back to the UNINITIALIZED state. It can be called only if the current MEM state is INITIALIZED, INIT_FAIL, or SHUTDOWN_FAIL.

Returns:
Zero if successful.

An error MSG code if the MEM package is in an invalid state or an error occurs.

Here is the call graph for this function:

unsigned int mem_unlock_access MEM_Control ctl_p,
unsigned int  status
[static]
 

Unlock access to a MEM control block.

Parameters:
ctl_p Pointer to MEM control block.
status Previous status code.
Returns:
MSG code.

unsigned int MEM_updateStats MEM_Control ctl_p,
unsigned int  msg_status,
unsigned int  fcode
 

Common routine to update MEM command statistics.

Parameters:
ctl_p Pointer to MEM control block.
msg_status Status MSG code for the command.
fcode Function code for the command.
Returns:
MSG code.

Here is the call graph for this function:


Variable Documentation

MEM_Control* Mem_control_p = NULL
 

Pointer to the MEM control information block.

Pointer to the control block (state) for the MEM application-level functions.

unsigned char mem_sim_ram_buf
 

Initial value:

    {
        0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16
    }
Buffer of simulated RAM buffer for memory dumps and loads.

This buffer simulates the RAD750 RAM in a non-RAD750 environment.


Generated on Mon Aug 15 23:35:47 2005 by doxygen 1.3.3