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

Re: [microblaze-uclinux] newbie question - KSP in entry.S



Hi Gary,

Gary Schumacher wrote:
We are using uClinux (2.4.32-uc0) on a Microblaze processor here and am hunting down a problem. In doing so, I am looking at entry.S and have a question how KSP is used. It is first set in head.S and is read in SAVE_STATE and written in RETURN. On the surface one would assume that KSP would maintain a value close to its original value (+- SAVE_SIZE) but I see it changing greatly. Could somebody enlighten me on what I am missing on the usage of KSP in 2.4?

Each Linux process has two stacks - one userspace, and one kernel space. KSP is a kernel global variable holds the value of the kernel stack pointer, for the current process, while it is running in usermode. It is required because unlike some other CPUs, MicroBlaze doesn't have seperate system and user stack pointer registers.

In a nutshell you see many different values because each process has its own kernel stack.

There's a good description of this stuff in "Understanding the Linux Kernel", but you need to read it a few times before it makes sense!

Cheers,

John

___________________________
microblaze-uclinux mailing list
microblaze-uclinux@xxxxxxxxxxxxxx
Project Home Page : http://www.itee.uq.edu.au/~jwilliams/mblaze-uclinux
Mailing List Archive : http://www.itee.uq.edu.au/~listarch/microblaze-uclinux/