Skip site navigation (1)Skip section navigation (2)
Date:      Sun, 6 Sep 2015 06:53:56 -0700
From:      Leonardo Fogel <leonardofogel@yahoo.com.br>
To:        freebsd-drivers@freebsd.org
Subject:   Memory barrier
Message-ID:  <1441547636.78646.YahooMailBasic@web120801.mail.ne1.yahoo.com>
In-Reply-To: <2149458.2Hg3JbBXY3@ralph.baldwin.cx>

next in thread | previous in thread | raw e-mail | index | archive | help
Hi.
Please, what are the correct barriers for the following cases?

Case 1:
   bus_write_1(region_0, ...);
   /* barrier here */
   DELAY(some_time);

Case 2:
   bus_write_1(region_0, ...);
   /* barrier here */
   bus_write_1(region_2, ...);

In the first one, I want the write to reach the device before the thread bu=
sy-waits. As I understand it, bus_space_barrier(9) is not adequate, because=
 it does not prevent the processor from executing instructions (or load/sto=
re to RAM) before the write completes.

In the second one, I want the write to a device (e.g. power management) to =
complete before the write to another starts/completes. Again, bus_space_bar=
rier() seems not to be adequate because it can not cover two regions.

Thank you for your time.

Leonardo



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?1441547636.78646.YahooMailBasic>