Commit 6918e83d authored by Dimitris Lampridis's avatar Dimitris Lampridis

Merge branch '42-add-a-module-parameter-to-set-the-size-of-the-hmq_buffer_out' into 'master'

Resolve "Add a module parameter to set the size of the HMQ_BUFFER_OUT"

Closes #42

See merge request be-cem-edl/common/mockturtle!32
parents be700479 4816e5b2
......@@ -1139,6 +1139,10 @@ static int input_msg_buffer_size = -1;
module_param(input_msg_buffer_size, int, S_IRUSR | S_IWUSR | S_IRGRP | S_IWGRP);
MODULE_PARM_DESC(input_msg_buffer_size, "input buffer size");
static int output_msg_buffer_size = -1;
module_param(output_msg_buffer_size, int, S_IRUSR | S_IWUSR | S_IRGRP | S_IWGRP);
MODULE_PARM_DESC(output_msg_buffer_size, "output buffer size");
/**
* Initialize and registers a HMQ device
*/
......@@ -1204,7 +1208,16 @@ int trtl_probe_hmq(struct trtl_cpu *cpu, unsigned int hmq_idx)
if (!hmq->buf_in.msg)
goto out_msg_in;
hmq->buf_out.entries = TRTL_CONFIG_ROM_MQ_SIZE_ENTRIES(hmq->cfg->sizes);
if (output_msg_buffer_size != -1) {
// check if power of 2
if (output_msg_buffer_size != 0 && (output_msg_buffer_size & (output_msg_buffer_size - 1)) != 0) {
goto out_msg_out;
}
hmq->buf_out.entries = output_msg_buffer_size;
} else {
hmq->buf_out.entries = TRTL_CONFIG_ROM_MQ_SIZE_ENTRIES(hmq->cfg->sizes);
}
hmq->buf_out.msg = kcalloc(hmq->buf_out.entries,
sizeof(struct trtl_msg),
GFP_KERNEL);
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment