From owner-freebsd-mips@FreeBSD.ORG Sun Oct 2 09:28:27 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 72EAA106564A; Sun, 2 Oct 2011 09:28:27 +0000 (UTC) (envelope-from adrian.chadd@gmail.com) Received: from mail-gy0-f182.google.com (mail-gy0-f182.google.com [209.85.160.182]) by mx1.freebsd.org (Postfix) with ESMTP id E3C288FC0A; Sun, 2 Oct 2011 09:28:26 +0000 (UTC) Received: by gyf2 with SMTP id 2so3337614gyf.13 for ; Sun, 02 Oct 2011 02:28:26 -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; bh=iS3ViA97sNvhLhy3MKWPC8OCuWXsjyPrmFx4ah2D4/s=; b=eBVA7CYms1HbObCD6dKxeHBKMp8i85hwC0gE2O5QjCN7fVVDSxW3B7+zCBymjvxx3m U+r3zelU6SLaiJ9r6sdIvJzMNQmfo7t/4TiCO15WdOItNWXCB+AHzHFfis6PpkH4ionJ Y7g0ADht6yWs2BvNJTyVzD0KQhFDdUaMJc9DU= MIME-Version: 1.0 Received: by 10.236.129.165 with SMTP id h25mr24166791yhi.38.1317547706008; Sun, 02 Oct 2011 02:28:26 -0700 (PDT) Sender: adrian.chadd@gmail.com Received: by 10.236.111.42 with HTTP; Sun, 2 Oct 2011 02:28:25 -0700 (PDT) In-Reply-To: References: <201110010556.p915uQH6003016@svn.freebsd.org> Date: Sun, 2 Oct 2011 17:28:25 +0800 X-Google-Sender-Auth: -rAfFmh7q0FpmkzvXOYbrlRvrHk Message-ID: From: Adrian Chadd To: "Jayachandran C." , Konstantin Belousov Content-Type: text/plain; charset=ISO-8859-1 Cc: Alexander Motin , 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: Sun, 02 Oct 2011 09:28:27 -0000 Hi, It doesn't look like openbsd or netbsd have tried addressing this. I took a shot at trying to port over the relevant bits. Linux seems to store the "can reschedule" flag in a bit of memory, rather than calling a function to check each time. This means that I can't simply port r4k_wait() verbose; there's no guarantee EPC would be pointing to inside r4k_wait if it had to call sched_runnable(). Also, since we are calling 'wait' inside a critical section, any EPC unwinding would have to also unwind the critical section (and maybe reprogram the timer) before restarting things. But since that now makes the "rollback" section even larger and unwieldy. I really don't have the time or brain power at the moment to try and port this solution over from Linux. I would really appreciate it if someone would help out here. Thanks, Adrian