Annotation of xinu/sys/freebuf.c, revision 1.1.1.1

1.1       root        1: /* freebuf.c - freebuf */
                      2: 
                      3: #include <conf.h>
                      4: #include <kernel.h>
                      5: #include <mark.h>
                      6: #include <bufpool.h>
                      7: 
                      8: /*------------------------------------------------------------------------
                      9:  *  freebuf  --  free a buffer that was allocated from a pool by getbuf
                     10:  *------------------------------------------------------------------------
                     11:  */
                     12: SYSCALL        freebuf(buf)
                     13: int *buf;
                     14: {
                     15:        PStype  ps;
                     16:        int     poolid;
                     17: 
                     18: #ifdef MEMMARK
                     19:        if ( unmarked(bpmark) )
                     20:                return(SYSERR);
                     21: #endif
                     22:        poolid = *(--buf);
                     23:        if (poolid<0 || poolid>=nbpools)
                     24:                return(SYSERR);
                     25:        disable(ps);
                     26:        *buf = (int)bptab[poolid].bpnext;
                     27:        bptab[poolid].bpnext = (char *)buf;
                     28:        restore(ps);
                     29:        signal(bptab[poolid].bpsem);
                     30:        return(OK);
                     31: }

unix.superglobalmegacorp.com

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