MOS Source Code
Loading...
Searching...
No Matches
libs.Stdlib

Some standard library functions. More...

+ Collaboration diagram for libs.Stdlib:

Macros

#define MIN(a, b)
 
#define MAX(a, b)
 
#define pow2(x)
 

Functions

MOSAPI unsigned char tolower (unsigned char c)
 
MOSAPI s32 abs (s32 x)
 
MOSAPI long labs (long x)
 
MOSAPI s64 llabs (s64 x)
 
MOSAPI s32 atoi (const char *nptr)
 
MOSAPI unsigned long strtoul (const char *nptr, char **endptr, int base)
 
MOSAPI s64 strtoll (const char *str, char **endptr, int base)
 
MOSAPI s64 strntoll (const char *str, char **endptr, int base, size_t n)
 
MOSAPI void format_size (char *buf, size_t buf_size, u64 size)
 
MOSAPI char * string_trim (char *in)
 
MOSAPI pid_t spawn (const char *path, const char *const argv[])
 
MOSAPI void exit (int status)
 
MOSAPI int atexit (void(*func)(void))
 
MOSAPI tid_t start_thread (const char *name, thread_entry_t entry, void *arg)
 
MOSAPI void abort (void)
 

Detailed Description

Some standard library functions.

Macro Definition Documentation

◆ MIN

◆ MAX

#define MAX ( a,
b )
Value:
__extension__ ({ __extension__ __auto_type _a = (a); __auto_type _b = (b); _a > _b ? _a : _b; })

Definition at line 31 of file mos_stdlib.h.

Referenced by add_to_memmap(), printf_cs(), printf_diouxX(), vfs_io_ops_seek(), and x86_setup_direct_map().

◆ pow2

#define pow2 ( x)
Value:
((__typeof__(x)) 1 << (x))

Definition at line 32 of file mos_stdlib.h.

Referenced by break_the_order(), break_this_pfn(), buddy_alloc_n_exact(), dump_list(), extract_exact_range(), get_buddy_pfn(), populate_freelist(), and try_merge().

Function Documentation

◆ tolower()

MOSAPI unsigned char tolower ( unsigned char c)

Definition at line 9 of file mos_stdlib.c.

Referenced by strncasecmp().

◆ abs()

MOSAPI s32 abs ( s32 x)

Definition at line 21 of file mos_stdlib.c.

◆ labs()

MOSAPI long labs ( long x)

Definition at line 26 of file mos_stdlib.c.

◆ llabs()

MOSAPI s64 llabs ( s64 x)

Definition at line 31 of file mos_stdlib.c.

◆ atoi()

MOSAPI s32 atoi ( const char * nptr)

Definition at line 36 of file mos_stdlib.c.

Referenced by encode_dictionary(), encode_tree(), and main().

+ Here is the call graph for this function:

◆ strtoul()

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

Referenced by main(), and overlay_fixup_phandle().

◆ strtoll()

MOSAPI s64 strtoll ( const char * str,
char ** endptr,
int base )

Definition at line 68 of file mos_stdlib.c.

Referenced by strtoul().

+ Here is the call graph for this function:

◆ strntoll()

MOSAPI s64 strntoll ( const char * str,
char ** endptr,
int base,
size_t n )

◆ format_size()

MOSAPI void format_size ( char * buf,
size_t buf_size,
u64 size )

Definition at line 103 of file mos_stdlib.c.

Referenced by mmstat_sysfs_stat().

+ Here is the call graph for this function:

◆ string_trim()

MOSAPI char * string_trim ( char * in)

Definition at line 124 of file mos_stdlib.c.

+ Here is the call graph for this function:

◆ spawn()

MOSAPI pid_t spawn ( const char * path,
const char *const argv[] )

◆ exit()

MOSAPI void exit ( int status)

◆ atexit()

MOSAPI int atexit ( void(* func )(void))

◆ start_thread()

MOSAPI tid_t start_thread ( const char * name,
thread_entry_t entry,
void * arg )

◆ abort()

MOSAPI void abort ( void )

Definition at line 37 of file avr_io.c.