From mboxrd@z Thu Jan 1 00:00:00 1970 From: arvid.brodin@enea.com (Arvid Brodin) Date: Wed, 25 May 2011 22:27:40 +0200 Subject: Build scatterlist covering a process' text segment? In-Reply-To: <4DDAE865.6000608@enea.com> References: <4DDAE865.6000608@enea.com> Message-ID: <4DDD663C.4060201@enea.com> To: kernelnewbies@lists.kernelnewbies.org List-Id: kernelnewbies.lists.kernelnewbies.org 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, ); > > 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