Google Groups no longer supports new Usenet posts or subscriptions. Historical content remains viewable.
Dismiss

declaration of memory barrier function

3 views
Skip to first unread message

dbtouch

unread,
Jun 22, 2009, 3:59:35 PM6/22/09
to
Dear Linux Programmers,

I am using fedora 10 with version of 2.6.27.5-117.fc10.x86_64 #1 SMP.
I am looking for the system head file where memory barrier functions
are declared.

Thanks,

dbtouch

David Schwartz

unread,
Jun 22, 2009, 7:21:05 PM6/22/09
to

There is no memory barrier API provided by default. If you want one,
you have to code it. On x86-64, this is sufficient:

#define membar() __asm__ __volatile__("" : : : "memory")

DS

dbtouch

unread,
Jun 22, 2009, 9:14:11 PM6/22/09
to

Hi, DS

Thanks.

What about smp_mb() mentioned in this article? Where I can find its
definition?

http://www.linuxjournal.com/article/8212

David Schwartz

unread,
Jun 22, 2009, 9:33:29 PM6/22/09
to
On Jun 22, 6:14 pm, dbtouch <dbto...@gmail.com> wrote:

> What about smp_mb()  mentioned in this article? Where I can find its
> definition?

Are you trying to write kernel code or user space code?

DS

dbtouch

unread,
Jun 22, 2009, 9:53:54 PM6/22/09
to

I am trying to modify libpcap and I need memory barrier function.

dbtouch

0 new messages