2 Copyright © 1995-2009, The AROS Development Team. All rights reserved.
5 Desc: Create an I/O request.
8 #include "exec_intern.h"
10 #include <exec/ports.h>
11 #include <exec/memory.h>
12 #include <aros/libcall.h>
13 #include <proto/exec.h>
15 /*****************************************************************************
19 AROS_LH2(APTR
, CreateIORequest
,
22 AROS_LHA(struct MsgPort
*, ioReplyPort
, A0
),
23 AROS_LHA(ULONG
, size
, D0
),
26 struct ExecBase
*, SysBase
, 109, Exec
)
29 Create an I/O request structure bound to a given messageport.
30 I/O requests are normally used to communicate with exec devices
31 but can be used as normal messages just as well.
34 ioReplyPort - Pointer to that one of your messageports where
35 the messages are replied to. A NULL port is legal
36 but then the function fails always.
37 size - Size of the message structure including the struct
38 IORequest header. The minimal allowable size is that
42 Pointer to a new I/O request structure or NULL if the function
55 ******************************************************************************/
59 struct IORequest
*ret
=NULL
;
61 /* A NULL ioReplyPort is legal but has no effect */
65 /* Allocate the memory */
66 ret
=(struct IORequest
*)AllocMem(size
,MEMF_PUBLIC
|MEMF_CLEAR
);
71 ret
->io_Message
.mn_ReplyPort
=ioReplyPort
;
73 /* This size is needed to free the memory at DeleteIORequest() time. */
74 ret
->io_Message
.mn_Length
=size
;
80 } /* CreateIORequest */