diff options
| author | Anup Patel <[email protected]> | 2019-01-14 13:58:29 +0530 |
|---|---|---|
| committer | Anup Patel <[email protected]> | 2019-01-16 11:25:25 +0530 |
| commit | 5f097cbf0715e217cd2fb67731b10ec9a54ed4f3 (patch) | |
| tree | 7c8527fa2bc85bd0373d6429b8745cab5fc62d05 | |
| parent | 5ef104062d52e9c5aeab7bc0d1eaa7e7e6d86ff3 (diff) | |
lib: Add documentation for sbi_init() API
This patch adds doxygen style documentation for sbi_init() API.
Signed-off-by: Anup Patel <[email protected]>
| -rw-r--r-- | include/sbi/sbi_init.h | 2 | ||||
| -rw-r--r-- | lib/sbi_init.c | 19 |
2 files changed, 15 insertions, 6 deletions
diff --git a/include/sbi/sbi_init.h b/include/sbi/sbi_init.h index b3aafdc1..7c4267ba 100644 --- a/include/sbi/sbi_init.h +++ b/include/sbi/sbi_init.h @@ -14,6 +14,6 @@ struct sbi_scratch; -void __attribute__((noreturn)) sbi_init(struct sbi_scratch *scratch); +void __noreturn sbi_init(struct sbi_scratch *scratch); #endif diff --git a/lib/sbi_init.c b/lib/sbi_init.c index f9429719..b0d44941 100644 --- a/lib/sbi_init.c +++ b/lib/sbi_init.c @@ -27,8 +27,7 @@ static const char *logo = " | |\n" " |_|\n"; -static void __attribute__((noreturn)) init_coldboot(struct sbi_scratch *scratch, - u32 hartid) +static void __noreturn init_coldboot(struct sbi_scratch *scratch, u32 hartid) { int rc; char str[64]; @@ -93,8 +92,7 @@ static void __attribute__((noreturn)) init_coldboot(struct sbi_scratch *scratch, scratch->next_addr, scratch->next_mode); } -static void __attribute__((noreturn)) init_warmboot(struct sbi_scratch *scratch, - u32 hartid) +static void __noreturn init_warmboot(struct sbi_scratch *scratch, u32 hartid) { int rc; struct sbi_platform *plat = sbi_platform_ptr(scratch); @@ -141,7 +139,18 @@ static void __attribute__((noreturn)) init_warmboot(struct sbi_scratch *scratch, static atomic_t coldboot_lottery = ATOMIC_INITIALIZER(0); -void __attribute__((noreturn)) sbi_init(struct sbi_scratch *scratch) +/** + * Initialize OpenSBI library for current HART and jump to next + * booting stage. + * + * The function expects following: + * 1. The 'mscratch' CSR is pointing to sbi_scratch of current HART + * 2. Stack pointer (SP) is setup for current HART + * 3. All interrupts are disabled in MIE CSR except MSIP + * + * @param scratch pointer to sbi_scratch of current HART + */ +void __noreturn sbi_init(struct sbi_scratch *scratch) { bool coldboot = FALSE; u32 hartid = sbi_current_hartid(); |
