Hardware Reference
In-Depth Information
/*-----------------------------------------------------------*/
/* reserve -- reserves a buffer in a CAB */
/*-----------------------------------------------------------*/
pointer reserve (cab c)
pointer p;
<disable cpu interrupts>
p = c.free;
/* get a free buffer
*/
c.free = p.next;
/* update the free list
*/
return(p);
<enable cpu interrupts>
}
/*-----------------------------------------------------------*/
/* putmes -- puts a message in a CAB */
/*-----------------------------------------------------------*/
void
putmes (cab c, pointer p)
{
<disable cpu interrupts>
if (c.mrb.use == 0)
{
/* if not accessed,
*/
c.mrb.next = c.free;
/* deallocate the mrb
*/
c.free = c.mrb;
c.mrb = p;
/* update the mrb
*/
<enable cpu interrupts>
}
Search WWH ::




Custom Search