os_log.c 531 B

123456789101112131415161718192021222324252627282930
  1. /*
  2. * functions for handling OS log buffer
  3. *
  4. * Copyright (c) 2009 Analog Devices Inc.
  5. *
  6. * Licensed under the 2-clause BSD.
  7. */
  8. #include <common.h>
  9. #define OS_LOG_MAGIC 0xDEADBEEF
  10. #define OS_LOG_MAGIC_ADDR ((unsigned long *)0x4f0)
  11. #define OS_LOG_PTR_ADDR ((char **)0x4f4)
  12. int bfin_os_log_check(void)
  13. {
  14. if (*OS_LOG_MAGIC_ADDR != OS_LOG_MAGIC)
  15. return 0;
  16. *OS_LOG_MAGIC_ADDR = 0;
  17. return 1;
  18. }
  19. void bfin_os_log_dump(void)
  20. {
  21. char *log = *OS_LOG_PTR_ADDR;
  22. while (*log) {
  23. puts(log);
  24. log += strlen(log) + 1;
  25. }
  26. }