Sample ALOM Watchdog Program


Following is a sample program for the ALOM watchdog program.

#include “lom_io.h”
main()
{ uint_t timeout = 30; /* 30 seconds */
lom_dogctl_t dogctl;
int fd = open("/dev/ntwdt", O_RDWR);
dogctl.reset_enable = 1;
dogctl.dog_enable = 1;
/* Set timeout */
ioctl(fd, LOMIOCDOGTIME, (void *)&timeout);
/* Enable watchdog */
ioctl(fd, LOMIOCDOGCTL, (void *)&dogctl);
/* Keep patting */
While (1) { ioctl(fd, LOMIOCDOGPAT, NULL);
sleep (5);
}
}

  

Understanding the ALOM watchdog timer

Driver properties

User APIs

Data structures

Error messages