rump_private.h revision 1.3.2.6 1 1.3.2.6 joerg /* $NetBSD: rump_private.h,v 1.3.2.6 2007/11/11 16:48:46 joerg Exp $ */
2 1.3.2.2 joerg
3 1.3.2.2 joerg /*
4 1.3.2.2 joerg * Copyright (c) 2007 Antti Kantee. All Rights Reserved.
5 1.3.2.2 joerg *
6 1.3.2.2 joerg * Development of this software was supported by Google Summer of Code.
7 1.3.2.2 joerg *
8 1.3.2.2 joerg * Redistribution and use in source and binary forms, with or without
9 1.3.2.2 joerg * modification, are permitted provided that the following conditions
10 1.3.2.2 joerg * are met:
11 1.3.2.2 joerg * 1. Redistributions of source code must retain the above copyright
12 1.3.2.2 joerg * notice, this list of conditions and the following disclaimer.
13 1.3.2.2 joerg * 2. Redistributions in binary form must reproduce the above copyright
14 1.3.2.2 joerg * notice, this list of conditions and the following disclaimer in the
15 1.3.2.2 joerg * documentation and/or other materials provided with the distribution.
16 1.3.2.2 joerg *
17 1.3.2.2 joerg * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS
18 1.3.2.2 joerg * OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
19 1.3.2.2 joerg * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
20 1.3.2.2 joerg * DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE
21 1.3.2.2 joerg * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
22 1.3.2.2 joerg * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
23 1.3.2.2 joerg * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
24 1.3.2.2 joerg * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
25 1.3.2.2 joerg * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
26 1.3.2.2 joerg * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
27 1.3.2.2 joerg * SUCH DAMAGE.
28 1.3.2.2 joerg */
29 1.3.2.2 joerg
30 1.3.2.2 joerg #ifndef _SYS_RUMP_PRIVATE_H_
31 1.3.2.2 joerg #define _SYS_RUMP_PRIVATE_H_
32 1.3.2.2 joerg
33 1.3.2.2 joerg #include <sys/param.h>
34 1.3.2.2 joerg #include <sys/types.h>
35 1.3.2.2 joerg
36 1.3.2.2 joerg #include <sys/disklabel.h>
37 1.3.2.2 joerg #include <sys/mount.h>
38 1.3.2.2 joerg #include <sys/vnode.h>
39 1.3.2.2 joerg
40 1.3.2.2 joerg #include <uvm/uvm.h>
41 1.3.2.2 joerg #include <uvm/uvm_object.h>
42 1.3.2.2 joerg #include <uvm/uvm_page.h>
43 1.3.2.2 joerg
44 1.3.2.2 joerg #include "rump.h"
45 1.3.2.2 joerg
46 1.3.2.3 joerg #if 0
47 1.3.2.3 joerg #define DPRINTF(x) printf x
48 1.3.2.3 joerg #else
49 1.3.2.3 joerg #define DPRINTF(x)
50 1.3.2.3 joerg #endif
51 1.3.2.3 joerg
52 1.3.2.2 joerg struct lwp;
53 1.3.2.2 joerg extern kauth_cred_t rump_cred;
54 1.3.2.2 joerg extern struct vmspace rump_vmspace;
55 1.3.2.2 joerg
56 1.3.2.6 joerg extern kmutex_t rump_giantlock;
57 1.3.2.6 joerg
58 1.3.2.2 joerg #define UIO_VMSPACE_SYS (&rump_vmspace)
59 1.3.2.2 joerg
60 1.3.2.2 joerg struct rump_specpriv {
61 1.3.2.2 joerg char rsp_path[MAXPATHLEN+1];
62 1.3.2.2 joerg int rsp_fd;
63 1.3.2.2 joerg
64 1.3.2.2 joerg struct partition *rsp_curpi;
65 1.3.2.2 joerg struct partition rsp_pi;
66 1.3.2.2 joerg struct disklabel rsp_dl;
67 1.3.2.2 joerg };
68 1.3.2.2 joerg
69 1.3.2.2 joerg #define RUMP_UBC_MAGIC_WINDOW (void *)0x37
70 1.3.2.2 joerg
71 1.3.2.2 joerg void abort(void) __attribute__((__noreturn__));
72 1.3.2.2 joerg
73 1.3.2.2 joerg void rump_putnode(struct vnode *);
74 1.3.2.2 joerg int rump_recyclenode(struct vnode *);
75 1.3.2.2 joerg
76 1.3.2.4 jmcneill struct ubc_window;
77 1.3.2.4 jmcneill int rump_ubc_magic_uiomove(void *, size_t, struct uio *, int *,
78 1.3.2.4 jmcneill struct ubc_window *);
79 1.3.2.2 joerg
80 1.3.2.2 joerg void rumpvm_init(void);
81 1.3.2.3 joerg void rump_sleepers_init(void);
82 1.3.2.2 joerg struct vm_page *rumpvm_makepage(struct uvm_object *, voff_t);
83 1.3.2.2 joerg
84 1.3.2.2 joerg void rumpvm_enterva(vaddr_t addr, struct vm_page *);
85 1.3.2.2 joerg void rumpvm_flushva(void);
86 1.3.2.2 joerg
87 1.3.2.2 joerg #endif /* _SYS_RUMP_PRIVATE_H_ */
88