Page MenuHomeFreeBSD

mrsas: unbreak i386 build

Authored by alfredo on Fri, Feb 5, 12:34 PM.



Fixes i386 build broke by D26531

Test Plan

Test on powerpc64 at OSU (by
Buildkernel on powerpc, i386, powerpc64, powerpc64le, amd4

Diff Detail

R10 FreeBSD src repository
Automatic diff as part of commit; lint not applicable.
Automatic diff as part of commit; unit tests not applicable.

Event Timeline

Book-E powerpc and i386 with PAE have a 64 bit bus_addr_t

jhibbits added inline comments.

Would it not work to only keep line 2788, and always do htole64() instead?

alfredo edited the test plan for this revision. (Show Details)
This revision was not accepted when it landed; it landed in state Needs Review.Fri, Feb 5, 3:55 PM
This revision was automatically updated to reflect the committed changes.

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:

So, using htole64() on a 32-bit value doesn't give the same result as htole32().

@luporl we want a LE 64-bit number here.

Putting the full address into the 'Words' field is the correct approach. (Accepted over IRC)