/** Free-up extra space in sbi_scratch */
void sbi_scratch_free_offset(unsigned long offset);
+/** Amount (in bytes) of used space in in sbi_scratch */
+unsigned long sbi_scratch_used_space(void);
+
/** Get pointer from offset in sbi_scratch */
#define sbi_scratch_offset_ptr(scratch, offset) (void *)((char *)(scratch) + (offset))
(u32)(sbi_heap_reserved_space() / 1024),
(u32)(sbi_heap_used_space() / 1024),
(u32)(sbi_heap_free_space() / 1024));
+ sbi_printf("Firmware Scratch Size : "
+ "%d B (total), %d B (used), %d B (free)\n",
+ SBI_SCRATCH_SIZE,
+ (u32)sbi_scratch_used_space(),
+ (u32)(SBI_SCRATCH_SIZE - sbi_scratch_used_space()));
/* SBI details */
sbi_printf("Runtime SBI Version : %d.%d\n",