libstdcpp.cpp 586 B

12345678910111213141516171819202122232425262728
  1. #include <asm/port_io.h>
  2. #include <assert.h>
  3. #include <kernel/log.hpp>
  4. #include <kernel/process.hpp>
  5. #include <stdio.h>
  6. #include <types/types.h>
  7. extern "C" void NORETURN __stack_chk_fail(void)
  8. {
  9. assert(false);
  10. for (;;) ;
  11. }
  12. extern "C" void NORETURN __cxa_pure_virtual(void)
  13. {
  14. assert(false);
  15. for (;;) ;
  16. }
  17. void NORETURN
  18. __assert_fail(const char* statement, const char* file, int line, const char* func)
  19. {
  20. char buf[256];
  21. snprintf(buf, sizeof(buf), "Kernel assertion failed: (%s), %s:%d, %s\n",
  22. statement, file, line, func);
  23. kmsg(buf);
  24. freeze();
  25. }