1 |
/* Definitions for multi-threaded pager library |
/* Definitions for multi-threaded pager library |
2 |
Copyright (C) 1994, 1995, 1996, 1997, 1999 Free Software Foundation, Inc. |
Copyright (C) 1994,1995,1996,1997,1999,2005 Free Software Foundation, Inc. |
3 |
|
|
4 |
This program is free software; you can redistribute it and/or |
This program is free software; you can redistribute it and/or |
5 |
modify it under the terms of the GNU General Public License as |
modify it under the terms of the GNU General Public License as |
32 |
mach_msg_header_t *outp); |
mach_msg_header_t *outp); |
33 |
|
|
34 |
/* Create a new pager. The pager will have a port created for it |
/* Create a new pager. The pager will have a port created for it |
35 |
(using libports, in BUCKET) and will be immediately ready |
(using libports, in BUCKET) and will be immediately ready to |
36 |
to receive requests. U_PAGER will be provided to later calls to |
receive requests. U_PAGER will be provided to later calls to |
37 |
pager_find_address. The pager will have one user reference |
pager_find_address. The pager will have one user reference |
38 |
created. MAY_CACHE and COPY_STRATEGY are the original values of |
created. MAY_CACHE and COPY_STRATEGY are the original values of |
39 |
those attributes as for memory_object_ready. Users may create |
those attributes as for memory_object_ready. If NOTIFY_ON_EVICT is |
40 |
references to pagers by use of the relevant ports library |
non-zero, pager_notify_evict user callback will be called when page |
41 |
functions. On errors, return null and set errno. */ |
is evicted. Users may create references to pagers by use of the |
42 |
|
relevant ports library functions. On errors, return null and set |
43 |
|
errno. */ |
44 |
struct pager * |
struct pager * |
45 |
pager_create (struct user_pager_info *u_pager, |
pager_create (struct user_pager_info *u_pager, |
46 |
struct port_bucket *bucket, |
struct port_bucket *bucket, |
47 |
boolean_t may_cache, |
boolean_t may_cache, |
48 |
memory_object_copy_strategy_t copy_strategy); |
memory_object_copy_strategy_t copy_strategy, |
49 |
|
boolean_t notify_on_evict); |
50 |
|
|
51 |
/* Return the user_pager_info struct associated with a pager. */ |
/* Return the user_pager_info struct associated with a pager. */ |
52 |
struct user_pager_info * |
struct user_pager_info * |
113 |
/* Change the attributes of the memory object underlying pager PAGER. |
/* Change the attributes of the memory object underlying pager PAGER. |
114 |
Args MAY_CACHE and COPY_STRATEGY are as for |
Args MAY_CACHE and COPY_STRATEGY are as for |
115 |
memory_object_change_atributes. Wait for the kernel to report completion |
memory_object_change_atributes. Wait for the kernel to report completion |
116 |
off WAIT is set.*/ |
iff WAIT is set. */ |
117 |
void |
void |
118 |
pager_change_attributes (struct pager *pager, |
pager_change_attributes (struct pager *pager, |
119 |
boolean_t may_cache, |
boolean_t may_cache, |
175 |
pager_unlock_page (struct user_pager_info *pager, |
pager_unlock_page (struct user_pager_info *pager, |
176 |
vm_offset_t address); |
vm_offset_t address); |
177 |
|
|
178 |
|
/* The user must define this function. It is used when you want be |
179 |
|
able to change association of pages to backing store. To use it, |
180 |
|
pass non-zero value in NOTIFY_ON_EVICT when pager is created with |
181 |
|
pager_create. You can change association of page only when |
182 |
|
pager_notify_evict has been called and you haven't touched page |
183 |
|
content after that. Note there is a possibility that a page is |
184 |
|
evicted, but user is not notified about that. The user should be |
185 |
|
able to handle this case. */ |
186 |
|
void |
187 |
|
pager_notify_evict (struct user_pager_info *pager, |
188 |
|
vm_offset_t page); |
189 |
|
|
190 |
/* The user must define this function. It should report back (in |
/* The user must define this function. It should report back (in |
191 |
*OFFSET and *SIZE the minimum valid address the pager will accept |
*OFFSET and *SIZE the minimum valid address the pager will accept |
192 |
and the size of the object. */ |
and the size of the object. */ |