mirror of
https://github.com/Fishwaldo/opensbi.git
synced 2025-03-21 06:11:30 +00:00
include: sbi_console: Remove scratch parameter from sbi_dprintf()
This patch removes scratch parameter from sbi_dprintf() function because sbi_dprintf() can use sbi_scratch_thishart_ptr() to get current HART scratch space. Signed-off-by: Anup Patel <anup.patel@wdc.com> Reviewed-by: Atish Patra <atish.patra@wdc.com>
This commit is contained in:
parent
0a28ea54dc
commit
648507a867
4 changed files with 10 additions and 12 deletions
|
@ -30,10 +30,9 @@ int __printf(3, 4) sbi_snprintf(char *out, u32 out_sz, const char *format, ...);
|
||||||
|
|
||||||
int __printf(1, 2) sbi_printf(const char *format, ...);
|
int __printf(1, 2) sbi_printf(const char *format, ...);
|
||||||
|
|
||||||
struct sbi_scratch;
|
int __printf(1, 2) sbi_dprintf(const char *format, ...);
|
||||||
|
|
||||||
int __printf(2, 3) sbi_dprintf(struct sbi_scratch *scratch,
|
struct sbi_scratch;
|
||||||
const char *format, ...);
|
|
||||||
|
|
||||||
int sbi_console_init(struct sbi_scratch *scratch);
|
int sbi_console_init(struct sbi_scratch *scratch);
|
||||||
|
|
||||||
|
|
|
@ -7,9 +7,10 @@
|
||||||
* Anup Patel <anup.patel@wdc.com>
|
* Anup Patel <anup.patel@wdc.com>
|
||||||
*/
|
*/
|
||||||
|
|
||||||
#include <sbi/sbi_platform.h>
|
|
||||||
#include <sbi/sbi_console.h>
|
|
||||||
#include <sbi/riscv_locks.h>
|
#include <sbi/riscv_locks.h>
|
||||||
|
#include <sbi/sbi_console.h>
|
||||||
|
#include <sbi/sbi_platform.h>
|
||||||
|
#include <sbi/sbi_scratch.h>
|
||||||
|
|
||||||
static const struct sbi_platform *console_plat = NULL;
|
static const struct sbi_platform *console_plat = NULL;
|
||||||
static spinlock_t console_out_lock = SPIN_LOCK_INITIALIZER;
|
static spinlock_t console_out_lock = SPIN_LOCK_INITIALIZER;
|
||||||
|
@ -375,10 +376,11 @@ int sbi_printf(const char *format, ...)
|
||||||
return retval;
|
return retval;
|
||||||
}
|
}
|
||||||
|
|
||||||
int sbi_dprintf(struct sbi_scratch *scratch, const char *format, ...)
|
int sbi_dprintf(const char *format, ...)
|
||||||
{
|
{
|
||||||
va_list args;
|
va_list args;
|
||||||
int retval = 0;
|
int retval = 0;
|
||||||
|
struct sbi_scratch *scratch = sbi_scratch_thishart_ptr();
|
||||||
|
|
||||||
va_start(args, format);
|
va_start(args, format);
|
||||||
if (scratch->options & SBI_SCRATCH_DEBUG_PRINTS)
|
if (scratch->options & SBI_SCRATCH_DEBUG_PRINTS)
|
||||||
|
|
|
@ -13,7 +13,6 @@
|
||||||
#include <sbi/sbi_console.h>
|
#include <sbi/sbi_console.h>
|
||||||
#include <sbi/sbi_emulate_csr.h>
|
#include <sbi/sbi_emulate_csr.h>
|
||||||
#include <sbi/sbi_error.h>
|
#include <sbi/sbi_error.h>
|
||||||
#include <sbi/sbi_scratch.h>
|
|
||||||
#include <sbi/sbi_timer.h>
|
#include <sbi/sbi_timer.h>
|
||||||
#include <sbi/sbi_trap.h>
|
#include <sbi/sbi_trap.h>
|
||||||
|
|
||||||
|
@ -111,8 +110,7 @@ int sbi_emulate_csr_read(int csr_num, struct sbi_trap_regs *regs,
|
||||||
};
|
};
|
||||||
|
|
||||||
if (ret)
|
if (ret)
|
||||||
sbi_dprintf(sbi_scratch_thishart_ptr(),
|
sbi_dprintf("%s: hartid%d: invalid csr_num=0x%x\n",
|
||||||
"%s: hartid%d: invalid csr_num=0x%x\n",
|
|
||||||
__func__, current_hartid(), csr_num);
|
__func__, current_hartid(), csr_num);
|
||||||
|
|
||||||
return ret;
|
return ret;
|
||||||
|
@ -180,8 +178,7 @@ int sbi_emulate_csr_write(int csr_num, struct sbi_trap_regs *regs,
|
||||||
};
|
};
|
||||||
|
|
||||||
if (ret)
|
if (ret)
|
||||||
sbi_dprintf(sbi_scratch_thishart_ptr(),
|
sbi_dprintf("%s: hartid%d: invalid csr_num=0x%x\n",
|
||||||
"%s: hartid%d: invalid csr_num=0x%x\n",
|
|
||||||
__func__, current_hartid(), csr_num);
|
__func__, current_hartid(), csr_num);
|
||||||
|
|
||||||
return ret;
|
return ret;
|
||||||
|
|
|
@ -359,7 +359,7 @@ static int sbi_tlb_update(struct sbi_scratch *scratch,
|
||||||
* this properly.
|
* this properly.
|
||||||
*/
|
*/
|
||||||
sbi_tlb_process_count(scratch, 1);
|
sbi_tlb_process_count(scratch, 1);
|
||||||
sbi_dprintf(remote_scratch, "hart%d: hart%d tlb fifo full\n",
|
sbi_dprintf("hart%d: hart%d tlb fifo full\n",
|
||||||
curr_hartid, remote_hartid);
|
curr_hartid, remote_hartid);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Add table
Reference in a new issue