vm_fault.h 2.4 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879
  1. /*
  2. * Mach Operating System
  3. * Copyright (c) 1991,1990,1989,1988,1987 Carnegie Mellon University
  4. * All Rights Reserved.
  5. *
  6. * Permission to use, copy, modify and distribute this software and its
  7. * documentation is hereby granted, provided that both the copyright
  8. * notice and this permission notice appear in all copies of the
  9. * software, derivative works or modified versions, and any portions
  10. * thereof, and that both notices appear in supporting documentation.
  11. *
  12. * CARNEGIE MELLON ALLOWS FREE USE OF THIS SOFTWARE IN ITS "AS IS"
  13. * CONDITION. CARNEGIE MELLON DISCLAIMS ANY LIABILITY OF ANY KIND FOR
  14. * ANY DAMAGES WHATSOEVER RESULTING FROM THE USE OF THIS SOFTWARE.
  15. *
  16. * Carnegie Mellon requests users of this software to return to
  17. *
  18. * Software Distribution Coordinator or Software.Distribution@CS.CMU.EDU
  19. * School of Computer Science
  20. * Carnegie Mellon University
  21. * Pittsburgh PA 15213-3890
  22. *
  23. * any improvements or extensions that they make and grant Carnegie Mellon
  24. * the rights to redistribute these changes.
  25. */
  26. /*
  27. * File: vm/vm_fault.h
  28. *
  29. * Page fault handling module declarations.
  30. */
  31. #ifndef _VM_VM_FAULT_H_
  32. #define _VM_VM_FAULT_H_
  33. #include <mach/kern_return.h>
  34. #include <mach/vm_prot.h>
  35. #include <vm/vm_map.h>
  36. #include <vm/vm_types.h>
  37. /*
  38. * Page fault handling based on vm_object only.
  39. */
  40. typedef kern_return_t vm_fault_return_t;
  41. #define VM_FAULT_SUCCESS 0
  42. #define VM_FAULT_RETRY 1
  43. #define VM_FAULT_INTERRUPTED 2
  44. #define VM_FAULT_MEMORY_SHORTAGE 3
  45. #define VM_FAULT_FICTITIOUS_SHORTAGE 4
  46. #define VM_FAULT_MEMORY_ERROR 5
  47. extern void vm_fault_init(void);
  48. extern vm_fault_return_t vm_fault_page(vm_object_t, vm_offset_t, vm_prot_t,
  49. boolean_t, boolean_t, vm_prot_t *,
  50. vm_page_t *, vm_page_t *, boolean_t,
  51. void (*)());
  52. extern void vm_fault_cleanup(vm_object_t, vm_page_t);
  53. /*
  54. * Page fault handling based on vm_map (or entries therein)
  55. */
  56. extern kern_return_t vm_fault(vm_map_t, vm_offset_t, vm_prot_t, boolean_t,
  57. boolean_t, void (*)());
  58. extern void vm_fault_wire(vm_map_t, vm_map_entry_t);
  59. extern void vm_fault_unwire(vm_map_t, vm_map_entry_t);
  60. /* Copy pages from one object to another. */
  61. extern kern_return_t vm_fault_copy(vm_object_t, vm_offset_t, vm_size_t *,
  62. vm_object_t, vm_offset_t, vm_map_t,
  63. vm_map_version_t *, boolean_t);
  64. kern_return_t vm_fault_wire_fast(
  65. vm_map_t map,
  66. vm_offset_t va,
  67. vm_map_entry_t entry);
  68. #endif /* _VM_VM_FAULT_H_ */