Lines Matching refs:Buffer
170 * DESCRIPTION: Copy a buffer object to another buffer object.
180 UINT8 *Buffer;
193 /* We know that SourceDesc is a buffer by now */
195 Buffer = ACPI_CAST_PTR (UINT8, SourceDesc->Buffer.Pointer);
196 Length = SourceDesc->Buffer.Length;
199 * If target is a buffer of length zero or is a static buffer,
200 * allocate a new buffer of the proper length
202 if ((TargetDesc->Buffer.Length == 0) ||
205 TargetDesc->Buffer.Pointer = ACPI_ALLOCATE (Length);
206 if (!TargetDesc->Buffer.Pointer)
211 TargetDesc->Buffer.Length = Length;
214 /* Copy source buffer to target buffer */
216 if (Length <= TargetDesc->Buffer.Length)
218 /* Clear existing buffer and copy in the new one */
220 memset (TargetDesc->Buffer.Pointer, 0, TargetDesc->Buffer.Length);
221 memcpy (TargetDesc->Buffer.Pointer, Buffer, Length);
225 * NOTE: ACPI versions up to 3.0 specified that the buffer must be
226 * truncated if the string is smaller than the buffer. However, "other"
228 * standard. ACPI 3.0A changes this behavior such that the buffer
234 * If the original source was a string, we must truncate the buffer,
235 * according to the ACPI spec. Integer-to-Buffer and Buffer-to-Buffer
236 * copy must not truncate the original buffer.
242 TargetDesc->Buffer.Length = Length;
250 memcpy (TargetDesc->Buffer.Pointer, Buffer,
251 TargetDesc->Buffer.Length);
254 "Truncating source buffer from %X to %X\n",
255 Length, TargetDesc->Buffer.Length));
260 TargetDesc->Buffer.Flags = SourceDesc->Buffer.Flags;
285 UINT8 *Buffer;
300 Buffer = ACPI_CAST_PTR (UINT8, SourceDesc->String.Pointer);
311 * String will fit in existing non-static buffer.
316 memcpy (TargetDesc->String.Pointer, Buffer, Length);
321 * Free the current buffer, then allocate a new buffer
341 memcpy (TargetDesc->String.Pointer, Buffer, Length);