From owner-freebsd-new-bus Wed Oct 4 1:26:12 2000 Delivered-To: freebsd-new-bus@freebsd.org Received: from finch-post-11.mail.demon.net (finch-post-11.mail.demon.net [194.217.242.39]) by hub.freebsd.org (Postfix) with ESMTP id B223137B503; Wed, 4 Oct 2000 01:26:05 -0700 (PDT) Received: from nlsys.demon.co.uk ([158.152.125.33] helo=herring.nlsystems.com) by finch-post-11.mail.demon.net with esmtp (Exim 2.12 #1) id 13gjsJ-000Alw-0B; Wed, 4 Oct 2000 08:26:04 +0000 Received: from salmon.nlsystems.com (salmon.nlsystems.com [10.0.0.3]) by herring.nlsystems.com (8.9.3/8.8.8) with ESMTP id JAA12097; Wed, 4 Oct 2000 09:32:18 +0100 (BST) (envelope-from dfr@nlsystems.com) Date: Wed, 4 Oct 2000 09:25:58 +0100 (BST) From: Doug Rabson To: John Baldwin Cc: new-bus@freebsd.org, msmith@freebsd.org Subject: Re: Generic memory barrier helper functions In-Reply-To: Message-ID: MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII Sender: owner-freebsd-new-bus@FreeBSD.ORG Precedence: bulk X-Loop: FreeBSD.ORG On Tue, 3 Oct 2000, John Baldwin wrote: > After talking with Mike, I whipped up some quick and dirty helper > functions for a MI memory barrier API. Basically, you have the following > four functions: > > barrier_acquire() - a read barrier > barrier_release() - a write barrier > barrier_fence() - a read/write barrier > barrier_flush() - a barrier that flushes the CPU's cache > > I have a simple patch to implement all of these on both x86 and alpha > with the exception of barrier_flush() on the alpha at > http://www.FreeBSD.org/~jhb/patches/barrier.patch and inlined here: It seems like a good idea although I'm not quite sure the functions should go in bus.h. I would probably have thought of putting them in atomic.h since one of their most important uses is for SMP communication. -- Doug Rabson Mail: dfr@nlsystems.com Phone: +44 20 8348 6160 To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe freebsd-new-bus" in the body of the message