This is the mail archive of the
ecos-discuss@sources.redhat.com
mailing list for the eCos project.
how cyg_mtocl(x) and cyg_cltom(x) work?
- From: =?gb2312?B?1cUgwcE=?= <johnsonest at hotmail dot com>
- To: ecos-discuss at sources dot redhat dot com
- Date: Tue, 31 Dec 2002 16:53:48 +0800
- Subject: [ECOS] how cyg_mtocl(x) and cyg_cltom(x) work?
- Bcc:
Hello, Mr. gthomas and everyone,
I really do not know the principle of function mtocl(x)and cltom(x).
:
int
cyg_mtocl(u_long x)
{
int res;
res = (((u_long)(x) - (u_long)mbutl) >> MCLSHIFT);
return res;
}
struct mbuf *
cyg_cltom(u_long x)
{
struct mbuf *res;
res = (struct mbuf *)((caddr_t)((u_long)mbutl + ((u_long)(x) <<
MCLSHIFT)));
return res;
}
here,mbutl is a pointer to pointer to cluster memory pool,I really do not
know
(((u_long)(x) - (u_long)mbutl) >> MCLSHIFT and
((caddr_t)((u_long)mbutl + ((u_long)(x) << MCLSHIFT
mean what?
because mbuf memory pool and cluster memory pool are two
deffirent memory pool,so add address or sub address means what?
SOS,please help me!
Brs/johnsonest
_________________________________________________________________
与联机的朋友进行交流,请使用 MSN Messenger: http://messenger.msn.com/cn
--
Before posting, please read the FAQ: http://sources.redhat.com/fom/ecos
and search the list archive: http://sources.redhat.com/ml/ecos-discuss