linux-mips
[Top] [All Lists]

Re: Remove ifdefs from setup_arch()

To: Jun Sun <jsun@mvista.com>
Subject: Re: Remove ifdefs from setup_arch()
From: Gerald Champagne <gerald.champagne@esstech.com>
Date: Fri, 12 Oct 2001 13:13:29 -0500
Cc: Geert Uytterhoeven <geert@linux-m68k.org>, Ralf Baechle <ralf@oss.sgi.com>, "linux-mips@oss.sgi.com" <linux-mips@oss.sgi.com>
References: <Pine.GSO.4.21.0110121350300.20566-100000@mullein.sonytel.be> <3BC72BE8.F50C2001@mvista.com>
Sender: owner-linux-mips@oss.sgi.com
User-agent: Mozilla/5.0 (X11; U; Linux i686; en-US; rv:0.9.3) Gecko/20010801
Can you wrap this code into small functions like machine_detect() and
board_setup() and put it all in one place?  That way those of us who
just want a simple system supporting only one board can just replace
those two functions with defines that alias the proper machine_detect
and board_setup fuctions.  Then all of the special elf sections and
function pointers go away.

If it's all in one place like this, then maybe it could be configured
in the config.in file.  I can ifdef it out for boards like mine or other
boards that can't possibly support more than one system in a given binary
image.  config.in could ifdef it in for configurations that could possibly
support more than one configuration in a given binary image.

Gerald


Jun Sun wrote:
The actual mechanism can vary and be flexible, but here is more detail what I
had in mind:

1. <my>_detect is placed in a special ELF section (mips_mach_detect), using
similar mechanism as .initcall.init section and __setup() macro.

2. in addition to the 3 possible return value, <my>_detect also returns a
function pointer to <my>_setup.  Once a final candidate is chosen, the machine
detection code will issue the right <my>_setup call.

There are probably some other related changes which need to be made, (e.g.,
prom_init() may be eliminated, etc).

It seems like I get more and more positive feedbacks on this idea.  We should
try to implement this in 2.5.

Jun







<Prev in Thread] Current Thread [Next in Thread>