LF OS
Hobby operating system for amd64 with high ambitions
Loading...
Searching...
No Matches
string.c File Reference

(29312b1 fbconsole, panic: render panic after framebuffer was given to userspace - without clearing screen contents)

#include <stdint.h>
#include <stdbool.h>
#include <string.h>
#include <efi.h>
+ Include dependency graph for string.c:

Go to the source code of this file.

Functions

static void outb (uint16_t port, uint8_t data)
 
static uint8_t inb (uint16_t port)
 
static int is_transmit_empty ()
 
static void uart_write (char *msg, size_t len)
 
static void conwrite (CHAR16 *s)
 
void * memset (void *s, int c, size_t n)
 
void * memcpy (void *dest, const void *src, size_t n)
 
int memcmp (const void *a, const void *b, size_t n)
 
size_t strlen (const char *s)
 
size_t strcpy (char *d, const char *s)
 
size_t wcslen (const CHAR16 *s)
 
int wcscpy (CHAR16 *d, const CHAR16 *s)
 
int wcscmp (const CHAR16 *s1, const CHAR16 *s2)
 
CHAR16 towlower (CHAR16 c)
 
int wcscasecmp (const CHAR16 *s1, const CHAR16 *s2)
 
size_t wcstombs (char *dest, const CHAR16 *src, size_t n)
 
void * malloc (size_t size)
 
void free (void *ptr)
 
void * realloc (void *ptr, size_t size)
 
size_t wprintui (unsigned long long int i, unsigned char base)
 
size_t wprinti (long long int i, unsigned char base)
 
int wprintf (const CHAR16 *fmt,...)
 
static void init_uart ()
 
void init_stdlib (EFI_HANDLE image_handle, EFI_SYSTEM_TABLE *system_table)
 

Variables

static bool uart_out = false
 
static EFI_SYSTEM_TABLE * st
 
EFI_BOOT_SERVICES * BS
 

Function Documentation

◆ conwrite()

static void conwrite ( CHAR16 *  s)
static

Definition at line 36 of file string.c.

References free(), malloc(), st, uart_out, uart_write(), wcslen(), and wcstombs().

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

◆ free()

void free ( void *  ptr)

Definition at line 180 of file string.c.

References BS.

+ Here is the caller graph for this function:

◆ inb()

static uint8_t inb ( uint16_t  port)
static

Definition at line 14 of file string.c.

+ Here is the caller graph for this function:

◆ init_stdlib()

void init_stdlib ( EFI_HANDLE  image_handle,
EFI_SYSTEM_TABLE *  system_table 
)

Definition at line 352 of file string.c.

References BS, init_uart(), and st.

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

◆ init_uart()

static void init_uart ( )
static

Definition at line 319 of file string.c.

References inb(), outb(), st, uart_out, wcscmp(), and wprintf().

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

◆ is_transmit_empty()

static int is_transmit_empty ( )
static

Definition at line 20 of file string.c.

References inb().

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

◆ malloc()

void * malloc ( size_t  size)

Definition at line 169 of file string.c.

References BS, and size.

+ Here is the caller graph for this function:

◆ memcmp()

int memcmp ( const void *  a,
const void *  b,
size_t  n 
)

Definition at line 68 of file string.c.

+ Here is the caller graph for this function:

◆ memcpy()

void * memcpy ( void *  dest,
const void *  src,
size_t  n 
)

Definition at line 60 of file string.c.

References size.

+ Here is the caller graph for this function:

◆ memset()

void * memset ( void *  s,
int  c,
size_t  n 
)

Definition at line 52 of file string.c.

References size.

+ Here is the caller graph for this function:

◆ outb()

static void outb ( uint16_t  port,
uint8_t  data 
)
static

Definition at line 10 of file string.c.

+ Here is the caller graph for this function:

◆ realloc()

void * realloc ( void *  ptr,
size_t  size 
)

Definition at line 184 of file string.c.

References free(), malloc(), memcpy(), and size.

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

◆ strcpy()

size_t strcpy ( char *  d,
const char *  s 
)

Definition at line 86 of file string.c.

+ Here is the caller graph for this function:

◆ strlen()

size_t strlen ( const char *  s)

Definition at line 80 of file string.c.

+ Here is the caller graph for this function:

◆ towlower()

CHAR16 towlower ( CHAR16  c)

Definition at line 119 of file string.c.

+ Here is the caller graph for this function:

◆ uart_write()

static void uart_write ( char *  msg,
size_t  len 
)
static

Definition at line 24 of file string.c.

References is_transmit_empty(), and outb().

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

◆ wcscasecmp()

int wcscasecmp ( const CHAR16 *  s1,
const CHAR16 *  s2 
)

Definition at line 127 of file string.c.

References towlower().

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

◆ wcscmp()

int wcscmp ( const CHAR16 *  s1,
const CHAR16 *  s2 
)

Definition at line 110 of file string.c.

+ Here is the caller graph for this function:

◆ wcscpy()

int wcscpy ( CHAR16 *  d,
const CHAR16 *  s 
)

Definition at line 101 of file string.c.

+ Here is the caller graph for this function:

◆ wcslen()

size_t wcslen ( const CHAR16 *  s)

Definition at line 95 of file string.c.

◆ wcstombs()

size_t wcstombs ( char *  dest,
const CHAR16 *  src,
size_t  n 
)

Definition at line 147 of file string.c.

References wcslen().

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

◆ wprintf()

int wprintf ( const CHAR16 *  fmt,
  ... 
)

Definition at line 226 of file string.c.

References conwrite(), wcslen(), wprinti(), and wprintui().

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

◆ wprinti()

size_t wprinti ( long long int  i,
unsigned char  base 
)

Definition at line 215 of file string.c.

References base, conwrite(), and wprintui().

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

◆ wprintui()

size_t wprintui ( unsigned long long int  i,
unsigned char  base 
)

Definition at line 196 of file string.c.

References base, and conwrite().

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

Variable Documentation

◆ BS

EFI_BOOT_SERVICES* BS

Definition at line 8 of file string.c.

◆ st

EFI_SYSTEM_TABLE* st
static

Definition at line 7 of file string.c.

◆ uart_out

bool uart_out = false
static

Definition at line 6 of file string.c.