147c9fbaeSopenharmony_ci/* 247c9fbaeSopenharmony_ci * Copyright (c) 2021 Huawei Device Co., Ltd. 347c9fbaeSopenharmony_ci * Licensed under the Apache License, Version 2.0 (the "License"); 447c9fbaeSopenharmony_ci * you may not use this file except in compliance with the License. 547c9fbaeSopenharmony_ci * You may obtain a copy of the License at 647c9fbaeSopenharmony_ci * 747c9fbaeSopenharmony_ci * http://www.apache.org/licenses/LICENSE-2.0 847c9fbaeSopenharmony_ci * 947c9fbaeSopenharmony_ci * Unless required by applicable law or agreed to in writing, software 1047c9fbaeSopenharmony_ci * distributed under the License is distributed on an "AS IS" BASIS, 1147c9fbaeSopenharmony_ci * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 1247c9fbaeSopenharmony_ci * See the License for the specific language governing permissions and 1347c9fbaeSopenharmony_ci * limitations under the License. 1447c9fbaeSopenharmony_ci */ 1547c9fbaeSopenharmony_ci 1647c9fbaeSopenharmony_ci#ifndef BLACKBOX_ADAPTER_H 1747c9fbaeSopenharmony_ci#define BLACKBOX_ADAPTER_H 1847c9fbaeSopenharmony_ci 1947c9fbaeSopenharmony_ci#include <stdio.h> 2047c9fbaeSopenharmony_ci#include <stdlib.h> 2147c9fbaeSopenharmony_ci 2247c9fbaeSopenharmony_ci#ifdef __cplusplus 2347c9fbaeSopenharmony_ci#if __cplusplus 2447c9fbaeSopenharmony_ciextern "C" { 2547c9fbaeSopenharmony_ci#endif /* End of #if __cplusplus */ 2647c9fbaeSopenharmony_ci#endif /* End of #ifdef __cplusplus */ 2747c9fbaeSopenharmony_ci 2847c9fbaeSopenharmony_ci#ifndef WEAK 2947c9fbaeSopenharmony_ci#define WEAK __attribute__((weak)) 3047c9fbaeSopenharmony_ci#endif 3147c9fbaeSopenharmony_ci 3247c9fbaeSopenharmony_ci/* The following functions need to be implemented by yourself */ 3347c9fbaeSopenharmony_ciextern void SystemModuleDump(const char *logDir, struct ErrorInfo *info); 3447c9fbaeSopenharmony_ciextern void SystemModuleReset(struct ErrorInfo *info); 3547c9fbaeSopenharmony_ciextern int SystemModuleGetLastLogInfo(struct ErrorInfo *info); 3647c9fbaeSopenharmony_ciextern int SystemModuleSaveLastLog(const char *logDir, struct ErrorInfo *info); 3747c9fbaeSopenharmony_ciextern int FullWriteFile(const char *filePath, const char *buf, unsigned int bufSize, int isAppend); 3847c9fbaeSopenharmony_ciextern char *GetFaultLogPath(void); 3947c9fbaeSopenharmony_ciextern void RebootSystem(void); 4047c9fbaeSopenharmony_ci 4147c9fbaeSopenharmony_ci/* The following functions have been implemented in the kernel */ 4247c9fbaeSopenharmony_ciextern unsigned int LOS_BinarySemCreate(unsigned short count, unsigned int *semHandle); 4347c9fbaeSopenharmony_ciextern unsigned int LOS_SemPend(unsigned int semHandle, unsigned int timeout); 4447c9fbaeSopenharmony_ciextern unsigned int LOS_SemPost(unsigned int semHandle); 4547c9fbaeSopenharmony_ci 4647c9fbaeSopenharmony_ci#ifdef __cplusplus 4747c9fbaeSopenharmony_ci#if __cplusplus 4847c9fbaeSopenharmony_ci} 4947c9fbaeSopenharmony_ci#endif /* End of #if __cplusplus */ 5047c9fbaeSopenharmony_ci#endif /* End of #ifdef __cplusplus */ 5147c9fbaeSopenharmony_ci 5247c9fbaeSopenharmony_ci#endif /* End of #ifndef BLACKBOX_ADAPTER_H */