lkml.org 
[lkml]   [2019]   [Aug]   [20]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
Date
From
SubjectRe: [RFC PATCH v4 8/9] printk-rb: new functionality to support printk
On (08/08/19 00:32), John Ogness wrote:
[..]
> +void prb_init(struct printk_ringbuffer *rb, char *data, int data_size_bits,
> + struct prb_desc *descs, int desc_count_bits,
> + struct wait_queue_head *waitq)
> +{
> + struct dataring *dr = &rb->dr;
> + struct numlist *nl = &rb->nl;
> +
> + rb->desc_count_bits = desc_count_bits;
> + rb->descs = descs;
> + atomic_long_set(&descs[0].id, 0);
> + descs[0].desc.begin_lpos = 1;
> + descs[0].desc.next_lpos = 1;

dataring_desc_init(), perhaps?

> + atomic_set(&rb->desc_next_unused, 1);
> +
> + atomic_long_set(&nl->head_id, 0);
> + atomic_long_set(&nl->tail_id, 0);
> + nl->node = prb_desc_node;
> + nl->node_arg = rb;
> + nl->busy = prb_desc_busy;
> + nl->busy_arg = rb;
> +
> + dr->size_bits = data_size_bits;
> + dr->data = data;
> + atomic_long_set(&dr->head_lpos, -111 * sizeof(long));
> + atomic_long_set(&dr->tail_lpos, -111 * sizeof(long));
> + dr->getdesc = prb_getdesc;
> + dr->getdesc_arg = rb;
> +
> + atomic_long_set(&rb->fail, 0);
> +
> + rb->wq = waitq;
> +}
> +EXPORT_SYMBOL(prb_init);

-ss

\
 
 \ /
  Last update: 2019-08-20 11:59    [W:0.654 / U:1.760 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site