From: George Anzinger <george@mvista.com>
To: "linux-kernel@vger.redhat.com" <linux-kernel@vger.kernel.org>
Subject: In line ASM magic? What is this?
Date: Wed, 15 Nov 2000 12:55:46 -0800 [thread overview]
Message-ID: <3A12F852.E578E6CE@mvista.com> (raw)
I am trying to understand what is going on in the following code. The
reference for %2, i.e. "m"(*__xg(ptr)) seems like magic (from
.../include/i386/system.h). At the same time, the code "m" (*mem) from
the second __asm__ below (my code) seems to generate the required asm
code. Before I go with the simple version, could someone tell me why?
Inquiring minds want to know.
struct __xchg_dummy { unsigned long a[100]; };
#define __xg(x) ((struct __xchg_dummy *)(x))
__asm__ __volatile__(LOCK_PREFIX "cmpxchgl %b1,%2"
: "=a"(prev)
: "q"(new), "m"(*__xg(ptr)), "0"(old)
: "memory");
__asm__ __volatile__(
LOCK "cmpxchgl %1,%2\n\t"
:"=a" (result)
:"r" (new),
"m" (*mem),
"a0" (test)
: "memory");
George
-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@vger.kernel.org
Please read the FAQ at http://www.tux.org/lkml/
next reply other threads:[~2000-11-15 21:22 UTC|newest]
Thread overview: 3+ messages / expand[flat|nested] mbox.gz Atom feed top
2000-11-15 20:55 George Anzinger [this message]
2000-11-15 22:17 ` In line ASM magic? What is this? Timur Tabi
2000-11-15 22:32 ` George Anzinger
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=3A12F852.E578E6CE@mvista.com \
--to=george@mvista.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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox