kmlog.h 1.3 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364
  1. /* include/kernel/kernel.h
  2. *
  3. * Copyright (C) 2021, 2022 intirain.
  4. *
  5. * This file is part of evx.
  6. *
  7. * evx is free software: you can redistribute it and/or modify
  8. * it under the terms of the GNU General Public License as published by
  9. * the Free Software Foundation, either version 3 of the License, or
  10. * (at your option) any later version.
  11. *
  12. * evx is distributed in the hope that it will be useful,
  13. * but WITHOUT ANY WARRANTY; without even the implied warranty of
  14. * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
  15. * GNU General Public License for more details.
  16. *
  17. * You should have received a copy of the GNU General Public License
  18. * along with evx. If not, see <https://www.gnu.org/licenses/>
  19. */
  20. #ifndef __KMLOG_H
  21. #define __KMLOG_H
  22. #ifndef __ASSEMBLER__
  23. #include <sys/types.h>
  24. #include <config.h>
  25. #include <stdarg.h>
  26. int kmlog(char *buf, ...);
  27. /* i think this is enough in kernel and not so big, because kernel
  28. * heap in x86 has 512k+ */
  29. #define KMLOG_SIZE 32768
  30. extern char *kmlog_buf;
  31. extern int kmlog_index;
  32. #define KERN_DEBUG "#0"
  33. #define KERN_INFO "#1"
  34. #define KERN_NOTICE "#2"
  35. #define KERN_WARN "#3"
  36. #define KERN_ERR "#4"
  37. #define KERN_EMERG "#5"
  38. #define KERN_ABANDON "#6"
  39. #ifndef CONFIG_KMLOG_LEVEL
  40. #define KMLOG_LEVEL -1
  41. #else
  42. #define KMLOG_LEVEL CONFIG_KMLOG_LEVEL
  43. #endif
  44. #endif
  45. #endif