1 #ifndef _GPXE_INTERFACE_H
2 #define _GPXE_INTERFACE_H
6 * Object communication interfaces
10 FILE_LICENCE ( GPL2_OR_LATER
);
12 #include <gpxe/refcnt.h>
14 /** An object communication interface */
16 /** Destination interface
18 * When messages are sent via this interface, they will be
19 * delivered to the destination interface.
21 * This pointer may never be NULL. When the interface is
22 * unplugged, it should point to a null interface.
24 struct interface
*dest
;
27 * If this interface is not part of a reference-counted
28 * object, this field may be NULL.
30 struct refcnt
*refcnt
;
34 * Increment reference count on an interface
39 static inline __attribute__ (( always_inline
)) struct interface
*
40 intf_get ( struct interface
*intf
) {
41 ref_get ( intf
->refcnt
);
46 * Decrement reference count on an interface
50 static inline __attribute__ (( always_inline
)) void
51 intf_put ( struct interface
*intf
) {
52 ref_put ( intf
->refcnt
);
55 extern void plug ( struct interface
*intf
, struct interface
*dest
);
56 extern void plug_plug ( struct interface
*a
, struct interface
*b
);
58 #endif /* _GPXE_INTERFACE_H */