| @@ -1,14 +1,14 @@ | | | @@ -1,14 +1,14 @@ |
1 | /* $NetBSD: rumpuser.h,v 1.20 2008/07/18 16:19:12 pooka Exp $ */ | | 1 | /* $NetBSD: rumpuser.h,v 1.21 2008/07/20 19:03:04 pooka Exp $ */ |
2 | | | 2 | |
3 | /* | | 3 | /* |
4 | * Copyright (c) 2007 Antti Kantee. All Rights Reserved. | | 4 | * Copyright (c) 2007 Antti Kantee. All Rights Reserved. |
5 | * | | 5 | * |
6 | * Development of this software was supported by Google Summer of Code. | | 6 | * Development of this software was supported by Google Summer of Code. |
7 | * | | 7 | * |
8 | * Redistribution and use in source and binary forms, with or without | | 8 | * Redistribution and use in source and binary forms, with or without |
9 | * modification, are permitted provided that the following conditions | | 9 | * modification, are permitted provided that the following conditions |
10 | * are met: | | 10 | * are met: |
11 | * 1. Redistributions of source code must retain the above copyright | | 11 | * 1. Redistributions of source code must retain the above copyright |
12 | * notice, this list of conditions and the following disclaimer. | | 12 | * notice, this list of conditions and the following disclaimer. |
13 | * 2. Redistributions in binary form must reproduce the above copyright | | 13 | * 2. Redistributions in binary form must reproduce the above copyright |
14 | * notice, this list of conditions and the following disclaimer in the | | 14 | * notice, this list of conditions and the following disclaimer in the |
| @@ -20,28 +20,26 @@ | | | @@ -20,28 +20,26 @@ |
20 | * DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE | | 20 | * DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE |
21 | * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL | | 21 | * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL |
22 | * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR | | 22 | * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR |
23 | * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) | | 23 | * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) |
24 | * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT | | 24 | * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT |
25 | * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY | | 25 | * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY |
26 | * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF | | 26 | * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF |
27 | * SUCH DAMAGE. | | 27 | * SUCH DAMAGE. |
28 | */ | | 28 | */ |
29 | | | 29 | |
30 | #ifndef _SYS_RUMPUSER_H_ | | 30 | #ifndef _SYS_RUMPUSER_H_ |
31 | #define _SYS_RUMPUSER_H_ | | 31 | #define _SYS_RUMPUSER_H_ |
32 | | | 32 | |
33 | #include <stdbool.h> | | | |
34 | | | | |
35 | struct stat; | | 33 | struct stat; |
36 | | | 34 | |
37 | int rumpuser_stat(const char *, struct stat *, int *); | | 35 | int rumpuser_stat(const char *, struct stat *, int *); |
38 | int rumpuser_lstat(const char *, struct stat *, int *); | | 36 | int rumpuser_lstat(const char *, struct stat *, int *); |
39 | int rumpuser_nanosleep(const struct timespec *, struct timespec *, int *); | | 37 | int rumpuser_nanosleep(const struct timespec *, struct timespec *, int *); |
40 | | | 38 | |
41 | #define rumpuser_malloc(a,b) _rumpuser_malloc(a,b,__func__,__LINE__); | | 39 | #define rumpuser_malloc(a,b) _rumpuser_malloc(a,b,__func__,__LINE__); |
42 | #define rumpuser_realloc(a,b,c) _rumpuser_realloc(a,b,c,__func__,__LINE__); | | 40 | #define rumpuser_realloc(a,b,c) _rumpuser_realloc(a,b,c,__func__,__LINE__); |
43 | | | 41 | |
44 | void *_rumpuser_malloc(size_t, int, const char *, int); | | 42 | void *_rumpuser_malloc(size_t, int, const char *, int); |
45 | void *_rumpuser_realloc(void *, size_t, int, const char *, int); | | 43 | void *_rumpuser_realloc(void *, size_t, int, const char *, int); |
46 | void rumpuser_free(void *); | | 44 | void rumpuser_free(void *); |
47 | | | 45 | |
| @@ -97,27 +95,27 @@ void rumpuser_rw_exit(struct rumpuser_rw | | | @@ -97,27 +95,27 @@ void rumpuser_rw_exit(struct rumpuser_rw |
97 | void rumpuser_rw_destroy(struct rumpuser_rw *); | | 95 | void rumpuser_rw_destroy(struct rumpuser_rw *); |
98 | int rumpuser_rw_held(struct rumpuser_rw *); | | 96 | int rumpuser_rw_held(struct rumpuser_rw *); |
99 | int rumpuser_rw_rdheld(struct rumpuser_rw *); | | 97 | int rumpuser_rw_rdheld(struct rumpuser_rw *); |
100 | int rumpuser_rw_wrheld(struct rumpuser_rw *); | | 98 | int rumpuser_rw_wrheld(struct rumpuser_rw *); |
101 | | | 99 | |
102 | struct rumpuser_cv; | | 100 | struct rumpuser_cv; |
103 | | | 101 | |
104 | void rumpuser_cv_init(struct rumpuser_cv **); | | 102 | void rumpuser_cv_init(struct rumpuser_cv **); |
105 | void rumpuser_cv_destroy(struct rumpuser_cv *); | | 103 | void rumpuser_cv_destroy(struct rumpuser_cv *); |
106 | void rumpuser_cv_wait(struct rumpuser_cv *, struct rumpuser_mtx *); | | 104 | void rumpuser_cv_wait(struct rumpuser_cv *, struct rumpuser_mtx *); |
107 | int rumpuser_cv_timedwait(struct rumpuser_cv *, struct rumpuser_mtx *, int); | | 105 | int rumpuser_cv_timedwait(struct rumpuser_cv *, struct rumpuser_mtx *, int); |
108 | void rumpuser_cv_signal(struct rumpuser_cv *); | | 106 | void rumpuser_cv_signal(struct rumpuser_cv *); |
109 | void rumpuser_cv_broadcast(struct rumpuser_cv *); | | 107 | void rumpuser_cv_broadcast(struct rumpuser_cv *); |
110 | bool rumpuser_cv_has_waiters(struct rumpuser_cv *); | | 108 | int rumpuser_cv_has_waiters(struct rumpuser_cv *); |
111 | | | 109 | |
112 | struct lwp; | | 110 | struct lwp; |
113 | | | 111 | |
114 | void rumpuser_set_curlwp(struct lwp *); | | 112 | void rumpuser_set_curlwp(struct lwp *); |
115 | struct lwp *rumpuser_get_curlwp(void); | | 113 | struct lwp *rumpuser_get_curlwp(void); |
116 | | | 114 | |
117 | /* actually part of the rumpkern */ | | 115 | /* actually part of the rumpkern */ |
118 | void rump_biodone(void *, size_t, int); | | 116 | void rump_biodone(void *, size_t, int); |
119 | | | 117 | |
120 | /* "aio" stuff for being able to fire of a B_ASYNC I/O and continue */ | | 118 | /* "aio" stuff for being able to fire of a B_ASYNC I/O and continue */ |
121 | struct rumpuser_aio { | | 119 | struct rumpuser_aio { |
122 | int rua_fd; | | 120 | int rua_fd; |
123 | uint8_t *rua_data; | | 121 | uint8_t *rua_data; |