85xx Address space query

Kumar Gala galak at kernel.crashing.org
Wed Jun 24 23:15:25 EST 2009


On Jun 24, 2009, at 4:44 AM, kernel mailz wrote:

> Hi,
>
> I am a newbie, trying to learn but have a few queries, nice if you  
> could respond
> For linux on 85xx systems...
>
> (a) Kernel code runs in PR=0 AS=0 and PID=0, which user space  
> application run in PR=1 AS=0 and PID 1-255.
> Is this correct.

correct.

> (b) I am writing a small program where the application code opens  
> invokes a ioctl call and passes a buffer pointer ( say 0x10000 in  
> user space)
> Now the driver code is using copy_from_user.
> How this works internally ?
>
> 1. User code executes ioctl
> 2. interrupt goes to the kernel

On the interrupt the PR changes from 0 -> 1

> 3. ioctl handler in driver gets invoked
> The buffer pointer still contains 0x10000.
>
> How kernel code running in PR=0 accesses it and does the copy. I am  
> not able to see a address space switch in the asm code of  
> copy_tofrom_user.

There isn't a address space switch.  But address spaces exist at the  
same time.  The user app is given 0..0xc000_0000 and the kernel uses  
0xc000_0000..0xffff_ffff.

- k


More information about the Linuxppc-dev mailing list