1 .\" $NetBSD: puffs_cc.3,v 1.13 2009/02/20 14:26:56 pooka 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
49 .It Fn puffs_cc_yield "pcc"
50 Suspend and save the current execution context and return control
51 to the previous point.
52 In practice, from the file system author perspective, control returns
53 back to where either the mainloop or where
54 .Fn puffs_dispatch_exec
56 .It Fn puffs_cc_continue pcc
57 Will suspend current execution and return control to where it was
60 This is rarely called directly but rather through
61 .Fn puffs_dispatch_exec .
62 .It Fn puffs_cc_schedule "pcc"
63 Schedule a continuation.
66 this call returns immediately.
68 will be scheduled sometime in the future.
69 .It Fn puffs_cc_getcc "pu"
70 Returns the current pcc or
72 if this is the main thread.
76 will most likely disappear at some point.
81 a file system will typically want to record some cookie value into its
82 own internal bookkeeping.
83 This cookie should be hooked to the
85 so that the correct continuation can be continued when the event it
86 was waiting for triggers.
91 can be used for handling this automatically.