bsr_query Kernel Service

Purpose

Queries the existence of the Barrier Synchronization Register facility, and, if it exists, its size and allocation granule.

Syntax

#include <sys/adspace.h>

int bsr_query (
	int *total_bytes,
	uint * supported_window_mask,
	int *free_bytes,
	uint *free_window_mask)

Parameters

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

Description

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.

Note: Due to dynamic reconfiguration, the information returned by this query service might become stale.

Execution Environment

The bsr_query service can only be called from the process environment.

Return Values

Item Description
0 The BSR facility exists and information is provided.
ENODEV The BSR facility does not exist.