^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1) /* SPDX-License-Identifier: BSD-3-Clause OR GPL-2.0 */
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 2) /******************************************************************************
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 3) *
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 4) * Name: acresrc.h - Resource Manager function prototypes
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 5) *
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 6) * Copyright (C) 2000 - 2020, Intel Corp.
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 7) *
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 8) *****************************************************************************/
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 9)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 10) #ifndef __ACRESRC_H__
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 11) #define __ACRESRC_H__
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 12)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 13) /* Need the AML resource descriptor structs */
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 14)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 15) #include "amlresrc.h"
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 16)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 17) /*
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 18) * If possible, pack the following structures to byte alignment, since we
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 19) * don't care about performance for debug output. Two cases where we cannot
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 20) * pack the structures:
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 21) *
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 22) * 1) Hardware does not support misaligned memory transfers
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 23) * 2) Compiler does not support pointers within packed structures
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 24) */
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 25) #if (!defined(ACPI_MISALIGNMENT_NOT_SUPPORTED) && !defined(ACPI_PACKED_POINTERS_NOT_SUPPORTED))
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 26) #pragma pack(1)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 27) #endif
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 28)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 29) /*
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 30) * Individual entry for the resource conversion tables
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 31) */
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 32) typedef const struct acpi_rsconvert_info {
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 33) u8 opcode;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 34) u8 resource_offset;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 35) u8 aml_offset;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 36) u8 value;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 37)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 38) } acpi_rsconvert_info;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 39)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 40) /* Resource conversion opcodes */
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 41)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 42) typedef enum {
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 43) ACPI_RSC_INITGET = 0,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 44) ACPI_RSC_INITSET,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 45) ACPI_RSC_FLAGINIT,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 46) ACPI_RSC_1BITFLAG,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 47) ACPI_RSC_2BITFLAG,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 48) ACPI_RSC_3BITFLAG,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 49) ACPI_RSC_ADDRESS,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 50) ACPI_RSC_BITMASK,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 51) ACPI_RSC_BITMASK16,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 52) ACPI_RSC_COUNT,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 53) ACPI_RSC_COUNT16,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 54) ACPI_RSC_COUNT_GPIO_PIN,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 55) ACPI_RSC_COUNT_GPIO_RES,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 56) ACPI_RSC_COUNT_GPIO_VEN,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 57) ACPI_RSC_COUNT_SERIAL_RES,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 58) ACPI_RSC_COUNT_SERIAL_VEN,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 59) ACPI_RSC_DATA8,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 60) ACPI_RSC_EXIT_EQ,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 61) ACPI_RSC_EXIT_LE,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 62) ACPI_RSC_EXIT_NE,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 63) ACPI_RSC_LENGTH,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 64) ACPI_RSC_MOVE_GPIO_PIN,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 65) ACPI_RSC_MOVE_GPIO_RES,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 66) ACPI_RSC_MOVE_SERIAL_RES,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 67) ACPI_RSC_MOVE_SERIAL_VEN,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 68) ACPI_RSC_MOVE8,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 69) ACPI_RSC_MOVE16,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 70) ACPI_RSC_MOVE32,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 71) ACPI_RSC_MOVE64,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 72) ACPI_RSC_SET8,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 73) ACPI_RSC_SOURCE,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 74) ACPI_RSC_SOURCEX
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 75) } ACPI_RSCONVERT_OPCODES;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 76)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 77) /* Resource Conversion sub-opcodes */
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 78)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 79) #define ACPI_RSC_COMPARE_AML_LENGTH 0
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 80) #define ACPI_RSC_COMPARE_VALUE 1
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 81)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 82) #define ACPI_RSC_TABLE_SIZE(d) (sizeof (d) / sizeof (struct acpi_rsconvert_info))
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 83)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 84) #define ACPI_RS_OFFSET(f) (u8) ACPI_OFFSET (struct acpi_resource,f)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 85) #define AML_OFFSET(f) (u8) ACPI_OFFSET (union aml_resource,f)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 86)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 87) /*
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 88) * Individual entry for the resource dump tables
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 89) */
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 90) typedef const struct acpi_rsdump_info {
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 91) u8 opcode;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 92) u8 offset;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 93) const char *name;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 94) const char **pointer;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 95)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 96) } acpi_rsdump_info;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 97)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 98) /* Values for the Opcode field above */
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 99)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 100) typedef enum {
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 101) ACPI_RSD_TITLE = 0,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 102) ACPI_RSD_1BITFLAG,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 103) ACPI_RSD_2BITFLAG,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 104) ACPI_RSD_3BITFLAG,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 105) ACPI_RSD_ADDRESS,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 106) ACPI_RSD_DWORDLIST,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 107) ACPI_RSD_LITERAL,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 108) ACPI_RSD_LONGLIST,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 109) ACPI_RSD_SHORTLIST,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 110) ACPI_RSD_SHORTLISTX,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 111) ACPI_RSD_SOURCE,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 112) ACPI_RSD_STRING,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 113) ACPI_RSD_UINT8,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 114) ACPI_RSD_UINT16,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 115) ACPI_RSD_UINT32,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 116) ACPI_RSD_UINT64,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 117) ACPI_RSD_WORDLIST,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 118) ACPI_RSD_LABEL,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 119) ACPI_RSD_SOURCE_LABEL,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 120)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 121) } ACPI_RSDUMP_OPCODES;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 122)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 123) /* restore default alignment */
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 124)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 125) #pragma pack()
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 126)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 127) /* Resource tables indexed by internal resource type */
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 128)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 129) extern const u8 acpi_gbl_aml_resource_sizes[];
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 130) extern const u8 acpi_gbl_aml_resource_serial_bus_sizes[];
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 131) extern struct acpi_rsconvert_info *acpi_gbl_set_resource_dispatch[];
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 132)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 133) /* Resource tables indexed by raw AML resource descriptor type */
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 134)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 135) extern const u8 acpi_gbl_resource_struct_sizes[];
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 136) extern const u8 acpi_gbl_resource_struct_serial_bus_sizes[];
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 137) extern struct acpi_rsconvert_info *acpi_gbl_get_resource_dispatch[];
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 138)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 139) extern struct acpi_rsconvert_info
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 140) *acpi_gbl_convert_resource_serial_bus_dispatch[];
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 141)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 142) struct acpi_vendor_walk_info {
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 143) struct acpi_vendor_uuid *uuid;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 144) struct acpi_buffer *buffer;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 145) acpi_status status;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 146) };
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 147)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 148) /*
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 149) * rscreate
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 150) */
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 151) acpi_status
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 152) acpi_rs_create_resource_list(union acpi_operand_object *aml_buffer,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 153) struct acpi_buffer *output_buffer);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 154)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 155) acpi_status
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 156) acpi_rs_create_aml_resources(struct acpi_buffer *resource_list,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 157) struct acpi_buffer *output_buffer);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 158)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 159) acpi_status
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 160) acpi_rs_create_pci_routing_table(union acpi_operand_object *package_object,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 161) struct acpi_buffer *output_buffer);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 162)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 163) /*
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 164) * rsutils
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 165) */
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 166)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 167) acpi_status
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 168) acpi_rs_get_prt_method_data(struct acpi_namespace_node *node,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 169) struct acpi_buffer *ret_buffer);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 170)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 171) acpi_status
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 172) acpi_rs_get_crs_method_data(struct acpi_namespace_node *node,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 173) struct acpi_buffer *ret_buffer);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 174)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 175) acpi_status
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 176) acpi_rs_get_prs_method_data(struct acpi_namespace_node *node,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 177) struct acpi_buffer *ret_buffer);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 178)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 179) acpi_status
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 180) acpi_rs_get_method_data(acpi_handle handle,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 181) const char *path, struct acpi_buffer *ret_buffer);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 182)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 183) acpi_status
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 184) acpi_rs_set_srs_method_data(struct acpi_namespace_node *node,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 185) struct acpi_buffer *ret_buffer);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 186)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 187) acpi_status
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 188) acpi_rs_get_aei_method_data(struct acpi_namespace_node *node,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 189) struct acpi_buffer *ret_buffer);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 190)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 191) /*
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 192) * rscalc
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 193) */
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 194) acpi_status
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 195) acpi_rs_get_list_length(u8 *aml_buffer,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 196) u32 aml_buffer_length, acpi_size *size_needed);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 197)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 198) acpi_status
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 199) acpi_rs_get_aml_length(struct acpi_resource *resource_list,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 200) acpi_size resource_list_size, acpi_size *size_needed);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 201)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 202) acpi_status
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 203) acpi_rs_get_pci_routing_table_length(union acpi_operand_object *package_object,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 204) acpi_size *buffer_size_needed);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 205)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 206) acpi_status
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 207) acpi_rs_convert_aml_to_resources(u8 * aml,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 208) u32 length,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 209) u32 offset, u8 resource_index, void **context);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 210)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 211) acpi_status
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 212) acpi_rs_convert_resources_to_aml(struct acpi_resource *resource,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 213) acpi_size aml_size_needed, u8 * output_buffer);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 214)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 215) /*
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 216) * rsaddr
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 217) */
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 218) void
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 219) acpi_rs_set_address_common(union aml_resource *aml,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 220) struct acpi_resource *resource);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 221)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 222) u8
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 223) acpi_rs_get_address_common(struct acpi_resource *resource,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 224) union aml_resource *aml);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 225)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 226) /*
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 227) * rsmisc
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 228) */
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 229) acpi_status
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 230) acpi_rs_convert_aml_to_resource(struct acpi_resource *resource,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 231) union aml_resource *aml,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 232) struct acpi_rsconvert_info *info);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 233)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 234) acpi_status
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 235) acpi_rs_convert_resource_to_aml(struct acpi_resource *resource,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 236) union aml_resource *aml,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 237) struct acpi_rsconvert_info *info);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 238)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 239) /*
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 240) * rsutils
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 241) */
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 242) void
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 243) acpi_rs_move_data(void *destination,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 244) void *source, u16 item_count, u8 move_type);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 245)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 246) u8 acpi_rs_decode_bitmask(u16 mask, u8 * list);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 247)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 248) u16 acpi_rs_encode_bitmask(u8 * list, u8 count);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 249)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 250) acpi_rs_length
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 251) acpi_rs_get_resource_source(acpi_rs_length resource_length,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 252) acpi_rs_length minimum_length,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 253) struct acpi_resource_source *resource_source,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 254) union aml_resource *aml, char *string_ptr);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 255)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 256) acpi_rsdesc_size
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 257) acpi_rs_set_resource_source(union aml_resource *aml,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 258) acpi_rs_length minimum_length,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 259) struct acpi_resource_source *resource_source);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 260)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 261) void
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 262) acpi_rs_set_resource_header(u8 descriptor_type,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 263) acpi_rsdesc_size total_length,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 264) union aml_resource *aml);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 265)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 266) void
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 267) acpi_rs_set_resource_length(acpi_rsdesc_size total_length,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 268) union aml_resource *aml);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 269)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 270) /*
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 271) * rsdump - Debugger support
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 272) */
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 273) #ifdef ACPI_DEBUGGER
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 274) void acpi_rs_dump_resource_list(struct acpi_resource *resource);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 275)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 276) void acpi_rs_dump_irq_list(u8 *route_table);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 277) #endif
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 278)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 279) /*
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 280) * Resource conversion tables
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 281) */
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 282) extern struct acpi_rsconvert_info acpi_rs_convert_dma[];
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 283) extern struct acpi_rsconvert_info acpi_rs_convert_end_dpf[];
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 284) extern struct acpi_rsconvert_info acpi_rs_convert_io[];
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 285) extern struct acpi_rsconvert_info acpi_rs_convert_fixed_io[];
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 286) extern struct acpi_rsconvert_info acpi_rs_convert_end_tag[];
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 287) extern struct acpi_rsconvert_info acpi_rs_convert_memory24[];
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 288) extern struct acpi_rsconvert_info acpi_rs_convert_generic_reg[];
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 289) extern struct acpi_rsconvert_info acpi_rs_convert_memory32[];
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 290) extern struct acpi_rsconvert_info acpi_rs_convert_fixed_memory32[];
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 291) extern struct acpi_rsconvert_info acpi_rs_convert_address32[];
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 292) extern struct acpi_rsconvert_info acpi_rs_convert_address16[];
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 293) extern struct acpi_rsconvert_info acpi_rs_convert_ext_irq[];
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 294) extern struct acpi_rsconvert_info acpi_rs_convert_address64[];
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 295) extern struct acpi_rsconvert_info acpi_rs_convert_ext_address64[];
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 296) extern struct acpi_rsconvert_info acpi_rs_convert_gpio[];
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 297) extern struct acpi_rsconvert_info acpi_rs_convert_fixed_dma[];
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 298) extern struct acpi_rsconvert_info acpi_rs_convert_i2c_serial_bus[];
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 299) extern struct acpi_rsconvert_info acpi_rs_convert_spi_serial_bus[];
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 300) extern struct acpi_rsconvert_info acpi_rs_convert_uart_serial_bus[];
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 301) extern struct acpi_rsconvert_info acpi_rs_convert_pin_function[];
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 302) extern struct acpi_rsconvert_info acpi_rs_convert_pin_config[];
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 303) extern struct acpi_rsconvert_info acpi_rs_convert_pin_group[];
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 304) extern struct acpi_rsconvert_info acpi_rs_convert_pin_group_function[];
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 305) extern struct acpi_rsconvert_info acpi_rs_convert_pin_group_config[];
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 306)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 307) /* These resources require separate get/set tables */
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 308)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 309) extern struct acpi_rsconvert_info acpi_rs_get_irq[];
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 310) extern struct acpi_rsconvert_info acpi_rs_get_start_dpf[];
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 311) extern struct acpi_rsconvert_info acpi_rs_get_vendor_small[];
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 312) extern struct acpi_rsconvert_info acpi_rs_get_vendor_large[];
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 313)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 314) extern struct acpi_rsconvert_info acpi_rs_set_irq[];
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 315) extern struct acpi_rsconvert_info acpi_rs_set_start_dpf[];
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 316) extern struct acpi_rsconvert_info acpi_rs_set_vendor[];
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 317)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 318) #if defined(ACPI_DEBUG_OUTPUT) || defined(ACPI_DEBUGGER)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 319) /*
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 320) * rsinfo
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 321) */
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 322) extern struct acpi_rsdump_info *acpi_gbl_dump_resource_dispatch[];
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 323) extern struct acpi_rsdump_info *acpi_gbl_dump_serial_bus_dispatch[];
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 324)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 325) /*
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 326) * rsdumpinfo
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 327) */
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 328) extern struct acpi_rsdump_info acpi_rs_dump_irq[];
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 329) extern struct acpi_rsdump_info acpi_rs_dump_prt[];
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 330) extern struct acpi_rsdump_info acpi_rs_dump_dma[];
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 331) extern struct acpi_rsdump_info acpi_rs_dump_start_dpf[];
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 332) extern struct acpi_rsdump_info acpi_rs_dump_end_dpf[];
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 333) extern struct acpi_rsdump_info acpi_rs_dump_io[];
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 334) extern struct acpi_rsdump_info acpi_rs_dump_io_flags[];
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 335) extern struct acpi_rsdump_info acpi_rs_dump_fixed_io[];
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 336) extern struct acpi_rsdump_info acpi_rs_dump_vendor[];
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 337) extern struct acpi_rsdump_info acpi_rs_dump_end_tag[];
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 338) extern struct acpi_rsdump_info acpi_rs_dump_memory24[];
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 339) extern struct acpi_rsdump_info acpi_rs_dump_memory32[];
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 340) extern struct acpi_rsdump_info acpi_rs_dump_memory_flags[];
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 341) extern struct acpi_rsdump_info acpi_rs_dump_fixed_memory32[];
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 342) extern struct acpi_rsdump_info acpi_rs_dump_address16[];
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 343) extern struct acpi_rsdump_info acpi_rs_dump_address32[];
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 344) extern struct acpi_rsdump_info acpi_rs_dump_address64[];
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 345) extern struct acpi_rsdump_info acpi_rs_dump_ext_address64[];
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 346) extern struct acpi_rsdump_info acpi_rs_dump_ext_irq[];
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 347) extern struct acpi_rsdump_info acpi_rs_dump_generic_reg[];
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 348) extern struct acpi_rsdump_info acpi_rs_dump_gpio[];
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 349) extern struct acpi_rsdump_info acpi_rs_dump_pin_function[];
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 350) extern struct acpi_rsdump_info acpi_rs_dump_fixed_dma[];
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 351) extern struct acpi_rsdump_info acpi_rs_dump_common_serial_bus[];
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 352) extern struct acpi_rsdump_info acpi_rs_dump_i2c_serial_bus[];
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 353) extern struct acpi_rsdump_info acpi_rs_dump_spi_serial_bus[];
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 354) extern struct acpi_rsdump_info acpi_rs_dump_uart_serial_bus[];
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 355) extern struct acpi_rsdump_info acpi_rs_dump_general_flags[];
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 356) extern struct acpi_rsdump_info acpi_rs_dump_pin_config[];
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 357) extern struct acpi_rsdump_info acpi_rs_dump_pin_group[];
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 358) extern struct acpi_rsdump_info acpi_rs_dump_pin_group_function[];
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 359) extern struct acpi_rsdump_info acpi_rs_dump_pin_group_config[];
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 360) #endif
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 361)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 362) #endif /* __ACRESRC_H__ */