ADMXRC_BUFFERMAP
Declaration
typedef struct _ADMXRC_BUFFERMAP
{
unsigned long MaxPages;
unsigned long* PagesPci;
unsigned long PageLength;
unsigned long PageBits;
unsigned long PagesSpanned;
unsigned long BytesSpanned;
unsigned long InitOffset;
} ADMXRC_BUFFERMAP;
Description
The ADMXRC_BUFFERMAP structure is filled in by ADMXRC_MapDirectMaster with a scatter-gather map of an application buffer.
The first two members are always initialized by the application:
- The PagesPci member must point to an application-supplied array of unsigned long. This array is filled in with the PCI addresses of pages making up the application buffer.
- The MaxPages member must be initialized to the maximum number of pages that the PagesPci member points to.
The other five members are filled in by ADMXRC_MapDirectMaster:
- The PageLength member is the length of a page of physical memory, for information purposes. For the x86 architecture, this value is 4096.
- The PageBits member is the number of address bits in a page offset. For the x86 architecture, this value is 12.
- The PagesSpanned member is the number of pages of physical memory spanned by the PagesPci array.
- The BytesSpanned member is the number of bytes of physical memory spanned by the PagesPci array and takes InitOffset into account.
- The InitOffset member is the offset within the first mapped page of the beginning of the region of the user buffer.
The following figures illustrate the relationship between the members of the ADMXRC_BUFFERMAP structure, in two possible cases:
- Here, when ADMXRC_MapDirectMaster is called, the MaxPages member of the ADMXRC_BUFFERMAP structure passed is greater than or equal to the number of pages spanned by the application buffer.

- Here, when ADMXRC_MapDirectMaster is called, the MaxPages of the ADMXRC_BUFFERMAP structure passed is 2, less than the number of pages spanned by the application buffer.
