9ns: Add a helper for getting chan's device's name
authorBarret Rhoden <brho@cs.berkeley.edu>
Fri, 6 Apr 2018 15:24:58 +0000 (11:24 -0400)
committerBarret Rhoden <brho@cs.berkeley.edu>
Mon, 30 Apr 2018 18:37:05 +0000 (14:37 -0400)
Signed-off-by: Barret Rhoden <brho@cs.berkeley.edu>
kern/include/ns.h

index 3729a62..ad43095 100644 (file)
@@ -1042,6 +1042,11 @@ uint16_t nhgets(void *);
 
 char *get_cur_genbuf(void);
 
+static inline const char *chan_dev_name(struct chan *c)
+{
+       return devtab[c->type].name;
+}
+
 /* hack for now. */
 #define        NOW     tsc2msec(read_tsc())
 #define        seconds() tsc2sec(read_tsc())