All of lore.kernel.org
 help / color / mirror / Atom feed
From: Jun Sun <jsun@mvista.com>
To: Geert Uytterhoeven <geert@linux-m68k.org>
Cc: Ralf Baechle <ralf@oss.sgi.com>,
	Gerald Champagne <gerald.champagne@esstech.com>,
	"linux-mips@oss.sgi.com" <linux-mips@oss.sgi.com>
Subject: Re: Remove ifdefs from setup_arch()
Date: Fri, 12 Oct 2001 10:44:08 -0700	[thread overview]
Message-ID: <3BC72BE8.F50C2001@mvista.com> (raw)
In-Reply-To: Pine.GSO.4.21.0110121350300.20566-100000@mullein.sonytel.be

Geert Uytterhoeven wrote:
> 
> On Wed, 3 Oct 2001, Jun Sun wrote:
> > I talked about machine detection a while back.  My idea is following:
> >
> > 0. all machines that are *configured* into the image will supply <my>_detect()
> > and <my>_setup() functions.
> >
> > 1. at MIPS start up, we loop through all <my>_detect(), which returns three
> > values, a) run-time detection negative, b) run-time detection positive, and c)
> > no run-time detection code, but I return positive because I am configured in.
> >
> > 2. the startup code resolves conflicts (which sometimes may panic); and decide
> > on one machine.
> >
> > 3. then the startup code calls the right <my>_setup() code which will set up
> > the mach_type and other stuff.
> 
> Nice!
> 
> I suppose you want to have struct containing pointers to both the detect() and
> setup() functions, so you know which setup() function you have to call?
> 

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

  reply	other threads:[~2001-10-12 17:44 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2001-10-03 19:11 Remove ifdefs from setup_arch() Gerald Champagne
2001-10-03 19:29 ` Ralf Baechle
2001-10-03 21:11   ` Jun Sun
2001-10-12 11:52     ` Geert Uytterhoeven
2001-10-12 17:44       ` Jun Sun [this message]
2001-10-12 18:13         ` Gerald Champagne
2001-10-12 21:35           ` Ralf Baechle

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=3BC72BE8.F50C2001@mvista.com \
    --to=jsun@mvista.com \
    --cc=geert@linux-m68k.org \
    --cc=gerald.champagne@esstech.com \
    --cc=linux-mips@oss.sgi.com \
    --cc=ralf@oss.sgi.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.