1 | /** |
---|
2 | * @file |
---|
3 | * |
---|
4 | * @ingroup rtems_bsd_rtems |
---|
5 | * |
---|
6 | * @brief TODO. |
---|
7 | */ |
---|
8 | |
---|
9 | /* |
---|
10 | * COPYRIGHT (c) 1989-2012. |
---|
11 | * On-Line Applications Research Corporation (OAR). |
---|
12 | * |
---|
13 | * The license and distribution terms for this file may be |
---|
14 | * found in the file LICENSE in this distribution or at |
---|
15 | * http://www.rtems.com/license/LICENSE. |
---|
16 | * |
---|
17 | */ |
---|
18 | |
---|
19 | #include <sys/cdefs.h> |
---|
20 | __FBSDID("$FreeBSD$"); |
---|
21 | |
---|
22 | #include <sys/param.h> |
---|
23 | #include <sys/lock.h> |
---|
24 | #include <sys/sched.h> |
---|
25 | |
---|
26 | /* |
---|
27 | * MPSAFE |
---|
28 | * |
---|
29 | * WARNING! This code calls vm_map_check_protection() which only checks |
---|
30 | * the associated vm_map_entry range. It does not determine whether the |
---|
31 | * contents of the memory is actually readable or writable. In most cases |
---|
32 | * just checking the vm_map_entry is sufficient within the kernel's address |
---|
33 | * space. |
---|
34 | */ |
---|
35 | int |
---|
36 | kernacc(addr, len, rw) |
---|
37 | void *addr; |
---|
38 | int len, rw; |
---|
39 | { |
---|
40 | return 1; |
---|
41 | } |
---|
42 | |
---|
43 | /* |
---|
44 | * MPSAFE |
---|
45 | * |
---|
46 | * WARNING! This code calls vm_map_check_protection() which only checks |
---|
47 | * the associated vm_map_entry range. It does not determine whether the |
---|
48 | * contents of the memory is actually readable or writable. vmapbuf(), |
---|
49 | * vm_fault_quick(), or copyin()/copout()/su*()/fu*() functions should be |
---|
50 | * used in conjuction with this call. |
---|
51 | */ |
---|
52 | int |
---|
53 | useracc(addr, len, rw) |
---|
54 | void *addr; |
---|
55 | int len, rw; |
---|
56 | { |
---|
57 | return 1; |
---|
58 | } |
---|
59 | |
---|
60 | int |
---|
61 | vslock(void *addr, size_t len) |
---|
62 | { |
---|
63 | return 0; |
---|
64 | } |
---|
65 | |
---|
66 | void |
---|
67 | vsunlock(void *addr, size_t len) |
---|
68 | { |
---|
69 | } |
---|
70 | |
---|
71 | /* |
---|
72 | * Destroy the given CPU private mapping and unpin the page that it mapped. |
---|
73 | */ |
---|
74 | void |
---|
75 | vm_imgact_unmap_page(struct sf_buf *sf) |
---|
76 | { |
---|
77 | } |
---|
78 | |
---|
79 | |
---|
80 | /* |
---|
81 | * Create the kernel stack (including pcb for i386) for a new thread. |
---|
82 | * This routine directly affects the fork perf for a process and |
---|
83 | * create performance for a thread. |
---|
84 | */ |
---|
85 | int |
---|
86 | vm_thread_new(struct thread *td, int pages) |
---|
87 | { |
---|
88 | return (1); |
---|
89 | } |
---|
90 | |
---|
91 | /* |
---|
92 | * Dispose of a thread's kernel stack. |
---|
93 | */ |
---|
94 | void |
---|
95 | vm_thread_dispose(struct thread *td) |
---|
96 | { |
---|
97 | } |
---|
98 | |
---|
99 | /* |
---|
100 | * Allow a thread's kernel stack to be paged out. |
---|
101 | */ |
---|
102 | void |
---|
103 | vm_thread_swapout(struct thread *td) |
---|
104 | { |
---|
105 | } |
---|
106 | |
---|
107 | /* |
---|
108 | * Bring the kernel stack for a specified thread back in. |
---|
109 | */ |
---|
110 | void |
---|
111 | vm_thread_swapin(struct thread *td) |
---|
112 | { |
---|
113 | } |
---|
114 | |
---|
115 | /* |
---|
116 | * Implement fork's actions on an address space. |
---|
117 | * Here we arrange for the address space to be copied or referenced, |
---|
118 | * allocate a user struct (pcb and kernel stack), then call the |
---|
119 | * machine-dependent layer to fill those in and make the new process |
---|
120 | * ready to run. The new process is set up so that it returns directly |
---|
121 | * to user mode to avoid stack copying and relocation problems. |
---|
122 | */ |
---|
123 | int |
---|
124 | vm_forkproc(td, p2, td2, vm2, flags) |
---|
125 | struct thread *td; |
---|
126 | struct proc *p2; |
---|
127 | struct thread *td2; |
---|
128 | struct vmspace *vm2; |
---|
129 | int flags; |
---|
130 | { |
---|
131 | } |
---|
132 | |
---|
133 | /* |
---|
134 | * Called after process has been wait(2)'ed apon and is being reaped. |
---|
135 | * The idea is to reclaim resources that we could not reclaim while |
---|
136 | * the process was still executing. |
---|
137 | */ |
---|
138 | void |
---|
139 | vm_waitproc(p) |
---|
140 | struct proc *p; |
---|
141 | { |
---|
142 | } |
---|
143 | |
---|
144 | void |
---|
145 | faultin(p) |
---|
146 | struct proc *p; |
---|
147 | { |
---|
148 | } |
---|
149 | |
---|
150 | void |
---|
151 | kick_proc0(void) |
---|
152 | { |
---|
153 | } |
---|