Home
last modified time | relevance | path

Searched refs:buffer (Results 1 – 25 of 717) sorted by relevance

12345678910>>...29

/device/google/cuttlefish_common/common/libs/utils/
Dsimulated_buffer_test.cpp68 MockSimulatedBuffer<SimulatedBufferBase> buffer; member in SimulatedBufferTest
70 SimulatedBufferTest() : buffer(kItemRate, kBufferCapacity, &clock) { } in SimulatedBufferTest()
77 buffer.FetchCurrentTime(&actual_time); in TEST_F()
82 buffer.SleepUntilTime(test_time); in TEST_F()
83 buffer.FetchCurrentTime(&actual_time); in TEST_F()
88 buffer.SleepUntilTime(test_time); in TEST_F()
89 buffer.FetchCurrentTime(&actual_time); in TEST_F()
95 EXPECT_EQ(0, buffer.GetCurrentItemNum()); in TEST_F()
99 buffer.FetchCurrentTime(&actual_time); in TEST_F()
101 buffer.SleepUntilTime(test_time); in TEST_F()
[all …]
/device/google/contexthub/util/nanotool/
Dnanomessage.cpp32 bool HardwareVersionInfo::Populate(const std::vector<uint8_t>& buffer) { in Populate() argument
33 if (buffer.size() != sizeof(VersionInfo)) { in Populate()
37 const uint8_t *data = buffer.data(); in Populate()
51 char buffer[1024]; in ToString() local
52 snprintf(buffer, sizeof(buffer), format_string, in ToString()
58 return std::string(buffer); in ToString()
66 char buffer[128]; in ToString() local
67 snprintf(buffer, sizeof(buffer), format_string, in ToString()
69 return std::string(buffer); in ToString()
72 bool WriteEventResponse::Populate(const std::vector<uint8_t>& buffer) { in Populate() argument
[all …]
Dsensorevent.cpp34 const std::vector<uint8_t>& buffer) { in FromBytes() argument
38 ReadEventResponse::EventTypeFromBuffer(buffer) - in FromBytes()
96 (!sensor_event->Populate(buffer) || !sensor_event->SizeIsValid())) { in FromBytes()
154 char buffer[32]; in GetSampleTimeStr() local
155 snprintf(buffer, sizeof(buffer), "%" PRIu64 ".%06" PRIu64 " ms", in GetSampleTimeStr()
158 return std::string(buffer); in GetSampleTimeStr()
176 char buffer[64]; in ToString() local
177 snprintf(buffer, sizeof(buffer), in ToString()
183 return std::string(buffer) + StringForAllSamples(); in ToString()
212 char buffer[64]; in StringForSample() local
[all …]
/device/linaro/bootloader/edk2/EdkCompatibilityPkg/Other/Maintained/Tools/Pccts/h/
DATokenBuffer.cpp56 buffer = (_ANTLRTokenPtr *) in ANTLRTokenBuffer()
58 if ( buffer == NULL ) { in ANTLRTokenBuffer()
61 buffer++; // leave the first elem empty so tp-1 is valid ptr in ANTLRTokenBuffer()
63 tp = &buffer[0]; in ANTLRTokenBuffer()
65 next = &buffer[0]; in ANTLRTokenBuffer()
67 end_of_buffer = &buffer[buffer_size-1]; in ANTLRTokenBuffer()
69 threshold = &buffer[(int)(buffer_size / 2)]; in ANTLRTokenBuffer()
83 for (z=buffer; z<=last; z++) in ~ANTLRTokenBuffer()
98 if ( buffer!=NULL ) free((char *)(buffer-1)); in ~ANTLRTokenBuffer()
120 fprintf(stderr,"getToken: next > threshold (high water is %d)\n", threshold-buffer); in getToken()
[all …]
/device/linaro/bootloader/edk2/BaseTools/Source/C/VfrCompile/Pccts/h/
DATokenBuffer.cpp58 buffer = (_ANTLRTokenPtr *) in ANTLRTokenBuffer()
60 if ( buffer == NULL ) { in ANTLRTokenBuffer()
63 buffer++; // leave the first elem empty so tp-1 is valid ptr in ANTLRTokenBuffer()
65 tp = &buffer[0]; in ANTLRTokenBuffer()
67 next = &buffer[0]; in ANTLRTokenBuffer()
69 end_of_buffer = &buffer[buffer_size-1]; in ANTLRTokenBuffer()
70 threshold = &buffer[(int)(buffer_size/2)]; // MR23 - Used to be 1.0/2.0 ! in ANTLRTokenBuffer()
84 for (z=buffer; z<=last; z++) in ~ANTLRTokenBuffer()
99 if ( buffer!=NULL ) free((char *)(buffer-1)); in ~ANTLRTokenBuffer()
121 /* MR23 */ printMessage(stderr,"getToken: next > threshold (high water is %d)\n", threshold-buffer); in getToken()
[all …]
/device/google/contexthub/util/stm32_flash/
Dspi.c24 uint8_t spi_write_data(handle_t *handle, uint8_t *buffer, int length) in spi_write_data() argument
30 .tx_buf = (unsigned long)buffer, in spi_write_data()
31 .rx_buf = (unsigned long)buffer, in spi_write_data()
35 buffer[length] = checksum(handle, buffer, length); in spi_write_data()
38 return buffer[length]; in spi_write_data()
46 uint8_t buffer[] = in spi_write_cmd() local
54 .len = sizeof(buffer), in spi_write_cmd()
55 .tx_buf = (unsigned long)buffer, in spi_write_cmd()
56 .rx_buf = (unsigned long)buffer, in spi_write_cmd()
69 uint8_t buffer[] = in spi_read_data() local
[all …]
Dstm32_bl.c45 uint8_t buffer[sizeof(uint8_t)+1]; in write_len() local
47 buffer[0] = len-1; in write_len()
49 return handle->write_data(handle, buffer, sizeof(uint8_t)); in write_len()
54 uint8_t buffer[sizeof(uint16_t)+1]; in write_cnt() local
56 buffer[0] = (cnt >> 8) & 0xFF; in write_cnt()
57 buffer[1] = (cnt ) & 0xFF; in write_cnt()
59 return handle->write_data(handle, buffer, sizeof(uint16_t)); in write_cnt()
64 uint8_t buffer[sizeof(uint32_t)+1]; in write_addr() local
66 buffer[0] = (addr >> 24) & 0xFF; in write_addr()
67 buffer[1] = (addr >> 16) & 0xFF; in write_addr()
[all …]
Dflash.c71 uint8_t *buffer; in main() local
226 buffer = calloc(tot_len(buf.st_size), 1); in main()
230 if (fread(&buffer[sizeof(uint32_t)], 1, length, file) < (size_t)length) { in main()
232 free(buffer); in main()
242 buffer[0] = type; in main()
243 buffer[1] = (length >> 16) & 0xFF; in main()
244 buffer[2] = (length >> 8) & 0xFF; in main()
245 buffer[3] = (length ) & 0xFF; in main()
246 crc = ~stm32f4_crc32(buffer, sizeof(uint32_t) + length); in main()
248 memcpy(&buffer[sizeof(uint32_t) + pad(length)], in main()
[all …]
Di2c.c26 uint8_t i2c_write_data(handle_t *handle, uint8_t *buffer, int length) in i2c_write_data() argument
30 buffer[length] = checksum(handle, buffer, length); in i2c_write_data()
32 if (write(i2c_handle->fd, buffer, length+1) == (length+1)) in i2c_write_data()
40 uint8_t buffer[sizeof(uint8_t)+1] = in i2c_write_cmd() local
45 return handle->write_data(handle, buffer, sizeof(uint8_t)); in i2c_write_cmd()
60 uint8_t buffer; in i2c_read_ack() local
62 if (handle->read_data(handle, &buffer, sizeof(uint8_t)) == CMD_ACK) in i2c_read_ack()
63 return buffer; in i2c_read_ack()
/device/linaro/hikey/gralloc960/
Dmali_gralloc_bufferdescriptor.cpp117 int mali_gralloc_get_backing_store_internal(buffer_handle_t buffer, gralloc1_backing_store_t *outSt… in mali_gralloc_get_backing_store_internal() argument
119 if (private_handle_t::validate(buffer) < 0) in mali_gralloc_get_backing_store_internal()
121 AERR("Invalid buffer %p, returning error", buffer); in mali_gralloc_get_backing_store_internal()
125 private_handle_t *hnd = (private_handle_t *)buffer; in mali_gralloc_get_backing_store_internal()
131 int mali_gralloc_get_consumer_usage_internal(buffer_handle_t buffer, uint64_t *outUsage) in mali_gralloc_get_consumer_usage_internal() argument
133 if (private_handle_t::validate(buffer) < 0) in mali_gralloc_get_consumer_usage_internal()
135 AERR("Invalid buffer %p, returning error", buffer); in mali_gralloc_get_consumer_usage_internal()
139 private_handle_t *hnd = (private_handle_t *)buffer; in mali_gralloc_get_consumer_usage_internal()
144 int mali_gralloc_get_dimensions_internal(buffer_handle_t buffer, uint32_t *outWidth, uint32_t *outH… in mali_gralloc_get_dimensions_internal() argument
146 if (private_handle_t::validate(buffer) < 0) in mali_gralloc_get_dimensions_internal()
[all …]
Dmali_gralloc_public_interface.cpp104 static int32_t mali_gralloc_get_backing_store(gralloc1_device_t *device, buffer_handle_t buffer, in mali_gralloc_get_backing_store() argument
108 ret = mali_gralloc_get_backing_store_internal(buffer, outStore); in mali_gralloc_get_backing_store()
113 static int32_t mali_gralloc_get_consumer_usage(gralloc1_device_t *device, buffer_handle_t buffer, in mali_gralloc_get_consumer_usage() argument
117 ret = mali_gralloc_get_consumer_usage_internal(buffer, outUsage); in mali_gralloc_get_consumer_usage()
122 static int32_t mali_gralloc_get_dimensions(gralloc1_device_t *device, buffer_handle_t buffer, uint3… in mali_gralloc_get_dimensions() argument
126 ret = mali_gralloc_get_dimensions_internal(buffer, outWidth, outHeight); in mali_gralloc_get_dimensions()
131 static int32_t mali_gralloc_get_format(gralloc1_device_t *device, buffer_handle_t buffer, int32_t *… in mali_gralloc_get_format() argument
134 ret = mali_gralloc_get_format_internal(buffer, outFormat); in mali_gralloc_get_format()
139 static int32_t mali_gralloc_get_producer_usage(gralloc1_device_t *device, buffer_handle_t buffer, in mali_gralloc_get_producer_usage() argument
143 ret = mali_gralloc_get_producer_usage_internal(buffer, outUsage); in mali_gralloc_get_producer_usage()
[all …]
/device/generic/goldfish-opengl/android-emu/android/base/files/
DStreamSerializing.h32 void saveBufferRaw(Stream* stream, char* buffer, uint32_t len);
33 bool loadBufferRaw(Stream* stream, char* buffer);
36 void saveBuffer(Stream* stream, const std::vector<T>& buffer) { in saveBuffer() argument
37 stream->putBe32(buffer.size()); in saveBuffer()
38 stream->write(buffer.data(), sizeof(T) * buffer.size()); in saveBuffer()
42 bool loadBuffer(Stream* stream, std::vector<T>* buffer) { in loadBuffer() argument
44 buffer->resize(len); in loadBuffer()
45 int ret = (int)stream->read(buffer->data(), len * sizeof(T)); in loadBuffer()
50 void saveBuffer(Stream* stream, const SmallVector<T>& buffer) { in saveBuffer() argument
51 stream->putBe32(buffer.size()); in saveBuffer()
[all …]
/device/google/bonito/health/
DLearnedCapacityBackupRestore.cpp44 std::string buffer; in ReadPersistData() local
46 if (!android::base::ReadFileToString(std::string(kSysCFPersistFile), &buffer)) { in ReadPersistData()
51 if (sscanf(buffer.c_str(), "%d", &sw_cap_) < 1) in ReadPersistData()
52 LOG(ERROR) << "data format is wrong in the storage file: " << buffer; in ReadPersistData()
54 LOG(INFO) << "Storage data: " << buffer; in ReadPersistData()
69 std::string buffer; in ReadNominalCapacity() local
71 if (!android::base::ReadFileToString(std::string(kChgFullDesignFile), &buffer)) { in ReadNominalCapacity()
76 buffer = android::base::Trim(buffer); in ReadNominalCapacity()
78 if (sscanf(buffer.c_str(), "%d", &nom_cap_) < 1) in ReadNominalCapacity()
79 LOG(ERROR) << "Failed to parse nominal capacity: " << buffer; in ReadNominalCapacity()
[all …]
/device/generic/goldfish/wifi/execns/
Dexecns.cpp103 char buffer[32]; in readNamespacePid() local
104 size_t bytesRead = ::fread(buffer, 1, sizeof(buffer), file.get()); in readNamespacePid()
105 if (bytesRead < sizeof(buffer) && feof(file.get())) { in readNamespacePid()
107 buffer[bytesRead] = '\0'; in readNamespacePid()
108 if (isNumericString(buffer)) { in readNamespacePid()
110 return buffer; in readNamespacePid()
112 LOGE("File %s does not contain a valid pid '%s'", nsPath, buffer); in readNamespacePid()
186 static int sncatf(char* buffer, size_t size, const char* fmt, ...) { in sncatf() argument
187 size_t len = strnlen(buffer, size); in sncatf()
197 int printed = vsnprintf(buffer + len, size - len, fmt, args); in sncatf()
[all …]
/device/google/cuttlefish_common/guest/hals/gralloc/
Dmapper.cpp70 GrallocBuffer* buffer = reinterpret_cast<GrallocBuffer*>( in reference_buffer() local
72 if (!buffer) { in reference_buffer()
73 buffer = new GrallocBuffer(); in reference_buffer()
74 hashmapPut(map, const_cast<int*>(&hnd->offset), buffer); in reference_buffer()
77 if (!buffer->vaddr) { in reference_buffer()
96 buffer->vaddr = mapped; in reference_buffer()
98 buffer->ref_count++; in reference_buffer()
99 return buffer->vaddr; in reference_buffer()
106 GrallocBuffer* buffer = reinterpret_cast<GrallocBuffer*>( in unreference_buffer() local
108 if (!buffer) { in unreference_buffer()
[all …]
/device/google/contexthub/firmware/os/core/
DhostIntf.c87 struct HostIntfDataBuffer buffer; member
419 void hostIntfTxAck(void *buffer, uint8_t len) in hostIntfTxAck() argument
423 memcpy(txPayload, buffer, len); in hostIntfTxAck()
538 sensor->buffer.length = 0; in resetBuffer()
539 memset(&sensor->buffer.firstSample, 0x00, sizeof(struct SensorFirstSample)); in resetBuffer()
560 struct HostIntfDataBuffer *buffer = data; in hostIntfPacketDequeue() local
565 ret = simpleQueueDequeue(mOutputQ, buffer); in hostIntfPacketDequeue()
567 sensor = getActiveSensorByType(buffer->sensType); in hostIntfPacketDequeue()
570 …if (sensor->sensorHandle == 0 && !buffer->firstSample.biasPresent && !buffer->firstSample.numFlush… in hostIntfPacketDequeue()
575 sensor->curSamples -= buffer->firstSample.numSamples; in hostIntfPacketDequeue()
[all …]
/device/linaro/bootloader/edk2/SecurityPkg/Library/HashLibTpm2/
DHashLibTpm2.c110 …(HashLen = DataToHashLen; HashLen > sizeof(HashBuffer.buffer); HashLen -= sizeof(HashBuffer.buffer in HashUpdate()
112 HashBuffer.size = sizeof(HashBuffer.buffer); in HashUpdate()
113 CopyMem(HashBuffer.buffer, Buffer, sizeof(HashBuffer.buffer)); in HashUpdate()
114 Buffer += sizeof(HashBuffer.buffer); in HashUpdate()
126 CopyMem(HashBuffer.buffer, Buffer, (UINTN)HashLen); in HashUpdate()
166 …(HashLen = DataToHashLen; HashLen > sizeof(HashBuffer.buffer); HashLen -= sizeof(HashBuffer.buffer in HashCompleteAndExtend()
168 HashBuffer.size = sizeof(HashBuffer.buffer); in HashCompleteAndExtend()
169 CopyMem(HashBuffer.buffer, Buffer, sizeof(HashBuffer.buffer)); in HashCompleteAndExtend()
170 Buffer += sizeof(HashBuffer.buffer); in HashCompleteAndExtend()
182 CopyMem(HashBuffer.buffer, Buffer, (UINTN)HashLen); in HashCompleteAndExtend()
[all …]
/device/google/marlin/health/
DLearnedCapacityBackupRestore.cpp53 std::string buffer; in ReadFromStorage() local
55 if (!android::base::ReadFileToString(std::string(kSysCFPersistFile), &buffer)) { in ReadFromStorage()
60 if (sscanf(buffer.c_str(), "%d", &sw_cap_) < 1) in ReadFromStorage()
61 LOG(ERROR) << "data format is wrong in the storage file: " << buffer; in ReadFromStorage()
63 LOG(INFO) << "Storage data: " << buffer; in ReadFromStorage()
78 std::string buffer; in ReadFromSRAM() local
80 if (!android::base::ReadFileToString(std::string(kChgFullFile), &buffer)) { in ReadFromSRAM()
85 buffer = android::base::Trim(buffer); in ReadFromSRAM()
87 if (sscanf(buffer.c_str(), "%d", &hw_cap_) < 1) in ReadFromSRAM()
88 LOG(ERROR) << "Failed to parse SRAM bins: " << buffer; in ReadFromSRAM()
[all …]
DCycleCountBackupRestore.cpp45 std::string buffer; in ReadFromStorage() local
47 if (!android::base::ReadFileToString(std::string(kSysPersistFile), &buffer)) { in ReadFromStorage()
52 if (sscanf(buffer.c_str(), "%d %d %d %d %d %d %d %d", in ReadFromStorage()
56 LOG(ERROR) << "data format is wrong in the storage file: " << buffer; in ReadFromStorage()
58 LOG(INFO) << "Storage data: " << buffer; in ReadFromStorage()
77 std::string buffer; in ReadFromSRAM() local
79 if (!android::base::ReadFileToString(std::string(kCycCntFile), &buffer)) { in ReadFromSRAM()
84 buffer = android::base::Trim(buffer); in ReadFromSRAM()
86 if (sscanf(buffer.c_str(), "%d %d %d %d %d %d %d %d", in ReadFromSRAM()
90 LOG(ERROR) << "Failed to parse SRAM bins: " << buffer; in ReadFromSRAM()
[all …]
/device/google/wahoo/health/
DLearnedCapacityBackupRestore.cpp53 std::string buffer; in ReadFromStorage() local
55 if (!android::base::ReadFileToString(std::string(kSysCFPersistFile), &buffer)) { in ReadFromStorage()
60 if (sscanf(buffer.c_str(), "%d", &sw_cap_) < 1) in ReadFromStorage()
61 LOG(ERROR) << "data format is wrong in the storage file: " << buffer; in ReadFromStorage()
63 LOG(INFO) << "Storage data: " << buffer; in ReadFromStorage()
78 std::string buffer; in ReadFromSRAM() local
80 if (!android::base::ReadFileToString(std::string(kChgFullFile), &buffer)) { in ReadFromSRAM()
85 buffer = android::base::Trim(buffer); in ReadFromSRAM()
87 if (sscanf(buffer.c_str(), "%d", &hw_cap_) < 1) in ReadFromSRAM()
88 LOG(ERROR) << "Failed to parse SRAM bins: " << buffer; in ReadFromSRAM()
[all …]
DCycleCountBackupRestore.cpp45 std::string buffer; in ReadFromStorage() local
47 if (!android::base::ReadFileToString(std::string(kSysPersistFile), &buffer)) { in ReadFromStorage()
52 if (sscanf(buffer.c_str(), "%d %d %d %d %d %d %d %d", in ReadFromStorage()
56 LOG(ERROR) << "data format is wrong in the storage file: " << buffer; in ReadFromStorage()
58 LOG(INFO) << "Storage data: " << buffer; in ReadFromStorage()
77 std::string buffer; in ReadFromSRAM() local
79 if (!android::base::ReadFileToString(std::string(kCycCntFile), &buffer)) { in ReadFromSRAM()
84 buffer = android::base::Trim(buffer); in ReadFromSRAM()
86 if (sscanf(buffer.c_str(), "%d %d %d %d %d %d %d %d", in ReadFromSRAM()
90 LOG(ERROR) << "Failed to parse SRAM bins: " << buffer; in ReadFromSRAM()
[all …]
/device/linaro/bootloader/edk2/AppPkg/Applications/Python/Python-2.7.10/PyMod-2.7.10/Python/
Drandom.c79 win32_urandom(unsigned char *buffer, Py_ssize_t size, int raise) in win32_urandom() argument
92 if (!pCryptGenRandom(hCryptProv, chunk, buffer)) in win32_urandom()
102 buffer += chunk; in win32_urandom()
114 py_getentropy(unsigned char *buffer, Py_ssize_t size, int fatal) in py_getentropy() argument
122 res = getentropy(buffer, len); in py_getentropy()
131 res = getentropy(buffer, len); in py_getentropy()
136 buffer += len; in py_getentropy()
147 vms_urandom(unsigned char *buffer, Py_ssize_t size, int raise) in vms_urandom() argument
149 if (RAND_pseudo_bytes(buffer, size) < 0) { in vms_urandom()
179 dev_urandom_noraise(unsigned char *buffer, Py_ssize_t size) in dev_urandom_noraise() argument
[all …]
/device/linaro/hikey/hifi/xaf/hifi-dpf/audio/
Dxa-class-base.c168 xf_set_param_msg_t *cmd = m->buffer; in xa_base_set_param()
212 xf_get_param_msg_t *cmd = m->buffer; in xa_base_get_param()
246 xf_ext_param_msg_t *cmd = m->buffer; in xa_base_set_param_ext()
255 ((u8 *)m->buffer)[i + 0], ((u8 *)m->buffer)[i + 1], in xa_base_set_param_ext()
256 ((u8 *)m->buffer)[i + 2], ((u8 *)m->buffer)[i + 3], in xa_base_set_param_ext()
257 ((u8 *)m->buffer)[i + 4], ((u8 *)m->buffer)[i + 5], in xa_base_set_param_ext()
258 ((u8 *)m->buffer)[i + 6], ((u8 *)m->buffer)[i + 7], in xa_base_set_param_ext()
259 ((u8 *)m->buffer)[i + 8], ((u8 *)m->buffer)[i + 9], in xa_base_set_param_ext()
260 ((u8 *)m->buffer)[i + 10], ((u8 *)m->buffer)[i + 11], in xa_base_set_param_ext()
261 ((u8 *)m->buffer)[i + 12], ((u8 *)m->buffer)[i + 13], in xa_base_set_param_ext()
[all …]
/device/google/marlin/dataservices/datatop/src/
Ddatatop_fileops.c58 int dt_read_file(const char *file, char **buffer, int len) in dt_read_file() argument
63 *buffer = (char *)malloc(len); in dt_read_file()
64 if (!(*buffer)) { in dt_read_file()
73 free(*buffer); in dt_read_file()
74 *buffer = 0; in dt_read_file()
77 read = fread(*buffer, sizeof(char), len, fp); in dt_read_file()
88 void dt_free(char **buffer) in dt_free() argument
90 free(*buffer); in dt_free()
91 *buffer = 0; in dt_free()
/device/google/cuttlefish_common/host/frontend/stream_audio/
Dmain.cpp132 std::vector<char>* buffer) const { in ReadAudioMessage()
135 audio_data_rv, buffer->data(), buffer->size()); in ReadAudioMessage()
137 DoubleSize(buffer); in ReadAudioMessage()
141 buffer->resize(read_size); in ReadAudioMessage()
147 void DoubleSize(std::vector<char>* buffer) const { in DoubleSize()
148 if (buffer->empty()) { in DoubleSize()
149 buffer->resize(1); in DoubleSize()
151 buffer->resize(buffer->size() * 2); in DoubleSize()
155 gce_audio_message GetHeaderFromBuffer(const std::vector<char>& buffer) const { in GetHeaderFromBuffer()
157 CHECK_GE(buffer.size(), sizeof new_header); in GetHeaderFromBuffer()
[all …]

12345678910>>...29