From e57be56d1b1ac79254162dee7c28f5a6f87cfb99 Mon Sep 17 00:00:00 2001 From: lucic71 Date: Tue, 28 Jun 2022 19:40:51 +0300 Subject: [PATCH] Made vga inlined in kernel/lib --- kernel/lib/Documentation.txt | 14 -------------- kernel/lib/include/lib/vga.h | 12 ++++++++++-- kernel/lib/vga/src/vga.c | 13 ------------- 3 files changed, 10 insertions(+), 29 deletions(-) delete mode 100644 kernel/lib/Documentation.txt delete mode 100644 kernel/lib/vga/src/vga.c diff --git a/kernel/lib/Documentation.txt b/kernel/lib/Documentation.txt deleted file mode 100644 index d5270cf..0000000 --- a/kernel/lib/Documentation.txt +++ /dev/null @@ -1,14 +0,0 @@ -I. File Structure ------------------ - - include/ - interfaces for library functions, only modules are intended to - access them - - so/ - archives and shared objects used by modules in linking stage - - lib_dir/ - asm/ assembly implementations - - src/ C implementations - - Makefile - build sources from lib_dirs using a template Makefile which can - be found in /scripts/ and links the resulting objects in different - shared objects and archives which can be found in so/ diff --git a/kernel/lib/include/lib/vga.h b/kernel/lib/include/lib/vga.h index 6b7c767..6cde1cb 100644 --- a/kernel/lib/include/lib/vga.h +++ b/kernel/lib/include/lib/vga.h @@ -47,7 +47,11 @@ enum vga_color { * */ -uint8_t vga_entry_color(enum vga_color fg, enum vga_color bg); +static inline uint8_t vga_entry_color(enum vga_color fg, enum vga_color bg) { + + return fg | (bg << 4); + +} /* * vga_entry: @@ -60,6 +64,10 @@ uint8_t vga_entry_color(enum vga_color fg, enum vga_color bg); * */ -uint16_t vga_entry(char c, uint8_t color); +static inline uint16_t vga_entry(char c, uint8_t color) { + + return (uint16_t) c | ((uint16_t) color << 8); + +} #endif diff --git a/kernel/lib/vga/src/vga.c b/kernel/lib/vga/src/vga.c deleted file mode 100644 index 45068d6..0000000 --- a/kernel/lib/vga/src/vga.c +++ /dev/null @@ -1,13 +0,0 @@ -#include "lib/vga.h" - -uint8_t vga_entry_color(enum vga_color fg, enum vga_color bg) { - - return fg | (bg << 4); - -} - -uint16_t vga_entry(char c, uint8_t color) { - - return (uint16_t) c | ((uint16_t) color << 8); - -}