From 6ed0ae250b5666b8a2657225106fd759f03ae975 Mon Sep 17 00:00:00 2001 From: Andreas Baumann Date: Wed, 5 Jul 2017 16:56:32 +0200 Subject: removed unneded volatile for text VIDEO_MEMORY (we should add the reference to "volatile is always wrong" --- src/kernel/vgatext.c | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) (limited to 'src') diff --git a/src/kernel/vgatext.c b/src/kernel/vgatext.c index 49c8c3c..13a089e 100644 --- a/src/kernel/vgatext.c +++ b/src/kernel/vgatext.c @@ -37,7 +37,7 @@ void vga_text_init( vga_text_t *vga_text ) void vga_text_clear_screen( vga_text_t *vga_text ) { - volatile uint8_t *VIDEO_MEMORY = (uint8_t *)0xb8000; + uint8_t *VIDEO_MEMORY = (uint8_t *)0xb8000; for( int i = 0; i < 2 * ( vga_text->res_x * vga_text->res_y ); i += 2 ) { *(VIDEO_MEMORY+i) = ' '; @@ -124,7 +124,7 @@ static int calculate_offset( vga_text_t *vga_text, const int x, const int y ) static void scroll_screen( vga_text_t *vga_text ) { - volatile uint8_t *VIDEO_MEMORY = (uint8_t *)0xb8000; + uint8_t *VIDEO_MEMORY = (uint8_t *)0xb8000; memmove( (void *)VIDEO_MEMORY, (const void *)VIDEO_MEMORY + 2 * vga_text->res_x, 2 * ( vga_text->res_y - 1 ) * vga_text->res_x ); @@ -171,7 +171,7 @@ void vga_text_put_char( vga_text_t *vga_text, const char c ) { int offset = calculate_offset( vga_text, vga_text->cursor_x, vga_text->cursor_y ); - volatile uint8_t *VIDEO_MEMORY = (uint8_t *)0xb8000; + uint8_t *VIDEO_MEMORY = (uint8_t *)0xb8000; *(VIDEO_MEMORY+offset) = (uint8_t)c; *(VIDEO_MEMORY+offset+1) = calculate_color_cell( vga_text ); @@ -209,7 +209,7 @@ void vga_text_set_background_color_at( vga_text_t *vga_text, const int x, const { int offset = calculate_offset( vga_text, x, y ); - volatile uint8_t *VIDEO_MEMORY = (uint8_t *)0xb8000; + uint8_t *VIDEO_MEMORY = (uint8_t *)0xb8000; *(VIDEO_MEMORY+offset+1) = ( *(VIDEO_MEMORY+offset+1) & 0x0f ) | ( color << 4 ); } @@ -217,7 +217,7 @@ vga_text_color_t vga_text_get_background_color_at( vga_text_t *vga_text, const i { int offset = calculate_offset( vga_text, x, y ); - volatile uint8_t *VIDEO_MEMORY = (uint8_t *)0xb8000; + uint8_t *VIDEO_MEMORY = (uint8_t *)0xb8000; uint8_t cell = *(VIDEO_MEMORY+offset+1); return cell & 0xf0; @@ -227,7 +227,7 @@ void vga_text_inverse_colors_at( vga_text_t *vga_text, const int x, const int y { int offset = calculate_offset( vga_text, x, y ); - volatile uint8_t *VIDEO_MEMORY = (uint8_t *)0xb8000; + uint8_t *VIDEO_MEMORY = (uint8_t *)0xb8000; *(VIDEO_MEMORY+offset+1) = ( ( *(VIDEO_MEMORY+offset+1) & 0x0f ) << 4 ) | ( ( *(VIDEO_MEMORY+offset+1) & 0xf0 ) >> 4 ); } @@ -264,14 +264,14 @@ void vga_text_hide_mouse_cursor( vga_text_t *vga_text ) void vga_text_save( vga_text_t *vga_text ) { - volatile uint8_t *VIDEO_MEMORY = (uint8_t *)0xA0000; + uint8_t *VIDEO_MEMORY = (uint8_t *)0xA0000; memcpy( vga_text->buf, (const uint8_t *)VIDEO_MEMORY, 2*65535 ); } void vga_text_restore( vga_text_t *vga_text ) { - volatile uint8_t *VIDEO_MEMORY = (uint8_t *)0xA0000; + uint8_t *VIDEO_MEMORY = (uint8_t *)0xA0000; memcpy( (void *)VIDEO_MEMORY, (const uint8_t *)vga_text->buf, 2*65535 ); } -- cgit v1.2.3-54-g00ecf