Subject: Processor type

From: Philip Blundell <[email-masked]>
Date: Sat, 04 Apr 1998 15:10:59 +0100

Hi.

Attached is a patch to remove CONFIG_CPU_ARM6 (etc) from circulation.  
Instead, the configure script works out whether your hardware uses a 26-bit or 
32-bit processor and defines CONFIG_CPU_{26,32} appropriately.  You can still 
specify an exact CPU type but this is only used to work out what compiler 
options to use.  

Also, this patch implements an optimisation to reduce the impact of having to 
vector processor-specific options through the `processor' structure.  Macros 
like xchg() now expand to a call to a function in proc-fn.c, which looks up 
the appropriate processor entry, calls the function and patches the calling 
procedure to transfer control directly to the right place in the future.  At 
the moment this only works for ARM2/3 machines and a couple of functions but 
it should be easy to extend if anyone has the inclination.

It might be possible to use a similar mechanism to handle 
architecture-dependent functions.  This way, we could drop the A5k/Archimedes 
distinction and have a single kernel that runs on all 26-bit machines.

Finally, I replaced the `CONFIG_CPU_ARM2' test in page_alloc.c with a general 
check for machines with large pages.  I imagine this will be a bit more 
Torvalds-acceptable.

Usual disclaimers apply.

p.

unsubscribe: body of `unsubscribe linux-arm' to [email-masked]

---

From: Alan Cox <[email-masked]>
Date: Sat, 4 Apr 1998 15:34:49 +0100 (BST)

> 32-bit processor and defines CONFIG_CPU_{26,32} appropriately.  You can still 

What about cross compiling.

> check for machines with large pages.  I imagine this will be a bit more 

That is probably a good idea, if its written in terms of

#if PAGE_SIZE > 8192 ...

or similar

---

From: Philip Blundell <[email-masked]>
Date: Sat, 04 Apr 1998 17:15:32 +0100

>> Instead, the configure script works out whether your hardware uses a 26-bit 
>

Sorry - by `your hardware' I meant the machine type you're compiling for.  It 
has no knowledge of what you're running on.

>That is probably a good idea, if its written in terms of

I can change it to be like that if you want.  At the moment it's like this

	/* 
	 * Except on machines with very big pages, enforce a minimum of 48.
	 */
	if (PAGE_SIZE < 32768 && i < 48)
		i = 48;

It only affects the init code so it's not a performance issue.  In any case 
gcc can optimise away a compare of one constant against another.

p.

---

From: [email-masked] (H. Peter Anvin)
Date: 5 Apr 1998 04:31:30 GMT

Followup to:  <[email-masked]>
By author:    Philip Blundell <[email-masked]>
In newsgroup: linux.dev.arm
> gcc can optimise away a compare of one constant against another.

Yes; in those cases this is better to do it this way than with the
preprocessor.

	-hpa
-- 
    PGP: 2047/2A960705 BA 03 D3 2C 14 A8 A8 BD  1E DF FE 69 EE 35 BD 74
    See http://www.zytor.com/~hpa/ for web page and full PGP public key
        I am Bahá'í -- ask me about it or see http://www.bahai.org/
   "To love another person is to see the face of God." -- Les Misérables
unsubscribe: body of `unsubscribe linux-arm' to [email-masked]