Clarify behaviour of plug() by using intf_put() and intf_get().

This commit is contained in:
Michael Brown
2007-05-01 00:06:21 +00:00
parent 7ff81f6654
commit a90a9adbd7
2 changed files with 22 additions and 3 deletions

View File

@@ -28,6 +28,26 @@ struct interface {
struct refcnt *refcnt;
};
/**
* Increment reference count on an interface
*
* @v intf Interface
* @ret intf Interface
*/
static inline struct interface * intf_get ( struct interface *intf ) {
ref_get ( intf->refcnt );
return intf;
}
/**
* Decrement reference count on an interface
*
* @v intf Interface
*/
static inline void intf_put ( struct interface *intf ) {
ref_put ( intf->refcnt );
}
extern void plug ( struct interface *intf, struct interface *dest );
extern void plug_plug ( struct interface *a, struct interface *b );