From owner-freebsd-mips@FreeBSD.ORG Sat Oct 1 10:31:32 2011 Return-Path: Delivered-To: freebsd-mips@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 687BC1065672; Sat, 1 Oct 2011 10:31:32 +0000 (UTC) (envelope-from adrian.chadd@gmail.com) Received: from mail-vw0-f54.google.com (mail-vw0-f54.google.com [209.85.212.54]) by mx1.freebsd.org (Postfix) with ESMTP id 00C768FC15; Sat, 1 Oct 2011 10:31:31 +0000 (UTC) Received: by vws11 with SMTP id 11so2675436vws.13 for ; Sat, 01 Oct 2011 03:31:31 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=mime-version:sender:in-reply-to:references:date :x-google-sender-auth:message-id:subject:from:to:cc:content-type :content-transfer-encoding; bh=VbSz/w81QGNd8MG1XbnpwnTswcINv1J7uBJsu7YNrhc=; b=l8RIeuVbrp+eoBV+7ZEvvZqX+UXcLi52r6bX6uN6g7UCNGuxxR+OqGKwMtvwQvoN8D 6gUAzJvCGv1Tp3t/HWikFpqmzxIIHpe5rPqdrKpWIfNl3BBF4qQyKfj+om543j/uJ171 85Z3bCEWXICznpe5TeDqoyJskXhyfiwHPy4bk= MIME-Version: 1.0 Received: by 10.52.68.203 with SMTP id y11mr2961731vdt.462.1317465091197; Sat, 01 Oct 2011 03:31:31 -0700 (PDT) Sender: adrian.chadd@gmail.com Received: by 10.52.161.138 with HTTP; Sat, 1 Oct 2011 03:31:31 -0700 (PDT) In-Reply-To: References: <201110010556.p915uQH6003016@svn.freebsd.org> Date: Sat, 1 Oct 2011 18:31:31 +0800 X-Google-Sender-Auth: T1MhMM8VbmAXm0To1qPywVsXlNo Message-ID: From: Adrian Chadd To: "Jayachandran C." Content-Type: text/plain; charset=windows-1252 Content-Transfer-Encoding: quoted-printable Cc: freebsd-mips@freebsd.org Subject: Re: svn commit: r225892 - head/sys/mips/mips X-BeenThere: freebsd-mips@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: Porting FreeBSD to MIPS List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 01 Oct 2011 10:31:32 -0000 Just FYI, the MIPS24K software users manual, section 9.2.1: 9.2.1 Wait IE Ignore A feature is included in the core that simplifies the task of using the WAIT instruction in the idle loop of an OS. The WAIT instruction is typically in block of code where the OS first checks to see if there is any pending work and if there is not, it will execute the WAIT as shown below. ... There is a tricky race condition present in this code. If an interrupt arrives between the pending check and the WAIT instruction, the service routine will return and execute the WAIT and go to sleep. However, the interrupt may have been enabling some pending work to be done in the =91bottom-half=92 processing. If the core goes back to sleep, this pending work will not be done until the next interrupt arrives. The OS can check to see if the interrupt was signalled in this window and adjust the EPC value to before the pending check, but this involves a fair amount of work. The Wait IE Ignore feature enables a simpler solution for the race con- dition. With this feature, a WAIT condition will be terminated by an active interrupt signal, even if that signal is pre- vented from causing an interrupt by StatusIE being clear or TCStatusIXMT being set. This allows interrupts to be disabled in this section of code while still allowing the WAIT to complete. That's likely a good solution for my platform, if it actually is implemented for my core. Would you mind seeing if XLR has something similar? I'll code this up tonight/tomorrow and see if I can coax my mips24k cores to work correctly. Adrian