w_setattr Kernel Service

Purpose

Sets attributes for a watchdog timer.

Syntax

#include <sys/watchdog.h>
#include <sys/kerrno.h>

kerrno_t w_setattr(struct watchdog *w, char attr)

Parameter

Item Description
w Specifies the watchdog timer structure.
attr A bitmask of attributes to be set. Supported flags are:
WD_ATTR_MOVE_OK
Allow timer to migrate from one CPU to another.

Description

The w_setattr kernel service sets attributes for the specified watchdog timer. The WD_ATTR_MOVE_OK attribute should be set when the caller does not have a dependency on which processor the timer expiration handler is called. This attribute allows the system to move the timer from one processor to another as needed, to improve the effectiveness of processor folding. When this attribute is set, the associated watchdog timer is moved to another processor when the owning processor is folded.

The w_setattr kernel service must be called after the w_init() kernel service but before the w_start() kernel service. Otherwise, the w_setattr kernel service may fail.

Execution Environment

The w_setattr kernel service can be called from either the process or interrupt environment.

Return Values

Item Description
0 The specified attribute was successfully set.
<0 The specified attribute was not set. The failure is indicated with return value set to one of the following values:

EINVAL_W_SETATTR_EYEC: An invalid eye catcher was detected.

EINVAL_W_SETATTR_ATTR: An invalid attribute flag was detected.