Hardware Reference
In-Depth Information
/*-----------------------------------------------------------*/
/* getmes -- gets a pointer to the most recent buffer */
/*-----------------------------------------------------------*/
pointer getmes (cab c)
pointer p;
<disable cpu interrupts>
p = c.mrb;
/* get the pointer to mrb */
p.use = p.use + 1;
/* increment the counter
*/
return(p);
<enable cpu interrupts>
}
/*-----------------------------------------------------------*/
/* unget -- deallocates a buffer only if it is not accessed */
/* and it is not the most recent buffer */
/*-----------------------------------------------------------*/
void unget (cab c, pointer p)
{ <disable cpu interrupts>
p.use = p.use - 1;
if ((p.use == 0) && (p != c.mrb)) {
p.next = c.free;
c.free = p;
<enable cpu interrupts>
}
Search WWH ::




Custom Search