summaryrefslogtreecommitdiff
path: root/stage3/font.c
diff options
context:
space:
mode:
authorLizzy Fleckenstein <lizzy@vlhl.dev>2024-01-09 21:22:14 +0100
committerLizzy Fleckenstein <lizzy@vlhl.dev>2024-01-09 21:26:23 +0100
commitc6e1454fbb872aed5d445d458958943556271529 (patch)
tree4951f6a95e4ddead170a355940822f8c86b6ed63 /stage3/font.c
parent59f22bc7ce5bbadf62722f3db5c93b45e86e4cca (diff)
downloadcuddles-c6e1454fbb872aed5d445d458958943556271529.tar.xz
rename some functions to not use standard names
this avoids confusion when some of those functions differ subtly from their standard versions. free -> kfree realloc -> krealloc malloc -> kmalloc rationale: kmalloc() behaves different from malloc() in that it will never return NULL. it will panic on OOM. try_kmalloc behaves like the usual malloc. memcpy -> lmemcpy memcpy_r -> rmemcpy rationale: by design, lmemcpy() and rmemcpy() allow memory areas to overlap. the 'l' and 'r' indicate the direction of the copy operation.
Diffstat (limited to 'stage3/font.c')
-rw-r--r--stage3/font.c10
1 files changed, 5 insertions, 5 deletions
diff --git a/stage3/font.c b/stage3/font.c
index f2e6bea..f0b8d93 100644
--- a/stage3/font.c
+++ b/stage3/font.c
@@ -24,7 +24,7 @@ static u16 screen_width, screen_height;
void font_init()
{
- font = malloc(256 * 16);
+ font = kmalloc(256 * 16);
}
void font_set_size(u16 size)
@@ -56,12 +56,12 @@ term_pos font_get_size()
void font_load_blob(const void *blob)
{
- memcpy(font, blob, 256*16);
+ lmemcpy(font, blob, 256*16);
}
void font_load_builtin()
{
- memcpy(font, fs_fonts_ter_u16n_cuddlefont, 256*16);
+ lmemcpy(font, fs_fonts_ter_u16n_cuddlefont, 256*16);
}
void font_load_classic()
@@ -89,7 +89,7 @@ void font_load_classic()
}
}
- free(cfont);
+ kfree(cfont);
}
void font_clear_screen()
@@ -127,7 +127,7 @@ static void update_cursor()
while (cursor_y >= screen_height) {
cursor_y--;
- memcpy((void *) (u64) gfx_info->framebuffer,
+ lmemcpy((void *) (u64) gfx_info->framebuffer,
(void *) (u64) gfx_info->framebuffer + gfx_info->pitch * outer_height,
gfx_info->pitch * (gfx_info->height - outer_height));