Subject: Re: another question about bus_space_map
To: None <tech-kern@NetBSD.ORG>
From: der Mouse <mouse@Rodents.Montreal.QC.CA>
List: tech-kern
Date: 02/04/1997 14:23:47
>> Should a probe routine unmap everything and let the attach routine
>> map it back in?
> yes.  there should be no permanent allocations or initializations
> done in the match/probe routine, EVER.

I've seen this said about four times.  I don't think I've ever seen it
explained _why_.  I can't see any harm in, for example,

	static int table_set_up = 0;
	static unsigned int *table;
	
	static void maybe_set_up_table(void)
	{
		if (table_set_up) return;
		...allocate *table and load it...
		table_set_up = 1;
	}
	
	xxx_match() {
		maybe_set_up_table();
		...check something on the bus using table[]...
	}

Yet this is clearly forbidden by the dictum in question.  So, what am I
missing?

					der Mouse

			       mouse@rodents.montreal.qc.ca
		     7D C8 61 52 5D E7 2D 39  4E F1 31 3E E8 B3 27 4B