HP UX 11i v1 I/O Cards manual Buffer flags Bfflag Field, Block Size Used flag

Models: UX 11i v1 I/O Cards

1 298
Download 298 pages 31.75 Kb
Page 105
Image 105

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

31

Block Size

10

Used flag

Block size The size of the memory block in bytes (including buffer 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 flag =0 Block is unused,

=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

These pointers are used to link all the free blocks within the memory pool, to form a circular list. The free queue contains the initial pointer to the first and last free block. The value in the pointer is the address of the buffer flag (i.e., the address of the next block pointer in the block).

Chapter 3

105

Page 105
Image 105
HP UX 11i v1 I/O Cards manual Buffer flags Bfflag Field, Block Size Used flag