Solaris mmap support

OSS specific Solaris discussion (x86/SPARC)

Moderators: cesium, dev, kodachi, hannu

Solaris mmap support

Postby Zephiris » Fri Jun 29, 2007 7:10 pm

OSS for Solaris dropped mmap support more than two years ago, is there any chance of the driver being updated to work with mmap?

The old info says support was dropped because hat_getkpfnum was deprecated, and that there was then no known way to map DMA memory for the use of applications. This hasn't been the case AFAIK for around as long. devmap can be used in a variety of ways to map the memory so that applications can access it correctly regardless of 32-bit/64-bit as well.

As mmap support is important for lots of things that poke the audio device, this seems like something that should be high priority?

Now that the source is available, I'd be trying to whip up such support myself and submit a patch, but I'm not very experienced with Solaris kernel things yet, though I did do a fair bit of research on this and asked around.

Here are (hopefully) some relevant notes.
New Member
Posts: 2
Joined: Fri Jun 29, 2007 6:22 pm

Postby hannu » Fri Jun 29, 2007 8:31 pm

I recall the exact problem was that the memory should be allocated with ddi_umem_alloc() begore the devmap(9E) interface could be used. I didn't manage to find out if ddi_dma_mem_alloc() is compatible.
Hannu Savolainen (
Site Admin
Posts: 10
Joined: Fri Sep 12, 2003 6:28 am

Postby Zephiris » Fri Jun 29, 2007 9:20 pm

On the link, or so, the thread mentions that you can use ddi_dma_mem_alloc(), although...a man page does say for ddi_dma_bind_handle():
ddi_dma_addr_bind_handle() allocates DMA resources for a
memory object such that a device can perform DMA to or from
the object.
As well, the opensolaris DDI manual part specifies pretty clearly how to allocate memory for DMA stuff.
A Sun Developer note specifies how to go about combining the two in specifics:

I know the OS-specific header says that, and I also looked through the code, and see that it's now stubbed out.

Amusingly, if the old code had been commented out, instead of a stub commented out in its place, it could've probably been adapted much faster, at least, it would be relatively clear how it worked before, and essentially what needs to be done to change it. ^^;

"Not enough documentation" is slightly a copout, though (no offense intended), since there's just oodles of documentation available for Solaris on both Sun and OpenSolaris websites, man pages, examples for things, kernel source code, etc.

The driver API is relatively stable. Most of the functions haven't needed any documentation changes for 10 years or longer. Website documentation is pretty loosely organized, but I found most of that stuff searching via Google pretty quickly after looking at the source, then the devmap and hat_getkpfnum man pages.

If I had the familiarity with Solaris kernel internal stuff, I'd do it myself. ^^; I've had to occasionally do similar on FreeBSD and Linux, but I'm still rather new to having Solaris as my main OS in general...though, a big part of the reason for that being the great developer tools and performance. But I digress.

If there's anything I can do to get this moved up, I can try, but it's one of the many things I'm trying to get fixed for Solaris, since quite a few things treat it as a second class citizen (even though it gets broad first tier support from the big boys).
New Member
Posts: 2
Joined: Fri Jun 29, 2007 6:22 pm

Postby Tomservo » Sat Feb 16, 2008 6:56 pm

Saw MMAP in someone else's ossinfo -v output, so I stumbled across this.

Now that Sun's officially licensing the Open Sound System, what's the status regarding memory mapping support in Solaris? I'd figure if Sun wants it in their operating system, they'd be helping out where they can.
Solaris 4 lyfe
Posts: 40
Joined: Sat May 05, 2007 8:15 pm

Return to Solaris

Who is online

Users browsing this forum: No registered users and 1 guest