lib: sbi_ecall: Add Kconfig option for each extension

For each SBI extension, we:

- Add a Kconfig option for it
- Add the extension to sbi_ecall_exts only if the extension is enabled
- Add the corresponding sbi_ecall_* object file only if the extension is
  enabled

Special cases are as follows:

- The legacy extensions are lumped together as one 'big' extension, as
  has always been the case in OpenSBI code.
- The platform-defined vendor extensions are regarded as one extension.
- The Base extension cannot be disabled.
- sbi_ecall_replace implements multiple extensions, so it's not easy to
  avoid linking it in. Enable it always, and use #ifdef to
  disable/enable individual extensions.

Signed-off-by: Vivian Wang <dramforever@live.com>
Reviewed-by: Andrew Jones <ajones@ventanamicro.com>
Reviewed-by: Anup Patel <anup@brainfault.org>
This commit is contained in:
Vivian Wang
2022-10-11 00:34:45 +08:00
committed by Anup Patel
parent 56bed1a0fe
commit 22f38ee6c6
4 changed files with 59 additions and 12 deletions

View File

@@ -16,22 +16,22 @@ libsbi-objs-y += sbi_ecall.o
libsbi-objs-y += sbi_ecall_exts.o
# The order of below extensions is performance optimized
carray-sbi_ecall_exts-y += ecall_time
carray-sbi_ecall_exts-y += ecall_rfence
carray-sbi_ecall_exts-y += ecall_ipi
carray-sbi_ecall_exts-$(CONFIG_SBI_ECALL_TIME) += ecall_time
carray-sbi_ecall_exts-$(CONFIG_SBI_ECALL_RFENCE) += ecall_rfence
carray-sbi_ecall_exts-$(CONFIG_SBI_ECALL_IPI) += ecall_ipi
carray-sbi_ecall_exts-y += ecall_base
carray-sbi_ecall_exts-y += ecall_hsm
carray-sbi_ecall_exts-y += ecall_srst
carray-sbi_ecall_exts-y += ecall_pmu
carray-sbi_ecall_exts-y += ecall_legacy
carray-sbi_ecall_exts-y += ecall_vendor
carray-sbi_ecall_exts-$(CONFIG_SBI_ECALL_HSM) += ecall_hsm
carray-sbi_ecall_exts-$(CONFIG_SBI_ECALL_SRST) += ecall_srst
carray-sbi_ecall_exts-$(CONFIG_SBI_ECALL_PMU) += ecall_pmu
carray-sbi_ecall_exts-$(CONFIG_SBI_ECALL_LEGACY) += ecall_legacy
carray-sbi_ecall_exts-$(CONFIG_SBI_ECALL_VENDOR) += ecall_vendor
libsbi-objs-y += sbi_ecall_base.o
libsbi-objs-y += sbi_ecall_hsm.o
libsbi-objs-y += sbi_ecall_legacy.o
libsbi-objs-y += sbi_ecall_pmu.o
libsbi-objs-$(CONFIG_SBI_ECALL_HSM) += sbi_ecall_hsm.o
libsbi-objs-$(CONFIG_SBI_ECALL_LEGACY) += sbi_ecall_legacy.o
libsbi-objs-$(CONFIG_SBI_ECALL_PMU) += sbi_ecall_pmu.o
libsbi-objs-y += sbi_ecall_replace.o
libsbi-objs-y += sbi_ecall_vendor.o
libsbi-objs-$(CONFIG_SBI_ECALL_VENDOR) += sbi_ecall_vendor.o
libsbi-objs-y += sbi_bitmap.o
libsbi-objs-y += sbi_bitops.o