Re: [Re: __asm__ ]
Blesson Paul Wrote:
Quoted 8 lines
Thanks for the reply. I am sorry that I misspelled the
line(__asm__(....)). It is from theget_current()function inasm-i386/current.h. But I am not clear what is the whole meaning of that line(__asm__(..)) inget_current(). I am doing a project in Linux related to VFS. From VFS. this function is called to get the base of the file system. I am not getting how this function will gave the base of the file system.get_current()is called fromlookup_dentryfunction.base=dget(current->fs->root)
get_current() returns the pointer to process descriptor (struct task_struct). Kernel allocates 8KB per each process, which is used for the process descriptor of process, and process kernel stack. So masking out 13 LSB of stack poiniter yields the pointer to process descriptor.
You can find more explanation in the Chapter 3 of
<Understanding the Linux Kernel>
fs field in the process descriptor describes the root directory and the current working directory of the process. so current->fs->root is the pointer to the directory entry of process' root directory.
*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*
Lee, Ho. Software Engineer, Embedded Linux Dep, LinuxOne ICQ : #52017992, Mail : [email protected], [email protected] Homepage : http://flyduck.com, http://linuxkernel.to