From mboxrd@z Thu Jan 1 00:00:00 1970 From: Stas Sergeev Subject: Re: [announce] dosemu-1.2.2 Date: Fri, 16 Jul 2004 21:40:08 +0400 Sender: linux-msdos-owner@vger.kernel.org Message-ID: <40F812F8.7050107@aknet.ru> Mime-Version: 1.0 Content-Type: multipart/mixed; boundary="------------040300060502050007030000" Return-path: List-Id: To: linux-msdos@vger.kernel.org --------------040300060502050007030000 Content-Type: text/plain; charset=us-ascii; format=flowed Content-Transfer-Encoding: 7bit Hello. Ralph Alvy wrote: > With version 1.2.1, hogthreshold at 2 keeps the CPU at 60% and printing > is almost immediate at a timeout value of 10. Probably the attached patch can rectify the problem? --------------040300060502050007030000 Content-Type: text/x-patch; name="lpt.diff" Content-Transfer-Encoding: 7bit Content-Disposition: inline; filename="lpt.diff" --- src/base/dev/misc/lpt.c 2004-06-07 00:14:59.000000000 +0400 +++ src/base/dev/misc/lpt.c 2004-07-16 21:26:10.157433832 +0400 @@ -20,6 +20,7 @@ #include #include "emu.h" +#include "timers.h" #include "lpt.h" #include "utilities.h" #include "dos2linux.h" @@ -53,11 +54,13 @@ return 1; } + reset_idle(); + switch (HI(ax)) { case 0: /* write char */ /* p_printf("print character on lpt%d : %c (%d)\n", LO(dx), LO(ax), LO(ax)); */ - HI(ax) = (lpt[LO(dx)].fops.write) (LO(dx), LO(ax)); + HI(ax) = printer_write(LO(dx), LO(ax)); break; case 1: /* init */ @@ -178,12 +181,12 @@ int stub_printer_write(int prnum, int outchar) { - (lpt[prnum].fops.open) (prnum); + printer_open(prnum); /* from now on, use real write */ lpt[prnum].fops.write = lpt[prnum].fops.realwrite; - return ((lpt[prnum].fops.write) (prnum, outchar)); + return printer_write(prnum, outchar); } int @@ -234,8 +237,7 @@ for (loop = 0; loop < NUM_PRINTERS; loop++) { p_printf("LPT: closing printer %d (%s)\n", loop, lpt[loop].dev ? lpt[loop].dev : "<>"); - if (lpt[loop].fops.close) - (lpt[loop].fops.close) (loop); + printer_close(loop); } } @@ -248,9 +250,10 @@ if (lpt[i].remaining >= 0) { p_printf("LPT: doing real tick for %d\n", i); if (lpt[i].remaining) { + reset_idle(); lpt[i].remaining--; if (!lpt[i].remaining) - (lpt[i].fops.flush) (i); + printer_flush(i); } } } --------------040300060502050007030000 Content-Type: text/plain Scanned by evaluation version of Dr.Web antivirus Daemon http://drweb.ru/unix/ --------------040300060502050007030000--