sbi_console.h 767 B

123456789101112131415161718192021222324252627282930313233343536
  1. /*
  2. * SPDX-License-Identifier: BSD-2-Clause
  3. *
  4. * Copyright (c) 2019 Western Digital Corporation or its affiliates.
  5. *
  6. * Authors:
  7. * Anup Patel <anup.patel@wdc.com>
  8. */
  9. #ifndef __SBI_CONSOLE_H__
  10. #define __SBI_CONSOLE_H__
  11. #include <sbi/sbi_types.h>
  12. #define __printf(a, b) __attribute__((format(printf, a, b)))
  13. bool sbi_isprintable(char ch);
  14. int sbi_getc(void);
  15. void sbi_putc(char ch);
  16. void sbi_puts(const char *str);
  17. void sbi_gets(char *s, int maxwidth, char endchar);
  18. int __printf(2, 3) sbi_sprintf(char *out, const char *format, ...);
  19. int __printf(3, 4) sbi_snprintf(char *out, u32 out_sz, const char *format, ...);
  20. int __printf(1, 2) sbi_printf(const char *format, ...);
  21. struct sbi_scratch;
  22. int sbi_console_init(struct sbi_scratch *scratch);
  23. #endif