• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
1 /*
2  * Copyright (c) 2020 HiSilicon (Shanghai) Technologies CO., LIMITED.
3  * Licensed under the Apache License, Version 2.0 (the "License");
4  * you may not use this file except in compliance with the License.
5  * You may obtain a copy of the License at
6  *
7  *     http://www.apache.org/licenses/LICENSE-2.0
8  *
9  * Unless required by applicable law or agreed to in writing, software
10  * distributed under the License is distributed on an "AS IS" BASIS,
11  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
12  * See the License for the specific language governing permissions and
13  * limitations under the License.
14  * Description: osal debug adapt
15  * Author:
16  * Create: 2022-05-16
17  */
18 
19 
20 #include <los_printf.h>
21 #include <los_config.h>
22 #include <los_printf_pri.h>
23 #include "soc_osal.h"
24 #include "los_exc.h"
25 #include "std_def.h"
26 #include "platform_core.h"
27 
28 #ifdef SW_UART_DEBUG
29 #include "debug_print.h"
30 #endif
31 #ifdef TEST_SUITE
32 #include "test_suite_uart.h"
33 #endif
34 #if defined(SW_RTT_DEBUG)
35 #include "SEGGER_RTT.h"
36 #endif
37 
38 #ifndef SW_UART_CHIP_DEFINE
UartPuts(const CHAR * s,uint32_t len,BOOL isLock)39 void UartPuts(const CHAR *s, uint32_t len, BOOL isLock)
40 {
41     if ((s == NULL) || (strlen(s) == 0)) {
42         return;
43     }
44 
45     UNUSED(isLock);
46 #ifdef SW_UART_DEBUG
47     print_str(s);
48 #elif defined(TEST_SUITE)
49     test_suite_uart_send(s);
50 #elif defined(SW_RTT_DEBUG)
51     SEGGER_RTT_Write(0, (const char *)s, len);
52 #else
53     UNUSED(s);
54     UNUSED(len);
55 #endif
56 }
57 #endif
58 
osal_dcache_flush_all(void)59 void osal_dcache_flush_all(void)
60 {
61     ArchDCacheFlush();
62 }
63