mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: peter meng <mengsanshui@yahoo.com.cn>
To: linux-kernel@vger.kernel.org
Subject: Ask a question related Assemble and C revert  within vmlinux ?
Date: Thu, 9 Jul 2009 18:50:47 +0800 (CST)	[thread overview]
Message-ID: <789976.67811.qm@web15703.mail.cnb.yahoo.com> (raw)


Hi

I compile the linux kernel with mips .
Is there any tools let the Assemble code correspond to C code ?
I mean Assemble line correspond to C line .



----------------cut from objdump -S vmlinux ----------------------
801b5b40 <ip_rcv>:
801b5b40:       27bdffc0        addiu   sp,sp,-64
801b5b44:       afb00028        sw      s0,40(sp)
801b5b48:       afbf0038        sw      ra,56(sp)
801b5b4c:       afb30034        sw      s3,52(sp)
801b5b50:       afb20030        sw      s2,48(sp)
801b5b54:       afb1002c        sw      s1,44(sp)
801b5b58:       8c82006c        lw      v0,108(a0)
801b5b5c:       3c0300e0        lui     v1,0xe0
801b5b60:       3c050060        lui     a1,0x60
801b5b64:       00431024        and     v0,v0,v1
801b5b68:       10450022        beq     v0,a1,801b5bf4 <ip_rcv+0xb4>
801b5b6c:       00808021        move    s0,a0
801b5b70:       3c128029        lui     s2,0x8029
801b5b74:       8e42ef90        lw      v0,-4208(s2)
801b5b78:       00808821        move    s1,a0
801b5b7c:       8c430004        lw      v1,4(v0)
801b5b80:       24630001        addiu   v1,v1,1
801b5b84:       ac430004        sw      v1,4(v0)
801b5b88:       8c850078        lw      a1,120(a0)
801b5b8c:       38a50001        xori    a1,a1,0x1
801b5b90:       14a00027        bnez    a1,801b5c30 <ip_rcv+0xf0>
801b5b94:       00000000        nop
801b5b98:       122000d6        beqz    s1,801b5ef4 <ip_rcv+0x3b4>
801b5b9c:       02208021        move    s0,s1
801b5ba0:       8e250058        lw      a1,88(s1)
........
----------------------ip_rcv source code ---------------

int ip_rcv(struct sk_buff *skb, struct net_device *dev, struct packet_type *pt, struct net_device *orig_dev)
{
	struct iphdr *iph;
	u32 len;

	/* When the interface is in promisc. mode, drop all the crap
	 * that it receives, do not try to analyse it.
	 */
	if (skb->pkt_type == PACKET_OTHERHOST)
		goto drop;

	IP_INC_STATS_BH(IPSTATS_MIB_INRECEIVES);

	if ((skb = skb_share_check(skb, GFP_ATOMIC)) == NULL) {
		IP_INC_STATS_BH(IPSTATS_MIB_INDISCARDS);
		goto out;
	}

	if (!pskb_may_pull(skb, sizeof(struct iphdr)))
		goto inhdr_error;

	iph = skb->nh.iph;


	if (iph->ihl < 5 || iph->version != 4)
		goto inhdr_error;

	if (!pskb_may_pull(skb, iph->ihl*4))
		goto inhdr_error;

	iph = skb->nh.iph;
.............


Thanks a lot .
Best Regards.
Peter Meng



      

             reply	other threads:[~2009-07-09 10:51 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2009-07-09 10:50 peter meng [this message]
2009-07-09 11:35 ` Albert ARIBAUD
2009-07-09 12:49 ` Jiri Olsa
2009-07-10  4:45 peter meng

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=789976.67811.qm@web15703.mail.cnb.yahoo.com \
    --to=mengsanshui@yahoo.com.cn \
    --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

all inboxes | Powered by JetHome®