From 0ad77f09fa0dc35f8ad1ede6dd1acbb68455dec7 Mon Sep 17 00:00:00 2001 From: Kevin O'Connor Date: Sun, 31 May 2009 20:46:43 -0400 Subject: [PATCH] VGA: Reduce stack usage. Make 'struct carattr' 3 bytes in size - gcc does better with this. Add 'noinline' directives to some funcs to reduce handle_10 stack usage. --- vgasrc/vga.c | 10 +++++----- vgasrc/vgatables.h | 3 +-- 2 files changed, 6 insertions(+), 7 deletions(-) diff --git a/vgasrc/vga.c b/vgasrc/vga.c index 403f047..a01b0fc 100644 --- a/vgasrc/vga.c +++ b/vgasrc/vga.c @@ -513,7 +513,7 @@ handle_1008(struct bregs *regs) regs->ah = ca.attr; } -static void +static void noinline write_chars(u8 page, struct carattr ca, u16 count) { struct cursorpos cp = get_cursor_pos(page); @@ -581,7 +581,7 @@ handle_100d(struct bregs *regs) biosfn_read_pixel(regs->bh, regs->cx, regs->dx, ®s->ax); } -static void +static void noinline handle_100e(struct bregs *regs) { // Ralf Brown Interrupt list is WRONG on bh(page) @@ -647,7 +647,7 @@ handle_101009(struct bregs *regs) vgahw_get_all_palette_reg(regs->es, (u8*)(regs->dx + 0)); } -static void +static void noinline handle_101010(struct bregs *regs) { u8 rgb[3] = {regs->dh, regs->ch, regs->cl}; @@ -666,7 +666,7 @@ handle_101013(struct bregs *regs) vgahw_select_video_dac_color_page(regs->bl, regs->bh); } -static void +static void noinline handle_101015(struct bregs *regs) { u8 rgb[3]; @@ -987,7 +987,7 @@ handle_1012(struct bregs *regs) } -static void +static void noinline handle_1013(struct bregs *regs) { struct cursorpos cp = {regs->dl, regs->dh, regs->bh}; diff --git a/vgasrc/vgatables.h b/vgasrc/vgatables.h index 0d64586..2eb0c71 100644 --- a/vgasrc/vgatables.h +++ b/vgasrc/vgatables.h @@ -152,8 +152,7 @@ extern u8 vgafont16alt[]; // vga.c struct carattr { - u8 car, attr; - u16 use_attr; + u8 car, attr, use_attr; }; struct cursorpos { u8 x, y, page; -- 2.39.5