Page MenuHomeFreeBSD

mrsas: unbreak i386 build
ClosedPublic

Authored by alfredo on Feb 5 2021, 12:34 PM.
Tags
None
Referenced Files
Unknown Object (File)
Tue, Apr 9, 3:30 AM
Unknown Object (File)
Mon, Apr 8, 6:08 PM
Unknown Object (File)
Mon, Apr 8, 1:08 PM
Unknown Object (File)
Sat, Mar 23, 8:18 AM
Unknown Object (File)
Sat, Mar 23, 8:18 AM
Unknown Object (File)
Mar 14 2024, 5:10 PM
Unknown Object (File)
Feb 29 2024, 2:48 AM
Unknown Object (File)
Feb 12 2024, 4:26 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
rS FreeBSD src repository - subversion
Lint
Lint Passed
Unit
No Test Coverage
Build Status
Buildable 36729
Build 33618: arc lint + arc unit

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
2785–2790

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)