Sun Microsystems CP2500 manual Watchdog Node Management Code

Page 19

:_class watchdog-timer :name watchdog-level2

Watchdog Node Management Code

CODE EXAMPLE 1-1contains an example of the code used for managing the watchdog timer nodes. This code can be used to change watchdog timer action and timeout values and also to arm and disarm the watchdog controller.

CODE EXAMPLE 1-1System Watchdog Node Management Code Example

/*

*Copyright 2003 Sun Microsystems, Inc. All rights reserved.

*Use is subject to license terms.

*/

#pragma ident "@(#)wdadm.c

1.6

03/10/16 SMI"

/*

*This program is used to manage the system watchdog nodes.

*Please refer to libpicl(3LIB) for information on picl APIs

*To compile:

*cc -o wdadm -lpicl wdadm.c

*/

#include

<stdio.h>

 

#include

<stdlib.h>

 

#include

<stdarg.h>

 

#include

<string.h>

 

#include

<strings.h>

 

#include

<errno.h>

 

#include

<alloca.h>

 

#include

<libintl.h>

 

#include

<locale.h>

 

#include

<unistd.h>

 

#include

<assert.h>

 

#include

<inttypes.h>

 

#include

<sys/termios.h>

 

#include

<picl.h>

 

/*

 

 

* Error

codes

 

*/

 

 

#define EM_USAGE

0

Chapter 1 Watchdog Timer 5

Image 19
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 How This Book Is Organized PrefaceTypographic Conventions Using Unix CommandsRelated Documentation Shell PromptsThird-Party Web Sites Documentation, Support, and TrainingSun Welcomes Your Comments Overview Watchdog TimerPicl Plug-In Module 2Properties Under watchdog-controllerNode 1Watchdog Plug-In Interfaces for Netra CP2500 Board SoftwareHEALTHY# 3Properties Under watchdog-timerNodeCode Example 1-1System Watchdog Node Management Code Example Watchdog Node Management CodeCode 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 Typical Environmental Monitoring System Application Environmental Monitoring Component Compatibility1Compatible Environmental Monitoring Components I2C Environmental Monitoring Protection at the OpenBoot Prom Typical Cycle From Power Up to ShutdownPost Shutdown Recovery 3I2C Components Hardware Environmental Monitoring FunctionsEnvironmental Monitoring CPU Inlet, Exhaust, and CPU Temperature Monitoring Switching Power On and OffNetra CP2500 Board Programming Guide March Critical Temperature Response at OpenBoot Prom OpenBoot Prom Environmental MonitoringEnvironmental Monitoring Application Programming Using the show-sensorsCommand at OpenBoot Prom4PICL Temperature Sensor Class Node Properties Reading Temperature Sensor States UsingSolaris Driver Interface Using a Configuration File for Sensor InformationCode Example 2-1Sample envmond Application Program Sample Application ProgramCode Example 2-1Sample envmond Application Program Code Example 2-1Sample envmond Application Program Code Example 2-1Sample envmond Application Program Prtdiag command example Reading the CPU Temperature Environmental Limits5Description of Values Displayed by Solaris Commands User Flash Usage and Implementation User FlashUser Flash Driver OpenBoot Prom Device Tree and Properties1User Flash Node Properties 2System Calls Application Programming InterfaceUser Flash Device Files Interface Header FileCode Example 3-1PROM Information Structure Structures to Use in Ioctl ArgumentsExample Programs ErrorsCode Example 3-2User Flash Interface Structure Code Example 3-3Read Action on User Flash Device Read Example ProgramCode Example 3-4Write Action on User Flash Device Write Example ProgramCode Example 3-4Write Action on User Flash Device Code Example 3-5Block Erase Action on User Flash Device Block Erase Example ProgramCode Example 3-5Block Erase Action on User Flash Device Code Example 3-6Sample User Flash Application Program Sample 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 Picl IndexWatchdog-controller, 3 Watchdog-timer, 3