Re: thread_info address calculation

2011-09-16 Thread Dave Hylands
Hi Vijay, On Fri, Sep 16, 2011 at 5:16 AM, Vijay Chauhan wrote: >> It's the same thing as you read: >> THREAD size is 8kb so the operation looks like the following: >> current_stack_pointer & ~(8191) == current_stack_pointet & 0xFE00 >> (last 13 bits are 0) > > Ok. Got it. > > But how ANDing

Re: thread_info address calculation

2011-09-16 Thread Vijay Chauhan
> It's the same thing as you read: > THREAD size is 8kb so the operation looks like the following: > current_stack_pointer & ~(8191) == current_stack_pointet & 0xFE00 > (last 13 bits are 0) Ok. Got it. But how ANDing it with current stack pointer points to the address of thread_info structure

Re: thread_info address calculation

2011-09-16 Thread Denis Kirjanov
It's the same thing as you read: THREAD size is 8kb so the operation looks like the following: current_stack_pointer & ~(8191) == current_stack_pointet & 0xFE00 (last 13 bits are 0) On Fri, Sep 16, 2011 at 3:38 PM, Vijay Chauhan wrote: > Hi list, > > I would like to know how the thread_info a

thread_info address calculation

2011-09-16 Thread Vijay Chauhan
Hi list, I would like to know how the thread_info address is calculated? As per the LKD book: struct thread_info is stored on the kernel stack. On x86, current is calculated by masking out the 13 least-significant bits of the stack pointer to obtain the thread_info structure.This is done by the cu