Copy the CP, PTRIN, etc macros from freebsd32.h into a sys/compat.h
and replace existing definitation with includes where required. This
eliminates duplicate code and allows Linux and FreeBSD compatability
headers to be included in the same files (mostly storage drivers).
Details
Diff Detail
- Lint
Lint Passed - Unit
No Test Coverage - Build Status
Buildable 30375 Build 28140: arc lint + arc unit
Event Timeline
CI run without the last mps fix: https://cirrus-ci.com/task/5297194320265216
Universe kernel build in progress (source of the mpr and mps fixes)
sys/dev/mpt/mpt_user.c | ||
---|---|---|
39 | This seems wrong, but it's the condition below... |
For the generic CP() type copy operations, I'd suggest _Static_assert size checks. Exceptions can have an exceptional copy mechanism (maybe provided here).
style(9): Lots of missing spaces in TS/TV CP.
Seems like PTROUT_CP() is going to truncate and generally be useless if used in compat32 ABIs. I guess a CP() size check would prevent that kind of misuse.
I feel like compat.h might be a bit too generic of a name? Maybe 'abi_compat.h' instead?
sys/dev/mpt/mpt_user.c | ||
---|---|---|
602 | It's matching these. These should probably all be COMPAT_FREEBSD32 instead, but what you have now is fine. |
While this seems like a good idea, I think it's out of scope for this reorganization and exceptions are quite common (see TV_CP for example...) so would be a bunch of work to fix.
style(9): Lots of missing spaces in TS/TV CP.
Fixed.
Seems like PTROUT_CP() is going to truncate and generally be useless if used in compat32 ABIs. I guess a CP() size check would prevent that kind of misuse.
PTROUT* should be eliminated, but that's also beyond the current scope. IIRC there's a mix of exporting kernel VAs which we shouldn't do at all and mindlessly sloshing user pointers back and forth between the 32-bit structs and the native versions.