From owner-freebsd-new-bus Thu Oct 5 14:31:28 2000 Delivered-To: freebsd-new-bus@freebsd.org Received: from pike.osd.bsdi.com (pike.osd.bsdi.com [204.216.28.222]) by hub.freebsd.org (Postfix) with ESMTP id 2845A37B502; Thu, 5 Oct 2000 14:31:11 -0700 (PDT) Received: from laptop.baldwin.cx (john@dhcp248.osd.bsdi.com [204.216.28.248]) by pike.osd.bsdi.com (8.11.0/8.9.3) with ESMTP id e95LUsi15495; Thu, 5 Oct 2000 14:30:54 -0700 (PDT) (envelope-from jhb@FreeBSD.org) Message-ID: X-Mailer: XFMail 1.4.0 on FreeBSD X-Priority: 3 (Normal) Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 8bit MIME-Version: 1.0 In-Reply-To: Date: Thu, 05 Oct 2000 14:31:06 -0700 (PDT) From: John Baldwin To: Doug Rabson Subject: Re: Generic memory barrier helper functions Cc: msmith@FreeBSD.org, new-bus@FreeBSD.org Sender: owner-freebsd-new-bus@FreeBSD.ORG Precedence: bulk X-Loop: FreeBSD.ORG On 04-Oct-00 Doug Rabson wrote: > 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. True I suppose, but they depend on bus_space_barrier(), so I would have thought that they were really bus_space helper functions. Also, can you suggest a barrier_flush() for the alpha? > -- > Doug Rabson Mail: dfr@nlsystems.com -- John Baldwin -- http://www.FreeBSD.org/~jhb/ PGP Key: http://www.baldwin.cx/~john/pgpkey.asc "Power Users Use the Power to Serve!" - http://www.FreeBSD.org/ To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe freebsd-new-bus" in the body of the message