mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
* pid offset into task structre
@ 2004-10-21 23:34 Fabiano Ramos
  2004-10-22 15:19 ` Vincent Hanquez
  0 siblings, 1 reply; 2+ messages in thread
From: Fabiano Ramos @ 2004-10-21 23:34 UTC (permalink / raw)
  To: LKML

Hi All. Some newbie question.

  I am writing some assembly code where I need to access the pid that issue
a certain syscall. In entry.S,  in the syscall stub, I wrote:

   GET_THREAD_INFO(%ebp)
   movl TI_task(%ebp), %ebp
   movl PID_OFFSET(%ebp), %ebx

 Questions are:
    1) Considering that I provided the correct value in PID_OFFSET, will
ebx contain the pid of the task that issued the syscall, at the end of the
fragment?

   2)  By taking some address arithmetic (&tsk.pid - &tsk) I got 144.  Is this
offset always the same? Is that an easy way to get it directly from
assembly code?


TIA,
Fabiano

^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2004-10-22 15:19 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2004-10-21 23:34 pid offset into task structre Fabiano Ramos
2004-10-22 15:19 ` Vincent Hanquez

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox

Powered by JetHome