FreeBSD virtual memory subsystem code
vm.h File Reference
#include <machine/vm.h>
Include dependency graph for vm.h:
This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Data Structures

struct  kva_md_info
 

Macros

#define VM_INHERIT_SHARE   ((vm_inherit_t) 0)
 
#define VM_INHERIT_COPY   ((vm_inherit_t) 1)
 
#define VM_INHERIT_NONE   ((vm_inherit_t) 2)
 
#define VM_INHERIT_ZERO   ((vm_inherit_t) 3)
 
#define VM_INHERIT_DEFAULT   VM_INHERIT_COPY
 
#define VM_PROT_NONE   ((vm_prot_t) 0x00)
 
#define VM_PROT_READ   ((vm_prot_t) 0x01)
 
#define VM_PROT_WRITE   ((vm_prot_t) 0x02)
 
#define VM_PROT_EXECUTE   ((vm_prot_t) 0x04)
 
#define VM_PROT_COPY   ((vm_prot_t) 0x08) /* copy-on-read */
 
#define VM_PROT_PRIV_FLAG   ((vm_prot_t) 0x10)
 
#define VM_PROT_FAULT_LOOKUP   VM_PROT_PRIV_FLAG
 
#define VM_PROT_QUICK_NOFAULT   VM_PROT_PRIV_FLAG /* same to save bits */
 
#define VM_PROT_ALL   (VM_PROT_READ|VM_PROT_WRITE|VM_PROT_EXECUTE)
 
#define VM_PROT_RW   (VM_PROT_READ|VM_PROT_WRITE)
 
#define VM_PROT_DEFAULT   VM_PROT_ALL
 
#define VA_IS_CLEANMAP(va)    ((va) >= kmi.clean_sva && (va) < kmi.clean_eva)
 

Typedefs

typedef char vm_inherit_t
 
typedef u_char vm_prot_t
 
typedef u_char objtype_t
 
typedef union vm_map_object vm_map_object_t
 
typedef struct vm_map_entryvm_map_entry_t
 
typedef struct vm_mapvm_map_t
 
typedef struct vm_objectvm_object_t
 
typedef struct vm_reserv * vm_reserv_t
 

Enumerations

enum  obj_type {
  OBJT_DEFAULT , OBJT_SWAP , OBJT_VNODE , OBJT_DEVICE ,
  OBJT_PHYS , OBJT_DEAD , OBJT_SG , OBJT_MGTDEVICE ,
  OBJT_FIRST_DYN
}
 

Functions

void vm_ksubmap_init (struct kva_md_info *)
 
bool swap_reserve (vm_ooffset_t incr)
 
bool swap_reserve_by_cred (vm_ooffset_t incr, struct ucred *cred)
 
void swap_reserve_force (vm_ooffset_t incr)
 
void swap_release (vm_ooffset_t decr)
 
void swap_release_by_cred (vm_ooffset_t decr, struct ucred *cred)
 
void swapper (void)
 

Variables

struct kva_md_info kmi
 
int old_mlock
 
int vm_ndomains
 

Macro Definition Documentation

◆ VA_IS_CLEANMAP

#define VA_IS_CLEANMAP (   va)     ((va) >= kmi.clean_sva && (va) < kmi.clean_eva)

Definition at line 157 of file vm.h.

◆ VM_INHERIT_COPY

#define VM_INHERIT_COPY   ((vm_inherit_t) 1)

Definition at line 71 of file vm.h.

◆ VM_INHERIT_DEFAULT

#define VM_INHERIT_DEFAULT   VM_INHERIT_COPY

Definition at line 74 of file vm.h.

◆ VM_INHERIT_NONE

#define VM_INHERIT_NONE   ((vm_inherit_t) 2)

Definition at line 72 of file vm.h.

◆ VM_INHERIT_SHARE

#define VM_INHERIT_SHARE   ((vm_inherit_t) 0)

Definition at line 70 of file vm.h.

◆ VM_INHERIT_ZERO

#define VM_INHERIT_ZERO   ((vm_inherit_t) 3)

Definition at line 73 of file vm.h.

◆ VM_PROT_ALL

#define VM_PROT_ALL   (VM_PROT_READ|VM_PROT_WRITE|VM_PROT_EXECUTE)

Definition at line 87 of file vm.h.

◆ VM_PROT_COPY

#define VM_PROT_COPY   ((vm_prot_t) 0x08) /* copy-on-read */

Definition at line 82 of file vm.h.

◆ VM_PROT_DEFAULT

#define VM_PROT_DEFAULT   VM_PROT_ALL

Definition at line 89 of file vm.h.

◆ VM_PROT_EXECUTE

#define VM_PROT_EXECUTE   ((vm_prot_t) 0x04)

Definition at line 81 of file vm.h.

◆ VM_PROT_FAULT_LOOKUP

#define VM_PROT_FAULT_LOOKUP   VM_PROT_PRIV_FLAG

Definition at line 84 of file vm.h.

◆ VM_PROT_NONE

#define VM_PROT_NONE   ((vm_prot_t) 0x00)

Definition at line 78 of file vm.h.

◆ VM_PROT_PRIV_FLAG

#define VM_PROT_PRIV_FLAG   ((vm_prot_t) 0x10)

Definition at line 83 of file vm.h.

◆ VM_PROT_QUICK_NOFAULT

#define VM_PROT_QUICK_NOFAULT   VM_PROT_PRIV_FLAG /* same to save bits */

Definition at line 85 of file vm.h.

◆ VM_PROT_READ

#define VM_PROT_READ   ((vm_prot_t) 0x01)

Definition at line 79 of file vm.h.

◆ VM_PROT_RW

#define VM_PROT_RW   (VM_PROT_READ|VM_PROT_WRITE)

Definition at line 88 of file vm.h.

◆ VM_PROT_WRITE

#define VM_PROT_WRITE   ((vm_prot_t) 0x02)

Definition at line 80 of file vm.h.

Typedef Documentation

◆ objtype_t

typedef u_char objtype_t

Definition at line 102 of file vm.h.

◆ vm_inherit_t

typedef char vm_inherit_t

Definition at line 68 of file vm.h.

◆ vm_map_entry_t

typedef struct vm_map_entry* vm_map_entry_t

Definition at line 108 of file vm.h.

◆ vm_map_object_t

Definition at line 105 of file vm.h.

◆ vm_map_t

typedef struct vm_map* vm_map_t

Definition at line 111 of file vm.h.

◆ vm_object_t

typedef struct vm_object* vm_object_t

Definition at line 114 of file vm.h.

◆ vm_prot_t

typedef u_char vm_prot_t

Definition at line 76 of file vm.h.

◆ vm_reserv_t

typedef struct vm_reserv* vm_reserv_t

Definition at line 144 of file vm.h.

Enumeration Type Documentation

◆ obj_type

enum obj_type
Enumerator
OBJT_DEFAULT 
OBJT_SWAP 
OBJT_VNODE 
OBJT_DEVICE 
OBJT_PHYS 
OBJT_DEAD 
OBJT_SG 
OBJT_MGTDEVICE 
OBJT_FIRST_DYN 

Definition at line 91 of file vm.h.

Function Documentation

◆ swap_release()

void swap_release ( vm_ooffset_t  decr)

Definition at line 346 of file swap_pager.c.

References swap_release_by_cred().

Referenced by kmap_alloc_wait().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ swap_release_by_cred()

void swap_release_by_cred ( vm_ooffset_t  decr,
struct ucred *  cred 
)

Definition at line 357 of file swap_pager.c.

References swap_release_by_cred_rlimit().

Referenced by swap_release(), vm_map_lookup(), and vm_object_destroy().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ swap_reserve()

bool swap_reserve ( vm_ooffset_t  incr)

Definition at line 255 of file swap_pager.c.

References swap_reserve_by_cred().

Referenced by kmap_alloc_wait(), vm_map_insert(), and vm_map_protect().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ swap_reserve_by_cred()

bool swap_reserve_by_cred ( vm_ooffset_t  incr,
struct ucred *  cred 
)

Definition at line 262 of file swap_pager.c.

References SWAP_RESERVE_ALLOW_NONWIRED, swap_reserve_by_cred_rlimit(), SWAP_RESERVE_FORCE_ON, and vm_cnt.

Referenced by default_pager_alloc(), swap_pager_init_object(), swap_reserve(), vm_map_lookup(), and vm_object_coalesce().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ swap_reserve_force()

void swap_reserve_force ( vm_ooffset_t  incr)

Definition at line 326 of file swap_pager.c.

References swap_reserve_force_rlimit().

Here is the call graph for this function:

◆ swapper()

void swapper ( void  )

Definition at line 745 of file vm_swapout.c.

References faultin(), SWAPIN_INTERVAL, swapper_selector(), and swapper_wkilled_only().

Here is the call graph for this function:

◆ vm_ksubmap_init()

Variable Documentation

◆ kmi

struct kva_md_info kmi
extern

Referenced by vm_ksubmap_init().

◆ old_mlock

int old_mlock
extern

Definition at line 101 of file vm_mmap.c.

Referenced by kern_break(), kern_mmap_racct_check(), and sys_mlockall().

◆ vm_ndomains