2 Copyright © 1995-2001, The AROS Development Team. All rights reserved.
5 Desc: Add a port to the public list of ports.
8 #include <aros/debug.h>
9 #include <exec/ports.h>
10 #include <exec/execbase.h>
11 #include <aros/libcall.h>
12 #include <proto/exec.h>
14 /*****************************************************************************
18 AROS_LH1(void, AddPort
,
21 AROS_LHA(struct MsgPort
*, port
, A1
),
24 struct ExecBase
*, SysBase
, 59, Exec
)
27 Add a port to the public port list. The ln_Name and ln_Pri fields
28 must be initialized prior to calling this function, while
29 the port itself is reinitialized before adding. Therefore it's
30 not allowed to add an active port.
33 port - Pointer to messageport structure.
47 ******************************************************************************/
50 ASSERT_VALID_PTR(port
);
52 /* Yes, this is a messageport */
53 port
->mp_Node
.ln_Type
=NT_MSGPORT
;
55 /* Clear the list of messages */
56 NEWLIST(&port
->mp_MsgList
);
58 /* Arbitrate for the list of messageports. */
61 /* And add the actual port */
62 Enqueue(&SysBase
->PortList
,&port
->mp_Node
);