* Circular queue
@ 2007-07-24 8:18 David H. Lynch Jr.
2007-07-25 6:26 ` Misbah khan
2007-07-26 19:55 ` David Hawkins
0 siblings, 2 replies; 3+ messages in thread
From: David H. Lynch Jr. @ 2007-07-24 8:18 UTC (permalink / raw)
To: linuxppc-embedded
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 ?
--
Dave Lynch DLA Systems
Software Development: Embedded Linux
717.627.3770 dhlii@dlasys.net http://www.dlasys.net
fax: 1.253.369.9244 Cell: 1.717.587.7774
Over 25 years' experience in platforms, languages, and technologies too numerous to list.
"Any intelligent fool can make things bigger and more complex... It takes a touch of genius - and a lot of courage to move in the opposite direction."
Albert Einstein
^ permalink raw reply [flat|nested] 3+ messages in thread
* Re: Circular queue
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
1 sibling, 0 replies; 3+ messages in thread
From: Misbah khan @ 2007-07-25 6:26 UTC (permalink / raw)
To: linuxppc-embedded
hi ....
Yes ofcourse there is a data structure for circular buffer implementation in
the driver but for the version 2.6.10 and onwards. Just see the
documentation on header file <linux/kfifo.h> I myself never tried with this
,where in i had implimented a circular buffer in the kernel and you need to
take care with the read index and write index. I suggest you to built your
own circular buffer insted on relaying on the standered because as far as i
know you should not relay on something new and untested . If you feel any
problem in the implementation i can help you in that.
regard
Misbah
David H. Lynch Jr.-2 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 ?
>
>
>
>
>
>
>
>
> --
> Dave Lynch DLA Systems
> Software Development: Embedded Linux
> 717.627.3770 dhlii@dlasys.net http://www.dlasys.net
> fax: 1.253.369.9244 Cell: 1.717.587.7774
> Over 25 years' experience in platforms, languages, and technologies too
> numerous to list.
>
> "Any intelligent fool can make things bigger and more complex... It takes
> a touch of genius - and a lot of courage to move in the opposite
> direction."
> Albert Einstein
>
> _______________________________________________
> Linuxppc-embedded mailing list
> Linuxppc-embedded@ozlabs.org
> https://ozlabs.org/mailman/listinfo/linuxppc-embedded
>
>
--
View this message in context: http://www.nabble.com/Circular-queue-tf4134423.html#a11777050
Sent from the linuxppc-embedded mailing list archive at Nabble.com.
^ permalink raw reply [flat|nested] 3+ messages in thread
* Re: Circular queue
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
1 sibling, 0 replies; 3+ messages in thread
From: David Hawkins @ 2007-07-26 19:55 UTC (permalink / raw)
To: David H. Lynch Jr.; +Cc: linuxppc-embedded
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
^ permalink raw reply [flat|nested] 3+ messages in thread
end of thread, other threads:[~2007-07-26 19:56 UTC | newest]
Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
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 is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.