Queries the existence of the Barrier Synchronization Register facility, and, if it exists, its size and allocation granule.
#include <sys/adspace.h>
int bsr_query (
int *total_bytes,
uint * supported_window_mask,
int *free_bytes,
uint *free_window_mask)
Item | Description |
---|---|
total_bytes | Total bytes of the BSR facility currently present within the system or logical partition |
supported_window_mask | Bit mask representing supported power-of-2-sized windows that can be allocated |
free_bytes | Number of BSR bytes currently available (not allocated) |
free_window_mask | Bit mask representing available (not allocated) power-of-2-sized windows |
The bsr_query service can be used to detect the presence and capabilities of the Barrier Synchronization Register (BSR) facility on a given system or logical partition. If the BSR facility is present on a system or within a logical partition, a value of 0 is returned, and the parameters, passed by reference, are written with the appropriate information.
The total_bytes field is written with the total number of BSR bytes currently present in the system or logical partition. The supported_window_mask field is written with a bitmask, where each bit set indicates the various power-of-2 window sizes that the total_bytes can be allocated and accessed. For example, a mask of 0x58 would indicate that windows of size 64 (0x40), 16 (0x10), and 8 (0x8) bytes were supported.
The free_bytes field is written with the number of BSR bytes within the system or logical partition that are currently unallocated. The free_window_mask field is written with a bitmask, where each bit set indicates the power-of-2 window sizes that are available for allocating and accessing the remaining free_bytes.
The bsr_query service can only be called from the process environment.
Item | Description |
---|---|
0 | The BSR facility exists and information is provided. |
ENODEV | The BSR facility does not exist. |