nckernel  0.1
 All Data Structures Files Functions Variables Typedefs Enumerations Enumerator Macros Groups Pages
Functions
표준 라이브러리 함수들을 구현

표준에서 정의하는 라이브러리 함수들을 구현 More...

Collaboration diagram for 표준 라이브러리 함수들을 구현:

Functions

void _Exit (int ret)
 
long a64l (const char *val)
 
void abort (void)
 
int abs (int val)
 
int atexit (void(*func)(void))
 
double atof (const char *str)
 
int atoi (const char *nptr)
 
long atol (const char *nptr)
 
long long atoll (const char *nptr)
 
long long atoq (const char *nptr)
 
void * bsearch (const void *key, const void *base, size_t nmemb, size_t size, int(*compar)(const void *, const void *))
 
void * calloc (size_t nmemb, size_t size)
 
double drand48 (void)
 
double erand48 (unsigned short xsubi[3])
 
void exit (int ret)
 
void free (void *buf)
 
char * getenv (const char *name)
 
int getsubopt (char **optionp, char *const *tokens, char **valuep)
 
int grantpt (int fd)
 
char * initstate (unsigned seed, char *state, size_t n)
 
long jrand48 (unsigned short xsubi[3])
 
char * l64a (long value)
 
long labs (long int j)
 
void lcong48 (unsigned short param[7])
 
long long llabs (long long)
 
long lrand48 (void)
 
void * malloc (size_t size)
 
int posix_memalign (void **memptr, size_t alignment, size_t size)
 
int setenv (const char *name, const char *value, int overwrite)
 
long int strtol (const char *nptr, char **endptr, int base)
 
long long int strtoll (const char *nptr, char **endptr, int base)
 
unsigned long int strtoul (const char *nptr, char **endptr, int base)
 
unsigned long long int strtoull (const char *nptr, char **endptr, int base)
 

Detailed Description

표준에서 정의하는 라이브러리 함수들을 구현

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

Function Documentation

void _Exit ( int  ret)
long a64l ( const char *  val)
void abort ( void  )
int abs ( int  val)
int atexit ( void(*)(void)  func)
double atof ( const char *  str)
int atoi ( const char *  nptr)

Definition at line 13 of file stdlib.c.

Referenced by common_get_tcb_sz().

Here is the caller graph for this function:

long atol ( const char *  nptr)

Definition at line 24 of file stdlib.c.

long long atoll ( const char *  nptr)

Definition at line 35 of file stdlib.c.

long long atoq ( const char *  nptr)

Definition at line 40 of file stdlib.c.

void* bsearch ( const void *  key,
const void *  base,
size_t  nmemb,
size_t  size,
int(*)(const void *, const void *)  compar 
)
void* calloc ( size_t  nmemb,
size_t  size 
)
Todo:
calloc 의 구현에 대한 정확한 요구사항 파악이 필요함 현재는 그냥 member 개수와 size 를 곱해서 실제 heap 할당 크기를 구하는 것으로 한다. malloc 을 그대로 사용한다.

Definition at line 139 of file malloc.c.

References malloc(), memset(), and NULL.

Here is the call graph for this function:

double drand48 ( void  )
double erand48 ( unsigned short  xsubi[3])
void exit ( int  ret)
void free ( void *  buf)
Note
병합되었으면, 다음 entry 와의 병합을 한번 더 시도한다.
이 경우, 병합된 것이 없으므로, 리스트에 추가하고 병합을 종료한다.
병합되었으면, 다음 entry 와의 병합을 한번 더 시도한다.

Definition at line 217 of file malloc.c.

References _SC_PAGESIZE, ALIGNED, CAN_BE_MERGED, container_of, chunk::head, irq_local_restore(), irq_local_save(), list_entry, list_for_each_safe, NEED_LOCK_TEST_BEGIN, NEED_LOCK_TEST_END, list_head::next, NULL, list_head::prev, chunk::size, and sysconf().

