]> begriffs open source - freertos/blob - FreeRTOS/Source/portable/ThirdParty/GCC/Xtensa_ESP32/xtensa_init.c
sync from github to svn: Xtensa GCC as-is.
[freertos] / FreeRTOS / Source / portable / ThirdParty / GCC / Xtensa_ESP32 / xtensa_init.c
1 /*******************************************************************************\r
2 // Copyright (c) 2003-2015 Cadence Design Systems, Inc.\r
3 //\r
4 // Permission is hereby granted, free of charge, to any person obtaining\r
5 // a copy of this software and associated documentation files (the\r
6 // "Software"), to deal in the Software without restriction, including\r
7 // without limitation the rights to use, copy, modify, merge, publish,\r
8 // distribute, sublicense, and/or sell copies of the Software, and to\r
9 // permit persons to whom the Software is furnished to do so, subject to\r
10 // the following conditions:\r
11 //\r
12 // The above copyright notice and this permission notice shall be included\r
13 // in all copies or substantial portions of the Software.\r
14 //\r
15 // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,\r
16 // EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF\r
17 // MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.\r
18 // IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY\r
19 // CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT,\r
20 // TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE\r
21 // SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.\r
22 --------------------------------------------------------------------------------\r
23 \r
24         XTENSA INITIALIZATION ROUTINES CODED IN C\r
25 \r
26 This file contains miscellaneous Xtensa RTOS-generic initialization functions\r
27 that are implemented in C.\r
28 \r
29 *******************************************************************************/\r
30 \r
31 \r
32 #ifdef XT_BOARD\r
33 #include    <xtensa/xtbsp.h>\r
34 #endif\r
35 \r
36 #include    "xtensa_rtos.h"\r
37 #include    "esp_clk.h"\r
38 \r
39 #ifdef XT_RTOS_TIMER_INT\r
40 \r
41 unsigned _xt_tick_divisor = 0;  /* cached number of cycles per tick */\r
42 \r
43 void _xt_tick_divisor_init(void)\r
44 {\r
45     _xt_tick_divisor = esp_clk_cpu_freq() / XT_TICK_PER_SEC;\r
46 }\r
47 \r
48 /* Deprecated, to be removed */\r
49 int xt_clock_freq(void)\r
50 {\r
51     return esp_clk_cpu_freq();\r
52 }\r
53 \r
54 #endif /* XT_RTOS_TIMER_INT */\r
55 \r