Subject: Re: interrupt variables
To: Robert Swindells <rjs@fdy2.demon.co.uk>
From: Richard Earnshaw <rearnsha@arm.com>
List: port-arm32
Date: 07/24/2001 09:36:15
> 
> Does anyone know why the variables in arch/arm/footbridge/footbridge_irq.S
> are declared as .text instead of .data or .bss ?

Sounds like a bug to me, unless it's an attempt to keep the variables 
accessible as pc-relative stores (which would save a load cycle).
> 
> It seems a rather bad practice to me to be modifying the text segment.
> 
> The kernel text segment is declared as AP_KR in cats_machdep.c, so my
> guess is that it only works because the variables only get written to
> from irq32 mode.

IIRC, AP_KR is actually implemented as kernel READ-WRITE; there is no 
protection mode in the MMU bits for kernel read-only.   Well, you can mark 
pages as being AP=00,S=1,R=0, but the SR bits are in CP15r1 which means 
that it's fiddly to keep changing them; the kernel isn't set up to do 
that, and without doing that it would be impossible to spot the kernel 
generating a genuine segfault.

R.