summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorSamuel Thibault <samuel.thibault@ens-lyon.org>2014-03-26 03:44:57 +0100
committerSamuel Thibault <samuel.thibault@ens-lyon.org>2014-03-26 03:48:31 +0100
commit25ae24c53dbada6be01791c5f15b26d103ee588d (patch)
tree961bcfe409ca78b9cd9089b382d03a4205342390
parent6d5511668545d00da4e3e5dd142b4f082c76b083 (diff)
Align VGA buffers
Some "hardware" (such as kvm on linux 3.2) would hang when transferring between video memory and unaligned main memory. This also allows better optimized transfers anyway. Thanks Petter Reinholdtsen for the report and patient tests. * console-client/vga-support.c (vga_state): Force maximum alignment of `videomem' and `fontmem' fields.
-rw-r--r--console-client/vga-support.c7
1 files changed, 5 insertions, 2 deletions
diff --git a/console-client/vga-support.c b/console-client/vga-support.c
index ce339e19..04926f92 100644
--- a/console-client/vga-support.c
+++ b/console-client/vga-support.c
@@ -55,8 +55,11 @@ struct vga_state
unsigned char attr_mode;
- char videomem[2 * 80 * 25];
- unsigned char fontmem[2 * VGA_FONT_SIZE * VGA_FONT_HEIGHT];
+ /* Alignment is required by some "hardware", and optimizes transfers. */
+ char videomem[2 * 80 * 25]
+ __attribute__ ((aligned (__BIGGEST_ALIGNMENT__)));
+ unsigned char fontmem[2 * VGA_FONT_SIZE * VGA_FONT_HEIGHT]
+ __attribute__ ((aligned (__BIGGEST_ALIGNMENT__)));
};
static struct vga_state *vga_state;