Linux MIPS Architecture development
 help / color / mirror / Atom feed
From: "Mike K." <linux_linux_2003@hotmail.com>
To: linux-mips@linux-mips.org
Subject: __asm__  C code in mips-Linux
Date: Wed, 02 Apr 2003 17:02:08 -0800	[thread overview]
Message-ID: <BAY2-F148jSQU0d0uub000985dc@hotmail.com> (raw)

extern __inline__ void atomic_add(int i, atomic_t * v)
{
	unsigned long temp;

	__asm__ __volatile__(
		"1:   ll      %0, %1      # atomic_add\n"
		"     addu    %0, %2                  \n"
		"     sc      %0, %1                  \n"
		"     beqz    %0, 1b                  \n"
		: "=&r" (temp), "=m" (v->counter)
		: "Ir" (i), "m" (v->counter));
}


Beginner questions on the above code:
1. what is %0 %1 %2?
2. what is the details meaning of the last two line of the above code?
3. Very thanksful if you can comment each line with detail description  for 
me, thanks a lot!


_________________________________________________________________
The new MSN 8: advanced junk mail protection and 2 months FREE*  
http://join.msn.com/?page=features/junkmail

             reply	other threads:[~2003-04-03  1:02 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2003-04-03  1:02 Mike K. [this message]
2003-04-03  2:09 ` __asm__ C code in mips-Linux Ralf Baechle
2003-04-03 12:58 ` Kevin D. Kissell
2003-04-03 12:58   ` Kevin D. Kissell

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=BAY2-F148jSQU0d0uub000985dc@hotmail.com \
    --to=linux_linux_2003@hotmail.com \
    --cc=linux-mips@linux-mips.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