vm_init.c 2.2 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788
  1. /*
  2. * Mach Operating System
  3. * Copyright (c) 1991,1990,1989,1988,1987 Carnegie Mellon University.
  4. * Copyright (c) 1993,1994 The University of Utah and
  5. * the Computer Systems Laboratory (CSL).
  6. * All rights reserved.
  7. *
  8. * Permission to use, copy, modify and distribute this software and its
  9. * documentation is hereby granted, provided that both the copyright
  10. * notice and this permission notice appear in all copies of the
  11. * software, derivative works or modified versions, and any portions
  12. * thereof, and that both notices appear in supporting documentation.
  13. *
  14. * CARNEGIE MELLON, THE UNIVERSITY OF UTAH AND CSL ALLOW FREE USE OF
  15. * THIS SOFTWARE IN ITS "AS IS" CONDITION, AND DISCLAIM ANY LIABILITY
  16. * OF ANY KIND FOR ANY DAMAGES WHATSOEVER RESULTING FROM THE USE OF
  17. * THIS SOFTWARE.
  18. *
  19. * Carnegie Mellon requests users of this software to return to
  20. *
  21. * Software Distribution Coordinator or Software.Distribution@CS.CMU.EDU
  22. * School of Computer Science
  23. * Carnegie Mellon University
  24. * Pittsburgh PA 15213-3890
  25. *
  26. * any improvements or extensions that they make and grant Carnegie Mellon
  27. * the rights to redistribute these changes.
  28. */
  29. /*
  30. * File: vm/vm_init.c
  31. * Author: Avadis Tevanian, Jr., Michael Wayne Young
  32. * Date: 1985
  33. *
  34. * Initialize the Virtual Memory subsystem.
  35. */
  36. #include <mach/machine/vm_types.h>
  37. #include <kern/slab.h>
  38. #include <kern/kalloc.h>
  39. #include <vm/vm_fault.h>
  40. #include <vm/vm_object.h>
  41. #include <vm/vm_map.h>
  42. #include <vm/vm_page.h>
  43. #include <vm/vm_kern.h>
  44. #include <vm/memory_object.h>
  45. #include <vm/memory_object_proxy.h>
  46. /*
  47. * vm_mem_bootstrap initializes the virtual memory system.
  48. * This is done only by the first cpu up.
  49. */
  50. void vm_mem_bootstrap(void)
  51. {
  52. vm_offset_t start, end;
  53. /*
  54. * Initializes resident memory structures.
  55. * From here on, all physical memory is accounted for,
  56. * and we use only virtual addresses.
  57. */
  58. vm_page_bootstrap(&start, &end);
  59. /*
  60. * Initialize other VM packages
  61. */
  62. slab_bootstrap();
  63. vm_object_bootstrap();
  64. vm_map_init();
  65. kmem_init(start, end);
  66. pmap_init();
  67. slab_init();
  68. kalloc_init();
  69. vm_fault_init();
  70. vm_page_module_init();
  71. memory_manager_default_init();
  72. }
  73. void vm_mem_init(void)
  74. {
  75. vm_object_init();
  76. memory_object_proxy_init();
  77. vm_page_info_all();
  78. }