From 4396a2bba4811c27e0ffe0f5dcc587f968f694f2 Mon Sep 17 00:00:00 2001 From: Aren Date: Wed, 17 Jan 2024 12:44:56 +0300 Subject: [PATCH] =?UTF-8?q?=D0=94=D0=BE=D0=B1=D0=B0=D0=B2=D0=BB=D0=B5?= =?UTF-8?q?=D0=BD=D0=B0=20=D0=B8=D0=BD=D0=B8=D1=86=D0=B8=D0=B0=D0=BB=D0=B8?= =?UTF-8?q?=D0=B7=D0=B0=D1=86=D0=B8=D1=8F=20=D0=B2=D1=81=D0=B5=D1=85=20?= =?UTF-8?q?=D1=84=D1=83=D0=BD=D0=BA=D1=86=D0=B8=D0=B9=20API?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- modlib/system.h | 16 ++++++++++++++++ modlib/types.h | 5 +++++ 2 files changed, 21 insertions(+) diff --git a/modlib/system.h b/modlib/system.h index d2179a7..cc226c0 100644 --- a/modlib/system.h +++ b/modlib/system.h @@ -15,6 +15,14 @@ static void *(*alloc)(uint64_t size); static void (*free)(void *ptr); static void (*fb_printf)(char *str, ...); static module_info_t *(*get_module)(char *module_id); +static framebuffer_t (*alloc_framebuffer)( ); +static void (*free_framebuffer)(framebuffer_t *frame); +static void (*exit)(int code); +static int (*get_error)( ); +static sys_info_t *(*get_info)( ); +static uint64_t (*new_thread)(uint64_t func); +static int (*delete_thread)(uint64_t thread_id); +static time_t (*get_time)( ); static uint64_t offset; #include @@ -25,6 +33,14 @@ static inline void init_env(env_t *loader_env) { alloc = loader_env->alloc; free = loader_env->free; get_module = loader_env->get_module; + alloc_framebuffer = loader_env->alloc_framebuffer; + free_framebuffer = loader_env->free_framebuffer; + exit = loader_env->exit; + get_error = loader_env->get_error; + get_info = loader_env->get_info; + new_thread = loader_env->new_thread; + delete_thread = loader_env->delete_thread; + get_time = loader_env->get_time; } static void *realloc(void *addr, size_t size) { diff --git a/modlib/types.h b/modlib/types.h index 51565fd..e86290e 100644 --- a/modlib/types.h +++ b/modlib/types.h @@ -27,6 +27,11 @@ typedef long long int64_t; typedef uint64_t size_t; typedef struct { + uint32_t *address; + uint64_t width; + uint64_t height; + uint64_t pitch; + uint16_t bpp; int reserved; } framebuffer_t;