Annotation of researchv9/sys/h/inet/mbuf.h, revision 1.1.1.1

1.1       root        1: /*
                      2:  * mbuf emulation.
                      3:  */
                      4: 
                      5: #define mbuf           block
                      6: #define m_next         next
                      7: #define mtod(m, type)  ((type) (m->rptr))
                      8: #define m_get(x1, x2)  bp_get()
                      9: #define m_free(m)      freeb(m)
                     10: #define m_freem(m)     bp_free(m)
                     11: #define m_pullup       bp_pullup
                     12: #define m_adj          bp_adj
                     13: #define dtom(x)                bp_dtom((struct block *) x)
                     14: #define m_copy         bp_copy
                     15: 
                     16: #define BLEN(bp) ((bp)->wptr - (bp)->rptr)
                     17: #define BSZ(bp) ((bp)->lim - (bp)->base)
                     18: #define MAXBLEN        64
                     19: 
                     20: #define MGET(m, x, y)  ((m) = m_get(x, y))
                     21: 
                     22: #ifdef KERNEL
                     23: extern struct block *bp_dtom(), *bp_copy();
                     24: extern struct block *bp_get();
                     25: #endif
                     26: 
                     27: #include "sparam.h"
                     28: #define NBLOCK (NBLKBIG+NBLK64+NBLK16+NBLK4)
                     29: extern struct block cblock[];
                     30: 
                     31: #ifdef IN_PARANOID
                     32: #define BLOCKCHK(bp)\
                     33:        if(bp < cblock || cblock >= &cblock[NBLOCK])\
                     34:                panic("bp_check bad bp");\
                     35:        if(bp->base == 0 || bp->lim == 0)\
                     36:                panic("bp_check 0");\
                     37:        if(bp->rptr >= bp->lim || bp->rptr < bp->base)\
                     38:                panic("bp_check rptr");\
                     39:        if(bp->wptr > bp->lim || bp->wptr < bp->base)\
                     40:                panic("bp_check wptr");\
                     41:        if(bp->rptr > bp->wptr)\
                     42:                panic("bp_check rptr > wptr")
                     43: #define MCHECK(bp) bp_check(bp)
                     44: #else
                     45: #define BLOCKCHK(bp)
                     46: #define MCHECK(bp)
                     47: #endif IN_PARANOID

unix.superglobalmegacorp.com

This archive runs on limited infrastructure. Preserving old code on modern bandwidth. Automated agents are requested to crawl responsibly.