From c2bce7cc39d27cf8d1d7bc23074f8392d1150405 Mon Sep 17 00:00:00 2001 From: Jung-uk Kim Date: Wed, 24 Mar 2010 15:40:18 +0000 Subject: [PATCH] Align memory access of 24-bit pixel renderer to word boundary. --- sys/dev/syscons/scvgarndr.c | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/sys/dev/syscons/scvgarndr.c b/sys/dev/syscons/scvgarndr.c index 583e51ae9bf9..dbee6f200d4a 100644 --- a/sys/dev/syscons/scvgarndr.c +++ b/sys/dev/syscons/scvgarndr.c @@ -184,8 +184,13 @@ static u_short mouse_or_mask[16] = { writel(pos, vga_palette32[color]); \ break; \ case 24: \ - writew(pos, vga_palette32[color]); \ - writeb(pos + 2, vga_palette32[color] >> 16); \ + if (((pos) & 1) == 0) { \ + writew(pos, vga_palette32[color]); \ + writeb(pos + 2, vga_palette32[color] >> 16);\ + } else { \ + writeb(pos, vga_palette32[color]); \ + writew(pos + 1, vga_palette32[color] >> 8);\ + } \ break; \ case 16: \ if (scp->sc->adp->va_info.vi_pixel_fsizes[1] == 5)\