Home
last modified time | relevance | path

Searched refs:len (Results 1 – 25 of 335) sorted by relevance

12345678910>>...14

/drivers/peripheral/pin_auth/test/fuzztest/pin_auth/pinauthhdi_fuzzer/
Diam_fuzz_test.cpp34 void FillFuzzBuffer(Parcel &parcel, void *p, uint32_t len) in FillFuzzBuffer() argument
36 if (len == 0) { in FillFuzzBuffer()
40 auto buffer = parcel.ReadBuffer(len); in FillFuzzBuffer()
42 IAM_LOGE("ReadBuffer len %{public}u fail", len); in FillFuzzBuffer()
46 if (memcpy_s(p, len, buffer, len) != EOK) { in FillFuzzBuffer()
57 uint32_t len = parcel.ReadUint32() % MAX_DATA_LEN; in FillFuzzUint8Vector() local
58 uint32_t memLen = len * sizeof(uint8_t); in FillFuzzUint8Vector()
59 data.resize(len); in FillFuzzUint8Vector()
61 IAM_LOGI("fill vector len %{public}u ok", len); in FillFuzzUint8Vector()
66 uint32_t len = parcel.ReadUint32() % MAX_DATA_LEN; in FillFuzzInt8Vector() local
[all …]
/drivers/peripheral/face_auth/test/fuzztest/face_auth/faceauthhdi_fuzzer/
Diam_fuzz_test.cpp34 void FillFuzzBuffer(Parcel &parcel, void *p, uint32_t len) in FillFuzzBuffer() argument
36 if (len == 0) { in FillFuzzBuffer()
40 auto buffer = parcel.ReadBuffer(len); in FillFuzzBuffer()
42 IAM_LOGE("ReadBuffer len %{public}u fail", len); in FillFuzzBuffer()
46 if (memcpy_s(p, len, buffer, len) != EOK) { in FillFuzzBuffer()
57 uint32_t len = parcel.ReadUint32() % MAX_DATA_LEN; in FillFuzzUint8Vector() local
58 uint32_t memLen = len * sizeof(uint8_t); in FillFuzzUint8Vector()
59 data.resize(len); in FillFuzzUint8Vector()
61 IAM_LOGI("fill vector len %{public}u ok", len); in FillFuzzUint8Vector()
66 uint32_t len = parcel.ReadUint32() % MAX_DATA_LEN; in FillFuzzInt8Vector() local
[all …]
/drivers/peripheral/user_auth/test/fuzztest/user_auth/userauthhdi_fuzzer/
Diam_fuzz_test.cpp34 void FillFuzzBuffer(Parcel &parcel, void *p, uint32_t len) in FillFuzzBuffer() argument
36 if (len == 0) { in FillFuzzBuffer()
40 auto buffer = parcel.ReadBuffer(len); in FillFuzzBuffer()
42 IAM_LOGE("ReadBuffer len %{public}u fail", len); in FillFuzzBuffer()
46 if (memcpy_s(p, len, buffer, len) != EOK) { in FillFuzzBuffer()
57 uint32_t len = parcel.ReadUint32() % MAX_DATA_LEN; in FillFuzzUint8Vector() local
58 uint32_t memLen = len * sizeof(uint8_t); in FillFuzzUint8Vector()
59 data.resize(len); in FillFuzzUint8Vector()
61 IAM_LOGI("fill vector len %{public}u ok", len); in FillFuzzUint8Vector()
66 uint32_t len = parcel.ReadUint32() % MAX_DATA_LEN; in FillFuzzInt8Vector() local
[all …]
/drivers/peripheral/fingerprint_auth/test/fuzztest/fingerprint_auth/fingerprintauthhdi_fuzzer/
Diam_fuzz_test.cpp34 void FillFuzzBuffer(Parcel &parcel, void *p, uint32_t len) in FillFuzzBuffer() argument
36 if (len == 0) { in FillFuzzBuffer()
40 auto buffer = parcel.ReadBuffer(len); in FillFuzzBuffer()
42 IAM_LOGE("ReadBuffer len %{public}u fail", len); in FillFuzzBuffer()
46 if (memcpy_s(p, len, buffer, len) != EOK) { in FillFuzzBuffer()
57 uint32_t len = parcel.ReadUint32() % MAX_DATA_LEN; in FillFuzzUint8Vector() local
58 uint32_t memLen = len * sizeof(uint8_t); in FillFuzzUint8Vector()
59 data.resize(len); in FillFuzzUint8Vector()
61 IAM_LOGI("fill vector len %{public}u ok", len); in FillFuzzUint8Vector()
66 uint32_t len = parcel.ReadUint32() % MAX_DATA_LEN; in FillFuzzInt8Vector() local
[all …]
/drivers/hdf_core/adapter/khdf/liteos_m/network/src/
Dnetbuf_adapter.c313 nb->len = size; in NetBufAlloc()
316 nb->bufs[E_HEAD_BUF].len = 0; in NetBufAlloc()
318 nb->bufs[E_DATA_BUF].len = 0; in NetBufAlloc()
320 nb->bufs[E_TAIL_BUF].len = size; in NetBufAlloc()
352 void *NetBufPush(NetBuf *nb, uint32_t id, uint32_t len) in NetBufPush() argument
368 if (dataBuf->len < len || nb->dataLen < len) { in NetBufPush()
369 …HDF_LOGE("%s fail, datasize[%u], dataroom[%u], len[%u]", __func__, nb->dataLen, dataBuf->len, len); in NetBufPush()
373 headBuf->len += len; in NetBufPush()
374 dataBuf->offset += len; in NetBufPush()
375 dataBuf->len -= len; in NetBufPush()
[all …]
/drivers/hdf_core/adapter/khdf/liteos/network/src/
Dnetbuf_adapter.c313 nb->len = size; in NetBufAlloc()
316 nb->bufs[E_HEAD_BUF].len = 0; in NetBufAlloc()
318 nb->bufs[E_DATA_BUF].len = 0; in NetBufAlloc()
320 nb->bufs[E_TAIL_BUF].len = size; in NetBufAlloc()
352 void *NetBufPush(NetBuf *nb, uint32_t id, uint32_t len) in NetBufPush() argument
368 if (dataBuf->len < len || nb->dataLen < len) { in NetBufPush()
369 …HDF_LOGE("%s fail, datasize[%u], dataroom[%u], len[%u]", __func__, nb->dataLen, dataBuf->len, len); in NetBufPush()
373 headBuf->len += len; in NetBufPush()
374 dataBuf->offset += len; in NetBufPush()
375 dataBuf->len -= len; in NetBufPush()
[all …]
/drivers/peripheral/user_auth/hdi_service/common/src/
Dc_array.c29 if ((*array)->len != 0 && ((*array)->len < UINT32_MAX / sizeof(uint8_t))) { in DestroyUint8Array()
30 uint32_t arraySize = sizeof(uint8_t) * (*array)->len; in DestroyUint8Array()
43 if ((*array)->len != 0 && ((*array)->len < UINT32_MAX / sizeof(uint64_t))) { in DestroyUint64Array()
44 uint32_t arraySize = sizeof(uint64_t) * (*array)->len; in DestroyUint64Array()
65 array->len = size; in CreateUint8ArrayBySize()
70 Uint8Array *CreateUint8ArrayByData(const uint8_t *data, uint32_t len) in CreateUint8ArrayByData() argument
72 if (data == NULL && len != 0) { in CreateUint8ArrayByData()
77 Uint8Array *array = CreateUint8ArrayBySize(len); in CreateUint8ArrayByData()
79 if (len == 0) { in CreateUint8ArrayByData()
83 if (memcpy_s(array->data, len, data, len) != EOK) { in CreateUint8ArrayByData()
[all …]
Dattribute.c91 for (uint32_t i = 0; i < array->len; i++) { in Ntohl64Array()
98 for (uint32_t i = 0; i < array->len; i++) { in Htonl64Array()
117 if (msg.len <= *readIndex) { in ReadDataFromMsg()
122 if (msg.len - *readIndex < retData->len) { in ReadDataFromMsg()
127 if (memcpy_s(retData->data, retData->len, msg.data + *readIndex, retData->len) != EOK) { in ReadDataFromMsg()
132 *readIndex += retData->len; in ReadDataFromMsg()
152 if (msg->len <= *writeIndex) { in WriteDataToMsg()
157 if (msg->len - *writeIndex < data.len) { in WriteDataToMsg()
162 if (memcpy_s(msg->data + *writeIndex, msg->len - *writeIndex, data.data, data.len) != EOK) { in WriteDataToMsg()
167 *writeIndex += data.len; in WriteDataToMsg()
[all …]
/drivers/hdf_core/adapter/khdf/linux/network/src/
Dnetbuf_adapter.c217 return nb->len; in NetBufGetDataLen()
259 void *NetBufPush(NetBuf *nb, uint32_t id, uint32_t len) in NetBufPush() argument
267 nb->data += len; in NetBufPush()
270 nb->tail += len; in NetBufPush()
271 nb->len += len; in NetBufPush()
274 if (unlikely(len > nb->len) || unlikely(len > nb->tail)) { in NetBufPush()
278 nb->tail -= len; in NetBufPush()
279 nb->len -= len; in NetBufPush()
308 void *NetBufPop(NetBuf *nb, uint32_t id, uint32_t len) in NetBufPop() argument
316 if (unlikely(len > nb->data)) { in NetBufPop()
[all …]
/drivers/hdf_core/framework/support/platform/src/pcie/
Dpcie_dispatch.c35 uint32_t len; in PcieCmdRead() local
44 if (!HdfSbufReadUint32(data, &len)) { in PcieCmdRead()
48 if (len == 0 || len > USER_LEM_MAX) { in PcieCmdRead()
57 buf = (uint8_t *)OsalMemCalloc(sizeof(*buf) * len); in PcieCmdRead()
63 ret = PcieCntlrRead(cntlr, mode, pos, buf, len); in PcieCmdRead()
69 if (!HdfSbufWriteBuffer(reply, buf, len)) { in PcieCmdRead()
82 uint32_t len; in PcieCmdWrite() local
91 if (!HdfSbufReadUint32(data, &len)) { in PcieCmdWrite()
103 if (len == 0 || len != size) { in PcieCmdWrite()
107 return PcieCntlrWrite(cntlr, mode, pos, buf, len); in PcieCmdWrite()
[all …]
Dpcie_if.c39 int32_t PcieRead(DevHandle handle, uint32_t mode, uint32_t pos, uint8_t *data, uint32_t len) in PcieRead() argument
41 return PcieCntlrRead((struct PcieCntlr *)handle, mode, pos, data, len); in PcieRead()
44 int32_t PcieWrite(DevHandle handle, uint32_t mode, uint32_t pos, uint8_t *data, uint32_t len) in PcieWrite() argument
46 return PcieCntlrWrite((struct PcieCntlr *)handle, mode, pos, data, len); in PcieWrite()
49 int32_t PcieDmaMap(DevHandle handle, PcieCallbackFunc cb, uintptr_t addr, uint32_t len, uint8_t dir) in PcieDmaMap() argument
51 return PcieCntlrDmaMap((struct PcieCntlr *)handle, cb, addr, len, dir); in PcieDmaMap()
54 void PcieDmaUnmap(DevHandle handle, uintptr_t addr, uint32_t len, uint8_t dir) in PcieDmaUnmap() argument
56 PcieCntlrDmaUnmap((struct PcieCntlr *)handle, addr, len, dir); in PcieDmaUnmap()
Dpcie_if_u.c35 uint32_t len; member
87 int32_t PcieRead(DevHandle handle, uint32_t mode, uint32_t pos, uint8_t *data, uint32_t len) in PcieRead() argument
97 if (data == NULL || mode > PCIE_IO || len == 0) { in PcieRead()
113 if (!HdfSbufWriteUint32(buf, len)) { in PcieRead()
135 ret = PcieGetDataFromReply(reply, data, len); in PcieRead()
144 int32_t PcieWrite(DevHandle handle, uint32_t mode, uint32_t pos, uint8_t *data, uint32_t len) in PcieWrite() argument
154 if (data == NULL || mode > PCIE_IO || len == 0) { in PcieWrite()
168 if (!HdfSbufWriteUint32(buf, len)) { in PcieWrite()
178 if (!HdfSbufWriteBuffer(buf, data, len)) { in PcieWrite()
207 param->len = dma->len; in PcieRegListener()
[all …]
/drivers/hdf_core/framework/test/unittest/osal/
Dosal_work_test.c162 int32_t len; in OsalTestFile() local
172 len = OsalFileRead(&file, buf, sizeof(buf)); in OsalTestFile()
173 UT_TEST_CHECK_RET(len != TEST_FILE_LEN, OSAL_FILE_READ_RD); in OsalTestFile()
174 HDF_LOGE("%s %d %d", __func__, __LINE__, len); in OsalTestFile()
175 len = OsalFileLseek(&file, 0, 0); in OsalTestFile()
176 UT_TEST_CHECK_RET(len == -1, OSAL_FILE_SEEK_RD); in OsalTestFile()
178 len = OsalFileWrite(&file, buf, sizeof(buf)); in OsalTestFile()
179 UT_TEST_CHECK_RET(len != -1, OSAL_FILE_WRITE_RD); in OsalTestFile()
180 HDF_LOGE("%s %d %d", __func__, __LINE__, len); in OsalTestFile()
181 len = OsalFileLseek(&file, TEST_FILE_OFFSET, 0); in OsalTestFile()
[all …]
/drivers/peripheral/user_auth/hdi_service/adaptor/src/
Dfile_operator.c45 IAM_STATIC int32_t ReadFile(const char *fileName, uint8_t *buf, uint32_t len) in ReadFile() argument
47 if ((fileName == NULL) || (buf == NULL) || (len == 0)) { in ReadFile()
56 size_t readLen = fread(buf, sizeof(uint8_t), len, fileOperator); in ReadFile()
57 if (readLen != len) { in ReadFile()
60 (void)memset_s(buf, len, 0, len); in ReadFile()
67 IAM_STATIC int32_t WriteFile(const char *fileName, const uint8_t *buf, uint32_t len) in WriteFile() argument
69 if ((fileName == NULL) || (buf == NULL) || (len == 0)) { in WriteFile()
85 size_t writeLen = fwrite(buf, sizeof(uint8_t), len, fileOperator); in WriteFile()
86 if (writeLen != len) { in WriteFile()
99 IAM_STATIC int32_t GetFileLen(const char *fileName, uint32_t *len) in GetFileLen() argument
[all …]
/drivers/hdf_core/framework/support/platform/src/hdmi/
Dhdmi_cec.c138 uint32_t len; in HdmiCecGetMsgLenInfo() local
140 len = sizeof(g_cecMsg) / sizeof(g_cecMsg[0]); in HdmiCecGetMsgLenInfo()
141 for (i = 0; i < len; i++) { in HdmiCecGetMsgLenInfo()
158 (msg->len < HDMI_CEC_GET_MSG_LEN(HDMI_CEC_TIMER_STATUS_DATA_MAX_LEN))) { in HdmiCecCheckTimerStatusMsgLen()
163 if (msg->len < HDMI_CEC_GET_MSG_LEN(HDMI_CEC_TIMER_STATUS_DATA_MAX_LEN)) { in HdmiCecCheckTimerStatusMsgLen()
177 if (msg->len < HDMI_CEC_GET_MSG_LEN(HDMI_CEC_RECORD_ON_DIGITAL_MSG_PARAM_LEN)) { in HdmiCecCheckRecordOnMsgLen()
183 if (msg->len < HDMI_CEC_GET_MSG_LEN(HDMI_CEC_RECORD_ON_ANALOG_MSG_PARAM_LEN)) { in HdmiCecCheckRecordOnMsgLen()
189 if (msg->len < HDMI_CEC_GET_MSG_LEN(HDMI_CEC_RECORD_ON_EXT_PLUG_MSG_PARAM_LEN)) { in HdmiCecCheckRecordOnMsgLen()
195 if (msg->len < HDMI_CEC_GET_MSG_LEN(HDMI_CEC_RECORD_ON_EXT_PHY_ADDR_MSG_PARAM_LEN)) { in HdmiCecCheckRecordOnMsgLen()
233 if (msg->len < info->minLen) { in HdmiCecCheckMsgLen()
[all …]
Dhdmi_infoframe.c19 static void HdmiInfoFrameFillCheckSum(uint8_t *data, uint32_t len) in HdmiInfoFrameFillCheckSum() argument
24 for (i = 0; i < len; i++) { in HdmiInfoFrameFillCheckSum()
37 …void HdmiInfoFrameFillHeader(const struct HdmiInfoFrameHeader *header, uint8_t *data, uint32_t len) in HdmiInfoFrameFillHeader() argument
39 if (len < HDMI_INFOFRAME_PACKET_HEADER_LEN) { in HdmiInfoFrameFillHeader()
40 HDF_LOGE("len = %u, val is too small.", len); in HdmiInfoFrameFillHeader()
45 data[UINT8_ARRAY_TELEMENT_2] = header->len; in HdmiInfoFrameFillHeader()
48 …32_t HdmiInfoFramePacketVsEncoding(union HdmiInfoFrameInfo *infoFrame, uint8_t *data, uint32_t len) in HdmiInfoFramePacketVsEncoding() argument
55 length = HDMI_INFOFRAME_PACKET_HEADER_LEN + vs->len; in HdmiInfoFramePacketVsEncoding()
56 if (len < length) { in HdmiInfoFramePacketVsEncoding()
57 HDF_LOGE("len = %u, val is too small.", len); in HdmiInfoFramePacketVsEncoding()
[all …]
/drivers/liteos/hievent/src/
Dhiview_hievent.c62 if (tmplen < len) { \
64 len -= tmplen; \
67 tmp += len; \
68 len = 0; \
213 int len; in HiviewHieventPutString() local
234 len = strlen(value); in HiviewHieventPutString()
236 if (len > MAX_STR_LEN) { in HiviewHieventPutString()
237 len = MAX_STR_LEN; in HiviewHieventPutString()
239 payload->value = LOS_MemAlloc((VOID *)OS_SYS_MEM_ADDR, len + 1); in HiviewHieventPutString()
243 (VOID)memset_s(payload->value, len + 1, 0, len + 1); in HiviewHieventPutString()
[all …]
/drivers/hdf_core/framework/tools/hdi-gen/util/
Dstring_builder.cpp47 size_t len = strlen(string); in Append() local
48 if (position_ + len >= capacity_) { in Append()
49 if (!Grow(len)) { in Append()
54 (void)memcpy_s(buffer_ + position_, capacity_ - position_, string, len); in Append()
55 position_ += len; in Append()
65 size_t len = string.size(); in Append() local
66 if (position_ + len >= capacity_) { in Append()
67 if (!Grow(len)) { in Append()
72 (void)memcpy_s(buffer_ + position_, capacity_ - position_, string.c_str(), len); in Append()
73 position_ += len; in Append()
[all …]
/drivers/peripheral/pin_auth/hdi_service/adaptor/src/
Dfile_operator.c38 static int32_t ReadFile(const char *fileName, uint8_t *buf, uint32_t len) in ReadFile() argument
40 if ((fileName == NULL) || (buf == NULL) || (len == 0)) { in ReadFile()
49 size_t readLen = fread(buf, sizeof(uint8_t), len, fileOperator); in ReadFile()
50 if (readLen != len) { in ReadFile()
59 static int32_t WriteFile(const char *fileName, const uint8_t *buf, uint32_t len) in WriteFile() argument
61 if ((fileName == NULL) || (buf == NULL) || (len == 0)) { in WriteFile()
77 size_t writeLen = fwrite(buf, sizeof(uint8_t), len, fileOperator); in WriteFile()
78 if (writeLen != len) { in WriteFile()
91 static int32_t GetFileLen(const char *fileName, uint32_t *len) in GetFileLen() argument
93 if ((fileName == NULL) || (len == NULL)) { in GetFileLen()
[all …]
/drivers/peripheral/user_auth/hdi_service/common/inc/
Dc_array.h27 #define IS_ARRAY_NULL(array) ((array).data == NULL || (array).len == 0)
28 #define IS_ARRAY_VALID(array) ((array).data != NULL || ((array).data == NULL && (array).len == 0))
32 uint32_t len; member
37 uint32_t len; member
43 Uint8Array *CreateUint8ArrayByData(const uint8_t *data, uint32_t len);
44 Uint64Array *CreateUint64ArrayByData(const uint64_t *data, uint32_t len);
/drivers/hdf_core/framework/test/unittest/platform/common/
Dspi_test.c32 uint32_t len; in SpiTestGetConfig() local
54 if (!HdfSbufReadBuffer(reply, (const void **)&cfg, &len)) { in SpiTestGetConfig()
60 if (len != sizeof(*cfg)) { in SpiTestGetConfig()
61 HDF_LOGE("SpiTestGetConfig: cfg size:%zu, read size:%u!", sizeof(*cfg), len); in SpiTestGetConfig()
72 if (!HdfSbufReadBuffer(reply, (const void **)&buf, &len)) { in SpiTestGetConfig()
78 if (len != config->len) { in SpiTestGetConfig()
79 HDF_LOGE("SpiTestGetConfig: buffer size:%zu, read size:%u!", config->len, len); in SpiTestGetConfig()
85 config->wbuf = (uint8_t *)OsalMemCalloc(config->len); in SpiTestGetConfig()
92 if (memcpy_s(config->wbuf, config->len, buf, len) != EOK) { in SpiTestGetConfig()
117 tester.config.rbuf = (uint8_t *)OsalMemCalloc(tester.config.len); in SpiTesterGet()
[all …]
/drivers/hdf_core/framework/test/unittest/platform/virtual/
Dpcie_virtual.c27 uint32_t len; member
33 uint32_t pos, uint8_t *data, uint32_t len) in PcieVirtualAdapterRead() argument
41 if (len == PCIE_VIRTUAL_ADAPTER_ONE_BYTE) { in PcieVirtualAdapterRead()
43 } else if (len == PCIE_VIRTUAL_ADAPTER_TWO_BYTE) { in PcieVirtualAdapterRead()
60 uint32_t pos, uint8_t *data, uint32_t len) in PcieVirtualAdapterWrite() argument
65 (void)len; in PcieVirtualAdapterWrite()
74 uint32_t len, uint8_t dir) in PcieVirtualAdapterDmaMap() argument
91 host->len = len; in PcieVirtualAdapterDmaMap()
97 static void PcieVirtualAdapterDmaUnmap(struct PcieCntlr *cntlr, uintptr_t addr, uintptr_t len, uint… in PcieVirtualAdapterDmaUnmap() argument
105 if (addr != host->dmaData || len != host->len || dir != host->dir) { in PcieVirtualAdapterDmaUnmap()
[all …]
/drivers/hdf_core/framework/model/storage/src/mmc/
Dmmc_emmc.c14 static int32_t EmmcDeviceDefaultGetCid(struct EmmcDevice *dev, uint8_t *cid, uint32_t len) in EmmcDeviceDefaultGetCid() argument
18 if (memcpy_s(cid, sizeof(uint8_t) * len, (uint8_t *)(mmc->reg.rawCid), in EmmcDeviceDefaultGetCid()
20 HDF_LOGE("EmmcDeviceDefaultGetCid: memcpy_s fail, size = %d!", len); in EmmcDeviceDefaultGetCid()
30 int32_t EmmcDeviceGetCid(struct EmmcDevice *dev, uint8_t *cid, uint32_t len) in EmmcDeviceGetCid() argument
36 if (cid == NULL || len == 0) { in EmmcDeviceGetCid()
44 return dev->emmcOps->getCid(dev, cid, len); in EmmcDeviceGetCid()
/drivers/hdf_core/framework/support/platform/src/i2c/
Di2c_msg.c30 buf += msgs[i].len; in AssignReplayBuffer()
40 uint32_t len; in RebuildMsgs() local
56 if (!HdfSbufReadBuffer(data, (const void **)&userMsgs, &len) || (userMsgs == NULL) || in RebuildMsgs()
57 (len != sizeof(struct I2cUserMsg))) { in RebuildMsgs()
63 msgs[i].len = userMsgs->len; in RebuildMsgs()
67 lenReply += msgs[i].len; in RebuildMsgs()
68 } else if ((!HdfSbufReadBuffer(data, (const void **)&buf, &len)) || (buf == NULL)) { in RebuildMsgs()
71 msgs[i].len = len; in RebuildMsgs()
116 if (!HdfSbufWriteBuffer(reply, msgs[i].buf, msgs[i].len)) { in I2cMsgsWriteToSbuf()
/drivers/hdf_core/adapter/khdf/liteos/osal/include/
Dosal_uaccess.h41 static inline size_t CopyToUser(void* to, const void* from, size_t len) in CopyToUser() argument
43 return LOS_ArchCopyToUser(to, from, len); in CopyToUser()
46 static inline size_t CopyFromUser(void* to, const void* from, size_t len) in CopyFromUser() argument
48 return LOS_ArchCopyFromUser(to, from, len); in CopyFromUser()

12345678910>>...14