summaryrefslogtreecommitdiff
path: root/docs
diff options
context:
space:
mode:
authorAbner Chang <abner.chang@hpe.com>2020-01-08 07:54:34 +0300
committerAnup Patel <anup@brainfault.org>2020-01-09 07:39:44 +0300
commitb28b8ac0d2ac99b99362d6052af9a507757469c9 (patch)
treefc1a056fb28d8a330d5663317d8da0f18de54626 /docs
parente340bbf7b5be2fbb79b2358821e77af77257db5e (diff)
downloadopensbi-b28b8ac0d2ac99b99362d6052af9a507757469c9.tar.xz
docs: Add description of using OPENSBI_EXTERNAL_SBI_TYPES
Add description of using OPENSBI_EXTERNAL_SBI_TYPES in external firmware code base. Signed-off-by: Abner Chang <abner.chang@hpe.com> Cc: Leif Lindholm <leif.lindholm@linaro.org> Reviewed-by: Anup Patel <anup.patel@wdc.com>
Diffstat (limited to 'docs')
-rw-r--r--docs/library_usage.md21
1 files changed, 21 insertions, 0 deletions
diff --git a/docs/library_usage.md b/docs/library_usage.md
index d765fa9..ff99801 100644
--- a/docs/library_usage.md
+++ b/docs/library_usage.md
@@ -66,3 +66,24 @@ bootloader to service the following interrupts and traps:
**Note:** external firmwares or bootloaders can be more conservative by
forwarding all traps and interrupts to *sbi_trap_handler()*.
+
+Definitions of OpenSBI Data Types for the External Firmware
+-----------------------------------------------------------
+
+OpenSBI can be built as library using external firmware build system such as EDK2
+code base (The open source of UEFI firmware implementation) and linked with external
+firmware drivers based on the external firmware architecture.
+
+**OPENSBI_EXTERNAL_SBI_TYPES** identifier is introduced to *sbi_types.h* for selecting
+external header file during the build preprocess in order to define OpensSBI data types
+based on external firmware data type binding.
+For example, *bool* is declared as *int* in sbi_types.h. However in EDK2 build system,
+*bool* is declared as *BOOLEAN* which is defined as *unsigned char* data type.
+
+External firmware can define **OPENSBI_EXTERNAL_SBI_TYPES** in CFLAGS and specify it to the
+header file maintained in its code tree. However, the external build system has to address
+the additional include directory for the external header file based on its own build system.
+For example,
+*-D***OPENSBI_EXTERNAL_SBI_TYPES***=OpensbiTypes.h*
+Above tells *sbi_types.h* to refer to *OpensbiTypes.h* instead of using original definitions of
+data types.