This is the mail archive of the ecos-discuss@sources.redhat.com mailing list for the eCos project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

how cyg_mtocl(x) and cyg_cltom(x) work?



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


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]