nckernel  0.1
 All Data Structures Files Functions Variables Typedefs Enumerations Enumerator Macros Groups Pages
Data Structures | Functions
Page Frame Management

페이지 프레임 관리 More...

Data Structures

struct  page_frame
 

Functions

void * page_frame_alloc (enum zone_type zone, size_t nr_pages)
 페이지 프레임을 할당한다. More...
 
int page_frame_fini (struct zone *zone)
 
int page_frame_free (void *ptr)
 할당 된 페이지 자원을 해제 한다. More...
 
int page_frame_init (struct zone *zone, void *base, size_t size)
 
int page_frame_manage (enum zone_type type, void *page, int nr_pages)
 페이지 프레임 관리자가 전달된 페이지를 관리 목록에 추가한다. More...
 
int page_frame_ref (void *page)
 주어진 페이지의 참조 횟수를 증가 시킨다. More...
 
int page_frame_refcnt (void *page)
 해당 페이지가 참조 된 수 More...
 

Detailed Description

페이지 프레임 관리

Author
Sung-jae Park nices.nosp@m.j@ni.nosp@m.cesj..nosp@m.com
Date
2011-9-16

Function Documentation

void* page_frame_alloc ( enum zone_type  zone,
size_t  nr_pages 
)

페이지 프레임을 할당한다.

Parameters
[in]type페이지를 할당 할 영역 (메모리 존)
[in]nr_pages할당 할 페이지 수 (2의 멱수 단위)
Returns
void * 할당된 페이지의 메모리 주소
See Also
page_frame_free()

Referenced by fdc_read(), and fdc_write().

Here is the caller graph for this function:

int page_frame_fini ( struct zone zone)

Definition at line 68 of file page_frame.c.

References free(), zone::handle, list_entry, list_for_each_safe, zone::managed_page_list, page_allocator_free(), page_head, zone::page_list, and pma.

Referenced by destroy_zone().

Here is the call graph for this function:

Here is the caller graph for this function:

int page_frame_free ( void *  ptr)

할당 된 페이지 자원을 해제 한다.

Parameters
[in]page페이지 주소(물리 주소 기준)
Returns
int 성공시 0 실패시 에러 코드
See Also
page_frame_alloc()

Definition at line 131 of file page_frame.c.

References EINVAL, free(), zone::handle, NEED_LOCK_TEST_BEGIN, NEED_LOCK_TEST_END, page_allocator_free(), pthread_mutex_lock(), and pthread_mutex_unlock().

Referenced by fdc_read(), and fdc_write().

Here is the call graph for this function:

Here is the caller graph for this function:

int page_frame_init ( struct zone zone,
void *  base,
size_t  size 
)

Definition at line 50 of file page_frame.c.

References EFAULT, ENOMEM, free(), zone::handle, malloc(), page_allocator_info_size(), and page_allocator_init().

Referenced by create_zone().

Here is the call graph for this function:

Here is the caller graph for this function:

int page_frame_manage ( enum zone_type  type,
void *  page,
int  nr_pages 
)

페이지 프레임 관리자가 전달된 페이지를 관리 목록에 추가한다.

Parameters
[in]type메모리 존의 종류
[in]page추가 관리할 페이지 주소
[in]nr_pages연속 할당 된 페이지의 수
Returns
int 성공시 0 실패시 에러 값

Definition at line 205 of file page_frame.c.

References EEXIST, EINVAL, ENOMEM, find_zone(), malloc(), zone::managed_page_list, NEED_LOCK_TEST_BEGIN, NEED_LOCK_TEST_END, NULL, pthread_mutex_lock(), and pthread_mutex_unlock().

Here is the call graph for this function:

int page_frame_ref ( void *  page)

주어진 페이지의 참조 횟수를 증가 시킨다.

Parameters
[in]page해당 page 의 주소 (물리 주소 기준)
Returns
int 성공시 0 실패시 에러 코드
See Also
page_frame_free()

Definition at line 161 of file page_frame.c.

References ENOENT, NEED_LOCK_TEST_BEGIN, NEED_LOCK_TEST_END, NULL, pthread_mutex_lock(), and pthread_mutex_unlock().

Here is the call graph for this function:

int page_frame_refcnt ( void *  page)

해당 페이지가 참조 된 수

Parameters
[in]page확인할 페이지 주소 (물리 주소 기준)
Returns
int 참조 횟수

Definition at line 183 of file page_frame.c.

References ENOENT, NEED_LOCK_TEST_BEGIN, NEED_LOCK_TEST_END, NULL, pthread_mutex_lock(), pthread_mutex_unlock(), and refcnt.

Here is the call graph for this function: