[Return to Top] [Kernel Objects]

EROS Object Reference

Kernel Objects

Sleep

D R A F T

Description

The Sleep key enables the holder to delay for a specified number of milliseconds, or until a particular number of milliseconds from system startup has been reached.

Under no conditions will a sleep return immediately; it is guaranteed that the caller will sleep for at least one hardware clock interval.

Sleep invocations may return prematurely in the event of system restart.


Operations

Check Alleged Key Type (OC = KT)

Returns the alleged type of the key.

ReplyR10x10000001: Key is a Sleep key.

Wake Me Up (OC = 0)

Causes the caller to resume immediately. The kernel implements wakeup by placing the caller to sleep according to the order code (OC=1 or OC=2) and then adjusting the order code to OC=0.

Sleep for N milliseconds (OC = 1)

Returns no later than N milliseconds from now, modulo the accuracy of the internal clock.

RequestR1Low order 32 bits of milliseconds to sleep.
R2High order 32 bits of milliseconds to sleep.
Result0No longer than N milliseconds have passed.
KT+1Unknown order code
KT+2An inappropriate number of bytes were passed (must be either 4 or 8 bytes).

Sleep till N milliseconds since startup (OC = 2)

Returns no later than N milliseconds from the last restart of the system, modulo the accuracy of the internal clock.
RequestW|LMilliseconds to sleep. If a four byte string is passed, the value is assumed to be a word value.
Result0No longer than N milliseconds have passed.
KT+1Unknown order code
KT+2An inappropriate number of bytes were passed (must be either 4 or 8 bytes).


Copyright 1998 by Jonathan Shapiro. All rights reserved. For terms of redistribution, see the GNU General Public License