From: David Hawkins <dwh@ovro•caltech.edu>
To: "David H. Lynch Jr." <dhlii@dlasys•net>
Cc: linuxppc-embedded@ozlabs•org
Subject: Re: Circular queue
Date: Thu, 26 Jul 2007 12:55:11 -0700 [thread overview]
Message-ID: <46A8FC1F.5070807@ovro.caltech.edu> (raw)
In-Reply-To: <46A5B5BA.2080707@dlasys.net>
David H. Lynch Jr. wrote:
> Is there a standard linux datastructure and routines to manage
> circular queues ?
>
> I have a device that is not fundimentally different from a serial
> character device
> except it is faster and the fundimental data type is 36 bits large.
>
> I have coded my own routines to setup and maintain a simple circular
> queue,
> but I was hoping that there might be something more standard that
> already exists.
>
> Anyone know of anything ?
Hi David,
Have you looked at the linked-list support? You can use it
for a circular queue.
I just copied the following comments from some driver examples
I wrote a while back:
http://www.ovro.caltech.edu/~dwh/correlator/software/driver_design.tar.gz
http://www.ovro.caltech.edu/~dwh/correlator/pdf/LNX-723-Hawkins.pdf
simple_page_buffer.c
*-----------------------------------------------------------------
* References:
* [1] "Linux device drivers", 3rd Ed, J. Corbet, A. Rubini,
* G. Kroah-Hartman, 2005
* [2] "Linux kernel development", 2nd Ed., R. Love.
*-----------------------------------------------------------------
*/
* For details on linked-lists, see p295 [1] and p345 [2].
I didn't look at the code again, but I'm pretty sure I used the
linked list for a circular buffer.
Cheers
Dave
prev parent reply other threads:[~2007-07-26 19:56 UTC|newest]
Thread overview: 3+ messages / expand[flat|nested] mbox.gz Atom feed top
2007-07-24 8:18 Circular queue David H. Lynch Jr.
2007-07-25 6:26 ` Misbah khan
2007-07-26 19:55 ` David Hawkins [this message]
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=46A8FC1F.5070807@ovro.caltech.edu \
--to=dwh@ovro$(echo .)caltech.edu \
--cc=dhlii@dlasys$(echo .)net \
--cc=linuxppc-embedded@ozlabs$(echo .)org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox