LINUX.ORG.RU

История изменений

Исправление X512, (текущая версия) :

http://books.gigatux.nl/mirror/kerneldevelopment/0672327201/ch03lev1sec1.html

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 current_thread_info() function. The assembly is shown here:

movl $-8192, %eax
andl %esp, %eax


This assumes that the stack size is 8KB. When 4KB stacks are enabled, 4096 is used in lieu of 8192.

Finally, current dereferences the task member of thread_info to return the task_struct:

current_thread_info()->task;

Исходная версия X512, :