diff options
author | Felix Held <felix-coreboot@felixheld.de> | 2023-05-27 01:02:37 +0200 |
---|---|---|
committer | Felix Held <felix-coreboot@felixheld.de> | 2023-05-30 16:05:35 +0000 |
commit | 0fdede09e0c142cce63579cd8b916c03bd48bb84 (patch) | |
tree | 924a204695f80fb83e3734338a546e99b518ac57 /src | |
parent | bc069ea6b3904e8bde0b7b7b93f7bfad156ee4b3 (diff) |
acpi/acpigen: rename and clarify bus/IO/MMIO resource producer functions
The acpigen_resource_[bus_number,io,mmio*] functions didn't make it very
clear that they are generating resource producer ranges and not resource
consumer ranges. To clarify this, change the function names to
acpigen_resource_producer_[bus_number,io,mmio*] and explicitly add the
ADDR_SPACE_GENERAL_FLAG_PRODUCER flag which evaluates to 0, so this
doesn't change the functionality.
Signed-off-by: Felix Held <felix-coreboot@felixheld.de>
Change-Id: I334f38aa8ab418d5577f92b980ff750504e2bb4e
Reviewed-on: https://review.coreboot.org/c/coreboot/+/75486
Tested-by: build bot (Jenkins) <no-reply@coreboot.org>
Reviewed-by: Tim Wawrzynczak <inforichland@gmail.com>
Diffstat (limited to 'src')
-rw-r--r-- | src/acpi/acpigen.c | 26 | ||||
-rw-r--r-- | src/include/acpi/acpigen.h | 6 |
2 files changed, 18 insertions, 14 deletions
diff --git a/src/acpi/acpigen.c b/src/acpi/acpigen.c index 7118d1ceec..21b8ac1504 100644 --- a/src/acpi/acpigen.c +++ b/src/acpi/acpigen.c @@ -2226,12 +2226,13 @@ void acpigen_resource_qword(u16 res_type, u16 gen_flags, u16 type_flags, u64 gra acpigen_emit_qword(length); } -void acpigen_resource_bus_number(u16 bus_base, u16 bus_limit) +void acpigen_resource_producer_bus_number(u16 bus_base, u16 bus_limit) { acpigen_resource_word(RSRC_TYPE_BUS, /* res_type */ ADDR_SPACE_GENERAL_FLAG_MAX_FIXED | ADDR_SPACE_GENERAL_FLAG_MIN_FIXED - | ADDR_SPACE_GENERAL_FLAG_DEC_POS, /* gen_flags */ + | ADDR_SPACE_GENERAL_FLAG_DEC_POS + | ADDR_SPACE_GENERAL_FLAG_PRODUCER, /* gen_flags */ BUS_NUM_RANGE_RESOURCE_FLAG, /* type_flags */ 0, /* gran */ bus_base, /* range_min */ @@ -2240,12 +2241,13 @@ void acpigen_resource_bus_number(u16 bus_base, u16 bus_limit) bus_limit - bus_base + 1); /* length */ } -void acpigen_resource_io(u16 io_base, u16 io_limit) +void acpigen_resource_producer_io(u16 io_base, u16 io_limit) { acpigen_resource_word(RSRC_TYPE_IO, /* res_type */ ADDR_SPACE_GENERAL_FLAG_MAX_FIXED | ADDR_SPACE_GENERAL_FLAG_MIN_FIXED - | ADDR_SPACE_GENERAL_FLAG_DEC_POS, /* gen_flags */ + | ADDR_SPACE_GENERAL_FLAG_DEC_POS + | ADDR_SPACE_GENERAL_FLAG_PRODUCER, /* gen_flags */ IO_RSRC_FLAG_ENTIRE_RANGE, /* type_flags */ 0, /* gran */ io_base, /* range_min */ @@ -2254,12 +2256,13 @@ void acpigen_resource_io(u16 io_base, u16 io_limit) io_limit - io_base + 1); /* length */ } -static void acpigen_resource_mmio32(u32 mmio_base, u32 mmio_limit, u16 type_flags) +static void acpigen_resource_producer_mmio32(u32 mmio_base, u32 mmio_limit, u16 type_flags) { acpigen_resource_dword(RSRC_TYPE_MEM, /* res_type */ ADDR_SPACE_GENERAL_FLAG_MAX_FIXED | ADDR_SPACE_GENERAL_FLAG_MIN_FIXED - | ADDR_SPACE_GENERAL_FLAG_DEC_POS, /* gen_flags */ + | ADDR_SPACE_GENERAL_FLAG_DEC_POS + | ADDR_SPACE_GENERAL_FLAG_PRODUCER, /* gen_flags */ type_flags, /* type_flags */ 0, /* gran */ mmio_base, /* range_min */ @@ -2268,12 +2271,13 @@ static void acpigen_resource_mmio32(u32 mmio_base, u32 mmio_limit, u16 type_flag mmio_limit - mmio_base + 1); /* length */ } -static void acpigen_resource_mmio64(u64 mmio_base, u64 mmio_limit, u16 type_flags) +static void acpigen_resource_producer_mmio64(u64 mmio_base, u64 mmio_limit, u16 type_flags) { acpigen_resource_qword(RSRC_TYPE_MEM, /* res_type */ ADDR_SPACE_GENERAL_FLAG_MAX_FIXED | ADDR_SPACE_GENERAL_FLAG_MIN_FIXED - | ADDR_SPACE_GENERAL_FLAG_DEC_POS, /* gen_flags */ + | ADDR_SPACE_GENERAL_FLAG_DEC_POS + | ADDR_SPACE_GENERAL_FLAG_PRODUCER, /* gen_flags */ type_flags, /* type_flags */ 0, /* gran */ mmio_base, /* range_min */ @@ -2282,12 +2286,12 @@ static void acpigen_resource_mmio64(u64 mmio_base, u64 mmio_limit, u16 type_flag mmio_limit - mmio_base + 1); /* length */ } -void acpigen_resource_mmio(u64 mmio_base, u64 mmio_limit, u16 type_flags) +void acpigen_resource_producer_mmio(u64 mmio_base, u64 mmio_limit, u16 type_flags) { if (mmio_base < 4ULL * GiB && mmio_limit < 4ULL * GiB) - acpigen_resource_mmio32(mmio_base, mmio_limit, type_flags); + acpigen_resource_producer_mmio32(mmio_base, mmio_limit, type_flags); else - acpigen_resource_mmio64(mmio_base, mmio_limit, type_flags); + acpigen_resource_producer_mmio64(mmio_base, mmio_limit, type_flags); } void acpigen_write_ADR(uint64_t adr) diff --git a/src/include/acpi/acpigen.h b/src/include/acpi/acpigen.h index 2147990944..346ae73408 100644 --- a/src/include/acpi/acpigen.h +++ b/src/include/acpi/acpigen.h @@ -688,9 +688,9 @@ void acpigen_resource_dword(u16 res_type, u16 gen_flags, u16 type_flags, void acpigen_resource_qword(u16 res_type, u16 gen_flags, u16 type_flags, u64 gran, u64 range_min, u64 range_max, u64 translation, u64 length); -void acpigen_resource_bus_number(u16 bus_base, u16 bus_limit); -void acpigen_resource_io(u16 io_base, u16 io_limit); -void acpigen_resource_mmio(u64 mmio_base, u64 mmio_limit, u16 type_flags); +void acpigen_resource_producer_bus_number(u16 bus_base, u16 bus_limit); +void acpigen_resource_producer_io(u16 io_base, u16 io_limit); +void acpigen_resource_producer_mmio(u64 mmio_base, u64 mmio_limit, u16 type_flags); /* Emits Notify(namestr, value) */ void acpigen_notify(const char *namestr, int value); |