1 .\" $NetBSD: puffs_cc.3,v 1.14 2009/04/11 16:48:53 wiz Exp $
3 .\" Copyright (c) 2007, 2008 Antti Kantee. All rights reserved.
5 .\" Redistribution and use in source and binary forms, with or without
6 .\" modification, are permitted provided that the following conditions
8 .\" 1. Redistributions of source code must retain the above copyright
9 .\" notice, this list of conditions and the following disclaimer.
10 .\" 2. Redistributions in binary form must reproduce the above copyright
11 .\" notice, this list of conditions and the following disclaimer in the
12 .\" documentation and/or other materials provided with the distribution.
14 .\" THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND
15 .\" ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
16 .\" IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
17 .\" ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE
18 .\" FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
19 .\" DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
20 .\" OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
21 .\" HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
22 .\" LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
23 .\" OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
31 .Nd puffs continuation routines
37 .Fn puffs_cc_yield "struct puffs_cc *pcc"
39 .Fn puffs_cc_continue "struct puffs_cc *pcc"
41 .Fn puffs_cc_schedule "struct puffs_cc *pcc"
43 .Fn puffs_cc_getcc "struct puffs_usermount *pu"
45 These routines are used for the cooperative multitasking suite present
48 .It Fn puffs_cc_yield "pcc"
49 Suspend and save the current execution context and return control
50 to the previous point.
51 In practice, from the file system author perspective, control returns
52 back to where either the mainloop or where
53 .Fn puffs_dispatch_exec
55 .It Fn puffs_cc_continue pcc
56 Will suspend current execution and return control to where it was
59 This is rarely called directly but rather through
60 .Fn puffs_dispatch_exec .
61 .It Fn puffs_cc_schedule "pcc"
62 Schedule a continuation.
65 this call returns immediately.
67 will be scheduled sometime in the future.
68 .It Fn puffs_cc_getcc "pu"
69 Returns the current pcc or
71 if this is the main thread.
75 will most likely disappear at some point.
80 a file system will typically want to record some cookie value into its
81 own internal bookkeeping.
82 This cookie should be hooked to the
84 so that the correct continuation can be continued when the event it
85 was waiting for triggers.
90 can be used for handling this automatically.