Page MenuHomeFreeBSD

Add arm_sync_icache() and arm_drain_writebuf() sysarch syscall wrappers.
ClosedPublic

Authored by ian on Jul 10 2019, 8:02 PM.
Tags
None
Referenced Files
Unknown Object (File)
Sun, Mar 24, 6:47 PM
Unknown Object (File)
Feb 14 2024, 8:03 AM
Unknown Object (File)
Jan 20 2024, 10:56 PM
Unknown Object (File)
Jan 13 2024, 11:26 AM
Unknown Object (File)
Dec 23 2023, 1:11 PM
Unknown Object (File)
Dec 20 2023, 12:24 AM
Unknown Object (File)
Dec 6 2023, 11:50 AM
Unknown Object (File)
Nov 30 2023, 2:56 AM
Subscribers

Details

Summary

NetBSD and OpenBSD have libc wrapper functions for the ARM_SYNC_ICACHE and ARM_DRAIN_WRITEBUF operations. This change adds compatible functions to our library. This should make it easier for various upstream sources to support *BSD operating systems with a single variation of cache maintence code in tools like interpreters and JIT compilers.

I consider the argument types passed to arm_sync_icache() to be especially unfortunate, but this is intended to match the other BSDs.

Test Plan

It compiles.

Note: I don't have a lot of experience adding code to libc, please have a look especially at the Symbol.map thing to see if I did it right.

Diff Detail

Repository
rS FreeBSD src repository - subversion
Lint
Lint Skipped
Unit
Tests Skipped
Build Status
Buildable 25291

Event Timeline

Libc symbol versioning chunks look fine.

Are described operations global for all CPUs in the system, or only for the CPU where the caller is executing ? It is not clear from the man pages.

Obviously at some point I wanted to provide those, and quite obviously as well, I forgot to provide the actual implementation.
That sounds good to me, thanks a lot, Ian !

Add some details to the manpage about the barrier and cache operations performed by arm_drain_writebuf().

Clarify in the manpage for arm_sync_icache() that cache maintenance to the level of unification makes the data range coherent amongst all cores. Technically just saying it's a POU operation implies that things are coherent within the Inner Shareable domain of the processor that executes the operation, but that only helps if you're aware of an easy-to-miss sentence in the ARM ARM:

"This architecture is written with an expectation that all processors using the same operating system or hypervisor are in the same Inner Shareable shareability domain."
This revision is now accepted and ready to land.Jul 11 2019, 11:55 AM