GLAST / LAT > DAQ and FSW > FSW > Doxygen Index> LCBD / V1-5-1 > lcbd / sun-gcc
#include "LCBD/LCBD_clk.h"
#include "LCBD/LCBD_evt.h"
#include "LCBD/LCBD_nut.h"
#include "LCBD/LCBD_rst.h"
#include "LCBD/LCBD_stats.h"
#include "PBI/Endianness.h"
#include "PBI/Attribute.h"
#include "MSG/MSG_pubdefs.h"
#include "PBS/FORK.h"
#include "PBS/TASK.h"
#include "PBS/L.h"
#include "PBS/MTX.h"
#include "PBS/SEM.h"
#include "PBS/BSWP.ih"
#include "LCBD/LCBD_drv.h"
Classes | |
struct | _LCBD_clk_ucb |
Clock Unit Control Block. More... | |
struct | _LCBD_hcb |
Handler control block. More... | |
struct | _LCBD_rst_msg |
Result dispatch messsage. More... | |
struct | _LCBD_rst_flush_msg |
Result flush dispatch messsage. More... | |
struct | _LCBD_rst_ccb |
The Command Control Block, describes the control information for needed to control access to the LCB's command request queue. More... | |
struct | _LCBD_rst_ucb |
Result Unit Control Block. More... | |
struct | _LCBD_evt_msg |
Event dispatch messsage. More... | |
struct | _LCBD_evt_cbb |
Cached information about the circular buffer. More... | |
struct | _LCBD_evt_fcb |
Event Unit free control block. More... | |
struct | _LCBD_evt_ucb |
Event Unit control block. More... | |
struct | _LCBD_siv_bf |
The driver's State Informat Vector, bit field representation. More... | |
struct | _LCBD_siv_us |
The driver's State Informat Vector, unsigned shorts. More... | |
union | _LCBD_siv |
Union of the bit field representation of the state vector with an unsigned int. More... | |
struct | _LCBD_ucb |
Control block for the 3 units that comprise the LCB. More... | |
struct | _LCBD_scb |
Statistics control block. More... | |
struct | _LCBD_ncb_msg |
Format of the fork notification messsage. More... | |
struct | _LCBD_ncb |
Notification control block. More... | |
struct | _LCBD_icb |
Interrupt control block. More... | |
struct | _LCBD_aib |
Asycnchronous Initialization Block. More... | |
struct | _LCBD |
Struct containing fundamental parameters for the LCB. More... | |
Defines | |
#define | _DPRINTF(format, args...) |
expands to empty statement for production builds | |
#define | CHECK_EQ(n, a, b) struct Check_ ## n { int x[1 / (a == b) ]; } |
Checks is a = b, and if not the compiler will issue an error. | |
#define | LCBD_K_INTERNAL_OP_STALL 0 |
Used as the stall value for commands to the LCBD internal registers. | |
Typedefs | |
typedef enum _LCBD_DISPATCH_TYPE | LCBD_DISPATCH_TYPE |
Typedef for enum __LCBD_DISPATCH_TYPE. | |
typedef struct _LCBD_clk_ucb | LCBD_clk_ucb |
Typedef for struct _LCBD_clk_ucb. | |
typedef struct _LCBD_hcb | LCBD_hcb |
Typedef for struct _LCBD_hcb. | |
typedef struct _LCBD_rst_msg | LCBD_rst_msg |
Typedef for struct _LCBD_rst_msg. | |
typedef struct _LCBD_rst_flush_msg | LCBD_rst_flush_msg |
Typedef for struct _LCBD_rst_flush_msg. | |
typedef struct _LCBD_rst_ccb | LCBD_rst_ccb |
Typedef for struct _LCBD_rst_ccb. | |
typedef struct _LCBD_rst_ucb | LCBD_rst_ucb |
Typedef for struct _LCBD_rst_ucb. | |
typedef struct _LCBD_evt_msg | LCBD_evt_msg |
Typedef for struct _LCBD_evt_msg. | |
typedef struct _LCBD_evt_cbb | LCBD_evt_cbb |
Typedef for struct _LCBD_evt_cbb. | |
typedef struct _LCBD_evt_fcb | LCBD_evt_fcb |
Typedef for struct _LCBD_evt_fcb. | |
typedef struct _LCBD_evt_ucb | LCBD_evt_ucb |
Typedef for struct _LCBD_evt_ucb. | |
typedef enum _LCBD_SIV_V | LCBD_SIV_V |
Typedef for enum _LCBD_SIV_V. | |
typedef enum _LCBD_SIV_M | LCBD_SIV_M |
Typedef for enum _LCBD_SIV_M. | |
typedef struct _LCBD_siv_bf | LCBD_siv_bf |
Typedef for enum _LCBD_siv_bf. | |
typedef struct _LCBD_siv_us | LCBD_siv_us |
Typedef for enum _LCBD_siv_us. | |
typedef union _LCBD_siv | LCBD_siv |
Typedef for union _LCBD_siv. | |
typedef struct _LCBD_ucb | LCBD_ucb |
Typedef for struct _LCBD_ucb. | |
typedef struct _LCBD_scb | LCBD_scb |
Typedef for struct _LCBD_scb. | |
typedef struct _LCBD_ncb_msg | LCBD_ncb_msg |
Typedef for struct _LCBD_ncb_msg. | |
typedef struct _LCBD_ncb | LCBD_ncb |
Typedef for struct _LCBD_ncb. | |
typedef enum _LCBD_ICB_K_TYPE | LCBD_ICB_K_TYPE |
Typedef for enum _LCBD_ICB_K_TYPE. | |
typedef struct _LCBD_icb | LCBD_icb |
Typedef for struct _LCBD_icb. | |
typedef void(* | LCBD_acb )(void *prm, LCBD lcb) |
Callback for LCBD_load asynchronous completion. | |
typedef enum _LCBD_aib_action | LCBD_aib_action |
Typedef for enum _LCBD_aib_action. | |
typedef struct _LCBD_aib | LCBD_aib |
Typedef for struct _LCBD_aib. | |
Enumerations | |
enum | _LCBD_DISPATCH_TYPE { LCBD_DISPATCH_TYPE_ISR = 0, LCBD_DISPATCH_TYPE_USR = 1 } |
Enumeration of the different types of events that cause bottom half processing. More... | |
enum | _LCBD_SIV_V { LCBD_SIV_V_PCI_UNINITIALIZED = 0, LCBD_SIV_V_SW_UNINITIALIZED = 1, LCBD_SIV_V_LATP_UNINITIALIZED = 2, LCBD_SIV_V_NOCLOCK = 3, LCBD_SIV_V_DISCONNECTED = 4, LCBD_SIV_V_RESULT_DISABLED = 5, LCBD_SIV_V_CNT = 6, LCBD_SIV_V_STATE = 16 } |
Bit field offsets for the State Information Vector. More... | |
enum | _LCBD_SIV_M { LCBD_SIV_M_PCI_UNINITIALIZED = (1 << LCBD_SIV_V_PCI_UNINITIALIZED), LCBD_SIV_M_SW_UNINITIALIZED = (1 << LCBD_SIV_V_SW_UNINITIALIZED), LCBD_SIV_M_LATP_UNINITIALIZED = (1 << LCBD_SIV_V_LATP_UNINITIALIZED), LCBD_SIV_M_NOCLOCK = (1 << LCBD_SIV_V_NOCLOCK), LCBD_SIV_M_DISCONNECTED = (1 << LCBD_SIV_V_DISCONNECTED), LCBD_SIV_M_RESULT_DISABLED = (1 << LCBD_SIV_V_RESULT_DISABLED), LCBD_SIV_M_STATE = 0xFFFF0000, LCBD_SIV_M_VEC_INITIAL_VALUE = (1 << LCBD_SIV_V_CNT) - 1, LCBD_SIV_M_STATE_ONLINE = (LCBD_STATE_ONLINE << LCBD_SIV_V_STATE), LCBD_SIV_M_STATE_OFFLINE = (LCBD_STATE_OFFLINE << LCBD_SIV_V_STATE), LCBD_SIV_M_STATE_UNINITIALIZED, LCBD_SIV_M_STATE_UNLOADING = (LCBD_STATE_UNLOADING << LCBD_SIV_V_STATE), LCBD_SIV_M_INITIAL_VALUE } |
Bit field masks for the State Information Vector. More... | |
enum | _LCBD_ICB_K_TYPE { LCBD_ICB_K_TYPE_PCI = 0, LCBD_ICB_K_TYPE_PID = 1 } |
The interrupt source type. | |
enum | _LCBD_aib_action { LCBD_AIB_ACTION_AVAILABLE = -1, LCBD_AIB_ACTION_NO_ACCESS = 0, LCBD_AIB_ACTION_COMPLETE = 1, LCBD_AIB_ACTION_CANCEL = 2 } |
The action to perform. More... | |
Functions | |
static __inline unsigned int | LCBD__pciLoad32 (volatile unsigned int *src) ATTR_UNUSED_OK |
Read a 32-bit integer from PCI Memory. | |
static __inline void | LCBD__pciStore32 (volatile unsigned int *dest, unsigned int w) ATTR_UNUSED_OK |
Write a 32-bit integer to PCI Memory. | |
static __inline void | LCBD__pciSynchStore32 (volatile unsigned int *dest, unsigned int w) ATTR_UNUSED_OK |
Write a 32-bit integer to PCI Memory. | |
static __inline unsigned int | msr_get (void) |
Gets the value of the Power PC Machine Status Register. | |
static __inline unsigned int | msr_clr (unsigned int msr) |
Clears the interrupt enable bit in the specified msr. | |
static __inline void | msr_put (unsigned int msr) |
Puts/restores the specified msr back into the Machine Status Register. | |
unsigned int | LCBD_stats_init (LCBD_scb *scb) |
Initializes the statistics control block. | |
unsigned int | LCBD_stats_destroy (LCBD_scb *scb) |
Destroys the statistics control block. | |
unsigned int | lcbd_csr_access (LCBD lcb, unsigned int value, unsigned int field_select, unsigned short int timeout, unsigned int *prv, unsigned int *cur) |
Utility routine to compose and execute an access command to LCB's CSR register independent of whether the driver is offline or online. | |
unsigned int | lcbd_faults_access (LCBD lcb, unsigned int value, unsigned int field_select, unsigned short int timeout, unsigned int *prv, unsigned int *cur) |
Utility routine to compose and execute an access command to LCB's FAULTS register independent of whether the driver is offline or online. | |
unsigned int | lcbd_create_handler (LCBD_hcb *hcb, const char *name, int priority, LCBD lcb, int que_cnt, const FORK_que_cfg *que_cfg, int que_id, unsigned int failure) |
Creates a FORK processing task. | |
FORK_cb_status | lcbd_evt_handler (FORK_cb_prm parameter, FORK_msg_hdr *fork_msg) |
The main LCBD descriptor dispatching routine for event traffic. | |
FORK_cb_status | lcbd_rst_handler (FORK_cb_prm parameter, FORK_msg_hdr *fork_msg) |
The main LCBD descriptor dispatching routine. | |
FORK_cb_status | lcbd_rst_flush_handler (FORK_cb_prm parameter, FORK_msg_hdr *fork_msg) |
The main LCBD descriptor dispatching routine. | |
unsigned int | lcbd_nut_post (LCBD lcb) |
Posts a message to the notify service task. | |
unsigned int | lcbd_nut_handler_destroy (LCBD lcb, unsigned int *exit_status) |
Destroys the notification service task. |
CVS $Id: LCBD_p.h,v 1.17 2009/03/26 00:25:49 russell Exp $
#define CHECK_EQ | ( | n, | |||
a, | |||||
b | ) | struct Check_ ## n { int x[1 / (a == b) ]; } |
Checks is a = b, and if not the compiler will issue an error.
n | Unique identifying string (helps isolate the error) | |
a | The value to check | |
b | The value to check |
Callback for LCBD_load asynchronous completion.
prm | A user specified parameter | |
lcb | The LCB handle |
Typedef for struct _LCBD_aib.
Typedef for struct _LCBD_evt_fcb.
Information for freeing events
Typedef for struct _LCBD_evt_msg.
Describes the FORK message passed to the event handler
Typedef for struct _LCBD_evt_ucb.
Combines an generic handler control block with a specific message
Typedef for struct _LCBD_hcb.
Describes the parameters of a LCBD handler (either event or result)
Typedef for struct _LCBD_ncb_msg.
Typedef for struct _LCBD_rst_ccb.
Typedef for struct _LCBD_rst_flush_msg.
Describes the FORK message passed to the result flush handler. This handler gets called back whenever the driver goes offline and there are messages on the pending que.
Typedef for struct _LCBD_rst_msg.
Describes the FORK message passed to the result handler
Typedef for struct _LCBD_rst_ucb.
Combines an generic handler control block with a specific message
Typedef for struct _LCBD_scb.
The block contains the context used by the LCBD statistics routines. These routines do not control the accumulation of the statistics, but manage the fetching and clearing of them.
Typedef for enum _LCBD_siv_bf.
Typedef for struct _LCBD_ucb.
The block contains the context used by the LCBD to control each of its three (nearly) distinct units. These units are
enum _LCBD_aib_action |
enum _LCBD_DISPATCH_TYPE |
enum _LCBD_SIV_M |
Bit field masks for the State Information Vector.
enum _LCBD_SIV_V |
Bit field offsets for the State Information Vector.
static __inline unsigned int LCBD__pciLoad32 | ( | volatile unsigned int * | src | ) | [static] |
Read a 32-bit integer from PCI Memory.
src | Pointer source memory location |
static __inline void LCBD__pciStore32 | ( | volatile unsigned int * | dest, | |
unsigned int | w | |||
) | [static] |
Write a 32-bit integer to PCI Memory.
dest | Pointer destination memory | |
w | 32-bit value to store |
static __inline void LCBD__pciSynchStore32 | ( | volatile unsigned int * | dest, | |
unsigned int | w | |||
) | [static] |
Write a 32-bit integer to PCI Memory.
dest | Pointer destination memory | |
w | 32-bit value to store |
unsigned int lcbd_create_handler | ( | LCBD_hcb * | hcb, | |
const char * | name, | |||
int | priority, | |||
LCBD | lcb, | |||
int | que_cnt, | |||
const FORK_que_cfg * | que_cfg, | |||
int | que_id, | |||
unsigned int | failure | |||
) |
Creates a FORK processing task.
hcb | The LCBD handler control block, upon success, this is filled in with information about the newly created FORK task. | |
name | The name of the FORK task | |
priority | The priority of the task | |
lcb | Used as the callback parameter to the handler | |
que_cnt | The number of queues to configure | |
que_cfg | The configuration of each que | |
que_id | The que id to use for the handler | |
failure | Status code to use in case of failure |
unsigned int lcbd_csr_access | ( | LCBD | lcb, | |
unsigned int | value, | |||
unsigned int | field_select, | |||
unsigned short int | stall, | |||
unsigned int * | prv, | |||
unsigned int * | cur | |||
) |
Utility routine to compose and execute an access command to LCB's CSR register independent of whether the driver is offline or online.
lcb | The LCB driver handle | |
value | The value to write. Only bits matching those in the field_select parameter will actually be written. | |
field_select | Pattern of those bits in value to write | |
stall | The stall period, in units of 20MHz clock ticks, for the LCB to wait for completion. | |
prv | Pointer to receive the value of the register before modification. This may be NULL. | |
cur | Pointer to receive the value of the register after modification. This may be NULL. |
FORK_cb_status lcbd_evt_handler | ( | FORK_cb_prm | parameter, | |
FORK_msg_hdr * | fork_msg | |||
) |
The main LCBD descriptor dispatching routine for event traffic.
parameter | Pointer to private LCBD structure | |
fork_msg | FORK system message |
unsigned int lcbd_faults_access | ( | LCBD | lcb, | |
unsigned int | value, | |||
unsigned int | field_select, | |||
unsigned short int | stall, | |||
unsigned int * | prv, | |||
unsigned int * | cur | |||
) |
Utility routine to compose and execute an access command to LCB's FAULTS register independent of whether the driver is offline or online.
lcb | The LCB driver handle | |
value | The value to write. Only bits matching those in the field_select parameter will actually be written. | |
field_select | Pattern of those bits in value to write | |
stall | The stall time, in units of 20MHz clock ticks, for the LCB to wait for completion. | |
prv | Pointer to receive the value of the register before modification. This may be NULL. | |
cur | Pointer to receive the value of the register after modification. This may be NULL. |
unsigned int lcbd_nut_handler_destroy | ( | LCBD | lcb, | |
unsigned int * | exit_status | |||
) |
Destroys the notification service task.
lcb | The LCB driver handle | |
exit_status | Pointer to receive the exit status of the notification routine. |
unsigned int lcbd_nut_post | ( | LCBD | lcb | ) |
Posts a message to the notify service task.
lcb | The LCB driver handle |
FORK_cb_status lcbd_rst_flush_handler | ( | FORK_cb_prm | parameter, | |
FORK_msg_hdr * | fork_msg | |||
) |
The main LCBD descriptor dispatching routine.
parameter | lcb Pointer to private LCBD structure | |
fork_msg | FORK system message |
FORK_cb_status lcbd_rst_handler | ( | FORK_cb_prm | parameter, | |
FORK_msg_hdr * | fork_msg | |||
) |
The main LCBD descriptor dispatching routine.
parameter | lcb Pointer to private LCBD structure | |
fork_msg | FORK system message |
The msg parameter could be use to indicate who "tickled" the processing. The usual suspects are the ISR or a user.
unsigned int LCBD_stats_destroy | ( | LCBD_scb * | scb | ) |
Destroys the statistics control block.
LCBD_OK,on | success | |
Anything | else, failure |
scb | Pointer to the statistics control block to destroy |
unsigned int LCBD_stats_init | ( | LCBD_scb * | scb | ) |
Initializes the statistics control block.
LCBD_OK,on | success | |
LCBD_STATSIFL,on | failure |
scb | Pointer to the statistics control block to initialize |
static __inline unsigned int msr_clr | ( | unsigned int | msr | ) | [static] |
Clears the interrupt enable bit in the specified msr.
msr | The value of the machine status register to clear the interrupt in. |
static __inline unsigned int msr_get | ( | void | ) | [static] |
Gets the value of the Power PC Machine Status Register.
static __inline void msr_put | ( | unsigned int | msr | ) | [static] |
Puts/restores the specified msr back into the Machine Status Register.
msr | The value of the machine status register to put |