Re: MVME177 panic: pmap_enter_ptpage (PR #45915 on 6.x)

Martin Husemann <[email protected]> Thu, 19 Sep 2013 15:31:44 +0200
Newsgroups gmane.os.netbsd.ports.m68k,gmane.os.netbsd.ports.mvme68k
Message-ID <[email protected]>
On Thu, Sep 19, 2013 at 09:52:44PM +0900, Izumi Tsutsui wrote:
> Does anyone have suggestion how this should be fixed?
> Rewrite outstr (and the similar outln) functions in asm?

This might be a bit overengeneered, but you could create arg-count specific
macros and create the functions with cpp:

#define DEFCALL_A2(CALLNO)					\
static inline int CALL_##CALLNO(void *arg0, void *arg1) 	\
{								\
	int ret;						\
	__asm volatile ("movel %0, %%sp@-; movel %0,%%sp@-;"	\
			"trap #15; .short " #CALLNO ";" 	\
			"movew %%sr,%0" 			\
			 : "=d" (ret)				\
			 : "r" (arg0), "r" (arg1)		\
			 :);					\
	return ret;						\
}

DEFCALL_A2(MVMEPROM_OUTSTR)

and then just call it like:

  CALL_MVMEPROM_OUTSTR(start, end);


Martin