ZCOM Tables and Data Structures

Data Buffer Pool

BFFLAG - Buffer flags

The use of the memory pool is based around a buffer flag field that indicates the size of a memory block as well as containing a flag that indicates whether the block is currently in use. This field appears at the start and end of each buffer segment. This field is 32 bits long. The size of the buffer is always a multiple of 8-bytes (so each buffer is 64-bit aligned). This allows the low order bit to be used as the Used flag (ZCOM-BFFLAG-BUSY). This field is located at both the start and end of the block, so that adjacent blocks can be identified from either end of any block.

Table 3-32 Buffer flags BFFLAG Field Format

31

1

0

 

 

 

Block Size

Used flag

Block The size of the memory block in bytes (including buffer

size flags). The block size is always a multiple of 8 bytes. However, the lower (least significant) bit is used to indicate whether the block is used or not, and is not included in the size of the block.

Used =0 Block is unused,

flag

=1 Block is used

Dummy Used flag - Start and end indicator of memory pool

This is a dummy buffer flag at the beginning and end of the buffer pool area. The used flag is set to indicate this block is used, so the coalesce algorithm will think there is a used block before the start of the pool, and after the end of the pool. The size is set to 0xFFFFFFFE so that these dummy blocks can be distinguished from the legitimate ones.

BFNEXT - Pointer to next buffer on queue

BFPREV - Pointer to previous buffer on queue

110

Chapter 3