From mboxrd@z Thu Jan 1 00:00:00 1970 From: Keir Fraser Subject: Re: A question related with symbol reference? Date: Tue, 18 Mar 2008 08:31:25 +0000 Message-ID: References: <20080318055957.E984013692B@ncic.ac.cn> Mime-Version: 1.0 Content-Type: text/plain; charset="GB2312" Content-Transfer-Encoding: quoted-printable Return-path: In-Reply-To: <20080318055957.E984013692B@ncic.ac.cn> List-Unsubscribe: , List-Post: List-Help: List-Subscribe: , Sender: xen-devel-bounces@lists.xensource.com Errors-To: xen-devel-bounces@lists.xensource.com To: Zang Hongyong , "fanghaifeng@ncic.ac.cn" , xen-devel List-Id: xen-devel@lists.xenproject.org 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" wrote: > anyone can help?=A1=A1=A1=A1 > I'm confused too. >=20 > =3D=3D=3D=3D=3D=3D=3D=3D 2008-03-18 14:04:50 =C4=FA=D4=DA=C0=B4=D0=C5=D6=D0=D0=B4=B5=C0=A3=BA =3D=3D=3D=3D=3D=3D=3D=3D >=20 > hi, my friends: >=20 > recently, i am reading the source codes about hypercall. >=20 > First, i study a simple hypercall, for example, the "do_xen_version". >=20 > In "xen-3.1.0-src\xen\common\kernel.c", the definition of "do_xen_version= " is: >=20 > DO(xen_version) (int cmd, XEN_GUEST_HANDLE(void) arg) > { > .... > } >=20 > according to the " #define DO(fn) long do_##fn ", the expanded form is > "do_xen_version (...)". >=20 > then, in the "xen-3.1.0-src\xen\arch\x86\x86_32\entry.S", there is an ite= m in > the "hypercall_table", like this: >=20 > ENTRY(hypercall_table) > .... > .long do_xen_version > .... >=20 >=20 > as we all known, for a symbol reference of function there need to be a he= ader > file contained, or a "global" declaration. >=20 > 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: >=20 > extern long > do_xen_version( > int cmd, > XEN_GUEST_HANDLE(void) arg); >=20 > 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" >=20 > So, please help me, or give me some advice. >=20 > thanks advance. >=20 > 2008-03-18=20 >=20 >=20 >=20 > =B7=BF=BA=A3=B7=E5=20 >=20 >=20 > _______________________________________________ > Xen-devel mailing list > Xen-devel@lists.xensource.com > http://lists.xensource.com/xen-devel