Build scatterlist covering a process' text segment?

Arvid Brodin arvid.brodin at enea.com
Wed May 25 16:27:40 EDT 2011


Arvid Brodin wrote:
> Hi,
> 
> How do I build a scatterlist covering the text segment of a process? I have
> found (struct task_struct).mm->start_code and ->end_code, that gives the address
> (in some - unknown to me - address space) of the text segment. Since my try to
> convert these addresses to an sglist:
> 
> 	sg_init_one(&sg, task->mm->start_code, <length>);
> 
> failed miserably, I'm guessing these addresses need to be converted to some
> address space compatible with sg_init_one()/sg_set_buf() before use? (I probably
> need to search for pages containing these addresses?)
> 

Am I correct in that the addresses in (struct task_struct).mm->start_code and
->end_code belong to the address space of the process whose task_struct I'm looking
at?

-- 
Arvid Brodin
Enea Services Stockholm AB



More information about the Kernelnewbies mailing list