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: 系统适配层标准输出接口实现(此文件为DEMO,需集成方适配修改)
15 */
16
17 #include "hilink_stdio_adapter.h"
18 #include <stddef.h>
19 #include <stdlib.h>
20 #include <los_printf.h>
21 #include <los_config.h>
22 #include <los_printf_pri.h>
23 #include "securec.h"
24 #include "hilink_sal_defines.h"
25
HILINK_Vprintf(const char * format,va_list ap)26 int HILINK_Vprintf(const char *format, va_list ap)
27 {
28 ConsoleVprintf(format, ap); // 此接口无返回值
29 return HILINK_SAL_OK;
30 }
31
HILINK_Printf(const char * format,...)32 int HILINK_Printf(const char *format, ...)
33 {
34 if (format == NULL) {
35 return HILINK_SAL_OK;
36 }
37 va_list ap;
38 va_start(ap, format);
39 int ret = HILINK_Vprintf(format, ap);
40 va_end(ap);
41
42 return ret;
43 }
44
HILINK_Rand(unsigned char * input,unsigned int len)45 int HILINK_Rand(unsigned char *input, unsigned int len)
46 {
47 (void)input;
48 (void)len;
49 return HILINK_SAL_NOK;
50 }
51
HILINK_Trng(unsigned char * input,unsigned int len)52 int HILINK_Trng(unsigned char *input, unsigned int len)
53 {
54 (void)input;
55 (void)len;
56 return HILINK_SAL_NOK;
57 }