kmlog.h 1.3 KB

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