Lines Matching +full:- +full:w
4 * SPDX-License-Identifier: Apache-2.0
55 #define MTRACE_LOG_BUF_SIZE (ADSP_DW_SLOT_SIZE - 2 * sizeof(uint32_t))
64 uint8_t data[ADSP_DW_SLOT_SIZE - sizeof(uint32_t) * 2];
69 if (ADSP_DW->descs[0].type == MTRACE_LOGGING_SLOT_TYPE(MTRACE_CORE)) { in mtrace_init()
73 ADSP_DW->descs[0].type = MTRACE_LOGGING_SLOT_TYPE(MTRACE_CORE); in mtrace_init()
78 struct adsp_debug_slot *slot = (struct adsp_debug_slot *)(ADSP_DW->slots[0]); in mtrace_out()
79 uint8_t *data = slot->data; in mtrace_out()
80 uint32_t r = slot->host_ptr; in mtrace_out()
81 uint32_t w = slot->dsp_ptr; in mtrace_out() local
84 if (w > r) { in mtrace_out()
85 avail = MTRACE_LOG_BUF_SIZE - w + r - 1; in mtrace_out()
86 } else if (w == r) { in mtrace_out()
87 avail = MTRACE_LOG_BUF_SIZE - 1; in mtrace_out()
89 avail = r - w - 1; in mtrace_out()
100 if (w + out >= MTRACE_LOG_BUF_SIZE) { in mtrace_out()
101 size_t tail = MTRACE_LOG_BUF_SIZE - w; in mtrace_out()
102 size_t head = out - tail; in mtrace_out()
104 memcpy(data + w, str, tail); in mtrace_out()
106 w = head; in mtrace_out()
108 memcpy(data + w, str, out); in mtrace_out()
109 w += out; in mtrace_out()
112 slot->dsp_ptr = w; in mtrace_out()
116 *space_left = avail > len ? avail - len : 0; in mtrace_out()
187 log_output_func(&log_output_adsp_mtrace, &msg->log, format_flags()); in process()