/drivers/hdf_core/adapter/khdf/linux/osal/src/ |
H A D | osal_file.c | 26 int32_t OsalFileOpen(OsalFile *file, const char *path, int flags, uint32_t rights) in OsalFileOpen() argument 28 struct file *fp = NULL; in OsalFileOpen() 30 if (file == NULL || path == NULL) { in OsalFileOpen() 35 file->realFile = (void *)fp; in OsalFileOpen() 39 HDF_LOGE("%s open file fail %d %u", __func__, flags, rights); in OsalFileOpen() 43 file->realFile = (void *)fp; in OsalFileOpen() 48 ssize_t OsalFileWrite(OsalFile *file, const void *string, uint32_t length) in OsalFileWrite() argument 52 struct file *fp = NULL; in OsalFileWrite() 54 if (file == NULL || IS_ERR_OR_NULL(file in OsalFileWrite() 70 OsalFileClose(OsalFile *file) OsalFileClose() argument 84 OsalFileRead(OsalFile *file, void *buf, uint32_t length) OsalFileRead() argument 106 OsalFileLseek(OsalFile *file, off_t offset, int32_t whence) OsalFileLseek() argument [all...] |
/drivers/hdf_core/framework/test/unittest/osal/ |
H A D | osal_file_test.c | 6 * See the LICENSE file in the root of this repository for complete details. 33 static void OsalPutWriteAccess(OsalFile *file) in OsalPutWriteAccess() argument 35 HDF_LOGE("%s %d %d", __func__, deny_write_access((struct file *)file->realFile), __LINE__); in OsalPutWriteAccess() 36 HDF_LOGE("%s %d %d", __func__, atomic_read(&file_inode((struct file *)file->realFile)->i_writecount), __LINE__); in OsalPutWriteAccess() 37 put_write_access(file_inode((struct file *)file->realFile)); in OsalPutWriteAccess() 38 HDF_LOGE("%s %d %d", __func__, atomic_read(&file_inode((struct file *)file in OsalPutWriteAccess() 47 OsalFile file; OsalTestFileInit() local [all...] |
H A D | osal_work_test.c | 6 * See the LICENSE file in the root of this repository for complete details. 160 OsalFile file; in OsalTestFile() local 166 HDF_LOGE("%s file do not exist %d", __func__, flag); in OsalTestFile() 170 UT_TEST_CHECK_RET(OsalFileOpen(&file, TEST_FILE_PATH_NAME, OSAL_O_RD_ONLY, OSAL_S_IREAD) != HDF_SUCCESS, in OsalTestFile() 172 len = OsalFileRead(&file, buf, sizeof(buf)); in OsalTestFile() 175 len = OsalFileLseek(&file, 0, 0); in OsalTestFile() 178 len = OsalFileWrite(&file, buf, sizeof(buf)); in OsalTestFile() 181 len = OsalFileLseek(&file, TEST_FILE_OFFSET, 0); in OsalTestFile() 183 len = OsalFileRead(&file, buf, sizeof(buf)); in OsalTestFile() 186 OsalFileClose(&file); in OsalTestFile() [all...] |
/drivers/hdf_core/adapter/khdf/liteos/osal/src/ |
H A D | osal_file.c | 32 #include "fs/file.h" 40 int32_t OsalFileOpen(OsalFile *file, const char *path, int flags, uint32_t rights) in OsalFileOpen() argument 45 if (file == NULL || path == NULL) { in OsalFileOpen() 50 file->realFile = (void *)(uintptr_t)fd; in OsalFileOpen() 53 HDF_LOGE("%s file name is invalid\n", __func__); in OsalFileOpen() 59 HDF_LOGE("%s open file fail %d %u %d", __func__, flags, rights, errno); in OsalFileOpen() 63 file->realFile = (void *)(uintptr_t)fd; in OsalFileOpen() 67 ssize_t OsalFileWrite(OsalFile *file, const void *string, uint32_t length) in OsalFileWrite() argument 71 if (file == NULL || (int32_t)(uintptr_t)file in OsalFileWrite() 85 OsalFileClose(OsalFile *file) OsalFileClose() argument 96 OsalFileRead(OsalFile *file, void *buf, uint32_t length) OsalFileRead() argument 114 OsalFileLseek(OsalFile *file, off_t offset, int32_t whence) OsalFileLseek() argument [all...] |
H A D | osal_cdev.c | 48 static int OsalCdevOpen(struct file *filep) in OsalCdevOpen() 55 static int OsalCdevRelease(struct file *filep) in OsalCdevRelease() 65 static ssize_t OsalCdevRead(struct file *filep, char *buffer, size_t buflen) in OsalCdevRead() 75 static ssize_t OsalCdevWrite(struct file *filep, const char *buffer, size_t buflen) in OsalCdevWrite() 85 static off_t OsalCdevSeek(struct file *filep, off_t offset, int whence) in OsalCdevSeek() 95 static int OsalCdevIoctl(struct file *filep, int cmd, unsigned long arg) in OsalCdevIoctl() 105 static int OsalCdevPoll(struct file *filep, poll_table *fds) in OsalCdevPoll() 176 void OsalSetFilePriv(struct file *filep, void *priv) in OsalSetFilePriv() 183 void *OsalGetFilePriv(struct file *filep) in OsalGetFilePriv()
|
/drivers/hdf_core/framework/include/osal/ |
H A D | osal_cdev.h | 6 * See the LICENSE file in the root of this repository for complete details. 23 struct file; 26 int64_t (*seek)(struct file *filep, int64_t offset, int whence); 27 ssize_t (*read)(struct file *filep, char __user *buffer, size_t buflen, int64_t *offset); 28 ssize_t (*write)(struct file *filep, const char __user *buffer, size_t buflen, int64_t *offset); 29 unsigned int (*poll)(struct file *filep, poll_table *pollTable); 30 long (*ioctl)(struct file *filep, unsigned int cmd, unsigned long arg); 31 int (*open)(struct OsalCdev *cdev, struct file *filep); 32 int (*release)(struct OsalCdev *cdev, struct file *filep); 42 void OsalSetFilePriv(struct file *file [all...] |
H A D | osal_file.h | 6 * See the LICENSE file in the root of this repository for complete details. 16 * including the memory management, thread, mutex, spinlock, semaphore, timer, file, interrupt, time, 24 * @file osal_file.h 26 * @brief Declares the file structures and interfaces. 28 * This file provides interfaces for opening, closing, reading, and writing a file, and setting the read/write offset. 44 * @brief Opens a file in read-only mode. 48 * @brief Opens a file in write-only mode. 52 * @brief Opens a file in read and write mode. 96 * @brief Defines the offset from the file heade [all...] |
/drivers/hdf_core/adapter/khdf/linux/platform/fwk/ |
H A D | platform_trace.c | 112 static ssize_t TraceFileWrite(OsalFile *file, const char *string, uint32_t length) in TraceFileWrite() argument 119 struct file *fp = NULL; in TraceFileWrite() 121 if (file == NULL || IS_ERR_OR_NULL(file->realFile) || string == NULL) { in TraceFileWrite() 125 fp = (struct file *)file->realFile; in TraceFileWrite() 137 HDF_LOGE("TraceFileWrite: write file length %d fail, ret: %d!", length, ret); in TraceFileWrite() 144 static ssize_t TraceFileRead(OsalFile *file, char *buf, uint32_t length) in TraceFileRead() argument 151 struct file *fp = NULL; in TraceFileRead() 153 if (file in TraceFileRead() 180 OsalFile file; TraceEventFileWrite() local 224 OsalFile file; PlatformTraceInfoDump() local [all...] |
/drivers/hdf_core/framework/tools/hcs-view/hcsWebView/ |
H A D | build.py | 8 # See the LICENSE file in the root of this repository for complete details.
14 with open(r".\..\hcsVSCode\editor.html", "r", encoding="utf8") as file:
15 ss = file.read()
18 with open(r".\dist\main.js", "r", encoding="utf8") as file:
19 destss = file.read()
24 "w", encoding="utf-8") as file:
25 file.write(ss)
|
/drivers/hdf_core/interfaces/inner_api/osal/shared/ |
H A D | osal_file.h | 6 * See the LICENSE file in the root of this repository for complete details. 16 * including the memory management, thread, mutex, spinlock, semaphore, timer, file, interrupt, time, 24 * @file osal_file.h 26 * @brief Declares the file structures and interfaces. 28 * This file provides interfaces for opening, closing, reading, and writing a file, and setting the read/write offset. 44 * @brief Opens a file in read-only mode. 48 * @brief Opens a file in write-only mode. 52 * @brief Opens a file in read and write mode. 96 * @brief Defines the offset from the file heade [all...] |
/drivers/hdf_core/adapter/khdf/linux/platform/watchdog/ |
H A D | watchdog_adapter.c | 37 static int WdtAdapterIoctlInner(struct file *fp, unsigned cmd, unsigned long arg) in WdtAdapterIoctlInner() 54 struct file *fp = NULL; in WdtOpenFile() 85 struct file *fp = (struct file *)wdt->priv; in WdtAdapterClose() 98 struct file *fp = NULL; in WdtAdapterStart() 119 struct file *fp = (struct file *)wdt->priv; in WdtAdapterStop() 135 struct file *fp = NULL; in WdtAdapterFeed() 141 fp = (struct file *)wdt->priv; in WdtAdapterFeed() 174 struct file *f in WdtAdapterGetStatus() [all...] |
/drivers/peripheral/audio/test/sample/ |
H A D | framework_common.c | 4 * you may not use this file except in compliance with the License. 85 int32_t CheckWavFileHeader(FILE *file, struct AudioHeadInfo *wavHeadInfo, struct AudioSampleAttributes *attrs) in CheckWavFileHeader() argument 87 if (file == NULL || wavHeadInfo == NULL || attrs == NULL) { in CheckWavFileHeader() 92 if (fread(wavHeadInfo, sizeof(struct AudioHeadInfo), 1, file) != 1) { in CheckWavFileHeader() 100 AUDIO_FUNC_LOGE("wav file head check fail\n"); in CheckWavFileHeader() 133 int32_t AddWavFileHeader(FILE *file, const struct StrParaCapture *strParam) in AddWavFileHeader() argument 142 (void)fseek(file, 0, SEEK_END); in AddWavFileHeader() 144 headInfo.riffSize = (uint32_t)ftell(file) - WAV_HEAD_RIFF_OFFSET; in AddWavFileHeader() 156 headInfo.dataSize = (uint32_t)ftell(file) - WAV_HEAD_OFFSET; in AddWavFileHeader() 157 rewind(file); in AddWavFileHeader() 234 FileClose(FILE **file) FileClose() argument [all...] |
H A D | framework_common.h | 4 * you may not use this file except in compliance with the License. 64 FILE *file; member 76 void FileClose(FILE **file); 83 int32_t CheckWavFileHeader(FILE *file, struct AudioHeadInfo *wavHeadInfo, struct AudioSampleAttributes *attrs); 84 int32_t AddWavFileHeader(FILE *file, const struct StrParaCapture *strParam);
|
/drivers/peripheral/audio/test/systemtest/common/lib_common/src/ |
H A D | audio_lib_common.cpp | 4 * you may not use this file except in compliance with the License. 28 * @file audio_lib_common.h 151 FILE *file = fopen(path.c_str(), "wb+"); in CaptureReqMmapBufferInit() local 152 if (file == nullptr) { in CaptureReqMmapBufferInit() 155 int fd = fileno(file); in CaptureReqMmapBufferInit() 157 (void)fclose(file); in CaptureReqMmapBufferInit() 167 (void)fclose(file); in CaptureReqMmapBufferInit() 176 (void)fclose(file); in CaptureReqMmapBufferInit() 187 FILE *file = fopen(absPath, "rb+"); in RenderReqMmapBufferInit() local 188 if (file in RenderReqMmapBufferInit() [all...] |
/drivers/peripheral/usb/test/moduletest/common/ |
H A D | usb_utils.h | 4 * you may not use this file except in compliance with the License. 43 extern bool HasLog(const std::string &target, double startTs, const std::string &file = "/data/acm_write_xts"); 46 extern void CalcProcInfoFromFile(struct ProcInfo &info, const std::string &file); 47 extern double GetTsFromLog(const std::string &target, double startTs, const std::string &file);
|
H A D | usb_utils.cpp | 4 * you may not use this file except in compliance with the License. 25 bool HasLog(const string &target, double startTs, const string &file) in HasLog() argument 28 ifstream logFile(file); in HasLog() 120 void CalcProcInfoFromFile(struct ProcInfo &info, const string &file) in CalcProcInfoFromFile() argument 125 FILE *fp = fopen(file.c_str(), "r"); in CalcProcInfoFromFile() 127 printf("%s:%d file open failed.", __func__, __LINE__); in CalcProcInfoFromFile() 151 double GetTsFromLog(const string &target, double startTs, const string &file) in GetTsFromLog() argument 154 ifstream logFile(file); in GetTsFromLog()
|
/drivers/hdf_core/framework/tools/hdi-gen/codegen/ |
H A D | cpp_custom_types_code_emitter.cpp | 6 * See the LICENSE file in the root of this repository for complete details.
10 #include "util/file.h"
50 File file(filePath, File::WRITE);
in EmitPassthroughCustomTypesHeaderFile() 69 file.WriteData(data.c_str(), data.size());
in EmitPassthroughCustomTypesHeaderFile() 70 file.Flush();
in EmitPassthroughCustomTypesHeaderFile() 71 file.Close();
in EmitPassthroughCustomTypesHeaderFile() 82 for (const auto &file : headerFiles) {
in EmitPassthroughHeaderFileInclusions() 83 sb.AppendFormat("%s\n", file.ToString().c_str());
in EmitPassthroughHeaderFileInclusions() 91 File file(filePath, File::WRITE);
in EmitCustomTypesHeaderFile() 117 file in EmitCustomTypesHeaderFile() [all...] |
H A D | cpp_service_impl_code_emitter.cpp | 6 * See the LICENSE file in the root of this repository for complete details.
10 #include "util/file.h"
49 File file(filePath, File::WRITE);
in EmitImplHeaderFile() 62 file.WriteData(data.c_str(), data.size());
in EmitImplHeaderFile() 63 file.Flush();
in EmitImplHeaderFile() 64 file.Close();
in EmitImplHeaderFile() 72 for (const auto &file : headerFiles) {
in EmitServiceImplInclusions() 73 sb.AppendFormat("%s\n", file.ToString().c_str());
in EmitServiceImplInclusions() 141 File file(filePath, File::WRITE);
in EmitImplSourceFile() 155 file in EmitImplSourceFile() [all...] |
H A D | c_service_impl_code_emitter.cpp | 6 * See the LICENSE file in the root of this repository for complete details.
10 #include "util/file.h"
61 File file(filePath, File::WRITE);
in EmitLowServiceImplHeaderFile() 80 file.WriteData(data.c_str(), data.size());
in EmitLowServiceImplHeaderFile() 81 file.Flush();
in EmitLowServiceImplHeaderFile() 82 file.Close();
in EmitLowServiceImplHeaderFile() 89 for (const auto &file : headerFiles) {
in EmitLowServiceImplInclusions() 90 sb.AppendFormat("%s\n", file.ToString().c_str());
in EmitLowServiceImplInclusions() 106 File file(filePath, File::WRITE);
in EmitLowServiceImplSourceFile() 121 file in EmitLowServiceImplSourceFile() [all...] |
H A D | c_interface_code_emitter.cpp | 6 * See the LICENSE file in the root of this repository for complete details.
10 #include "util/file.h"
53 File file(filePath, File::WRITE);
in EmitLowModeInterfaceHeaderFile() 80 file.WriteData(data.c_str(), data.size());
in EmitLowModeInterfaceHeaderFile() 81 file.Flush();
in EmitLowModeInterfaceHeaderFile() 82 file.Close();
in EmitLowModeInterfaceHeaderFile() 99 File file(filePath, File::WRITE);
in EmitInterfaceHeaderFile() 130 file.WriteData(data.c_str(), data.size());
in EmitInterfaceHeaderFile() 131 file.Flush();
in EmitInterfaceHeaderFile() 132 file in EmitInterfaceHeaderFile() [all...] |
/drivers/peripheral/audio/test/systemtest/common/hdi_common/src/ |
H A D | audio_hdi_common.cpp | 4 * you may not use this file except in compliance with the License. 28 * @file audio_adapter.h 218 int32_t WavHeadAnalysis(struct AudioHeadInfo &wavHeadInfo, FILE *file, struct AudioSampleAttributes &attrs) in WavHeadAnalysis() argument 221 if (file == nullptr) { in WavHeadAnalysis() 224 ret = fread(&wavHeadInfo, sizeof(wavHeadInfo), 1, file); in WavHeadAnalysis() 481 FILE *file = fopen(AUDIO_CAPTURE_FILE.c_str(), "wb+"); in AudioCreateStartCapture() local 482 if (file == nullptr) { in AudioCreateStartCapture() 492 ret = FrameStartCapture((*capture), file, attrs); in AudioCreateStartCapture() 496 fclose(file); in AudioCreateStartCapture() 499 (void)fclose(file); in AudioCreateStartCapture() 512 FILE *file = fopen(AUDIO_CAPTURE_FILE.c_str(), "wb+"); AudioCaptureStartAndOneFrame() local 525 FrameStart(struct AudioHeadInfo wavHeadInfo, struct AudioRender *render, FILE *file, struct AudioSampleAttributes attrs) FrameStart() argument 576 FrameStartCapture(struct AudioCapture *capture, FILE *file, const struct AudioSampleAttributes attrs) FrameStartCapture() argument 634 FILE *file = fopen(absPath, "rb"); RenderFramePrepare() local 668 StartRecord(struct AudioCapture *capture, FILE *file, uint64_t filesize) StartRecord() argument 924 FILE *file = fopen(absPath, "rb"); PlayAudioFile() local 979 FILE *file = fopen(audiopara.path, "wb+"); RecordAudio() local [all...] |
/drivers/hdf_core/adapter/khdf/linux/platform/uart/ |
H A D | uart_adapter.c | 43 struct file *fp = NULL; in UartAdapterInit() 59 fp = filp_open(name, O_RDWR | O_NOCTTY | O_NDELAY, 0600); /* 0600 : file mode */ in UartAdapterInit() 76 struct file *fp = NULL; in UartAdapterDeInit() 86 fp = (struct file *)host->priv; in UartAdapterDeInit() 105 struct file *fp = NULL; in UartAdapterRead() 117 fp = (struct file *)host->priv; in UartAdapterRead() 140 struct file *fp = NULL; in UartAdapterWrite() 151 fp = (struct file *)host->priv; in UartAdapterWrite() 170 static int UartAdapterIoctlInner(struct file *fp, unsigned cmd, unsigned long arg) in UartAdapterIoctlInner() 248 struct file *f in UartAdapterGetBaud() [all...] |
/drivers/peripheral/display/test/unittest/lite/ |
H A D | loadbmp_test.c | 4 * you may not use this file except in compliance with the License. 65 FILE *file = NULL; in GetBmpInfo() local 70 printf("%s: file %s does not exist\n", __func__, fileName); in GetBmpInfo() 73 if ((file = fopen((const char*)realPath, "rb")) == NULL) { in GetBmpInfo() 74 HDF_LOGE("%s: Open file failure: %s", __func__, fileName); in GetBmpInfo() 78 (void)fread(&bfType, 1, sizeof(bfType), file); in GetBmpInfo() 80 HDF_LOGE("%s: not bitmap file", __func__); in GetBmpInfo() 81 fclose(file); in GetBmpInfo() 85 (void)fread(bmpFileHeader, 1, sizeof(OsdBitMapFileHeader), file); in GetBmpInfo() 86 (void)fread(bmpInfo, 1, sizeof(OsdBitMapInfo), file); in GetBmpInfo() 136 FILE *file = NULL; LoadPicToBuffer() local [all...] |
/drivers/peripheral/audio/test/systemtest/common/hdi_service_common/src/ |
H A D | hdi_service_common.cpp | 4 * you may not use this file except in compliance with the License. 216 int32_t WavHeadAnalysis(struct AudioHeadInfo &wavHeadInfo, FILE *file, struct AudioSampleAttributes &attrs) in WavHeadAnalysis() argument 219 if (file == nullptr) { in WavHeadAnalysis() 223 ret = fread(&wavHeadInfo, sizeof(wavHeadInfo), 1, file); in WavHeadAnalysis() 233 HDF_LOGE("%{public}s: AUDIO_TEST:audio file is not wav format\n", __func__); in WavHeadAnalysis() 519 FILE *file = fopen(AUDIO_CAPTURE_FILE.c_str(), "wb+"); in AudioCaptureStartAndOneFrame() local 520 if (file == nullptr) { in AudioCaptureStartAndOneFrame() 524 ret = FrameStartCapture(capture, file, attrs); in AudioCaptureStartAndOneFrame() 526 fclose(file); in AudioCaptureStartAndOneFrame() 529 (void) fclose(file); in AudioCaptureStartAndOneFrame() 556 FrameStart(struct AudioHeadInfo wavHeadInfo, struct IAudioRender *render, FILE *file, struct AudioSampleAttributes attrs) FrameStart() argument 601 FrameStartCapture(struct IAudioCapture *capture, FILE *file, const struct AudioSampleAttributes attrs) FrameStartCapture() argument 655 FILE *file = fopen(absPath, "rb"); RenderFramePrepare() local 714 StartRecord(struct IAudioCapture *capture, FILE *file, uint64_t filesize) StartRecord() argument 791 FILE *file = fopen(absPath, "rb"); PlayAudioFile() local 824 FILE *file = fopen(audiopara.path, "wb+"); RecordAudio() local [all...] |
/drivers/hdf_core/framework/tools/hdi-gen/test/unittest/ |
H A D | unit_test.py | 8 # See the LICENSE file in the root of this repository for complete details.
32 print("line\n", second_info, "is not in output file")
48 first_files = set([file[len(first_file_path):] for file in first_files_list])
49 second_files = set([file[len(second_file_path):-4] for file in second_files_list])
55 print("file ", "{}{}".format(first_file_path, files), "{}{}.txt".format(second_file_path, files), \
93 for file in file_list:
94 if os.path.splitext(file)[-1] == ".idl":
95 idl_file_list.append(file)
[all...] |