Use more appropriate types for pt_regs struct, e.g. 16-bit types for 16-bit
[cake.git] / rom / exec / addport.c
blob85be3744fb6a6690a456d3a07bf389a157fc1c3a
1 /*
2 Copyright © 1995-2001, The AROS Development Team. All rights reserved.
3 $Id$
5 Desc: Add a port to the public list of ports.
6 Lang: english
7 */
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 /*****************************************************************************
16 NAME */
18 AROS_LH1(void, AddPort,
20 /* SYNOPSIS */
21 AROS_LHA(struct MsgPort *, port, A1),
23 /* LOCATION */
24 struct ExecBase *, SysBase, 59, Exec)
26 /* FUNCTION
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.
32 INPUTS
33 port - Pointer to messageport structure.
35 RESULT
37 NOTES
39 EXAMPLE
41 BUGS
43 SEE ALSO
45 INTERNALS
47 ******************************************************************************/
49 AROS_LIBFUNC_INIT
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. */
59 Forbid();
61 /* And add the actual port */
62 Enqueue(&SysBase->PortList,&port->mp_Node);
64 /* All done */
65 Permit();
66 AROS_LIBFUNC_EXIT
67 } /* AddPort */