Subject: The spagetti that is arm32/machdep.c
To: None <port-arm@netbsd.org>
From: Richard Earnshaw <rearnsha@arm.com>
List: port-arm
Date: 06/07/2001 17:07:27
Oh dear!  what a tangled web of dependencies.

Summary of arm32/arm32/machdep.c

#include "opt_footbridge.h"	So everyone must defopt footbridge
...
#ifndef SHARK			So everyone who isn't a shark wants mainbus
#include <mainbus.h>
#endif

#if !defined(SHARK) && !defined(FOOTBRIDGE)
...				So everyone who isn't a shark or doesn't
				have footbridge wants the vidcvideo guff
#endif

...

#ifndef FOOTBRIDGE
#if NVIDCVIDEO > 0 ...		But we only compile the vidc code if
				we have one or more instances
#endif
#else
				And footbridge gets its own special version
				here -- everyone else must put it in
				another file...
#endif


These ndefs are really a pain, IMO we need to get rid of them.  Even 
worse, I can't see how FOOTBRIDGE and the type of console we want is even 
related.

In this case, I think we should move all the consinit code out of this 
file and into one of its own (controlled by files.* adding the file as 
required for a configuration).  I think this would entirely eliminate the 
dependency of this file on FOOTBRIDGE, SHARK or vidc.

Any comments before I get out the scissors?

R.