All of lore.kernel.org
 help / color / mirror / Atom feed
From: Keir Fraser <keir.fraser@eu.citrix.com>
To: Zang Hongyong <zanghongyong@ncic.ac.cn>,
	"fanghaifeng@ncic.ac.cn" <fanghaifeng@ncic.ac.cn>,
	xen-devel <xen-devel@lists.xensource.com>
Subject: Re: A question related with symbol reference?
Date: Tue, 18 Mar 2008 08:31:25 +0000	[thread overview]
Message-ID: <C4052E5D.151CF%keir.fraser@eu.citrix.com> (raw)
In-Reply-To: <20080318055957.E984013692B@ncic.ac.cn>

Assembly code does not need a function prototype or indeed any label
declaration to be able to reference that function/label.

 -- Keir

On 18/3/08 06:19, "Zang Hongyong" <zanghongyong@ncic.ac.cn> wrote:

> anyone can help?  
> I'm confused too.
> 
> ======== 2008-03-18 14:04:50 您在来信中写道: ========
> 
> hi, my friends:
> 
> recently, i am reading the source codes about hypercall.
> 
> First, i study a simple hypercall, for example, the "do_xen_version".
> 
> In "xen-3.1.0-src\xen\common\kernel.c", the definition of "do_xen_version" is:
> 
> DO(xen_version) (int cmd, XEN_GUEST_HANDLE(void) arg)
> {
> ....
> }
> 
> according to the " #define DO(fn) long do_##fn ", the expanded form is
> "do_xen_version (...)".
> 
> then, in the "xen-3.1.0-src\xen\arch\x86\x86_32\entry.S", there is an item in
> the "hypercall_table", like this:
> 
> ENTRY(hypercall_table)
> ....
> .long do_xen_version
> ....
> 
> 
> as we all known, for a symbol reference of function there need to be a header
> file contained, or a "global" declaration.
> 
> By searching the header files, i found the file,
> "xen-3.1.0-src\xen\include\xen\hypercall.h" that declared the function in a
> form as follows:
> 
> extern long
> do_xen_version(
> int cmd,
> XEN_GUEST_HANDLE(void) arg);
> 
> But, i can not find where the file "hypercall.h" is contained in order to link
> it with the reference of "do_xen_version" in the "entry.S"
> 
> So, please help me, or give me some advice.
> 
> thanks advance.
> 
> 2008-03-18 
> 
> 
> 
> 房海峰 
> 
> 
> _______________________________________________
> Xen-devel mailing list
> Xen-devel@lists.xensource.com
> http://lists.xensource.com/xen-devel

  reply	other threads:[~2008-03-18  8:31 UTC|newest]

Thread overview: 8+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2008-03-18  6:19 A question related with symbol reference? Zang Hongyong
2008-03-18  8:31 ` Keir Fraser [this message]
     [not found]   ` <200803181649061402866@ncic.ac.cn>
2008-03-18  8:49     ` Fw: Re: " 房海峰
2008-03-18  8:53       ` Keir Fraser
2008-03-18  8:58         ` 房海峰
  -- strict thread matches above, loose matches on Subject: below --
2008-03-18  6:04 房海峰
2008-03-18  5:48 房海峰
2008-03-18  5:43 房海峰

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=C4052E5D.151CF%keir.fraser@eu.citrix.com \
    --to=keir.fraser@eu.citrix.com \
    --cc=fanghaifeng@ncic.ac.cn \
    --cc=xen-devel@lists.xensource.com \
    --cc=zanghongyong@ncic.ac.cn \
    /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.