All of lore.kernel.org
 help / color / mirror / Atom feed
From: David Mosberger <davidm@napali.hpl.hp.com>
To: linux-ia64@vger.kernel.org
Subject: Re: atomic.h vs spinlock.h
Date: Fri, 20 Jun 2003 23:08:28 +0000	[thread overview]
Message-ID: <marc-linux-ia64-105615055203234@msgid-missing> (raw)
In-Reply-To: <marc-linux-ia64-105615005202860@msgid-missing>

>>>>> On Fri, 20 Jun 2003 16:00:45 -0700, Umut Aymakoglu <umuta@us.ibm.com> said:

  Umut> 1) what is the difference between the macros defined in
  Umut> asm/atomic.h and asm/spinlock.h. (usage and purpose wise)?

The first provides atomic operations, such as increment and decrement;
the second provides spinlocks.  I'm afraid I'm just stating the
obvious here.

In case you have a copy of my book (ia64 linux kernel), atomic ops and
spinlocks are described in sections 3.3.2 and 3.3.5, respectively.
(Of course, I wouldn't recommend to get the book _just_ because of
this.)

  Umut> 2) If I need to use asm/atomic.h, which macro can I use to
  Umut> test-and-set?

cmpxchg() is the closest thing to test-and-set.  Not all platforms support it.
Platforms that do support it (such as ia64), define macro __HAVE_ARCH_CMPXCHG.

	--david

      reply	other threads:[~2003-06-20 23:08 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2003-06-20 23:00 atomic.h vs spinlock.h Umut Aymakoglu
2003-06-20 23:08 ` David Mosberger [this message]

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=marc-linux-ia64-105615055203234@msgid-missing \
    --to=davidm@napali.hpl.hp.com \
    --cc=linux-ia64@vger.kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.