2
0

retarget.c 1.6 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182
  1. /* retarget.c
  2. *
  3. * Copyright (C) 2006-2015 wolfSSL Inc.
  4. *
  5. * This file is part of wolfSSL. (formerly known as CyaSSL)
  6. *
  7. * wolfSSL 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 2 of the License, or
  10. * (at your option) any later version.
  11. *
  12. * wolfSSL 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 this program; if not, write to the Free Software
  19. * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA
  20. */
  21. #include "hw.h"
  22. double current_time(int reset)
  23. {
  24. double time;
  25. time = hw_get_time_sec();
  26. time += (double)hw_get_time_msec() / 1000;
  27. return time;
  28. }
  29. uint32_t custom_rand_generate(void)
  30. {
  31. return hw_rand();
  32. }
  33. // Debug print handler
  34. int __putchar(int c, __printf_tag_ptr ctx)
  35. {
  36. hw_uart_printchar(c);
  37. }
  38. extern unsigned char __stack_process_start__[];
  39. unsigned char * __aeabi_read_tp(void)
  40. {
  41. // thread-local storage addressing refers to the thread pointer
  42. // This is returning start address of stack process
  43. return (__stack_process_start__);
  44. }
  45. /* Stubs */
  46. void __heap_lock(void)
  47. {
  48. }
  49. void __heap_unlock(void)
  50. {
  51. }
  52. void __printf_lock(void)
  53. {
  54. }
  55. void __printf_unlock(void)
  56. {
  57. }
  58. void __scanf_lock(void)
  59. {
  60. }
  61. void __scanf_unlock(void)
  62. {
  63. }
  64. void __debug_io_lock(void)
  65. {
  66. }
  67. void __debug_io_unlock(void)
  68. {
  69. }