2 Copyright © 1995-2013, The AROS Development Team. All rights reserved.
9 #include <aros/debug.h>
11 #include "dos_intern.h"
13 /*****************************************************************************
16 #include <proto/dos.h>
18 AROS_LH7I(SIPTR
, DoPkt
,
21 AROS_LHA(struct MsgPort
*, port
, D1
),
22 AROS_LHA(LONG
, action
, D2
),
23 AROS_LHA(SIPTR
, arg1
, D3
),
24 AROS_LHA(SIPTR
, arg2
, D4
),
25 AROS_LHA(SIPTR
, arg3
, D5
),
26 AROS_LHA(SIPTR
, arg4
, D6
),
27 AROS_LHA(SIPTR
, arg5
, D7
),
30 struct DosLibrary
*, DOSBase
, 40, Dos
)
33 Send a dos packet to a filesystem and wait for the action to complete.
42 This function should NOT be used; it's only here for AmigaOS
53 *****************************************************************************/
57 return dopacket(NULL
, port
, action
, arg1
, arg2
, arg3
, arg4
, arg5
, 0, 0);
63 * All Amiga kickstart versions accept most dos packet dos calls without dosbase in A6.
64 * So we have this internal routine here for compatibility purposes.
66 SIPTR
dopacket(SIPTR
*res2
, struct MsgPort
*port
, LONG action
, SIPTR arg1
, SIPTR arg2
, SIPTR arg3
, SIPTR arg4
, SIPTR arg5
, SIPTR arg6
, SIPTR arg7
)
69 struct Process
*me
= (struct Process
*)FindTask(NULL
);
71 struct MsgPort
*replyPort
;
73 ASSERT_VALID_PROCESS(me
);
78 D(bug("NULL port => handling NIL:\n"));
79 return handleNIL(action
, arg1
, arg2
, arg3
);
82 /* First I create a regular dos packet */
83 dp
= allocdospacket();
88 replyPort
= &me
->pr_MsgPort
;
92 * Make sure that tasks can use DoPkt().
93 * This is needed, for example, by Dos/Init()
94 * when creating the initial Shell.
96 replyPort
= CreateMsgPort();
98 if (NULL
== replyPort
)
105 D(bug("dp=0x%p act=%d port=0x%p reply=0x%p proc=%d 0x%lx 0x%lx 0x%lx 0x%lx 0x%lx 0x%lx 0x%lx '%s'\n",
106 dp
, action
, port
, replyPort
, __is_process(me
), arg1
, arg2
, arg3
, arg4
, arg5
, arg6
, arg7
, me
->pr_Task
.tc_Node
.ln_Name
));
107 dp
->dp_Type
= action
;
118 internal_SendPkt(dp
, port
, replyPort
);
120 /* Did we get different packet back? System is in unstable state. */
121 if (internal_WaitPkt(replyPort
) != dp
)
124 D(bug("res1=%x res2=%x\n", dp
->dp_Res1
, dp
->dp_Res2
));
130 if (__is_process(me
))
131 me
->pr_Result2
= dp
->dp_Res2
;
133 DeleteMsgPort(replyPort
);