[ECOS] how cyg_mtocl(x) and cyg_cltom(x) work?

张 亮 johnsonest@hotmail.com
Tue Dec 31 05:54:00 GMT 2002


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



More information about the Ecos-discuss mailing list