From 924a26d82fd948318619c6645865eaa0691640f9 Mon Sep 17 00:00:00 2001 From: Anup Patel Date: Mon, 14 Jan 2019 14:00:32 +0530 Subject: [PATCH] include: Add documentation for sbi_scratch and friends This patch adds doxygen style documentation for struct sbi_scratch and related helper macros/defines. Signed-off-by: Anup Patel --- include/sbi/sbi_scratch.h | 22 ++++++++++++++++++++++ 1 file changed, 22 insertions(+) diff --git a/include/sbi/sbi_scratch.h b/include/sbi/sbi_scratch.h index 25b00c32..ace1a0de 100644 --- a/include/sbi/sbi_scratch.h +++ b/include/sbi/sbi_scratch.h @@ -12,36 +12,58 @@ #include +/** Offset of fw_start member in sbi_scratch */ #define SBI_SCRATCH_FW_START_OFFSET (0 * __SIZEOF_POINTER__) +/** Offset of fw_size member in sbi_scratch */ #define SBI_SCRATCH_FW_SIZE_OFFSET (1 * __SIZEOF_POINTER__) +/** Offset of next_arg1 member in sbi_scratch */ #define SBI_SCRATCH_NEXT_ARG1_OFFSET (2 * __SIZEOF_POINTER__) +/** Offset of next_addr member in sbi_scratch */ #define SBI_SCRATCH_NEXT_ADDR_OFFSET (3 * __SIZEOF_POINTER__) +/** Offset of next_mode member in sbi_scratch */ #define SBI_SCRATCH_NEXT_MODE_OFFSET (4 * __SIZEOF_POINTER__) +/** Offset of warmboot_addr member in sbi_scratch */ #define SBI_SCRATCH_WARMBOOT_ADDR_OFFSET (5 * __SIZEOF_POINTER__) +/** Offset of platform_addr member in sbi_scratch */ #define SBI_SCRATCH_PLATFORM_ADDR_OFFSET (6 * __SIZEOF_POINTER__) +/** Offset of hartid_to_scratch member in sbi_scratch */ #define SBI_SCRATCH_HARTID_TO_SCRATCH_OFFSET (7 * __SIZEOF_POINTER__) +/** Offset of ipi_type member in sbi_scratch */ #define SBI_SCRATCH_IPI_TYPE_OFFSET (8 * __SIZEOF_POINTER__) +/** Maximum size of sbi_scratch */ #define SBI_SCRATCH_SIZE 256 #ifndef __ASSEMBLY__ #include +/** Representation of per-HART scratch space */ struct sbi_scratch { + /** Start (or base) address of firmware linked to OpenSBI library */ unsigned long fw_start; + /** Size (in bytes) of firmware linked to OpenSBI library */ unsigned long fw_size; + /** Arg1 (or 'a1' register) of next booting stage for this HART */ unsigned long next_arg1; + /** Address of next booting stage for this HART */ unsigned long next_addr; + /** Priviledge mode of next booting stage for this HART */ unsigned long next_mode; + /** Warm boot entry point address for this HART */ unsigned long warmboot_addr; + /** Address of sbi_platform */ unsigned long platform_addr; + /** Address of HART ID to sbi_scratch conversion function */ unsigned long hartid_to_scratch; + /** IPI type (or flags) */ unsigned long ipi_type; } __attribute__((packed)); +/** Get pointer to sbi_scratch for current HART */ #define sbi_scratch_thishart_ptr() \ ((struct sbi_scratch *)csr_read(mscratch)) +/** Get Arg1 of next booting stage for current HART */ #define sbi_scratch_thishart_arg1_ptr() \ ((void *)(sbi_scratch_thishart_ptr()->next_arg1))