linux/include/acpi/acbuffer.h

/* SPDX-License-Identifier: BSD-3-Clause OR GPL-2.0 */
/******************************************************************************
 *
 * Name: acbuffer.h - Support for buffers returned by ACPI predefined names
 *
 * Copyright (C) 2000 - 2023, Intel Corp.
 *
 *****************************************************************************/

#ifndef __ACBUFFER_H__
#define __ACBUFFER_H__

/*
 * Contains buffer structures for these predefined names:
 * _FDE, _GRT, _GTM, _PLD, _SRT
 */

/*
 * Note: C bitfields are not used for this reason:
 *
 * "Bitfields are great and easy to read, but unfortunately the C language
 * does not specify the layout of bitfields in memory, which means they are
 * essentially useless for dealing with packed data in on-disk formats or
 * binary wire protocols." (Or ACPI tables and buffers.) "If you ask me,
 * this decision was a design error in C. Ritchie could have picked an order
 * and stuck with it." Norman Ramsey.
 * See http://stackoverflow.com/a/1053662/41661
 */

/* _FDE return value */

struct acpi_fde_info {};

/*
 * _GRT return value
 * _SRT input value
 */
struct acpi_grt_info {};

/* _GTM return value */

struct acpi_gtm_info {};

/*
 * Formatted _PLD return value. The minimum size is a package containing
 * one buffer.
 * Revision 1: Buffer is 16 bytes (128 bits)
 * Revision 2: Buffer is 20 bytes (160 bits)
 *
 * Note: This structure is returned from the acpi_decode_pld_buffer
 * interface.
 */
struct acpi_pld_info {};

/*
 * Macros to:
 *     1) Convert a _PLD buffer to internal struct acpi_pld_info format - ACPI_PLD_GET*
 *        (Used by acpi_decode_pld_buffer)
 *     2) Construct a _PLD buffer - ACPI_PLD_SET*
 *        (Intended for BIOS use only)
 */
#define ACPI_PLD_REV1_BUFFER_SIZE
#define ACPI_PLD_REV2_BUFFER_SIZE
#define ACPI_PLD_BUFFER_SIZE

/* First 32-bit dword, bits 0:32 */

#define ACPI_PLD_GET_REVISION(dword)
#define ACPI_PLD_SET_REVISION(dword,value)

#define ACPI_PLD_GET_IGNORE_COLOR(dword)
#define ACPI_PLD_SET_IGNORE_COLOR(dword,value)

#define ACPI_PLD_GET_RED(dword)
#define ACPI_PLD_SET_RED(dword,value)

#define ACPI_PLD_GET_GREEN(dword)
#define ACPI_PLD_SET_GREEN(dword,value)

#define ACPI_PLD_GET_BLUE(dword)
#define ACPI_PLD_SET_BLUE(dword,value)

/* Second 32-bit dword, bits 33:63 */

#define ACPI_PLD_GET_WIDTH(dword)
#define ACPI_PLD_SET_WIDTH(dword,value)

#define ACPI_PLD_GET_HEIGHT(dword)
#define ACPI_PLD_SET_HEIGHT(dword,value)

/* Third 32-bit dword, bits 64:95 */

#define ACPI_PLD_GET_USER_VISIBLE(dword)
#define ACPI_PLD_SET_USER_VISIBLE(dword,value)

#define ACPI_PLD_GET_DOCK(dword)
#define ACPI_PLD_SET_DOCK(dword,value)

#define ACPI_PLD_GET_LID(dword)
#define ACPI_PLD_SET_LID(dword,value)

#define ACPI_PLD_GET_PANEL(dword)
#define ACPI_PLD_SET_PANEL(dword,value)

#define ACPI_PLD_GET_VERTICAL(dword)
#define ACPI_PLD_SET_VERTICAL(dword,value)

#define ACPI_PLD_GET_HORIZONTAL(dword)
#define ACPI_PLD_SET_HORIZONTAL(dword,value)

#define ACPI_PLD_GET_SHAPE(dword)
#define ACPI_PLD_SET_SHAPE(dword,value)

#define ACPI_PLD_GET_ORIENTATION(dword)
#define ACPI_PLD_SET_ORIENTATION(dword,value)

#define ACPI_PLD_GET_TOKEN(dword)
#define ACPI_PLD_SET_TOKEN(dword,value)

#define ACPI_PLD_GET_POSITION(dword)
#define ACPI_PLD_SET_POSITION(dword,value)

#define ACPI_PLD_GET_BAY(dword)
#define ACPI_PLD_SET_BAY(dword,value)

/* Fourth 32-bit dword, bits 96:127 */

#define ACPI_PLD_GET_EJECTABLE(dword)
#define ACPI_PLD_SET_EJECTABLE(dword,value)

#define ACPI_PLD_GET_OSPM_EJECT(dword)
#define ACPI_PLD_SET_OSPM_EJECT(dword,value)

#define ACPI_PLD_GET_CABINET(dword)
#define ACPI_PLD_SET_CABINET(dword,value)

#define ACPI_PLD_GET_CARD_CAGE(dword)
#define ACPI_PLD_SET_CARD_CAGE(dword,value)

#define ACPI_PLD_GET_REFERENCE(dword)
#define ACPI_PLD_SET_REFERENCE(dword,value)

#define ACPI_PLD_GET_ROTATION(dword)
#define ACPI_PLD_SET_ROTATION(dword,value)

#define ACPI_PLD_GET_ORDER(dword)
#define ACPI_PLD_SET_ORDER(dword,value)

/* Fifth 32-bit dword, bits 128:159 (Revision 2 of _PLD only) */

#define ACPI_PLD_GET_VERT_OFFSET(dword)
#define ACPI_PLD_SET_VERT_OFFSET(dword,value)

#define ACPI_PLD_GET_HORIZ_OFFSET(dword)
#define ACPI_PLD_SET_HORIZ_OFFSET(dword,value)

/* Panel position defined in _PLD section of ACPI Specification 6.3 */

#define ACPI_PLD_PANEL_TOP
#define ACPI_PLD_PANEL_BOTTOM
#define ACPI_PLD_PANEL_LEFT
#define ACPI_PLD_PANEL_RIGHT
#define ACPI_PLD_PANEL_FRONT
#define ACPI_PLD_PANEL_BACK
#define ACPI_PLD_PANEL_UNKNOWN

#endif				/* ACBUFFER_H */