NetBSD-Bugs archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

re: kern/50038: udl (DisplayLink GX-DVI_U2B) alignment fault on earmv6hf NETWALKER



> Now it's been shown that device/strongly ordered memory is the reason I 
> think we should commit your diff...
> 
> > --- udl.c.ORIG	2016-10-19 05:17:37.000000000 +0900
> > +++ udl.c	2016-11-15 02:59:21.000000000 +0900
> > @@ -187,8 +187,14 @@
> >   static inline void
> >   udl_cmd_add_2(struct udl_softc *sc, uint16_t val)
> >   {
> > +	uint8_t *p = sc->sc_cmd_buf;
> >   
> > -	be16enc(sc->sc_cmd_buf, val);
> > +	if (ALIGNED_POINTER(p, uint16_t))
> > +		be16enc(p, val);
> > +	else {
> > +		*p++ = (val >> 8) & 0xff;
> > +		*p = val & 0xff;
> > +	}

doesn't the else{} block assume little endianness?


.mrg.


Home | Main Index | Thread Index | Old Index