tk_sus_dev
Suspend Device
INT cnt = tk_sus_dev ( UINT mode ) ;
UINT mode Mode
INT cnt Suspend disable request count
or Error code
E_BUSY Suspend already disabled
E_QOVR Suspend disable request count limit exceeded
Performs the processing specified in mode, then passes the resulting suspend disable request count in the return code.
mode := ( (TD_SUSPEND | TD_FORCE) || TD_DISSUS || TD_ENASUS || TD_CHECK)
#define TD_SUSPEND 0x0001 /* suspend */
#define TD_DISSUS 0x0002 /* disable suspension */
#define TD_ENASUS 0x0003 /* enable suspension */
#define TD_CHECK 0x0004 /* get suspend disable request count */
#define TD_FORCE 0x8000 /* forcibly suspend */
TD_SUSPEND Suspend
If suspending is enabled, suspends processing. If suspending is disabled, returns E_BUSY.
TD_SUSPEND | TD FORCE Forcibly suspend
Suspends even in suspend disabled state.
TD_DISSUS Disable suspension
Disables suspension.
TD_ENASUS Enable suspension
Enables suspension.
If the enable request count is greater than the disable count for the resource group, no operation is performed.
TD_CHECK Get suspend disable count
Gets only the number of times suspend disable has been requested.
Suspension is performed in the following steps.
1. Suspension processing in non-disk devices
2. Suspension processing in disk devices
3. SUSPEND state entered
Resumption from SUSPEND state is performed in the following steps.
1. Return from SUSPEND state
2. Resumption processing in disk devices
3. Resumption processing in non-disk devices
The number of suspend disable requests is counted. Suspension is enabled only if the same number of suspend enable requests are made. At system boot, the suspend disable count is 0 and suspension is enabled. There is only one suspend disable request count kept per system, but the system keeps track of the resource group making the request. It is not possible to clear suspend disable requests made in another resource group. When the cleanup function runs in a resource group, all the suspend requests made in that group are cleared and the suspend disable request count is reduced accordingly. The upper limit of suspend-disabled request count is implementation-defined, but the count can be executed up to at least 255. When the upper limit is exceeded, E_QOVR is returned.

Comments
Click here to Post a Comment