Browse Source

AROS: Use structure spinlock for SMP enabled build (ABI/BC break)

This commit will add an additional spinlock field to record structures
TMsgPort and TSemaphoreRequest for a SMP enabled build.

This will break ABI and Binary Compatibility between ABIv0 and ABIv1 and for
ABIv1 (for a SMP enabled build).

Recompilation in such case is required as both record structures TMsgPort and
TSemaphoreRequest are embedded in other record structures which causes a
myriad of changes to those records including different record sizes and other
field offsets.

Note that SMP is currently only available for ABIv1 and afaik only supported
for AROS target x86_64 while AROS target i386 has initial support for SMP
(but not actively enabled).

SMP enabled build can be 'activated' by defining AROS_PLATFORM_SMP and
AROSEXEC_SMP.
magorium 3 years ago
parent
commit
41a48fe385
2 changed files with 28 additions and 0 deletions
  1. 14 0
      packages/arosunits/src/exec.pas
  2. 14 0
      rtl/aros/i386/execd.inc

+ 14 - 0
packages/arosunits/src/exec.pas

@@ -638,6 +638,13 @@ type
     mp_SigBit: Byte;     { signal bit number    }
     mp_SigBit: Byte;     { signal bit number    }
     mp_SigTask: Pointer;   { task to be signalled (TaskPtr) }
     mp_SigTask: Pointer;   { task to be signalled (TaskPtr) }
     mp_MsgList: TList;     { message linked list  }
     mp_MsgList: TList;     { message linked list  }
+{$ifdef AROSPLATFORM_SMP}
+{$ifdef AROSEXEC_SMP}
+    mp_SpinLock: TSpinLock;
+{$else}
+    mp_Pad: TSpinlock;
+{$endif}
+{$endif}
   end;
   end;
 
 
 //****** Message *****************************************************
 //****** Message *****************************************************
@@ -861,6 +868,13 @@ type
   TSemaphoreRequest = record
   TSemaphoreRequest = record
     sr_Link: TMinNode;
     sr_Link: TMinNode;
     sr_Waiter: PTask;
     sr_Waiter: PTask;
+{$ifdef AROSPLATFORM_SMP}
+{$ifdef AROSEXEC_SMP}
+    sr_SpinLock: TSpinLock;
+{$else}
+    sr_pad: TSpinLock;
+{$endif}
+{$endif}
   end;
   end;
 
 
 // The actual semaphore itself
 // The actual semaphore itself

+ 14 - 0
rtl/aros/i386/execd.inc

@@ -604,6 +604,13 @@ type  // Checked OK 05.08.2011 ALB
     mp_SigBit : Byte;
     mp_SigBit : Byte;
     mp_SigTask: Pointer;
     mp_SigTask: Pointer;
     mp_MsgList: TEList;
     mp_MsgList: TEList;
+{$ifdef AROSPLATFORM_SMP}
+{$ifdef AROSEXEC_SMP}
+    mp_SpinLock: TSpinLock;
+{$else}
+    mp_pad: TSpinLock;
+{$endif}
+{$endif}
   end;
   end;
 
 
 
 
@@ -1093,6 +1100,13 @@ type
   TSemaphoreRequest = record
   TSemaphoreRequest = record
     sr_Link  : TMinNode;
     sr_Link  : TMinNode;
     sr_Waiter: PTask;
     sr_Waiter: PTask;
+{$ifdef AROSPLATFORM_SMP}
+{$ifdef AROSEXEC_SMP}
+    sr_SpinLock: TSpinLock;
+{$else}
+    sr_pad: TSpinLock;
+{$endif}
+{$endif}
   end;
   end;
 
 
 type
 type