Skip site navigation (1)Skip section navigation (2)
Date:      Fri, 23 Jan 2015 13:40:28 -0800
From:      John-Mark Gurney <jmg@funkthat.com>
To:        Daisuke Aoyama <aoyama@peach.ne.jp>
Cc:        freebsd-arm@freebsd.org, Rui Paulo <rpaulo@me.com>
Subject:   Re: mount_smbfs
Message-ID:  <20150123214028.GQ1949@funkthat.com>
In-Reply-To: <62AC231D96DE425FB72E0C6DA6ACBF1F@ad.peach.ne.jp>
References:  <54B9DCD1.3040306@foxvalley.net> <4759EAA0-D4AA-4923-9350-B7E753819169@me.com> <6E32991C3BD8465DB8DB0E65DFDA47AA@ad.peach.ne.jp> <20150123195403.GO1949@funkthat.com> <62AC231D96DE425FB72E0C6DA6ACBF1F@ad.peach.ne.jp>

next in thread | previous in thread | raw e-mail | index | archive | help
Daisuke Aoyama wrote this message on Sat, Jan 24, 2015 at 06:28 +0900:
> Thank you for a comment.
> I didn't think about endian functions.
> 
> >Please use {l,b}e16dec, or if the code is suppose to be native endian,
> >make it dependant on __NO_STRICT_ALIGNMENT and add the proper endian
> >swap, not __arm__ as there are other arches that require the same fix...
> 
> I make a patch again for supporting BE CPU.
> 
> man page don't mention about strict alignment, if le16enc is not using byte access,
> you need expand it like this:

le16enc is documented to work any alignment... from byteorder(9):
     The be16enc(), be16dec(), be32enc(), be32dec(), be64enc(), be64dec(),
     le16enc(), le16dec(), le32enc(), le32dec(), le64enc(), and le64dec()
     functions encode and decode integers to/from byte strings on any
								  ^^^
     alignment in big/little endian format.
     ^^^^^^^^^

> 
> +                       le16enc(cp, le16toh(NBENCODE(toupper(*name))));
> vvvvvv
> +                       *(cp + 0) = le16toh(NBENCODE(toupper(*name))) & 0xffU;
> +                       *(cp + 1) = (le16toh(NBENCODE(toupper(*name))) >> 8) & 0xffU;

-- 
  John-Mark Gurney				Voice: +1 415 225 5579

     "All that I will do, has been done, All that I have, has not."



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?20150123214028.GQ1949>