- Wait for mouse acks properly.
[cake.git] / rom / exec / doio.c
blobb626a265884e3d34aa100827269bfd2334c6ac26
1 /*
2 Copyright © 1995-2007, The AROS Development Team. All rights reserved.
3 $Id$
5 Desc: Start an IO request and wait until it completes.
6 Lang: english
7 */
8 #include <exec/execbase.h>
9 #include <exec/io.h>
10 #include <aros/libcall.h>
11 #include <proto/exec.h>
13 /*****************************************************************************
15 NAME */
17 AROS_LH1(BYTE, DoIO,
19 /* SYNOPSIS */
20 AROS_LHA(struct IORequest *, iORequest, A1),
22 /* LOCATION */
23 struct ExecBase *, SysBase, 76, Exec)
25 /* FUNCTION
26 Start an I/O request by calling the devices's BeginIO() vector.
27 It waits until the request is complete.
29 INPUTS
30 iORequest - Pointer to iorequest structure.
32 RESULT
34 NOTES
36 EXAMPLE
38 BUGS
40 SEE ALSO
41 OpenDevice(), CloseDevice(), DoIO(), SendIO(), AbortIO(), WaitIO()
43 INTERNALS
45 ******************************************************************************/
47 AROS_LIBFUNC_INIT
50 Prepare the message. Tell the device that it is OK to wait in the
51 BeginIO() call by setting the quick bit.
53 iORequest->io_Flags=IOF_QUICK;
54 iORequest->io_Message.mn_Node.ln_Type=0;
56 /* Call BeginIO() vector */
57 AROS_LVO_CALL1NR(void,
58 AROS_LCA(struct IORequest *,iORequest,A1),
59 struct Device *,iORequest->io_Device,5,
62 /* It the quick flag is cleared it wasn't done quick. Wait for completion. */
63 if(!(iORequest->io_Flags&IOF_QUICK))
64 WaitIO(iORequest);
66 /* All done. Get returncode. */
67 return iORequest->io_Error;
68 AROS_LIBFUNC_EXIT
69 } /* DoIO */