* vm_map_entry_create: [ internal use only ] * * Allocates a VM map entry for insertion. * No entry fields are filled in. */
| 967 | * No entry fields are filled in. |
| 968 | */ |
| 969 | static vm_map_entry_t |
| 970 | vm_map_entry_create(vm_map_t map) |
| 971 | { |
| 972 | vm_map_entry_t new_entry; |
| 973 | |
| 974 | #ifndef UMA_MD_SMALL_ALLOC |
| 975 | if (map == kernel_map) { |
| 976 | VM_MAP_ASSERT_LOCKED(map); |
| 977 | |
| 978 | /* |
| 979 | * A new slab of kernel map entries cannot be allocated at this |
| 980 | * point because the kernel map has not yet been updated to |
| 981 | * reflect the caller's request. Therefore, we allocate a new |
| 982 | * map entry, dipping into the reserve if necessary, and set a |
| 983 | * flag indicating that the reserve must be replenished before |
| 984 | * the map is unlocked. |
| 985 | */ |
| 986 | new_entry = uma_zalloc(kmapentzone, M_NOWAIT | M_NOVM); |
| 987 | if (new_entry == NULL) { |
| 988 | new_entry = uma_zalloc(kmapentzone, |
| 989 | M_NOWAIT | M_NOVM | M_USE_RESERVE); |
| 990 | kernel_map->flags |= MAP_REPLENISH; |
| 991 | } |
| 992 | } else |
| 993 | #endif |
| 994 | if (map->system_map) { |
| 995 | new_entry = uma_zalloc(kmapentzone, M_NOWAIT); |
| 996 | } else { |
| 997 | new_entry = uma_zalloc(mapentzone, M_WAITOK); |
| 998 | } |
| 999 | KASSERT(new_entry != NULL, |
| 1000 | ("vm_map_entry_create: kernel resources exhausted")); |
| 1001 | return (new_entry); |
| 1002 | } |
| 1003 | |
| 1004 | /* |
| 1005 | * vm_map_entry_set_behavior: |
no test coverage detected