Skip to content

AROS: Add SMP support for ABI's > v0 (ABI/API/BC break)

magorium requested to merge magorium/fpc-source:AROS-ABI-break-SMP into main

These changes add SMP support fields/structures for the different AROS ABI's.

These changes will break ABI compatibility between ABIv0, ABIv1 and ABIv11.

Additionally these changes will break API and Binary Compatibility between ABIv1 and ABIv11.

It breaks Binary Compatibility between these two ABI's because ABIv11 always adds an additional field to record structure TMsgPort (for non m68k targets) while ABIv1 only adds additional fields when you specifically build for SMP

Therefor ABIv1 will break Binary Compatibility and API compatibility (with itself) between SMP enabled builds and non SMP enabled builds.

ABIv11 will break Binary Compatibility with itself because of the now always added additional field to record structure TMsgPort (no matter if SMP is active for a build or not).

Whenever Binary Compatibility is broken a recompilation of existing code is required.

Commit summary (applies to both RTL (execd) and unit (Exec)):

  • first commit adds record structure TSpinLock for a SMP build (compiler define AROSPLATFORM_SMP).
  • Second commit adds an additional spinlock field to record structures TMsgPort and TSemaphoreRequest (fields mp_Spinlock and sr_Spinlock respectively) for a SMP build when SMP is enabled (compiler define AROSEXEC_SMP).
  • Third commit ensures that the previous made changes are only compiled for ABIv1.
  • Fourth commit 'disables' compilation for all previous changes for ABIv11.
  • Fifth commit adds an additional (opaque) field to record structure TMsgPort in order to support SMP for ABIv11

Note that because of changes made to record structure TMsgPort that all records embedding record structure TMsgPort are also changed in size and uses other field offsets and as such has a very major and radical impact.

In conclusion:

AROS ABIv0:

Does not support SMP. Binary Compatibility and API compatibility (with itself) is not broken.

No special action(s) for existing compiled code need to be taken.

AROS ABIv1:

Does support SMP for a SMP enabled build but the only target that currently offers true SMP is AROS-x86_64.

Binary Compatibility between SMP enabled and SMP disabled builds is broken and SMP enabled builds offer additional information for record structures TMsgPort and TSemaphoreRequest rendering them API incompatible to non SMP enabled builds as well (whenever code makes use of a spinlock field).

Recompilation of existing code is required when switching from SMP to non SMP enabled build.

AROS ABIv11:

Breaks Binary Compatibility with itself by adding an additional field to record structure TMsgPort for non-m68k targets.

The only target for AROS ABIv11 that currently actively supports SMP is AxRT (for which FPC currently has no support)

Recompilation of existing code is required for non AROS-m68k targets.

References:

Merge request reports