Back to home page

OSCL-LXR

 
 

    


0001 // SPDX-License-Identifier: GPL-2.0-only
0002 //
0003 // Copyright(c) 2021-2022 Intel Corporation. All rights reserved.
0004 //
0005 // Author: Cezary Rojewski <cezary.rojewski@intel.com>
0006 //         Amadeusz Slawinski <amadeuszx.slawinski@linux.intel.com>
0007 //
0008 
0009 #include <linux/types.h>
0010 
0011 #define CREATE_TRACE_POINTS
0012 #include "trace.h"
0013 
0014 #define BYTES_PER_LINE 16
0015 #define MAX_CHUNK_SIZE ((PAGE_SIZE - 150) /* Place for trace header */  \
0016             / (2 * BYTES_PER_LINE + 4) /* chars per line */ \
0017             * BYTES_PER_LINE)
0018 
0019 void trace_avs_msg_payload(const void *data, size_t size)
0020 {
0021     size_t remaining = size;
0022     size_t offset = 0;
0023 
0024     while (remaining > 0) {
0025         u32 chunk;
0026 
0027         chunk = min(remaining, (size_t)MAX_CHUNK_SIZE);
0028         trace_avs_ipc_msg_payload(data, chunk, offset, size);
0029 
0030         remaining -= chunk;
0031         offset += chunk;
0032     }
0033 }