Loading...
Searching...
No Matches
_addrxlat_buffer Struct Reference

Read buffer metadata. More...

`#include <addrxlat.h>`

## Data Fields

addrxlat_fulladdr_t | addr
| Buffer start address.
const void * | ptr
| Pointer to raw binary data.
size_t | size
| Buffer size.
addrxlat_byte_order_t | byte_order
| Page data byte order.
addrxlat_put_page_fn * | put_page
| Callback to release a page buffer.
void * | priv
| Private data to be used by the callback.

## Detailed Description

Read buffer metadata.

This structure is used to pass data between the library and a callback function. The idea is that the library should not have to care about the limitations of any given implementation. It communicates the intention to get data at a given address, the get-page callback translates that to a full page and returns as much as possible, adjusting remaining fields accordingly.

NOTE: The callback may theoretically provide as little as one byte at the desired address. However, it does not happen in practice, because:

- the library needs at most 64-bit entities (8 bytes),
- a page is greater than 8 bytes on all architectures,
- the desired address is always aligned. The library does NOT implement reads across page boundary. Keep that in mind when writing your own custom implementation.

## Field Documentation

## addr

addrxlat_fulladdr_t _addrxlat_buffer::addr

Buffer start address.

This field is set to the desired read address before calling the get-page callback. The callback should adjust it to the start address of the page that contains the desired address.

## priv

void* _addrxlat_buffer::priv

Private data to be used by the callback.

The library will preserve this value between a call to the get-page and put-page callbacks.

## size

size_t _addrxlat_buffer::size

Buffer size.

This field must be initialized by the get-page callback to the length of the buffer at `ptr`.

The documentation for this struct was generated from the following file:

- include/libkdumpfile/addrxlat.h