Page MenuHomeFreeBSD

stand/ficl 64-bit compatibility
ClosedPublic

Authored by bdragon on Sep 8 2020, 11:37 PM.
Referenced Files
Unknown Object (File)
Mon, Nov 25, 11:47 AM
Unknown Object (File)
Nov 1 2024, 8:35 PM
Unknown Object (File)
Nov 1 2024, 8:35 PM
Unknown Object (File)
Nov 1 2024, 8:35 PM
Unknown Object (File)
Nov 1 2024, 8:35 PM
Unknown Object (File)
Nov 1 2024, 8:35 PM
Unknown Object (File)
Nov 1 2024, 8:24 PM
Unknown Object (File)
Oct 3 2024, 11:27 PM
Subscribers

Details

Summary

Currently, the only thing that prevents a functioning 64-bit ficl build is a few integer types that were intended to be fixed-width.

Changing them to C99 integer types allows building a functioning 64-bit ficl.

I tested this a while back locally the last time I was working on a Petitboot loader.

Diff Detail

Repository
rS FreeBSD src repository - subversion
Lint
Lint Not Applicable
Unit
Tests Not Applicable

Event Timeline

imp added inline comments.
stand/ficl/ficl.h
252 ↗(On Diff #76787)

This won't work quite right for long long types though. Eg, it won't be all 1s

This revision is now accepted and ready to land.Sep 9 2020, 1:10 AM
stand/ficl/ficl.h
252 ↗(On Diff #76787)

I believe that since FICL_INT is actually required to be equal to the size of void*, this is not an issue in practice.

stand/ficl/ficl.h
252 ↗(On Diff #76787)

if words are 64-bit and long long actually 128, then forth has double words for 128 bit

stand/ficl/ficl.h
252 ↗(On Diff #76787)

Yes, but that is a multiple-cell situation. The entire FICL codebase assumes that cells are either 32 bit or 64 bit and will not build if this is not the case.

stand/ficl/ficl.h
252 ↗(On Diff #76787)

Yes, exactly.

stand/ficl/ficl.h
252 ↗(On Diff #76787)

By the way, here are the overrides that these changes are in support of:

CFLAGS+=        -DFICL_INT=int64_t -DFICL_UNS=uint64_t -DBITS_PER_CELL=64 -DFICL_ALIGN=3

(for ficl running on powerpc64(le) in 64 bit mode)

Actually, reading this over again, I think the FICL_INT part is wrong too, it should have been FICL_UNS.

I guess I'll be adjusting this after all.

stand/ficl/ficl.h
252 ↗(On Diff #76787)

You need to cast the 0 to the proper type BEFORE ~ to get the right answer when FILC_INT is larger than long.

That's the point I'm trying to make. If there's casts needed for other reasons, you need to do those too.

Addressed comments.

This version passes make tinderbox locally, and hardware test passed on G4 (memmap command works as expected)

This revision now requires review to proceed.Sep 13 2020, 6:29 PM
stand/powerpc/ofw/main.c
66 ↗(On Diff #76986)

wouldn't it be more correct to use uintptr_t here?

This revision is now accepted and ready to land.Sep 14 2020, 4:42 AM
This revision was automatically updated to reflect the committed changes.