From: Tristan Gingold Subject: PATCH: console bug fixes Date: Thu, 13 Apr 2006 09:58:04 +0100 Message-ID: <200604131058.04195.Tristan.Gingold@bull.net> Mime-Version: 1.0 Content-Type: Multipart/Mixed; boundary="Boundary-00=_cKhPECV/K2fkRD0" Return-path: List-Unsubscribe: , List-Post: List-Help: List-Subscribe: , Sender: xen-devel-bounces@lists.xensource.com Errors-To: xen-devel-bounces@lists.xensource.com To: xen-devel@lists.xensource.com, Keir Fraser List-Id: xen-devel@lists.xenproject.org --Boundary-00=_cKhPECV/K2fkRD0 Content-Transfer-Encoding: 7bit Content-Type: text/plain; charset="us-ascii" Content-Disposition: inline Hi, small patch to fix memcpy misuses in console.c Tested on ia64 only. Tristan. --Boundary-00=_cKhPECV/K2fkRD0 Content-Transfer-Encoding: 7bit Content-Type: text/x-diff; charset="us-ascii"; name="xen-vga.diffs" Content-Disposition: attachment; filename="xen-vga.diffs" # HG changeset patch # User tristan.gingold@bull.net # Node ID d2be6e89ea51a8469500d9abccf02af4c9d1bc3d # Parent bfc00c83f08318097446b3818c9de6f2ce286fb6 Use memmove instead of memcpy for overlapping areas (console scroll). Use memset instead of memcpy to clear line. Signed-off-by: Tristan Gingold diff -r bfc00c83f083 -r d2be6e89ea51 xen/drivers/char/console.c --- a/xen/drivers/char/console.c Fri Apr 7 20:06:44 2006 +++ b/xen/drivers/char/console.c Thu Apr 13 04:35:47 2006 @@ -180,12 +180,10 @@ if (ypos >= LINES) { - static char zeroarr[2*COLUMNS] = { 0 }; ypos = LINES-1; - memcpy((char*)video, - (char*)video + 2*COLUMNS, (LINES-1)*2*COLUMNS); - memcpy((char*)video + (LINES-1)*2*COLUMNS, - zeroarr, 2*COLUMNS); + memmove((char*)video, + (char*)video + 2*COLUMNS, (LINES-1)*2*COLUMNS); + memset((char*)video + (LINES-1)*2*COLUMNS, 0, 2*COLUMNS); } } --Boundary-00=_cKhPECV/K2fkRD0 Content-Type: text/plain; charset="us-ascii" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit Content-Disposition: inline _______________________________________________ Xen-devel mailing list Xen-devel@lists.xensource.com http://lists.xensource.com/xen-devel --Boundary-00=_cKhPECV/K2fkRD0--