Subject: _btop macros are non-MI
To: None <tech-kern@netbsd.org>
From: Simon Burge <simonb@netbsd.org>
List: tech-kern
Date: 06/22/2000 13:16:17
Is there any reason why each archtecture defines an <arch>_btop macro
and not just a single btop macro?  At the moment, we've got code
segments like

	#if defined(__alpha__)
		struct tga_softc *sc = v;

		if (offset >= sc->sc_dc->dc_tgaconf->tgac_cspace_size || offset < 0)
			return -1;
		return alpha_btop(sc->sc_dc->dc_paddr + offset);
	#elif defined(__mips__)
		struct tga_softc *sc = v;

		if (offset >= sc->sc_dc->dc_tgaconf->tgac_cspace_size || offset < 0)
			return -1;
		return mips_btop(sc->sc_dc->dc_paddr + offset);
	#else   
		return (-1); 
	#endif          

and

	#if defined(pmax)
	#define machine_btop(x) mips_btop(x)
	#endif  

	#if defined(__alpha__) || defined(alpha)
	#define machine_btop(x) alpha_btop(x)
	#endif

	...

		return machine_btop(sc->sc_dc->dc_paddr + offset);

These would be much cleaner if you could just say

	return btop(sc->sc_dc->dc_paddr + offset);

and be done with it...

Simon.