Referenced by cpu_node_destroy(), create_fat_cache(), create_zone(), destroy_fat_cache(), destroy_zone(), fat_load(), fdc_close(), fdc_open(), keyboard_close(), load_rootfs(), page_frame_alloc(), page_frame_fini(), page_frame_free(), page_frame_init(), pthread_attr_destroy(), pthread_cancel(), pthread_create(), pthread_init(), register_irq(), sem_clear(), sem_destroy(), sem_post(), serial_close(), serial_open(), ston_destroy(), ston_fini(), unregister_irq(), vfs_del_ninfo(), vfs_new_dev_ninfo(), vfs_new_ninfo(), and video_close().

Here is the call graph for this function:

Here is the caller graph for this function:

char * getenv ( const char *  name)

Definition at line 50 of file stdlib.c.

References environ, NULL, strlen(), and strncmp().

Referenced by common_get_tcb_sz().

Here is the call graph for this function:

Here is the caller graph for this function:

int getsubopt ( char **  optionp,
char *const *  tokens,
char **  valuep 
)
int grantpt ( int  fd)
char* initstate ( unsigned  seed,
char *  state,
size_t  n 
)
long jrand48 ( unsigned short  xsubi[3])
char* l64a ( long  value)
long labs ( long int  j)
void lcong48 ( unsigned short  param[7])
long long llabs ( long  long)
long lrand48 ( void  )
void* malloc ( size_t  size)
Note
리스트의 수정을 최소화 하기 위해서 남는공간의 뒤에서 할당을 하고, free 리스트에서 분리해내 used 리스트로 추가한다. 이렇게 하면, free 리스트를 수정하지 않아도 된다.

new_item 은 할당된 영역이 되고 item 은 남는 영역이 된다.

Definition at line 79 of file malloc.c.

References _SC_PAGESIZE, ALIGNED, irq_local_restore(), irq_local_save(), list_entry, list_for_each_safe, NEED_LOCK_TEST_BEGIN, NEED_LOCK_TEST_END, NULL, sbrk(), chunk::size, and sysconf().

Referenced by calloc(), cpu_node_create(), create_fat_cache(), create_zone(), fat_load(), fdc_open(), keyboard_open(), load_rootfs(), onetime_map_init(), page_frame_alloc(), page_frame_init(), page_frame_manage(), pthread_attr_init(), pthread_create(), pthread_init(), register_irq(), sem_init(), sem_wait(), serial_open(), ston_create(), ston_init(), strdup(), strndup(), vfs_del_ninfo(), vfs_new_dev_ninfo(), vfs_new_ninfo(), and video_open().

Here is the call graph for this function:

Here is the caller graph for this function:

int posix_memalign ( void **  memptr,
size_t  alignment,
size_t  size 
)

Definition at line 165 of file malloc.c.

References ALIGNED, ENOMEM, chunk::head, irq_local_restore(), irq_local_save(), list_entry, list_for_each_safe, NEED_LOCK_TEST_BEGIN, NEED_LOCK_TEST_END, chunk::ptr, sbrk(), and chunk::size.

Referenced by memalign().

Here is the call graph for this function:

Here is the caller graph for this function:

int setenv ( const char *  name,
const char *  value,
int  overwrite 
)

Definition at line 45 of file stdlib.c.

long int strtol ( const char *  nptr,
char **  endptr,
int  base 
)
Note
endptr is already updated

Definition at line 83 of file stdlib.c.

References isspace(), and NULL.

Referenced by strtoul().

Here is the call graph for this function:

Here is the caller graph for this function:

long long int strtoll ( const char *  nptr,
char **  endptr,
int  base 
)

Definition at line 163 of file stdlib.c.

Referenced by strtoull().

Here is the caller graph for this function:

unsigned long int strtoul ( const char *  nptr,
char **  endptr,
int  base 
)

Definition at line 168 of file stdlib.c.

References strtol().

Here is the call graph for this function:

unsigned long long int strtoull ( const char *  nptr,
char **  endptr,
int  base 
)

Definition at line 175 of file stdlib.c.

References strtoll().

Here is the call graph for this function: