[Krafton Jungle] PintOS 2.0.0
크래프톤 정글 PintOS
 
Loading...
Searching...
No Matches
uninit.c File Reference
#include "vm/vm.h"
#include "vm/uninit.h"
Include dependency graph for uninit.c:

Functions

static bool uninit_initialize (struct page *page, void *kva)
 
static void uninit_destroy (struct page *page)
 
void uninit_new (struct page *page, void *va, vm_initializer *init, enum vm_type type, void *aux, bool(*initializer)(struct page *, enum vm_type, void *))
 

Variables

static const struct page_operations uninit_ops
 

Function Documentation

◆ uninit_destroy()

static void uninit_destroy ( struct page page)
static
75 {
76 struct uninit_page *uninit UNUSED = &page->uninit;
77 /* TODO: Fill this function.
78 * TODO: If you don't have anything to do, just return. */
79 if (page->uninit.aux != NULL) // ? uninit.aux의 의미?
81 return;
82}
#define UNUSED
Definition: debug.h:7
void free(void *)
Definition: malloc.c:202
#define NULL
Definition: stddef.h:4
Definition: vm.h:51
struct uninit_page uninit
Definition: vm.h:67
Definition: uninit.h:12
void * aux
Definition: uninit.h:16
Here is the call graph for this function:

◆ uninit_initialize()

static bool uninit_initialize ( struct page page,
void *  kva 
)
static
54 {
55 struct uninit_page *uninit = &page->uninit;
56
57 /* Fetch first, page_initialize may overwrite the values */
58 // 가져오기 먼저하고, page_initialize 값을 덮어쓸 수 있음
59 vm_initializer *init = uninit->init;
60 void *aux = uninit->aux;
61
62 /* TODO: You may need to fix this function. */
63 return uninit->page_initializer (page, uninit->type, kva) &&
64 (init ? init (page, aux) : true);
65}
#define true
Definition: stdbool.h:5
enum vm_type type
Definition: uninit.h:15
vm_initializer * init
Definition: uninit.h:14
bool(* page_initializer)(struct page *, enum vm_type, void *kva)
Definition: uninit.h:18
bool vm_initializer(struct page *, void *aux)
Definition: uninit.h:8
static void init(void)
Definition: vga.c:36
Here is the call graph for this function:

◆ uninit_new()

void uninit_new ( struct page page,
void *  va,
vm_initializer init,
enum vm_type  type,
void *  aux,
bool(*)(struct page *, enum vm_type, void *)  initializer 
)
35 {
36 ASSERT (page != NULL);
37
38 *page = (struct page) {
40 // operations 필드로 uninit_ops를 설정해서 'VM_UNINIT'에 대한 처리를 해준다.
41 .va = va,
42 .frame = NULL, /* no frame for now */ // 현재는 물리 메모리와 매핑되지는 않은 상태
43 .uninit = (struct uninit_page) {
44 .init = init,
45 .type = type,
46 .aux = aux,
47 .page_initializer = initializer,
48 }
49 };
50}
#define ASSERT(CONDITION)
Definition: debug.h:30
const struct page_operations * operations
Definition: vm.h:52
void * va
Definition: vm.h:53
static const struct page_operations uninit_ops
Definition: uninit.c:24
Here is the call graph for this function:

Variable Documentation

◆ uninit_ops

const struct page_operations uninit_ops
static
Initial value:
= {
.swap_in = uninit_initialize,
.swap_out = NULL,
.destroy = uninit_destroy,
.type = VM_UNINIT,
}
static bool uninit_initialize(struct page *page, void *kva)
Definition: uninit.c:54
static void uninit_destroy(struct page *page)
Definition: uninit.c:75
@ VM_UNINIT
Definition: vm.h:11