~kris/9p

9hist

aea8d731dceb6987760d15c2d00dc363b8c03212 — David du Colombier 25 years ago 0640f45
Plan 9 from Bell Labs 2001-09-14
3 files changed, 24 insertions(+), 7 deletions(-)

M bitsy/etherwavelan.c
M pc/etherwavelan.c
M pc/trap.c
M bitsy/etherwavelan.c => bitsy/etherwavelan.c +8 -3
@@ 438,7 438,7 @@ ltv_outstr(Ctlr* ctlr, int type, char* val)
	ltv.type = type;

//	This should be ltv.slen = len; according to Axel Belinfante
	ltv.slen = (len+1) & ~1;
	ltv.slen = len;

	strncpy(ltv.s, val, len);
	w_outltv(ctlr, &ltv);


@@ 451,15 451,20 @@ static char*
ltv_inname(Ctlr* ctlr, int type)
{
	static Wltv ltv;
	int len;

	memset(&ltv,0,sizeof(ltv));
	ltv.len = WNameLen/2+2;
	ltv.type = type;
	if (w_inltv(ctlr, &ltv))
		return Unkname;
	if (ltv.name[2] == 0)
	len = ltv.slen;
	if(len == 0 || ltv.s[0] == 0)
		return Nilname;
	return ltv.name+2;
	if(len >= sizeof ltv.s)
		len = sizeof ltv.s - 1;
	ltv.s[len] = '\0';
	return ltv.s;
}

static int

M pc/etherwavelan.c => pc/etherwavelan.c +8 -3
@@ 438,7 438,7 @@ ltv_outstr(Ctlr* ctlr, int type, char* val)
	ltv.type = type;

//	This should be ltv.slen = len; according to Axel Belinfante
	ltv.slen = (len+1) & ~1;
	ltv.slen = len;	

	strncpy(ltv.s, val, len);
	w_outltv(ctlr, &ltv);


@@ 451,15 451,20 @@ static char*
ltv_inname(Ctlr* ctlr, int type)
{
	static Wltv ltv;
	int len;

	memset(&ltv,0,sizeof(ltv));
	ltv.len = WNameLen/2+2;
	ltv.type = type;
	if (w_inltv(ctlr, &ltv))
		return Unkname;
	if (ltv.name[2] == 0)
	len = ltv.slen;
	if(len == 0 || ltv.s[0] == 0)
		return Nilname;
	return ltv.name+2;
	if(len >= sizeof ltv.s)
		len = sizeof ltv.s - 1;
	ltv.s[len] = '\0';
	return ltv.s;
}

static int

M pc/trap.c => pc/trap.c +8 -1
@@ 56,6 56,13 @@ intrdisable(int irq, void (*f)(Ureg *, void *), void *a, int tbdf, char *name)
	Vctl **pv, *v;
	int vno;

	/*
	 * For now, none of this will work with the APIC code,
	 * there is no mapping between irq and vector as the IRQ
	 * is pretty meaningless.
	 */
	if(arch->intrvecno == nil)
		return;
	vno = arch->intrvecno(irq);
	ilock(&vctllock);
	pv = &vctl[vno];


@@ 68,7 75,7 @@ intrdisable(int irq, void (*f)(Ureg *, void *), void *a, int tbdf, char *name)
	v = *pv;
	*pv = (*pv)->next;	/* Link out the entry */
	
	if (vctl[vno] == nil)
	if (vctl[vno] == nil && arch->intrdisable != nil)
		arch->intrdisable(irq);
	iunlock(&vctllock);
	xfree(v);