Originally posted by: Glenn Nethercutt
I have a kernel extension that allocates a buffer as a scratch area for communication with a userspace process.
On more recent 64bit kernels (say AIX6.1) I can use the vm_g{alloc,uatt,udet,free} family of functions to accomplish this with no problem. For AIX 5.x (specifically 5.2 and 5.3), I clearly don't have that API available in the 32bit kernel. What's the recommended way to:
1) allocate the memory in the global kernel address space (xmalloc?), and
2) map the kernel memory into the userspace process within the context of an ioctl() invoked by that process
The whole group of memory services in
AIX 5L Version 5.3 Kernel Extensions and Device Support Programming Concepts seems to be geared toward cross-process mapping, non-global user memory mapped into the kernel and device IO maps. Chunks of memory shared between a process and the kernel, accessible from interrupt context, isn't called out very well in any of the documents (the +Technical Reference:Kernel and Subsystems, Vol 1-2+) I've been digging through.
I suppose I could resort to allocating the memory in the user process, passing it as a pointer via the ioctl, and then pinning/mapping it into the kernel address space. This will be a long term allocation, however, and I'd rather preserve the ownership model that I already have in my 6.1 driver. I'm sure some incantation of as_att/det,vm_att/det,etc will do what I need, I'm just not sure which ones.
-Glenn
#AIX-Forum