On Mon, Jul 25, 2022 at 5:11 PM Darius Rad <darius@...> wrote:
On Mon, Jul 25, 2022 at 10:04:52AM +0530, Anup Patel wrote:
It is really necessary to have two long parameters for a physical address
Function: Console Puts (FID #0)
struct sbiret sbi_debug_console_puts(unsigned long addr_lo,
unsigned long addr_hi,
unsigned long num_chars)
Print a specified input string on the debug console.
The physical base address and size of the string to be printed is
derived from parameters as follows:
1) `addr_lo` parameter specifies the lower XLEN bits of the string
physical base address.
2) `addr_hi` parameter specifies the string physical base address
right shifted by XLEN.
on RV64? Clearly this is necessary for RV32, where the maximum physical
address is greater than XLEN, but that is not the case for RV64.
Why not use long long, which is 8 bytes on both RV32 and RV64 (on the
respective ABIs, that is)? Or use a different function signature for RV32
and RV64, with two parameters for the former and one for the latter?
For SBI spec, we have avoided separate function signatures for RV32
and RV64 so better to prefer other options.
If we want to combine "addr_lo" and "addr_hi" into one parameter then
uint64_t is better and consistent with other parts of SBI spec as well.
3) `num_chars` parameter specifies the size of the string as the// darius
number of characters (or bytes).