Up to [cvs.NetBSD.org] / src / sys / arch / i386 / i386
Request diff between arbitrary revisions
Default branch: MAIN
Current tag: pgoyette-compat-1226
Revision 1.26 / (download) - annotate - [select for diffs], Sat Dec 22 21:27:22 2018 UTC (5 years, 3 months ago) by cherry
Branch: MAIN
CVS Tags: pgoyette-compat-1226
Changes since 1.25: +18 -6
lines
Diff to previous 1.25 (colored)
Introduce a weak alias method of exporting different implementations of the same API. For eg: the amd64 native implementation of invlpg() now becomes amd64_invlpg() with a weak symbol export of invlpg(), while the XEN implementation becomes xen_invlpg(), also weakly exported as invlpg() Note that linking in both together without having an override function named invlpg() would be a mistake, as we have limited control over which of the two options would emerge as the finally exported invlpg() resulting in a potential situation where the wrong function is finally exported. This change avoids this situation. We should however include an override function invlpg() in that case, such that it is able to then pass on the call to the appropriate backing function (amd64_invlpg() in the case of native, and xen_invlpg() in the case of under XEN virtualisation) at runtime. This change does not introduce such a function and therefore does not alter builds to include native as well as XEN implementations in the same binary. This will be done later, with the introduction of XEN PVHVM mode, where precisely such a runtime switch is required. There are no operational changes introduced by this change.