diff options
| author | Michael Brown | 2007-05-01 02:06:21 +0200 |
|---|---|---|
| committer | Michael Brown | 2007-05-01 02:06:21 +0200 |
| commit | a90a9adbd7f7ae53aa824c77d159f21ace1bc1f6 (patch) | |
| tree | 5e2bb67f5ffac5060ff5049063dd19e77304c47d /src/include/gpxe | |
| parent | Document the fact that a zeroed-out refcounted object will behave in (diff) | |
| download | ipxe-a90a9adbd7f7ae53aa824c77d159f21ace1bc1f6.tar.gz ipxe-a90a9adbd7f7ae53aa824c77d159f21ace1bc1f6.tar.xz ipxe-a90a9adbd7f7ae53aa824c77d159f21ace1bc1f6.zip | |
Clarify behaviour of plug() by using intf_put() and intf_get().
Diffstat (limited to 'src/include/gpxe')
| -rw-r--r-- | src/include/gpxe/interface.h | 20 |
1 files changed, 20 insertions, 0 deletions
diff --git a/src/include/gpxe/interface.h b/src/include/gpxe/interface.h index 59bb42692..d27ba6a53 100644 --- a/src/include/gpxe/interface.h +++ b/src/include/gpxe/interface.h @@ -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 ); |
