:: commit e909489635811d7c0260f6071b224e971315bb28

mintsuki <mintsuki@protonmail.com> — 2023-02-16 02:21

parents: a3f814b5f7

vga_textmode: Unbreak on trunk

diff --git a/common/drivers/vga_textmode.c b/common/drivers/vga_textmode.c
index 2acbf4ca..d49007e2 100644
--- a/common/drivers/vga_textmode.c
+++ b/common/drivers/vga_textmode.c
@@ -244,9 +244,9 @@ static void text_deinit(struct term_context *_ctx, void (*_free)(void *, size_t)
         _free(ctx->front_buffer, VD_ROWS * VD_COLS);
         ctx->front_buffer = NULL;
     }
-}
 
-static struct textmode_context term_local_struct;
+    pmm_free(ctx, sizeof(struct textmode_context));
+}
 
 void vga_textmode_init(bool managed) {
     term_notready();
@@ -266,12 +266,10 @@ void vga_textmode_init(bool managed) {
     terms = ext_mem_alloc(sizeof(void *));
     terms_i = 1;
 
-    terms[0] = ext_mem_alloc(sizeof(struct term_context));
+    terms[0] = ext_mem_alloc(sizeof(struct textmode_context));
 
     struct term_context *term = terms[0];
-
-    struct textmode_context *ctx = &term_local_struct;
-    term = &term_local_struct.term;
+    struct textmode_context *ctx = (void *)term;
 
     if (ctx->back_buffer == NULL) {
         ctx->back_buffer = ext_mem_alloc(VD_ROWS * VD_COLS);
tab: 248 wrap: offon