FreeBSD/sys/dev/drm2/radeon/radeon_acpi.c
/**
 * radeon_atif_get_sbios_requests - get requested sbios event
 *
 * @handle: acpi handle
 * @req: atif sbios request struct
 *
 * Execute the ATIF_FUNCTION_GET_SYSTEM_BIOS_REQUESTS ATIF function
 * to determine what requests the sbios is making to the driver
 * (all asics).
 * Returns 0 on success, error on failure.
 */
get requested sbios event
@handle: acpi handle
@req: atif sbios request struct

Execute the ATIF_FUNCTION_GET_SYSTEM_BIOS_REQUESTS ATIF function
to determine what requests the sbios is making to the driver
(all asics).
Returns 0 on success, error on failure.
get requested sbios event @handle : acpi handle @req : atif sbios request struct Execute the ATIF_FUNCTION_GET_SYSTEM_BIOS_REQUESTS ATIF function to determine what requests the sbios is making to the driver ( all asics ) . Returns 0 on success error on failure .
static int radeon_atif_get_sbios_requests(ACPI_HANDLE handle,
		struct atif_sbios_requests *req)
{
	ACPI_OBJECT *info;
	size_t size;
	int count = 0;
	info = radeon_atif_call(handle, ATIF_FUNCTION_GET_SYSTEM_BIOS_REQUESTS, NULL);
	if (!info)
		return -EIO;
	size = *(u16 *)info->Buffer.Pointer;
	if (size < 0xd) {
		count = -EINVAL;
		goto out;
	}
	memset(req, 0, sizeof(*req));
	size = min(sizeof(*req), size);
	memcpy(req, info->Buffer.Pointer, size);
	DRM_DEBUG_DRIVER("SBIOS pending requests: %#x\n", req->pending);
	count = hweight32(req->pending);
out:
	AcpiOsFree(info);
	return count;
}
static int radeon_atif_get_sbios_requests ( ACPI_HANDLE handle , struct atif_sbios_requests * req ) { ACPI_OBJECT * info ; size_t size ; int count = 0 ; info = radeon_atif_call ( handle , ATIF_FUNCTION_GET_SYSTEM_BIOS_REQUESTS , NULL ) ; if ( ! info ) return - EIO ; size = * ( u16 * ) info -> Buffer . Pointer ; if ( size < 0xd ) { count = - EINVAL ; goto out ; } memset ( req , 0 , sizeof ( * req ) ) ; size = min ( sizeof ( * req ) , size ) ; memcpy ( req , info -> Buffer . Pointer , size ) ; DRM_DEBUG_DRIVER ( " \n " , req -> pending ) ; count = hweight32 ( req -> pending ) ; out : AcpiOsFree ( info ) ; return count ; }
radeon_atif_get_sbios_requests - get requested sbios event
 @handle: acpi handle
 @req: atif sbios request struct
radeon_atif_get_sbios_requests - get requested sbios event @handle : acpi handle @req : atif sbios request struct