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);
