Fixes i386 build broke by D26531
Details
Details
Test on powerpc64 at OSU (by @afscoelho_gmail.com)
Buildkernel on powerpc, i386, powerpc64, powerpc64le, amd4
Diff Detail
Diff Detail
- Repository
- rG FreeBSD src repository
- Lint
Lint Not Applicable - Unit
Tests Not Applicable
Event Timeline
sys/dev/mrsas/mrsas.c | ||
---|---|---|
2784–2785 | Would it not work to only keep line 2788, and always do htole64() instead? |
Comment Actions
Using only htole64() won't work in all cases.
Consider the following code running on a BE machine:
uint32_t u32 = 0x12345678; uint64_t u64; u64 = htole32(u32); printf("0x%016lx\n", u64); u64 = htole64(u32); printf("0x%016lx\n", u64);
It will print the following:
0x0000000078563412
0x7856341200000000
So, using htole64() on a 32-bit value doesn't give the same result as htole32().
Comment Actions
@luporl we want a LE 64-bit number here.
Putting the full address into the 'Words' field is the correct approach. (Accepted over IRC)