Regarding the working of current macro in Linux kernel(I am referring to ARM architecture)
The code for current macro :
return (struct thread_info *)(sp & ~(THREAD_SIZE - 1));
This means that the struct thread_info
is placed at the top of stack ?
This is from linux Kernel development 3rd edition :
struct thread_info
lives at the bottom of the stack (for stacks that grow down) and at the top of the stack (for stacks that grow up).
How is this struct thread_info
prevented by getting overwritten ?