home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Gold Fish 1
/
GoldFishApril1994_CD1.img
/
d1xx
/
d111
/
amyload
/
load.doc
< prev
next >
Wrap
Text File
|
1987-11-15
|
11KB
|
343 lines
TABLE OF CONTENTS
load.device/structure/LoadBase
load.device/command/Flush
load.device/command/Read
load.device/command/Reset
load.device/command/Set
load.device/command/Start
load.device/command/Stop
load.device/function/AbortIO
load.device/function/BeginIO
load.device/function/CloseDevice
load.device/function/OpenDevice
load.device/structure/LoadBase load.device/command/LoadBase
NAME
LoadBase - the load device data structure
DESCRIPTION
The io_Device field of the loadrequest structure points to the
LoadBase structure. This structure should not be modified except
indirectly as a result of executing a device command. It is
permissible to read the data structure (using Forbid/Permit as
appropriate), but the only values of any interest are probably
ld_max_chip - the maximum amount of chip memory available at
the time the load device was first loaded.
ld_max_fast - as above, but for fast memory.
SEE ALSO
devices/load.h
devices/load.i
load.device/command/Flush load.device/command/Flush
NAME
Flush -- clear all queued I/O requests for the load task
FUNCTION
This command purges the read request queue for the load
task.
IO REQUEST
io_Message mn_ReplyPort initialized
io_Device set by OpenDevice
io_Command CMD_FLUSH
RESULTS
io_Error -- if the Flush succeded, then io_Error will be 0.
If the Flush failed, then the io_Error will be non-zero.
(No known reason for it to fail.)
SEE ALSO
load.device/command/Read
load.device/command/Read load.device/command/Read
NAME
Read -- read load values collected by load task
FUNCTION
This command reads the load values of the CPU, blitter, chip
memory, and fast memory.
IO REQUEST
io_Message mn_ReplyPort initialized
io_Device set by OpenDevice
io_Command CMD_READ
io_Flags IOF_QUICK if quick I/O desired
RESULTS
If the read succeeded, the following load values will be set:
lr_load.lv_cpu -- The sum of the length of the ready queue as
measured at each tick during the interval.
This value may be greater than the number of
ticks in an interval, theoretically having no
upper bound (but try to tell that to your
poor little 68000!).
lr_load.lv_blitter -- The number of ticks at which the blitter was
detected to be busy during the interval.
lr_load.lv_chip -- The number of bytes of chip memory currently
in use. To find the maximum chip memory
available, see the description of the
LoadBase structure.
lr_load.lv_fast -- The number of bytes of fast memory currently
in use. To find the maximum fast memory
available, see the description of the
LoadBase structure.
io_Error -- If the Read succeeded, then io_Error will be 0.
If the Read failed, then the io_Error will be non-zero.
It may fail if IOF_QUICK is not set and a Flush or AbortIO
request is executed before the end of the current interval,
in which case the error will be IOERR_ABORTED.
BUGS
The length of the ready queue is measured, which may not be an
accurate measurement of CPU usage.
Time arithmetic is not currently used to ensure that an interval is
really an interval. That is, that due to delays between the time
that the load.device task is signalled by the timer and when the
task places its next timer request, the actual interval will end up
being greater than the specified interval.
SEE ALSO
load.device/structure/LoadBase
load.device/command/Flush
load.device/function/AbortIO
load.device/command/Reset load.device/command/Reset
NAME
Reset -- reinitializes the load device parameters
FUNCTION
This command sets the interval time, the number of ticks per interval,
and the priority of the load task to their default values.
IO REQUEST
io_Message mn_ReplyPort initialized
io_Device set by OpenDevice
io_Command CMD_RESET
RESULTS
io_Error -- If the Reset succeeded, then io_Error will be 0.
If the Reset failed, then the io_Error will be non-zero.
(No known reason for it to fail.)
If the Reset succeeded, then the lr_interval, lr_ticks, and lr_pri
fields of the loadrequest will contain the default settings of
those parameters.
SEE ALSO
load.device/command/Set
load.device/function/OpenDevice
load.device/command/Set load.device/command/Set
NAME
Set -- change load device parameters
FUNCTION
This command sets the interval time, number of ticks per interval,
and priority of the load task to values specified in the load IO
request.
IO REQUEST
io_Message mn_ReplyPort initialized
io_Command LD_SET
lr_interval A word indicating the sampling period time (in seconds),
during which a number of samples may be taken.
lr_ticks A word indicating the number of samples to be taken
during each interval.
lr_pri A byte indicating the priority of the load task.
NOTE: The last three fields are initialized when OpenDevice
is called to indicate the devices current configuration.
RESULTS
io_Error -- 0 if the command succeeded, otherwise an error number.
(No known reason for it to fail.)
SEE ALSO
load.device/command/Reset
load.device/function/OpenDevice
load.device/command/Start load.device/command/Start
NAME
Start -- restart the paused load task.
FUNCTION
Restarts the paused load task, but not if other Stop commands
have been performed without corresponding Start commands.
IO REQUEST
io_Message mn_ReplyPort initialized
io_Device set by OpenDevice
io_Command CMD_START
RESULTS
io_Error -- 0 if the start succeeded, an error number otherwise.
The only possible error is LDERR_NOT_STOPPED, if the
device was not currently in the stopped state.
SEE ALSO
load.device/command/Stop
load.device/command/Stop load.device/command/Stop
NAME
Stop -- stop the load task from executing
FUNCTION
Stops the load task at the end of the current interval if it is not
already stopped, otherwise increments the number of Stop commands
that must be cancelled by Start commands before the load task will
begin executing again.
IO REQUEST
io_Message mn_ReplyPort initialized
io_Device set by OpenDevice
io_Command CMD_STOP
RESULTS
io_Error -- 0 if the Stop succeeded, an error number otherwise.
(No known reason for it to fail.)
SEE ALSO
load.device/command/Start
BUGS
If 255 Stop commands are already outstanding, executing
another Stop command will cause a counter to wrap around, and
undesirable behaviour may result.
load.device/function/AbortIO load.device/function/AbortIO
NAME
AbortIO -- abort an I/O request
SYNOPSIS
AbortIO(ioRequest)
FUNCTION
This function aborts a specified read request
If the request is queued, it is painlessly removed.
INPUTS
iORequest -- pointer to the IORequest Block that is to be aborted.
RESULTS
io_Error -- IOERR_ABORTED if the AbortIO succeeded.
0 if the AbortIO failed (the request was not in the queue).
SEE ALSO
load.device/function/BeginIO
load.device/function/BeginIO load.device/function/BeginIO
NAME
BeginIO -- start up an I/O process
FUNCTION
This function initiates a I/O request made to the load
device. Other than read, the functions are performed
synchronously, and do not depend on any interrupt handling
logic (or it's associated discontinuities), and hence, if so
selected, can be performed as IO_QUICK.
Read requests that are not flagged as IO_QUICK are queued and
replied to by the load task at the end of the next interval.
Completion is signalled via the standard ReplyMsg routine.
INPUTS
iORequest -- pointer to an I/O Request Block of size
sizeof(struct loadrequest) (see devices/load.h for
definition), containing a valid command in io_Command
to process, as well as the command's other required parameters.
The io_Device field must have been initialized during the
OpenDevice call to point to the load.device.
RESULTS
Error -- if the BeginIO succeded, then Error will be 0.
If the BeginIO failed, then the Error will be non-zero.
Possible errors:
IOERR_NOCMD - Invalid command attempted.
IOERR_ABORTED - The request was aborted before completion.
SEE ALSO
devices/load.h
devices/load.i
load.device/function/CloseDevice load.device/function/CloseDevice
NAME
CloseDevice -- close the load device
SYNOPSIS
CloseDevice(ioRequest)
FUNCTION
Close the device previously opened by calling OpenDevice.
INPUTS
ioRequest - pointer to a load request initialized by a call to
OpenDevice.
SEE ALSO
load.device/function/OpenDevice
load.device/function/OpenDevice load.device/function/OpenDevice
NAME
OpenDevice -- Request an opening of the load device.
SYNOPSIS
error = OpenDevice(loadname, unit, ioRequest, flags)
FUNCTION
Open the load device and initialize the ioRequest.
INPUTS
loadname - pointer to literal string "load.device"
unit - ignored (should be 0).
ioRequest - pointer to an ioRequest block of size
sizeof(loadrequest) (see devices/load.i,h
for size/definition) to be
initialized by the OpenDevice routine.
flags - LDF_OPEN_EXCL if exclusive access to the load
device is desired, othewise 0.
RESULTS
error - 0 if the OpenDevice succeeded, an error number otherwise.
Possible errors:
IOERR_OPENFAIL - generic
LDERR_ACCESS_DENIED - the device is currently opened
by a task with exclusive access.
LDERR_IN_USE - an attempt was made to obtain exclusive
access to the device but it has already been
opened by another task.
If the OpenDevice succeeded, the io_Device field of the ioRequest
structure will be initialized to point to the load.device. The
three load device parameters will contain their current settings:
lr_interval - The number of seconds in each interval.
lr_ticks - The number of ticks in each interval. Measurements
of CPU usage (ready queue length) and blitter usage
are taken at each tick during an interval, and at
the end of the interval queued read requests are
replied to.
lr_pri - The priority of the load.device task. Note that
CPU usage of tasks running at a priority greater
than this cannot be measured, and those at an
equal priority are not accurately measured.
SEE ALSO
load.device/function/CloseDevice
devices/load.h
devices/load.i