Please note that diffs are not public domain; they are subject to the copyright notices on the relevant files. =================================================================== RCS file: /ftp/cvs/cvsroot/src/lib/libpuffs/framebuf.c,v rcsdiff: /ftp/cvs/cvsroot/src/lib/libpuffs/framebuf.c,v: warning: Unknown phrases like `commitid ...;' are present. retrieving revision 1.12 retrieving revision 1.13 diff -u -p -r1.12 -r1.13 --- src/lib/libpuffs/framebuf.c 2007/05/20 16:24:37 1.12 +++ src/lib/libpuffs/framebuf.c 2007/05/20 19:56:56 1.13 @@ -1,4 +1,4 @@ -/* $NetBSD: framebuf.c,v 1.12 2007/05/20 16:24:37 pooka Exp $ */ +/* $NetBSD: framebuf.c,v 1.13 2007/05/20 19:56:56 pooka Exp $ */ /* * Copyright (c) 2007 Antti Kantee. All Rights Reserved. @@ -30,7 +30,7 @@ #include #if !defined(lint) -__RCSID("$NetBSD: framebuf.c,v 1.12 2007/05/20 16:24:37 pooka Exp $"); +__RCSID("$NetBSD: framebuf.c,v 1.13 2007/05/20 19:56:56 pooka Exp $"); #endif /* !lint */ #include @@ -67,6 +67,8 @@ struct puffs_framebuf { #define ISTAT_INTERNAL 0x02 /* never leaves library */ #define ISTAT_NOREPLY 0x04 /* nuke after sending */ +#define ISTAT_ONQUEUE ISTAT_NODESTROY /* alias */ + #define PUFBUF_INCRALLOC 4096 #define PUFBUF_REMAIN(p) (p->len - p->offset) @@ -380,6 +382,29 @@ puffs_framev_enqueue_justsend(struct puf return 0; } +/* + * this beauty shall remain undocumented for now + */ +int +puffs_framev_framebuf_ccpromote(struct puffs_framebuf *pufbuf, + struct puffs_cc *pcc) +{ + + if ((pufbuf->istat & ISTAT_ONQUEUE) == 0) { + errno = EBUSY; + return -1; + } + + pufbuf->pcc = pcc; + pufbuf->fcb = NULL; + pufbuf->fcb_arg = NULL; + pufbuf->istat &= ~ISTAT_NOREPLY; + + puffs_cc_yield(pcc); + + return 0; +} + static struct puffs_framebuf * findbuf(struct puffs_usermount *pu, struct puffs_framectrl *fctrl, struct puffs_fctrl_io *fio, struct puffs_framebuf *findme)