[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [cdi-devel] Proposed Sound Infrastructure


I like the looks of the initial interface: it is generic and yet also
highly effective at its role.

Just a couple of caveats I'd like to point out...

> struct cdi_memory_area {
> ...
>     /* OS specific part */
>     int shm_id;

Is it possible to do perhaps make "cdi_memory_area" a generic struct,
and have an OS-specific struct defined in "cdi-osdep.h"? Something

struct cdi_memory_area {
    /* Common part */
    size_t size;
    void* vaddr;
    uintptr_t paddr;

    /* OS specific part */
    struct cdi_memory_area_os_specific osdata;

struct cdi_memory_area_os_specific {
    int shm_id;

Just an idea... Apart from that, I like the looks of this interface.


On Tue, Nov 24, 2009 at 4:18 AM, Kevin Wolf <kevin@xxxxxxxxxx> wrote:
> On Mon, Nov 23, 2009 at 12:10:47PM +1000, Matthew Iselin wrote:
>> Right, and I think a method to access other devices from CDI drivers
>> would be rather handy at times as well. This should be another CDI
>> "system call", in my opinion. How that call looks is probably
>> something to be discussed - it needs to be generic for driver code but
>> at the same time able to cater to many different ways for an OS to
>> handle devices. Any ideas?
> We found that getting this IDC (Inter Driver Communication) part right
> is the most important thing for now, so I'm ignoring the whole audio
> stuff for now.
> I have tried to write down some header file fragments that would make up
> a suitable framework, both for monolithic kernels and microkernel
> systems. Basically the only new thing is the abstraction of memory areas
> that allows a (microkernel) OS to use shared memory for the actual sound
> data, so that the user application can create the buffer and it doesn't
> need to be copied anywhere. Other OSes might decide not to implement
> this but rather do a copy. Monolithic kernels will probably just pass
> pointers around.
> I'm attaching a first attempt of the header. Comments are appreciated.
> Kevin
> _______________________________________________
> cdi-devel mailing list
> cdi-devel@xxxxxxxxxx
> http://list.tyndur.org/cgi-bin/mailman/listinfo/cdi-devel