mirror of
https://github.com/AuxXxilium/linux_dsm_epyc7002.git
synced 2024-11-25 17:10:50 +07:00
Merge branch 'acpica' into acpi-resources
This commit is contained in:
commit
b2cd5dd71a
@ -69,10 +69,10 @@ static acpi_status find_csr_space(struct acpi_resource *resource, void *data)
|
||||
status = acpi_resource_to_address64(resource, &addr);
|
||||
if (ACPI_SUCCESS(status) &&
|
||||
addr.resource_type == ACPI_MEMORY_RANGE &&
|
||||
addr.address_length &&
|
||||
addr.address.address_length &&
|
||||
addr.producer_consumer == ACPI_CONSUMER) {
|
||||
space->base = addr.minimum;
|
||||
space->length = addr.address_length;
|
||||
space->base = addr.address.minimum;
|
||||
space->length = addr.address.address_length;
|
||||
return AE_CTRL_TERMINATE;
|
||||
}
|
||||
return AE_OK; /* keep looking */
|
||||
|
@ -188,12 +188,12 @@ static u64 add_io_space(struct pci_root_info *info,
|
||||
|
||||
name = (char *)(iospace + 1);
|
||||
|
||||
min = addr->minimum;
|
||||
max = min + addr->address_length - 1;
|
||||
min = addr->address.minimum;
|
||||
max = min + addr->address.address_length - 1;
|
||||
if (addr->info.io.translation_type == ACPI_SPARSE_TRANSLATION)
|
||||
sparse = 1;
|
||||
|
||||
space_nr = new_space(addr->translation_offset, sparse);
|
||||
space_nr = new_space(addr->address.translation_offset, sparse);
|
||||
if (space_nr == ~0)
|
||||
goto free_resource;
|
||||
|
||||
@ -247,7 +247,7 @@ static acpi_status resource_to_window(struct acpi_resource *resource,
|
||||
if (ACPI_SUCCESS(status) &&
|
||||
(addr->resource_type == ACPI_MEMORY_RANGE ||
|
||||
addr->resource_type == ACPI_IO_RANGE) &&
|
||||
addr->address_length &&
|
||||
addr->address.address_length &&
|
||||
addr->producer_consumer == ACPI_PRODUCER)
|
||||
return AE_OK;
|
||||
|
||||
@ -284,7 +284,7 @@ static acpi_status add_window(struct acpi_resource *res, void *data)
|
||||
if (addr.resource_type == ACPI_MEMORY_RANGE) {
|
||||
flags = IORESOURCE_MEM;
|
||||
root = &iomem_resource;
|
||||
offset = addr.translation_offset;
|
||||
offset = addr.address.translation_offset;
|
||||
} else if (addr.resource_type == ACPI_IO_RANGE) {
|
||||
flags = IORESOURCE_IO;
|
||||
root = &ioport_resource;
|
||||
@ -297,8 +297,8 @@ static acpi_status add_window(struct acpi_resource *res, void *data)
|
||||
resource = &info->res[info->res_num];
|
||||
resource->name = info->name;
|
||||
resource->flags = flags;
|
||||
resource->start = addr.minimum + offset;
|
||||
resource->end = resource->start + addr.address_length - 1;
|
||||
resource->start = addr.address.minimum + offset;
|
||||
resource->end = resource->start + addr.address.address_length - 1;
|
||||
info->res_offset[info->res_num] = offset;
|
||||
|
||||
if (insert_resource(root, resource)) {
|
||||
|
@ -231,23 +231,23 @@ static acpi_status resource_to_addr(struct acpi_resource *resource,
|
||||
case ACPI_RESOURCE_TYPE_MEMORY24:
|
||||
memory24 = &resource->data.memory24;
|
||||
addr->resource_type = ACPI_MEMORY_RANGE;
|
||||
addr->minimum = memory24->minimum;
|
||||
addr->address_length = memory24->address_length;
|
||||
addr->maximum = addr->minimum + addr->address_length - 1;
|
||||
addr->address.minimum = memory24->minimum;
|
||||
addr->address.address_length = memory24->address_length;
|
||||
addr->address.maximum = addr->address.minimum + addr->address.address_length - 1;
|
||||
return AE_OK;
|
||||
case ACPI_RESOURCE_TYPE_MEMORY32:
|
||||
memory32 = &resource->data.memory32;
|
||||
addr->resource_type = ACPI_MEMORY_RANGE;
|
||||
addr->minimum = memory32->minimum;
|
||||
addr->address_length = memory32->address_length;
|
||||
addr->maximum = addr->minimum + addr->address_length - 1;
|
||||
addr->address.minimum = memory32->minimum;
|
||||
addr->address.address_length = memory32->address_length;
|
||||
addr->address.maximum = addr->address.minimum + addr->address.address_length - 1;
|
||||
return AE_OK;
|
||||
case ACPI_RESOURCE_TYPE_FIXED_MEMORY32:
|
||||
fixed_memory32 = &resource->data.fixed_memory32;
|
||||
addr->resource_type = ACPI_MEMORY_RANGE;
|
||||
addr->minimum = fixed_memory32->address;
|
||||
addr->address_length = fixed_memory32->address_length;
|
||||
addr->maximum = addr->minimum + addr->address_length - 1;
|
||||
addr->address.minimum = fixed_memory32->address;
|
||||
addr->address.address_length = fixed_memory32->address_length;
|
||||
addr->address.maximum = addr->address.minimum + addr->address.address_length - 1;
|
||||
return AE_OK;
|
||||
case ACPI_RESOURCE_TYPE_ADDRESS16:
|
||||
case ACPI_RESOURCE_TYPE_ADDRESS32:
|
||||
@ -256,7 +256,7 @@ static acpi_status resource_to_addr(struct acpi_resource *resource,
|
||||
if (ACPI_SUCCESS(status) &&
|
||||
(addr->resource_type == ACPI_MEMORY_RANGE ||
|
||||
addr->resource_type == ACPI_IO_RANGE) &&
|
||||
addr->address_length > 0) {
|
||||
addr->address.address_length > 0) {
|
||||
return AE_OK;
|
||||
}
|
||||
break;
|
||||
@ -298,8 +298,8 @@ static acpi_status setup_resource(struct acpi_resource *acpi_res, void *data)
|
||||
} else
|
||||
return AE_OK;
|
||||
|
||||
start = addr.minimum + addr.translation_offset;
|
||||
orig_end = end = addr.maximum + addr.translation_offset;
|
||||
start = addr.address.minimum + addr.address.translation_offset;
|
||||
orig_end = end = addr.address.maximum + addr.address.translation_offset;
|
||||
|
||||
/* Exclude non-addressable range or non-addressable portion of range */
|
||||
end = min(end, (u64)iomem_resource.end);
|
||||
@ -320,7 +320,7 @@ static acpi_status setup_resource(struct acpi_resource *acpi_res, void *data)
|
||||
res->flags = flags;
|
||||
res->start = start;
|
||||
res->end = end;
|
||||
info->res_offset[info->res_num] = addr.translation_offset;
|
||||
info->res_offset[info->res_num] = addr.address.translation_offset;
|
||||
info->res_num++;
|
||||
|
||||
if (!pci_use_crs)
|
||||
|
@ -397,12 +397,12 @@ static acpi_status check_mcfg_resource(struct acpi_resource *res, void *data)
|
||||
|
||||
status = acpi_resource_to_address64(res, &address);
|
||||
if (ACPI_FAILURE(status) ||
|
||||
(address.address_length <= 0) ||
|
||||
(address.address.address_length <= 0) ||
|
||||
(address.resource_type != ACPI_MEMORY_RANGE))
|
||||
return AE_OK;
|
||||
|
||||
if ((mcfg_res->start >= address.minimum) &&
|
||||
(mcfg_res->end < (address.minimum + address.address_length))) {
|
||||
if ((mcfg_res->start >= address.address.minimum) &&
|
||||
(mcfg_res->end < (address.address.minimum + address.address.address_length))) {
|
||||
mcfg_res->flags = 1;
|
||||
return AE_CTRL_TERMINATE;
|
||||
}
|
||||
|
@ -101,8 +101,8 @@ acpi_memory_get_resource(struct acpi_resource *resource, void *context)
|
||||
/* Can we combine the resource range information? */
|
||||
if ((info->caching == address64.info.mem.caching) &&
|
||||
(info->write_protect == address64.info.mem.write_protect) &&
|
||||
(info->start_addr + info->length == address64.minimum)) {
|
||||
info->length += address64.address_length;
|
||||
(info->start_addr + info->length == address64.address.minimum)) {
|
||||
info->length += address64.address.address_length;
|
||||
return AE_OK;
|
||||
}
|
||||
}
|
||||
@ -114,8 +114,8 @@ acpi_memory_get_resource(struct acpi_resource *resource, void *context)
|
||||
INIT_LIST_HEAD(&new->list);
|
||||
new->caching = address64.info.mem.caching;
|
||||
new->write_protect = address64.info.mem.write_protect;
|
||||
new->start_addr = address64.minimum;
|
||||
new->length = address64.address_length;
|
||||
new->start_addr = address64.address.minimum;
|
||||
new->length = address64.address.address_length;
|
||||
list_add_tail(&new->list, &mem_device->res_list);
|
||||
|
||||
return AE_OK;
|
||||
|
@ -51,50 +51,6 @@
|
||||
#define _COMPONENT ACPI_NAMESPACE
|
||||
ACPI_MODULE_NAME("nsxfobj")
|
||||
|
||||
/*******************************************************************************
|
||||
*
|
||||
* FUNCTION: acpi_get_id
|
||||
*
|
||||
* PARAMETERS: Handle - Handle of object whose id is desired
|
||||
* ret_id - Where the id will be placed
|
||||
*
|
||||
* RETURN: Status
|
||||
*
|
||||
* DESCRIPTION: This routine returns the owner id associated with a handle
|
||||
*
|
||||
******************************************************************************/
|
||||
acpi_status acpi_get_id(acpi_handle handle, acpi_owner_id * ret_id)
|
||||
{
|
||||
struct acpi_namespace_node *node;
|
||||
acpi_status status;
|
||||
|
||||
/* Parameter Validation */
|
||||
|
||||
if (!ret_id) {
|
||||
return (AE_BAD_PARAMETER);
|
||||
}
|
||||
|
||||
status = acpi_ut_acquire_mutex(ACPI_MTX_NAMESPACE);
|
||||
if (ACPI_FAILURE(status)) {
|
||||
return (status);
|
||||
}
|
||||
|
||||
/* Convert and validate the handle */
|
||||
|
||||
node = acpi_ns_validate_handle(handle);
|
||||
if (!node) {
|
||||
(void)acpi_ut_release_mutex(ACPI_MTX_NAMESPACE);
|
||||
return (AE_BAD_PARAMETER);
|
||||
}
|
||||
|
||||
*ret_id = node->owner_id;
|
||||
|
||||
status = acpi_ut_release_mutex(ACPI_MTX_NAMESPACE);
|
||||
return (status);
|
||||
}
|
||||
|
||||
ACPI_EXPORT_SYMBOL(acpi_get_id)
|
||||
|
||||
/*******************************************************************************
|
||||
*
|
||||
* FUNCTION: acpi_get_type
|
||||
|
@ -74,7 +74,7 @@ struct acpi_rsconvert_info acpi_rs_convert_address16[5] = {
|
||||
* Address Translation Offset
|
||||
* Address Length
|
||||
*/
|
||||
{ACPI_RSC_MOVE16, ACPI_RS_OFFSET(data.address16.granularity),
|
||||
{ACPI_RSC_MOVE16, ACPI_RS_OFFSET(data.address16.address.granularity),
|
||||
AML_OFFSET(address16.granularity),
|
||||
5},
|
||||
|
||||
@ -112,7 +112,7 @@ struct acpi_rsconvert_info acpi_rs_convert_address32[5] = {
|
||||
* Address Translation Offset
|
||||
* Address Length
|
||||
*/
|
||||
{ACPI_RSC_MOVE32, ACPI_RS_OFFSET(data.address32.granularity),
|
||||
{ACPI_RSC_MOVE32, ACPI_RS_OFFSET(data.address32.address.granularity),
|
||||
AML_OFFSET(address32.granularity),
|
||||
5},
|
||||
|
||||
@ -150,7 +150,7 @@ struct acpi_rsconvert_info acpi_rs_convert_address64[5] = {
|
||||
* Address Translation Offset
|
||||
* Address Length
|
||||
*/
|
||||
{ACPI_RSC_MOVE64, ACPI_RS_OFFSET(data.address64.granularity),
|
||||
{ACPI_RSC_MOVE64, ACPI_RS_OFFSET(data.address64.address.granularity),
|
||||
AML_OFFSET(address64.granularity),
|
||||
5},
|
||||
|
||||
@ -194,7 +194,8 @@ struct acpi_rsconvert_info acpi_rs_convert_ext_address64[5] = {
|
||||
* Address Length
|
||||
* Type-Specific Attribute
|
||||
*/
|
||||
{ACPI_RSC_MOVE64, ACPI_RS_OFFSET(data.ext_address64.granularity),
|
||||
{ACPI_RSC_MOVE64,
|
||||
ACPI_RS_OFFSET(data.ext_address64.address.granularity),
|
||||
AML_OFFSET(ext_address64.granularity),
|
||||
6}
|
||||
};
|
||||
|
@ -183,15 +183,15 @@ struct acpi_rsdump_info acpi_rs_dump_address16[8] = {
|
||||
{ACPI_RSD_TITLE, ACPI_RSD_TABLE_SIZE(acpi_rs_dump_address16),
|
||||
"16-Bit WORD Address Space", NULL},
|
||||
{ACPI_RSD_ADDRESS, 0, NULL, NULL},
|
||||
{ACPI_RSD_UINT16, ACPI_RSD_OFFSET(address16.granularity), "Granularity",
|
||||
NULL},
|
||||
{ACPI_RSD_UINT16, ACPI_RSD_OFFSET(address16.minimum), "Address Minimum",
|
||||
NULL},
|
||||
{ACPI_RSD_UINT16, ACPI_RSD_OFFSET(address16.maximum), "Address Maximum",
|
||||
NULL},
|
||||
{ACPI_RSD_UINT16, ACPI_RSD_OFFSET(address16.translation_offset),
|
||||
{ACPI_RSD_UINT16, ACPI_RSD_OFFSET(address16.address.granularity),
|
||||
"Granularity", NULL},
|
||||
{ACPI_RSD_UINT16, ACPI_RSD_OFFSET(address16.address.minimum),
|
||||
"Address Minimum", NULL},
|
||||
{ACPI_RSD_UINT16, ACPI_RSD_OFFSET(address16.address.maximum),
|
||||
"Address Maximum", NULL},
|
||||
{ACPI_RSD_UINT16, ACPI_RSD_OFFSET(address16.address.translation_offset),
|
||||
"Translation Offset", NULL},
|
||||
{ACPI_RSD_UINT16, ACPI_RSD_OFFSET(address16.address_length),
|
||||
{ACPI_RSD_UINT16, ACPI_RSD_OFFSET(address16.address.address_length),
|
||||
"Address Length", NULL},
|
||||
{ACPI_RSD_SOURCE, ACPI_RSD_OFFSET(address16.resource_source), NULL, NULL}
|
||||
};
|
||||
@ -200,15 +200,15 @@ struct acpi_rsdump_info acpi_rs_dump_address32[8] = {
|
||||
{ACPI_RSD_TITLE, ACPI_RSD_TABLE_SIZE(acpi_rs_dump_address32),
|
||||
"32-Bit DWORD Address Space", NULL},
|
||||
{ACPI_RSD_ADDRESS, 0, NULL, NULL},
|
||||
{ACPI_RSD_UINT32, ACPI_RSD_OFFSET(address32.granularity), "Granularity",
|
||||
NULL},
|
||||
{ACPI_RSD_UINT32, ACPI_RSD_OFFSET(address32.minimum), "Address Minimum",
|
||||
NULL},
|
||||
{ACPI_RSD_UINT32, ACPI_RSD_OFFSET(address32.maximum), "Address Maximum",
|
||||
NULL},
|
||||
{ACPI_RSD_UINT32, ACPI_RSD_OFFSET(address32.translation_offset),
|
||||
{ACPI_RSD_UINT32, ACPI_RSD_OFFSET(address32.address.granularity),
|
||||
"Granularity", NULL},
|
||||
{ACPI_RSD_UINT32, ACPI_RSD_OFFSET(address32.address.minimum),
|
||||
"Address Minimum", NULL},
|
||||
{ACPI_RSD_UINT32, ACPI_RSD_OFFSET(address32.address.maximum),
|
||||
"Address Maximum", NULL},
|
||||
{ACPI_RSD_UINT32, ACPI_RSD_OFFSET(address32.address.translation_offset),
|
||||
"Translation Offset", NULL},
|
||||
{ACPI_RSD_UINT32, ACPI_RSD_OFFSET(address32.address_length),
|
||||
{ACPI_RSD_UINT32, ACPI_RSD_OFFSET(address32.address.address_length),
|
||||
"Address Length", NULL},
|
||||
{ACPI_RSD_SOURCE, ACPI_RSD_OFFSET(address32.resource_source), NULL, NULL}
|
||||
};
|
||||
@ -217,15 +217,15 @@ struct acpi_rsdump_info acpi_rs_dump_address64[8] = {
|
||||
{ACPI_RSD_TITLE, ACPI_RSD_TABLE_SIZE(acpi_rs_dump_address64),
|
||||
"64-Bit QWORD Address Space", NULL},
|
||||
{ACPI_RSD_ADDRESS, 0, NULL, NULL},
|
||||
{ACPI_RSD_UINT64, ACPI_RSD_OFFSET(address64.granularity), "Granularity",
|
||||
NULL},
|
||||
{ACPI_RSD_UINT64, ACPI_RSD_OFFSET(address64.minimum), "Address Minimum",
|
||||
NULL},
|
||||
{ACPI_RSD_UINT64, ACPI_RSD_OFFSET(address64.maximum), "Address Maximum",
|
||||
NULL},
|
||||
{ACPI_RSD_UINT64, ACPI_RSD_OFFSET(address64.translation_offset),
|
||||
{ACPI_RSD_UINT64, ACPI_RSD_OFFSET(address64.address.granularity),
|
||||
"Granularity", NULL},
|
||||
{ACPI_RSD_UINT64, ACPI_RSD_OFFSET(address64.address.minimum),
|
||||
"Address Minimum", NULL},
|
||||
{ACPI_RSD_UINT64, ACPI_RSD_OFFSET(address64.address.maximum),
|
||||
"Address Maximum", NULL},
|
||||
{ACPI_RSD_UINT64, ACPI_RSD_OFFSET(address64.address.translation_offset),
|
||||
"Translation Offset", NULL},
|
||||
{ACPI_RSD_UINT64, ACPI_RSD_OFFSET(address64.address_length),
|
||||
{ACPI_RSD_UINT64, ACPI_RSD_OFFSET(address64.address.address_length),
|
||||
"Address Length", NULL},
|
||||
{ACPI_RSD_SOURCE, ACPI_RSD_OFFSET(address64.resource_source), NULL, NULL}
|
||||
};
|
||||
@ -234,15 +234,16 @@ struct acpi_rsdump_info acpi_rs_dump_ext_address64[8] = {
|
||||
{ACPI_RSD_TITLE, ACPI_RSD_TABLE_SIZE(acpi_rs_dump_ext_address64),
|
||||
"64-Bit Extended Address Space", NULL},
|
||||
{ACPI_RSD_ADDRESS, 0, NULL, NULL},
|
||||
{ACPI_RSD_UINT64, ACPI_RSD_OFFSET(ext_address64.granularity),
|
||||
{ACPI_RSD_UINT64, ACPI_RSD_OFFSET(ext_address64.address.granularity),
|
||||
"Granularity", NULL},
|
||||
{ACPI_RSD_UINT64, ACPI_RSD_OFFSET(ext_address64.minimum),
|
||||
{ACPI_RSD_UINT64, ACPI_RSD_OFFSET(ext_address64.address.minimum),
|
||||
"Address Minimum", NULL},
|
||||
{ACPI_RSD_UINT64, ACPI_RSD_OFFSET(ext_address64.maximum),
|
||||
{ACPI_RSD_UINT64, ACPI_RSD_OFFSET(ext_address64.address.maximum),
|
||||
"Address Maximum", NULL},
|
||||
{ACPI_RSD_UINT64, ACPI_RSD_OFFSET(ext_address64.translation_offset),
|
||||
{ACPI_RSD_UINT64,
|
||||
ACPI_RSD_OFFSET(ext_address64.address.translation_offset),
|
||||
"Translation Offset", NULL},
|
||||
{ACPI_RSD_UINT64, ACPI_RSD_OFFSET(ext_address64.address_length),
|
||||
{ACPI_RSD_UINT64, ACPI_RSD_OFFSET(ext_address64.address.address_length),
|
||||
"Address Length", NULL},
|
||||
{ACPI_RSD_UINT64, ACPI_RSD_OFFSET(ext_address64.type_specific),
|
||||
"Type-Specific Attribute", NULL}
|
||||
|
@ -60,11 +60,11 @@ ACPI_MODULE_NAME("rsxface")
|
||||
ACPI_COPY_FIELD(out, in, min_address_fixed); \
|
||||
ACPI_COPY_FIELD(out, in, max_address_fixed); \
|
||||
ACPI_COPY_FIELD(out, in, info); \
|
||||
ACPI_COPY_FIELD(out, in, granularity); \
|
||||
ACPI_COPY_FIELD(out, in, minimum); \
|
||||
ACPI_COPY_FIELD(out, in, maximum); \
|
||||
ACPI_COPY_FIELD(out, in, translation_offset); \
|
||||
ACPI_COPY_FIELD(out, in, address_length); \
|
||||
ACPI_COPY_FIELD(out, in, address.granularity); \
|
||||
ACPI_COPY_FIELD(out, in, address.minimum); \
|
||||
ACPI_COPY_FIELD(out, in, address.maximum); \
|
||||
ACPI_COPY_FIELD(out, in, address.translation_offset); \
|
||||
ACPI_COPY_FIELD(out, in, address.address_length); \
|
||||
ACPI_COPY_FIELD(out, in, resource_source);
|
||||
/* Local prototypes */
|
||||
static acpi_status
|
||||
|
@ -263,45 +263,6 @@ acpi_get_table_header(char *signature,
|
||||
|
||||
ACPI_EXPORT_SYMBOL(acpi_get_table_header)
|
||||
|
||||
/*******************************************************************************
|
||||
*
|
||||
* FUNCTION: acpi_unload_table_id
|
||||
*
|
||||
* PARAMETERS: id - Owner ID of the table to be removed.
|
||||
*
|
||||
* RETURN: Status
|
||||
*
|
||||
* DESCRIPTION: This routine is used to force the unload of a table (by id)
|
||||
*
|
||||
******************************************************************************/
|
||||
acpi_status acpi_unload_table_id(acpi_owner_id id)
|
||||
{
|
||||
int i;
|
||||
acpi_status status = AE_NOT_EXIST;
|
||||
|
||||
ACPI_FUNCTION_TRACE(acpi_unload_table_id);
|
||||
|
||||
/* Find table in the global table list */
|
||||
for (i = 0; i < acpi_gbl_root_table_list.current_table_count; ++i) {
|
||||
if (id != acpi_gbl_root_table_list.tables[i].owner_id) {
|
||||
continue;
|
||||
}
|
||||
/*
|
||||
* Delete all namespace objects owned by this table. Note that these
|
||||
* objects can appear anywhere in the namespace by virtue of the AML
|
||||
* "Scope" operator. Thus, we need to track ownership by an ID, not
|
||||
* simply a position within the hierarchy
|
||||
*/
|
||||
acpi_tb_delete_namespace_by_owner(i);
|
||||
status = acpi_tb_release_owner_id(i);
|
||||
acpi_tb_set_table_loaded_flag(i, FALSE);
|
||||
break;
|
||||
}
|
||||
return_ACPI_STATUS(status);
|
||||
}
|
||||
|
||||
ACPI_EXPORT_SYMBOL(acpi_unload_table_id)
|
||||
|
||||
/*******************************************************************************
|
||||
*
|
||||
* FUNCTION: acpi_get_table_with_size
|
||||
|
@ -112,10 +112,10 @@ get_root_bridge_busnr_callback(struct acpi_resource *resource, void *data)
|
||||
if (ACPI_FAILURE(status))
|
||||
return AE_OK;
|
||||
|
||||
if ((address.address_length > 0) &&
|
||||
if ((address.address.address_length > 0) &&
|
||||
(address.resource_type == ACPI_BUS_NUMBER_RANGE)) {
|
||||
res->start = address.minimum;
|
||||
res->end = address.minimum + address.address_length - 1;
|
||||
res->start = address.address.minimum;
|
||||
res->end = address.address.minimum + address.address.address_length - 1;
|
||||
}
|
||||
|
||||
return AE_OK;
|
||||
|
@ -202,22 +202,22 @@ bool acpi_dev_resource_address_space(struct acpi_resource *ares,
|
||||
if (ACPI_FAILURE(status))
|
||||
return false;
|
||||
|
||||
res->start = addr.minimum;
|
||||
res->end = addr.maximum;
|
||||
res->start = addr.address.minimum;
|
||||
res->end = addr.address.maximum;
|
||||
window = addr.producer_consumer == ACPI_PRODUCER;
|
||||
|
||||
switch(addr.resource_type) {
|
||||
case ACPI_MEMORY_RANGE:
|
||||
len = addr.maximum - addr.minimum + 1;
|
||||
len = addr.address.maximum - addr.address.minimum + 1;
|
||||
res->flags = acpi_dev_memresource_flags(len,
|
||||
addr.info.mem.write_protect,
|
||||
window);
|
||||
break;
|
||||
case ACPI_IO_RANGE:
|
||||
io_decode = addr.granularity == 0xfff ?
|
||||
io_decode = addr.address.granularity == 0xfff ?
|
||||
ACPI_DECODE_10 : ACPI_DECODE_16;
|
||||
res->flags = acpi_dev_ioresource_flags(addr.minimum,
|
||||
addr.maximum,
|
||||
res->flags = acpi_dev_ioresource_flags(addr.address.minimum,
|
||||
addr.address.maximum,
|
||||
io_decode, window);
|
||||
break;
|
||||
case ACPI_BUS_NUMBER_RANGE:
|
||||
@ -253,22 +253,22 @@ bool acpi_dev_resource_ext_address_space(struct acpi_resource *ares,
|
||||
|
||||
ext_addr = &ares->data.ext_address64;
|
||||
|
||||
res->start = ext_addr->minimum;
|
||||
res->end = ext_addr->maximum;
|
||||
res->start = ext_addr->address.minimum;
|
||||
res->end = ext_addr->address.maximum;
|
||||
window = ext_addr->producer_consumer == ACPI_PRODUCER;
|
||||
|
||||
switch(ext_addr->resource_type) {
|
||||
case ACPI_MEMORY_RANGE:
|
||||
len = ext_addr->maximum - ext_addr->minimum + 1;
|
||||
len = ext_addr->address.maximum - ext_addr->address.minimum + 1;
|
||||
res->flags = acpi_dev_memresource_flags(len,
|
||||
ext_addr->info.mem.write_protect,
|
||||
window);
|
||||
break;
|
||||
case ACPI_IO_RANGE:
|
||||
io_decode = ext_addr->granularity == 0xfff ?
|
||||
io_decode = ext_addr->address.granularity == 0xfff ?
|
||||
ACPI_DECODE_10 : ACPI_DECODE_16;
|
||||
res->flags = acpi_dev_ioresource_flags(ext_addr->minimum,
|
||||
ext_addr->maximum,
|
||||
res->flags = acpi_dev_ioresource_flags(ext_addr->address.minimum,
|
||||
ext_addr->address.maximum,
|
||||
io_decode, window);
|
||||
break;
|
||||
case ACPI_BUS_NUMBER_RANGE:
|
||||
|
@ -976,8 +976,8 @@ static acpi_status hpet_resources(struct acpi_resource *res, void *data)
|
||||
status = acpi_resource_to_address64(res, &addr);
|
||||
|
||||
if (ACPI_SUCCESS(status)) {
|
||||
hdp->hd_phys_address = addr.minimum;
|
||||
hdp->hd_address = ioremap(addr.minimum, addr.address_length);
|
||||
hdp->hd_phys_address = addr.address.minimum;
|
||||
hdp->hd_address = ioremap(addr.address.minimum, addr.address.address_length);
|
||||
|
||||
if (hpet_is_known(hdp)) {
|
||||
iounmap(hdp->hd_address);
|
||||
|
@ -861,8 +861,8 @@ static acpi_status vmbus_walk_resources(struct acpi_resource *res, void *ctx)
|
||||
break;
|
||||
|
||||
case ACPI_RESOURCE_TYPE_ADDRESS64:
|
||||
hyperv_mmio.start = res->data.address64.minimum;
|
||||
hyperv_mmio.end = res->data.address64.maximum;
|
||||
hyperv_mmio.start = res->data.address64.address.minimum;
|
||||
hyperv_mmio.end = res->data.address64.address.maximum;
|
||||
break;
|
||||
}
|
||||
|
||||
|
@ -475,7 +475,7 @@ static int disable_slot(struct hotplug_slot *bss_hotplug_slot)
|
||||
struct slot *slot = bss_hotplug_slot->private;
|
||||
struct pci_dev *dev, *temp;
|
||||
int rc;
|
||||
acpi_owner_id ssdt_id = 0;
|
||||
acpi_handle ssdt_hdl = NULL;
|
||||
|
||||
/* Acquire update access to the bus */
|
||||
mutex_lock(&sn_hotplug_mutex);
|
||||
@ -522,7 +522,7 @@ static int disable_slot(struct hotplug_slot *bss_hotplug_slot)
|
||||
if (ACPI_SUCCESS(ret) &&
|
||||
(adr>>16) == (slot->device_num + 1)) {
|
||||
/* retain the owner id */
|
||||
acpi_get_id(chandle, &ssdt_id);
|
||||
ssdt_hdl = chandle;
|
||||
|
||||
ret = acpi_bus_get_device(chandle,
|
||||
&device);
|
||||
@ -547,12 +547,13 @@ static int disable_slot(struct hotplug_slot *bss_hotplug_slot)
|
||||
pci_unlock_rescan_remove();
|
||||
|
||||
/* Remove the SSDT for the slot from the ACPI namespace */
|
||||
if (SN_ACPI_BASE_SUPPORT() && ssdt_id) {
|
||||
if (SN_ACPI_BASE_SUPPORT() && ssdt_hdl) {
|
||||
acpi_status ret;
|
||||
ret = acpi_unload_table_id(ssdt_id);
|
||||
ret = acpi_unload_parent_table(ssdt_hdl);
|
||||
if (ACPI_FAILURE(ret)) {
|
||||
printk(KERN_ERR "%s: acpi_unload_table_id failed (0x%x) for id %d\n",
|
||||
__func__, ret, ssdt_id);
|
||||
acpi_handle_err(ssdt_hdl,
|
||||
"%s: acpi_unload_parent_table failed (0x%x)\n",
|
||||
__func__, ret);
|
||||
/* try to continue on */
|
||||
}
|
||||
}
|
||||
|
@ -410,12 +410,12 @@ static __init void pnpacpi_parse_address_option(struct pnp_dev *dev,
|
||||
if (p->resource_type == ACPI_MEMORY_RANGE) {
|
||||
if (p->info.mem.write_protect == ACPI_READ_WRITE_MEMORY)
|
||||
flags = IORESOURCE_MEM_WRITEABLE;
|
||||
pnp_register_mem_resource(dev, option_flags, p->minimum,
|
||||
p->minimum, 0, p->address_length,
|
||||
pnp_register_mem_resource(dev, option_flags, p->address.minimum,
|
||||
p->address.minimum, 0, p->address.address_length,
|
||||
flags);
|
||||
} else if (p->resource_type == ACPI_IO_RANGE)
|
||||
pnp_register_port_resource(dev, option_flags, p->minimum,
|
||||
p->minimum, 0, p->address_length,
|
||||
pnp_register_port_resource(dev, option_flags, p->address.minimum,
|
||||
p->address.minimum, 0, p->address.address_length,
|
||||
IORESOURCE_IO_FIXED);
|
||||
}
|
||||
|
||||
@ -429,12 +429,12 @@ static __init void pnpacpi_parse_ext_address_option(struct pnp_dev *dev,
|
||||
if (p->resource_type == ACPI_MEMORY_RANGE) {
|
||||
if (p->info.mem.write_protect == ACPI_READ_WRITE_MEMORY)
|
||||
flags = IORESOURCE_MEM_WRITEABLE;
|
||||
pnp_register_mem_resource(dev, option_flags, p->minimum,
|
||||
p->minimum, 0, p->address_length,
|
||||
pnp_register_mem_resource(dev, option_flags, p->address.minimum,
|
||||
p->address.minimum, 0, p->address.address_length,
|
||||
flags);
|
||||
} else if (p->resource_type == ACPI_IO_RANGE)
|
||||
pnp_register_port_resource(dev, option_flags, p->minimum,
|
||||
p->minimum, 0, p->address_length,
|
||||
pnp_register_port_resource(dev, option_flags, p->address.minimum,
|
||||
p->address.minimum, 0, p->address.address_length,
|
||||
IORESOURCE_IO_FIXED);
|
||||
}
|
||||
|
||||
|
@ -117,8 +117,8 @@ acpi_memory_get_resource(struct acpi_resource *resource, void *context)
|
||||
list_for_each_entry(info, &mem_device->res_list, list) {
|
||||
if ((info->caching == address64.info.mem.caching) &&
|
||||
(info->write_protect == address64.info.mem.write_protect) &&
|
||||
(info->start_addr + info->length == address64.minimum)) {
|
||||
info->length += address64.address_length;
|
||||
(info->start_addr + info->length == address64.address.minimum)) {
|
||||
info->length += address64.address.address_length;
|
||||
return AE_OK;
|
||||
}
|
||||
}
|
||||
@ -130,8 +130,8 @@ acpi_memory_get_resource(struct acpi_resource *resource, void *context)
|
||||
INIT_LIST_HEAD(&new->list);
|
||||
new->caching = address64.info.mem.caching;
|
||||
new->write_protect = address64.info.mem.write_protect;
|
||||
new->start_addr = address64.minimum;
|
||||
new->length = address64.address_length;
|
||||
new->start_addr = address64.address.minimum;
|
||||
new->length = address64.address.address_length;
|
||||
list_add_tail(&new->list, &mem_device->res_list);
|
||||
|
||||
return AE_OK;
|
||||
|
@ -890,12 +890,6 @@ ACPI_APP_DEPENDENT_RETURN_VOID(ACPI_PRINTF_LIKE(1)
|
||||
*/
|
||||
ACPI_GLOBAL(u8, acpi_gbl_permanent_mmap);
|
||||
|
||||
ACPI_EXTERNAL_RETURN_STATUS(acpi_status
|
||||
acpi_get_id(acpi_handle object,
|
||||
acpi_owner_id * out_type))
|
||||
|
||||
ACPI_EXTERNAL_RETURN_STATUS(acpi_status acpi_unload_table_id(acpi_owner_id id))
|
||||
|
||||
ACPI_EXTERNAL_RETURN_STATUS(acpi_status
|
||||
acpi_get_table_with_size(acpi_string signature,
|
||||
u32 instance,
|
||||
|
@ -305,43 +305,51 @@ struct acpi_resource_source {
|
||||
u8 max_address_fixed; \
|
||||
union acpi_resource_attribute info;
|
||||
|
||||
struct acpi_resource_address {
|
||||
ACPI_RESOURCE_ADDRESS_COMMON};
|
||||
|
||||
struct acpi_resource_address16 {
|
||||
ACPI_RESOURCE_ADDRESS_COMMON u16 granularity;
|
||||
struct acpi_address16_attribute {
|
||||
u16 granularity;
|
||||
u16 minimum;
|
||||
u16 maximum;
|
||||
u16 translation_offset;
|
||||
u16 address_length;
|
||||
struct acpi_resource_source resource_source;
|
||||
};
|
||||
|
||||
struct acpi_resource_address32 {
|
||||
ACPI_RESOURCE_ADDRESS_COMMON u32 granularity;
|
||||
struct acpi_address32_attribute {
|
||||
u32 granularity;
|
||||
u32 minimum;
|
||||
u32 maximum;
|
||||
u32 translation_offset;
|
||||
u32 address_length;
|
||||
struct acpi_resource_source resource_source;
|
||||
};
|
||||
|
||||
struct acpi_resource_address64 {
|
||||
ACPI_RESOURCE_ADDRESS_COMMON u64 granularity;
|
||||
u64 minimum;
|
||||
u64 maximum;
|
||||
u64 translation_offset;
|
||||
u64 address_length;
|
||||
struct acpi_resource_source resource_source;
|
||||
};
|
||||
|
||||
struct acpi_resource_extended_address64 {
|
||||
ACPI_RESOURCE_ADDRESS_COMMON u8 revision_ID;
|
||||
struct acpi_address64_attribute {
|
||||
u64 granularity;
|
||||
u64 minimum;
|
||||
u64 maximum;
|
||||
u64 translation_offset;
|
||||
u64 address_length;
|
||||
};
|
||||
|
||||
struct acpi_resource_address {
|
||||
ACPI_RESOURCE_ADDRESS_COMMON};
|
||||
|
||||
struct acpi_resource_address16 {
|
||||
ACPI_RESOURCE_ADDRESS_COMMON struct acpi_address16_attribute address;
|
||||
struct acpi_resource_source resource_source;
|
||||
};
|
||||
|
||||
struct acpi_resource_address32 {
|
||||
ACPI_RESOURCE_ADDRESS_COMMON struct acpi_address32_attribute address;
|
||||
struct acpi_resource_source resource_source;
|
||||
};
|
||||
|
||||
struct acpi_resource_address64 {
|
||||
ACPI_RESOURCE_ADDRESS_COMMON struct acpi_address64_attribute address;
|
||||
struct acpi_resource_source resource_source;
|
||||
};
|
||||
|
||||
struct acpi_resource_extended_address64 {
|
||||
ACPI_RESOURCE_ADDRESS_COMMON u8 revision_ID;
|
||||
struct acpi_address64_attribute address;
|
||||
u64 type_specific;
|
||||
};
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user