All of lore.kernel.org
 help / color / mirror / Atom feed
* A question related with symbol reference?
@ 2008-03-18  5:43 房海峰
  0 siblings, 0 replies; 8+ messages in thread
From: 房海峰 @ 2008-03-18  5:43 UTC (permalink / raw)
  To: xen-devel


[-- Attachment #1.1: Type: text/plain, Size: 1154 bytes --]

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 



房海峰 

[-- Attachment #1.2: Type: text/html, Size: 2813 bytes --]

[-- Attachment #2: Type: text/plain, Size: 138 bytes --]

_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xensource.com
http://lists.xensource.com/xen-devel

^ permalink raw reply	[flat|nested] 8+ messages in thread

* A question related with symbol reference?
@ 2008-03-18  5:48 房海峰
  0 siblings, 0 replies; 8+ messages in thread
From: 房海峰 @ 2008-03-18  5:48 UTC (permalink / raw)
  To: xen-devel


[-- Attachment #1.1: Type: text/plain, Size: 1154 bytes --]

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 



房海峰 

[-- Attachment #1.2: Type: text/html, Size: 2813 bytes --]

[-- Attachment #2: Type: text/plain, Size: 138 bytes --]

_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xensource.com
http://lists.xensource.com/xen-devel

^ permalink raw reply	[flat|nested] 8+ messages in thread

* A question related with symbol reference?
@ 2008-03-18  6:04 房海峰
  0 siblings, 0 replies; 8+ messages in thread
From: 房海峰 @ 2008-03-18  6:04 UTC (permalink / raw)
  To: xen-devel


[-- Attachment #1.1: Type: text/plain, Size: 1154 bytes --]

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 



房海峰 

[-- Attachment #1.2: Type: text/html, Size: 2813 bytes --]

[-- Attachment #2: Type: text/plain, Size: 138 bytes --]

_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xensource.com
http://lists.xensource.com/xen-devel

^ permalink raw reply	[flat|nested] 8+ messages in thread

* Re: A question related with symbol reference?
@ 2008-03-18  6:19 Zang Hongyong
  2008-03-18  8:31 ` Keir Fraser
  0 siblings, 1 reply; 8+ messages in thread
From: Zang Hongyong @ 2008-03-18  6:19 UTC (permalink / raw)
  To: fanghaifeng@ncic.ac.cn, xen-devel

[-- Attachment #1: Type: text/plain, Size: 1259 bytes --]

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 



房海峰 



[-- Attachment #2: Type: text/plain, Size: 138 bytes --]

_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xensource.com
http://lists.xensource.com/xen-devel

^ permalink raw reply	[flat|nested] 8+ messages in thread

* Re: A question related with symbol reference?
  2008-03-18  6:19 A question related with symbol reference? Zang Hongyong
@ 2008-03-18  8:31 ` Keir Fraser
       [not found]   ` <200803181649061402866@ncic.ac.cn>
  0 siblings, 1 reply; 8+ messages in thread
From: Keir Fraser @ 2008-03-18  8:31 UTC (permalink / raw)
  To: Zang Hongyong, fanghaifeng@ncic.ac.cn, xen-devel

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

^ permalink raw reply	[flat|nested] 8+ messages in thread

* Fw: Re: Re: A question related with symbol reference?
       [not found]   ` <200803181649061402866@ncic.ac.cn>
@ 2008-03-18  8:49     ` 房海峰
  2008-03-18  8:53       ` Keir Fraser
  0 siblings, 1 reply; 8+ messages in thread
From: 房海峰 @ 2008-03-18  8:49 UTC (permalink / raw)
  To: xen-devel


[-- Attachment #1.1: Type: text/plain, Size: 2462 bytes --]



2008-03-18



房海峰



发件人: 房海峰
发送时间: 2008-03-18 16:49:06
收件人: Keir Fraser
抄送: 
主题: Re: Re: [Xen-devel] A question related with symbol reference?

I have been programmed assembly code with "nasm" language.
in "nasm", when you refere to a function/label that come from another file, you should make a declaration of the function with "extern" keywords in advance.

i don't know whether "at&t" assembly language is different with "nasm"?

thanks again!


2008-03-18 



房海峰 



发件人: Keir Fraser 
发送时间: 2008-03-18  16:12:41 
收件人: Zang Hongyong; fanghaifeng@ncic.ac.cn; xen-devel 
抄送: 
主题: Re: [Xen-devel] A question related with symbol reference? 
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

[-- Attachment #1.2: Type: text/html, Size: 9073 bytes --]

[-- Attachment #2: Type: text/plain, Size: 138 bytes --]

_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xensource.com
http://lists.xensource.com/xen-devel

^ permalink raw reply	[flat|nested] 8+ messages in thread

* Re: A question related with symbol reference?
  2008-03-18  8:49     ` Fw: Re: " 房海峰
@ 2008-03-18  8:53       ` Keir Fraser
  2008-03-18  8:58         ` 房海峰
  0 siblings, 1 reply; 8+ messages in thread
From: Keir Fraser @ 2008-03-18  8:53 UTC (permalink / raw)
  To: fanghaifeng, xen-devel


[-- Attachment #1.1: Type: text/plain, Size: 443 bytes --]

The EXTERN directive is specific to nasm.

 -- Keir

On 18/3/08 08:49, "房海峰" <fanghaifeng@ncic.ac.cn> wrote:

> I have been programmed assembly code with "nasm" language.
> in "nasm", when you refere to a function/label that come from another file,
> you should make a declaration of the function with "extern" keywords in
> advance.
>  
> i don't know whether "at&t" assembly language is different with "nasm"?
>  
> thanks again!



[-- Attachment #1.2: Type: text/html, Size: 1088 bytes --]

[-- Attachment #2: Type: text/plain, Size: 138 bytes --]

_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xensource.com
http://lists.xensource.com/xen-devel

^ permalink raw reply	[flat|nested] 8+ messages in thread

* Re: Re: A question related with symbol reference?
  2008-03-18  8:53       ` Keir Fraser
@ 2008-03-18  8:58         ` 房海峰
  0 siblings, 0 replies; 8+ messages in thread
From: 房海峰 @ 2008-03-18  8:58 UTC (permalink / raw)
  To: Keir Fraser; +Cc: xen-devel


[-- Attachment #1.1: Type: text/plain, Size: 722 bytes --]

maybe! i will study "at&t" indepth.

thank you for your reply.


2008-03-18 



房海峰 



发件人: Keir Fraser 
发送时间: 2008-03-18  16:35:27 
收件人: fanghaifeng@ncic.ac.cn; xen-devel 
抄送: 
主题: Re: [Xen-devel] A question related with symbol reference? 
 
The EXTERN directive is specific to nasm.

 -- Keir

On 18/3/08 08:49, "^[$BK<3$Jv^[(B" <fanghaifeng@ncic.ac.cn> wrote:


I have been programmed assembly code with "nasm" language.
in "nasm", when you refere to a function/label that come from another file, you should make a declaration of the function with "extern" keywords in advance.

i don't know whether "at&t" assembly language is different with "nasm"?

thanks again!

[-- Attachment #1.2: Type: text/html, Size: 3811 bytes --]

[-- Attachment #2: Type: text/plain, Size: 138 bytes --]

_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xensource.com
http://lists.xensource.com/xen-devel

^ permalink raw reply	[flat|nested] 8+ messages in thread

end of thread, other threads:[~2008-03-18  8:58 UTC | newest]

Thread overview: 8+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2008-03-18  6:19 A question related with symbol reference? Zang Hongyong
2008-03-18  8:31 ` Keir Fraser
     [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 房海峰

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.