Page MenuHomeFreeBSD

mrsas: unbreak i386 build
ClosedPublic

Authored by alfredo on Feb 5 2021, 12:34 PM.
Tags
None
Referenced Files
Unknown Object (File)
Wed, Nov 13, 7:07 PM
Unknown Object (File)
Tue, Nov 5, 10:01 PM
Unknown Object (File)
Oct 16 2024, 6:03 PM
Unknown Object (File)
Oct 4 2024, 10:01 PM
Unknown Object (File)
Sep 30 2024, 11:28 PM
Unknown Object (File)
Sep 24 2024, 7:49 AM
Unknown Object (File)
Sep 24 2024, 4:49 AM
Unknown Object (File)
Sep 20 2024, 7:08 AM

Details

Summary

Fixes i386 build broke by D26531

Test Plan

Test on powerpc64 at OSU (by @afscoelho_gmail.com)
Buildkernel on powerpc, i386, powerpc64, powerpc64le, amd4

Diff Detail

Repository
rG FreeBSD src repository
Lint
Lint Not Applicable
Unit
Tests Not Applicable

Event Timeline

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

jhibbits added inline comments.
sys/dev/mrsas/mrsas.c
2784–2785

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.Feb 5 2021, 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:
0x0000000078563412
0x7856341200000000

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)