Sun Microsystems CP2500 manual Code Example 1-1System Watchdog Node Management Code Example

Page 20

CODE EXAMPLE 1-1System Watchdog Node Management Code Example (Continued)

#define EM_INIT

1

#define EM_GETROOT

2

#define EM_GETPVALBYNAME

3

#define USAGE_STR

"Usage:\n"\

"wdadm -l [<controller_name:timer_name>...]\n"\

"wdadm -m <controller_name:timer_name> [-t <timeout>]"\

" [-a action]]\n"\

"wdadm -c <controller_name> -o <op>\n"

#define DETAILED_HELP "wdadm - System Watchdog Controller Administration\n"\ "Description:\n"\

"The operations include displaying status (-l), modifying the values (-m)\n"\ "and executing commands on the watchdog controller (-c).\n"\

"This utility must be run with super user permissions.\n"\ "OPTIONS\n"\

"

-l list all

the watchdog timer nodes.\n"\

"

Each Timer node is denoted as controller:timer\n"\

"

Example:\n"\

 

 

"

wdadm -l

 

 

- lists all the nodes\n"\

"

wdadm -l

c1:t1 c1:t2

- lists c:t1 and c:t2 nodes\n"\

"

 

c1

- controller name\n"\

"

 

t1

- timer name\n"\

"

-m modify the timeout and action parameters for a timer node.\n"\

"

Example:\n"\

 

 

"

wdadm -m

c1:t1 -t <timeout in ms> -a <action>\n"\

"

wdadm -m

c1:t1 -t <timeout in ms>\n"\

"

wdadm -m

c1:t1 -a <action>\n"\

"

Note: Before using this option, the controller must be\n"\

"

disarmed (using -c option).\n"\

"

-c Execute commands on the watchdog controller node\n"\

"

Commands

supported are : arm, disarm\n"\

"

Example:\n"\

 

 

"

wdadm -c

controller -o arm\n"\

"

arms the

watchdog controller node called controller\n"

#define HEADER

"NAME (controller:timer)\t\tSTATUS"\

 

 

"\t\tACTION\t\tTIMEOUT\n"

#define PRINT_FORMAT

"\t%-10s\t%-10s\t%d"

#define ILLEGAL_TIMEOUT -999

 

/* watchdog properties */

 

 

#define WATCHDOG_ACTION

 

"WdAction"

#define WATCHDOG_TIMEOUT

 

"WdTimeout"

#define WATCHDOG_STATUS

 

"State"

#define WATCHDOG_OP

 

 

"WdOp"

#define PICL_WATCHDOG_CONTROLLER

"watchdog-controller"

6 Netra CP2500 Board Programming Guide • March 2007

Image 20
Contents Netra CP2500 Board Programming Guide Page Contents User Flash Figures Vi Netra CP2500 Board Programming Guide March Tables Viii Netra CP2500 Board Programming Guide March Code Samples Netra CP2500 Board Programming Guide March Preface How This Book Is OrganizedUsing Unix Commands Typographic ConventionsShell Prompts Related DocumentationSun Welcomes Your Comments Documentation, Support, and TrainingThird-Party Web Sites Watchdog Timer OverviewPicl Plug-In Module 1Watchdog Plug-In Interfaces for Netra CP2500 Board Software 2Properties Under watchdog-controllerNode3Properties Under watchdog-timerNode HEALTHY#Watchdog Node Management Code Code Example 1-1System Watchdog Node Management Code ExampleCode Example 1-1System Watchdog Node Management Code Example Usagestr Code Example 1-1System Watchdog Node Management Code Example Code Example 1-1System Watchdog Node Management Code Example Code Example 1-1System Watchdog Node Management Code Example Code Example 1-1System Watchdog Node Management Code Example Code Example 1-1System Watchdog Node Management Code Example Null Code Example 1-1System Watchdog Node Management Code Example Code Example 1-1System Watchdog Node Management Code Example Code Example 1-1System Watchdog Node Management Code Example Code Example 1-1System Watchdog Node Management Code Example Code Example 1-1System Watchdog Node Management Code Example Notreached Code Example 1-1System Watchdog Node Management Code Example OpenBoot Prom Interface Netra CP2500 Board Programming Guide March Environmental Monitoring 1Compatible Environmental Monitoring Components Environmental Monitoring Component CompatibilityTypical Environmental Monitoring System Application I2C Typical Cycle From Power Up to Shutdown Environmental Monitoring Protection at the OpenBoot PromPost Shutdown Recovery Hardware Environmental Monitoring Functions 3I2C ComponentsEnvironmental Monitoring CPU Switching Power On and Off Inlet, Exhaust, and CPU Temperature MonitoringNetra CP2500 Board Programming Guide March OpenBoot Prom Environmental Monitoring Critical Temperature Response at OpenBoot PromUsing the show-sensorsCommand at OpenBoot Prom Environmental Monitoring Application ProgrammingReading Temperature Sensor States Using 4PICL Temperature Sensor Class Node PropertiesUsing a Configuration File for Sensor Information Solaris Driver InterfaceSample Application Program Code Example 2-1Sample envmond Application ProgramCode Example 2-1Sample envmond Application Program Code Example 2-1Sample envmond Application Program Code Example 2-1Sample envmond Application Program Reading the CPU Temperature Environmental Limits Prtdiag command example5Description of Values Displayed by Solaris Commands User Flash User Flash Usage and Implementation1User Flash Node Properties OpenBoot Prom Device Tree and PropertiesUser Flash Driver Application Programming Interface User Flash Device FilesInterface Header File 2System CallsStructures to Use in Ioctl Arguments Code Example 3-1PROM Information StructureCode Example 3-2User Flash Interface Structure ErrorsExample Programs Read Example Program Code Example 3-3Read Action on User Flash DeviceWrite Example Program Code Example 3-4Write Action on User Flash DeviceCode Example 3-4Write Action on User Flash Device Block Erase Example Program Code Example 3-5Block Erase Action on User Flash DeviceCode Example 3-5Block Erase Action on User Flash Device Sample User Flash Application Program Code Example 3-6Sample User Flash Application ProgramCode Example 3-6Sample User Flash Application Program Code Example 3-6Sample User Flash Application Program Code Example 3-6Sample User Flash Application Program Code Example 3-6Sample User Flash Application Program Code Example 3-6Sample User Flash Application Program Index PiclWatchdog-controller, 3 Watchdog-timer, 3