Lines Matching full:buffer

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