From: Timur Tabi <ttabi@interactivesi.com>
To: linux-kernel@vger.kernel.org
Subject: Re: gnu asm help...
Date: Tue, 19 Jun 2001 10:48:48 -0500 [thread overview]
Message-ID: <giuPyB.A.JvE.jR3L7@dinero.interactivesi.com> (raw)
In-Reply-To: <635DA093636@vcnet.vc.cvut.cz>
** Reply to message from "Petr Vandrovec" <VANDROVE@vc.cvut.cz> on Tue, 19 Jun
2001 01:36:26 MET-1
> No. Another CPU might increment value between LOCK INCL and
> fetching v->counter. On ia32 architecture you are almost out of
> luck. You can either try building atomic_inc around CMPXCHG,
> using it as conditional store (but CMPXCHG is not available
> on i386), or you can just guard your atomic variable with
> spinlock - but in that case there is no reason for using atomic_t
> at all.
Oh, I see the problem. You could do something like this:
cli
mov %0, %%eax
inc %%eax
mov %%eax, %0
sti
and then return eax, but that won't work on SMP (whereas the "lock inc" does).
Doing a global cli might work, though.
--
Timur Tabi - ttabi@interactivesi.com
Interactive Silicon - http://www.interactivesi.com
next prev parent reply other threads:[~2001-06-19 15:49 UTC|newest]
Thread overview: 10+ messages / expand[flat|nested] mbox.gz Atom feed top
2001-06-19 1:36 gnu asm help Petr Vandrovec
2001-06-19 15:48 ` Timur Tabi [this message]
2001-06-19 17:21 ` Richard B. Johnson
-- strict thread matches above, loose matches on Subject: below --
2001-06-19 20:02 Petr Vandrovec
2001-06-19 3:06 Rick Hohensee
2001-06-18 22:56 Raj, Ashok
2001-06-18 23:18 ` Erik Mouw
2001-06-19 6:25 ` Bohdan Vlasyuk
2001-06-18 23:20 ` Timur Tabi
2001-06-19 7:44 ` Alan Cox
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=giuPyB.A.JvE.jR3L7@dinero.interactivesi.com \
--to=ttabi@interactivesi.com \
--cc=linux-kernel@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.