Can I open the macro "CONFIG_8xx" in function do_page_fault() in file kernel\linux-2.6.14-cgl\arch\ppc\mm\fault.c
Hi All,
For function do_page_fault(), my understanding is that if a "push
stack" actions occurs for a protected area (such as thread stack guard
area protected by "mprotect"), it will come here.
But it seems SIGSEGV can only be sent when CONFIG_8xx is defined. My
CPU is 8541 and I want to open this macro, but I also found there are
sveral parts in the kernel related to this macro. And I'm not sure
about it's impact.
Could any one give some proposals?
Thanks a lot.
Br.
Hema.
----------------------------------------------------------------------------------------
Below is my understanding/comments for the function.
int do_page_fault(struct pt_regs *regs, unsigned long address,
unsigned long error_code)
{
//..............
#if defined(CONFIG_8xx)
[
Comments:
If MACO CONFIG_8xx is not defined, this part will not be run. That
means we can not handle this kind of error(access a protected area),
hence SIGSEGV will not be triggered.
]
/* The MPC8xx seems to always set 0x80000000, which is
* "undefined". Of those that can be set, this is the only
* one which seems bad.
*/
if (error_code & 0x10000000)
/* Guarded storage error. */
goto bad_area;
[ Comments:
I think the error code defined in PPC platform is 0x10000000, so
goto "bad_area"
]
#endif /* CONFIG_8xx */
//..................
bad_area:
up_read(&mm->mmap_sem);
pte_errors++;
/* User mode accesses cause a SIGSEGV */
if (user_mode(regs)) {
[ Comments: Yes, we are user mod, the signal SIGSEGV will be sent
out ]
_exception(SIGSEGV, regs, code, address);
trace_kernel_trap_exit();
return 0;
}
return SIGSEGV;
//................
Reply to: