Lines Matching defs:buffer
26 * DESCRIPTION: Copy a buffer object to another buffer object.
34 u8 *buffer;
44 /* We know that source_desc is a buffer by now */
46 buffer = ACPI_CAST_PTR(u8, source_desc->buffer.pointer);
47 length = source_desc->buffer.length;
50 * If target is a buffer of length zero or is a static buffer,
51 * allocate a new buffer of the proper length
53 if ((target_desc->buffer.length == 0) ||
55 target_desc->buffer.pointer = ACPI_ALLOCATE(length);
56 if (!target_desc->buffer.pointer) {
60 target_desc->buffer.length = length;
63 /* Copy source buffer to target buffer */
65 if (length <= target_desc->buffer.length) {
67 /* Clear existing buffer and copy in the new one */
69 memset(target_desc->buffer.pointer, 0,
70 target_desc->buffer.length);
71 memcpy(target_desc->buffer.pointer, buffer, length);
75 * NOTE: ACPI versions up to 3.0 specified that the buffer must be
76 * truncated if the string is smaller than the buffer. However, "other"
78 * standard. ACPI 3.0A changes this behavior such that the buffer
84 * If the original source was a string, we must truncate the buffer,
86 * copy must not truncate the original buffer.
92 target_desc->buffer.length = length;
98 memcpy(target_desc->buffer.pointer, buffer,
99 target_desc->buffer.length);
102 "Truncating source buffer from %X to %X\n",
103 length, target_desc->buffer.length));
108 target_desc->buffer.flags = source_desc->buffer.flags;
131 u8 *buffer;
143 buffer = ACPI_CAST_PTR(u8, source_desc->string.pointer);
153 * String will fit in existing non-static buffer.
158 memcpy(target_desc->string.pointer, buffer, length);
161 * Free the current buffer, then allocate a new buffer
180 memcpy(target_desc->string.pointer, buffer, length);