Getting "current" task's pointer in 2.6

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

 



hi all,
I was going through RML's book (ch. 2). There he mentions that
having the new structure "thread_info" helps in calculating the
offsets using assembly code rather easily. How does having a struct
(which has a pointer to task_struct) stored on the top a process
kernel stack be more advantageous than storing a pointer to
task_struct itself on the same location!?

Furthermore the assembly code used to get a pointer to thread_info
masks the lower 13 bits to obtain the pointer. Does this mean that
the size of thread_info is 8191 bytes (13 bits)?? I was trying to
do a "sizeof" of struct thread_info from a sample prog. but was
getting errors when i tried to include linux/thread_info.h.....so
i thought i'll ask here! :)

thanks,
-mandeep

--
Kernelnewbies: Help each other learn about the Linux kernel.
Archive:       http://mail.nl.linux.org/kernelnewbies/
FAQ:           http://kernelnewbies.org/faq/


[Index of Archives]     [Newbies FAQ]     [Linux Kernel Mentors]     [Linux Kernel Development]     [IETF Annouce]     [Git]     [Networking]     [Security]     [Bugtraq]     [Yosemite]     [MIPS Linux]     [ARM Linux]     [Linux RAID]     [Linux SCSI]     [Linux ACPI]
  Powered by Linux