GLAST / LAT > DAQ and FSW > FSW > Doxygen Index> PBC / dev > pbc_build_ser_num / rhel5-32


Interface   Data Structures   File List   Data Fields   Globals  

build_ser_num.c File Reference

Build a RAD750 SUROM image containing CPU serial numbers. More...

#include <fcntl.h>
#include <stdio.h>
#include <stdlib.h>
#include <unistd.h>

Classes

struct  _Fill_Map
 Map of locations to fill with the CPU serial number value. More...

Defines

#define PROG_NAME   "pbc_build_ser_num"

Functions

int show_usage (void)
 Display a usage message for the program.
int show_too_large (char *desc, unsigned int act_value, unsigned int max_value)
 Display a message that a parameter is too large.
int show_missing (char *desc)
 Display a message that a parameter is missing.
int write_word (FILE *file, unsigned int value)
 Write a 32-bit value to a file.
int write_region (FILE *file, unsigned int value, unsigned int first, unsigned int last)
 Write to an emcLd input file to fill a region of memory.
int main (int argc, char **argv)
 Entry point for the program.

Variables

struct _Fill_Map Fill_Map []
 Instance of the _Fill_Map structure.


Detailed Description

Build a RAD750 SUROM image containing CPU serial numbers.

**  CVS $Id: build_ser_num.c,v 1.2 2005/10/17 15:56:44 dmay Exp $
**  

This utility builds a sparse RAD750 SUROM image that contains multiple copies of a CPU serial number. The serial number is a 32-bit value that contains the following information:

byte 0 (MSB) - serial ID value that is unique for each CPU board. byte 1 - physical (hardware) address of the CPU on the EBM. byte 2 - logical (ITC) address of the CPU. byte 3 (LSB) - location of the CPU (LAT, test-bed, NRL, etc.).

A copy of the CPU serial number value is stored between each of the four PBC images within the SUROM. Furthermore, the last 3K bytes of SUROM are filled with the CPU serial number value. The locations at which the copies are stored are hard-coded by this utility, i.e. there are no options to specify where to store them.

See the show_usage() function for a description of the options for this program.


Function Documentation

int main ( int  argc,
char **  argv 
)

Entry point for the program.

Parameters:
argc Number of command-line arguments.
argv Array of pointers to the command-line arguments.
Return values:
0 Success.
-1 Failure.

References Fill_Map, show_missing(), show_too_large(), show_usage(), and write_region().

int show_missing ( char *  desc  ) 

Display a message that a parameter is missing.

Parameters:
desc String describing the parameter.
Returns:
Status code value of -3.

Referenced by main().

int show_too_large ( char *  desc,
unsigned int  act_value,
unsigned int  max_value 
)

Display a message that a parameter is too large.

Parameters:
desc String describing the parameter.
act_value Actual value of the parameter.
max_value Maximum value of the parameter.
Returns:
Status code value of -2.

Referenced by main().

int show_usage ( void   ) 

Display a usage message for the program.

Returns:
Status code value of -1.

Referenced by main().

int write_region ( FILE *  file,
unsigned int  value,
unsigned int  first,
unsigned int  last 
)

Write to an emcLd input file to fill a region of memory.

Parameters:
file File pointer.
value 32-bit value to write.
first Address of first word in the region.
last Address of last word in the region.
Return values:
0 Success.
-6 Failure.

References write_word().

Referenced by main().

int write_word ( FILE *  file,
unsigned int  value 
)

Write a 32-bit value to a file.

Parameters:
file File pointer.
value 32-bit value to write.
Return values:
0 Success.
-6 Failure.

Referenced by write_region().


Generated on Mon Apr 18 14:04:01 2011 by  doxygen 1.5.8