OpenBSD/sgi on octane2 - ipi割り込み その2

cpu1を一旦切って、cpu0だけでIPI割り込みのテストを続行中。
Linuxのコードと見比べたが、IRQとかは今ので正しいような気がする。
が、どうしても割り込み入らない。

絶対初期化が間違ってると思うので、その辺りを家宅捜索中。

int
xheart_intr_establish(int (*func)(void *), void *arg, int intrbit,
    int level, const char *name)
{
	struct xheart_softc *sc = (void *)xheart_cd.cd_devs[0];
	struct intrhand *ih;
	paddr_t heart;
	unsigned cpu = cpu_number();

	printf("xheart_intr_establish func:%p arg:%p intrbit:%d level:%d name:%s\n",
	    func, arg, intrbit, level, name);
#if 0
//#ifdef DIAGNOSTIC
	if (intrbit < HEART_INTR_MIN || intrbit > HEART_INTR_MAX)
		return EINVAL;
#endif
	if (intrbit >= INTMASKSIZE)
		return EINVAL;

とりあえずprintf入れてみる。

ioc0: xheart_intr_establish func:0xa80000002013c440 arg:0xffffffffc00fc800 intrbit:11 level:4 name:(null)
superio irq 4xheart_intr_establish func:0xa80000002013c440 arg:0xffffffffc00fc700 intrbit:10 level:3 name:(null)
, ethernet irq 2
com0 at ioc0 base 0x00020178: ns16550a, 16 byte fifo
com0: console
com1 at ioc0 base 0x00020170: ns16550a, 16 byte fifo
iockbc at ioc0 not configured
ef at ioc0 base 0x000000f0 not configured
dsrtc at ioc0 not configured
"SGI Rad1" rev 0xc0 at pci0 dev 3 function 0 not configured
clock0 at mainbus0: ticker on int5 using count register
Timecounters tick every 10.000 msec
rd0: fixed, 8192 blocks
boot device: sd0
root on rd0a swap on rd0b dump on rd0b
rootdev=0x800 rrootdev=0x1600 rawdev=0x1602
WARNING: No TOD clock, believing file system.
WARNING: CHECK AND RESET THE DATE!
mips64_ipi_init
xheart_intr_establish func:0xa800000020139068 arg:0x0 intrbit:0 level:7 name:ipi
init: copying out path `/sbin/init' 11
erase ^?, werase ^W, kill ^U, intr ^C, status ^T
(I)nstall, (U)pgrade or (S)hell? 

おっと?? IPIの初期化時に渡すintrbitが0になっちゃってる。

ここで呼んでる、1UL << HEART_INTR_IPI(cpu)なんだけど。

#define HEART_INTR_IPI(x)	(46+(x))

	ret = xheart_intr_establish(mips64_ipi_intr, NULL,
	    1UL << HEART_INTR_IPI(cpu), IPL_HIGH, "ipi");

あ、そうか。これ数字じゃなくてビットで指定してるから、桁溢れしてるのか。理解。