Browse Source

AROS: fixed TTask type

git-svn-id: trunk@35064 -
marcus 8 years ago
parent
commit
114a43e6ef
2 changed files with 64 additions and 62 deletions
  1. 20 16
      packages/arosunits/src/exec.pas
  2. 44 46
      rtl/aros/i386/execd.inc

+ 20 - 16
packages/arosunits/src/exec.pas

@@ -28,6 +28,8 @@ defines:
 
 
 unit Exec;
 unit Exec;
 
 
+{$PACKRECORDS C}
+
 interface
 interface
 
 
 type
 type
@@ -659,22 +661,24 @@ type
     tc_SigWait: ULONG;      // sigs we are waiting for
     tc_SigWait: ULONG;      // sigs we are waiting for
     tc_SigRecvd: ULONG;     // sigs we have received
     tc_SigRecvd: ULONG;     // sigs we have received
     tc_SigExcept: ULONG;    // sigs we will take excepts for
     tc_SigExcept: ULONG;    // sigs we will take excepts for
-    tc_TrapAlloc: Word;     // traps allocated
-    tc_TrapAble: Word;      // traps enabled
-    {$ifdef CPU64}
-    Pad64bit: LongWord;
-    {$endif}
-    tc_ExceptData: APTR;    // points to except data
-    tc_ExceptCode: APTR;    // points to except code
-    tc_TrapData: APTR;      // points to trap data
-    tc_TrapCode: APTR;      // points to trap code
-    tc_SPReg: APTR;         // stack pointer
-    tc_SPLower: APTR;       // stack lower bound
-    tc_SPUpper: APTR;       // stack upper bound + 2
-    tc_Switch: Pointer;     // task losing CPU
-    tc_Launch: Pointer;     // task getting CPU
-    tc_MemEntry: TList;     // allocated memory
-    tc_UserData: APTR;      // per task data
+    case boolean of
+      True:(
+        tc_TrapAlloc: Word;     // traps allocated
+        tc_TrapAble: Word;);      // traps enabled
+      False:(
+        tc_ETask: Pointer;      // Valid if TF_ETask is set
+        tc_ExceptData: APTR;    // points to except data
+        tc_ExceptCode: APTR;    // points to except code
+        tc_TrapData: APTR;      // points to trap data
+        tc_TrapCode: APTR;      // points to trap code
+        tc_SPReg: APTR;         // stack pointer
+        tc_SPLower: APTR;       // stack lower bound
+        tc_SPUpper: APTR;       // stack upper bound + 2
+        tc_Switch: Pointer;     // task losing CPU
+        tc_Launch: Pointer;     // task getting CPU
+        tc_MemEntry: TList;     // allocated memory
+        tc_UserData: APTR;      // per task data
+      );
   end;
   end;
 
 
 // Stack swap structure as passed to StackSwap()
 // Stack swap structure as passed to StackSwap()

+ 44 - 46
rtl/aros/i386/execd.inc

@@ -73,7 +73,7 @@ const  // Checked OK 05.08.2011 ALB
   NT_KICKMEM      = 17;
   NT_KICKMEM      = 17;
   NT_GRAPHICS     = 18;
   NT_GRAPHICS     = 18;
   NT_DEATHMESSAGE = 19;
   NT_DEATHMESSAGE = 19;
-  NT_HIDD	  = 20;	// AROS specific
+  NT_HIDD   = 20; // AROS specific
   NT_USER         = 254;
   NT_USER         = 254;
   NT_EXTENDED     = 255;
   NT_EXTENDED     = 255;
 
 
@@ -111,7 +111,7 @@ type  // Checked OK 05.08.2011 ALB
 
 
 const  // Checked OK 04.08.2011 ALB
 const  // Checked OK 04.08.2011 ALB
 // General Types
 // General Types
-  AT_DeadEnd              = $80000000;  // Alert that crashes 
+  AT_DeadEnd              = $80000000;  // Alert that crashes
   AT_Recovery             = $00000000;  // Alert that returns
   AT_Recovery             = $00000000;  // Alert that returns
 // General Errors
 // General Errors
   AG_NoMemory             = $00010000;
   AG_NoMemory             = $00010000;
@@ -406,7 +406,7 @@ const  // Checked OK 04.08.2011 ALB
   AN_OOP                  = $41000000;
   AN_OOP                  = $41000000;
 // Hidd Subsystem */
 // Hidd Subsystem */
   AN_Hidd                 = $42000000;
   AN_Hidd                 = $42000000;
-  AN_HiddNoRoot           = $C2000001;	// Could not create root device
+  AN_HiddNoRoot           = $C2000001;  // Could not create root device
 
 
   { *
   { *
     * For use by any application that needs it
     * For use by any application that needs it
@@ -416,7 +416,7 @@ const  // Checked OK 04.08.2011 ALB
 
 
 
 
 
 
-{ * exec error definitions 
+{ * exec error definitions
   *********************************************************************
   *********************************************************************
   * }
   * }
 
 
@@ -603,35 +603,33 @@ type
 type
 type
   PTask = ^TTask;
   PTask = ^TTask;
   TTask = record
   TTask = record
-    tc_Node     : TNode;
-    tc_Flags    : Byte;
-    tc_State    : Byte;
-    tc_IDNestCnt: ShortInt;
-    tc_TDNestCnt: ShortInt;
-    tc_SigAlloc : DWord;
-    tc_SigWait  : DWord;
-    tc_SigRecvd : DWord;
-    tc_SigExcept: DWord;
-    {$IF 0}
-      tc_TrapAlloc: Word;
-      tc_TrapAble : Word;
-      {$ifdef CPU64}
-      Pad64bit: LongWord;
-      {$endif}
-    {$ELSE}
-      tc_ETask: Pointer;
-    {$ENDIF}
-    tc_ExceptData: Pointer;
-    tc_ExceptCode: Pointer;
-    tc_TrapData  : Pointer;
-    tc_TrapCode  : Pointer;
-    tc_SPReg     : Pointer;
-    tc_SPLower   : Pointer;
-    tc_SPUpper   : Pointer;
-    tc_Switch    : Pointer; { *** OBSOLETE *** }
-    tc_Launch    : Pointer; { *** OBSOLETE *** }
-    tc_MemEntry  : TEList;
-    tc_UserData  : Pointer;
+    tc_Node: TNode;
+    tc_Flags: Byte;
+    tc_State: Byte;
+    tc_IDNestCnt: Shortint; // intr disabled nesting
+    tc_TDNestCnt: Shortint; // task disabled nesting
+    tc_SigAlloc: LongWord;  // sigs allocated
+    tc_SigWait: LongWord;   // sigs we are waiting for
+    tc_SigRecvd: LongWord;  // sigs we have received
+    tc_SigExcept: LongWord; // sigs we will take excepts for
+    case boolean of
+      True:(
+        tc_TrapAlloc: Word;  // traps allocated
+        tc_TrapAble: Word;); // traps enabled
+      False:(
+        tc_ETask: Pointer;      // Valid if TF_ETask is set
+        tc_ExceptData: Pointer; // points to except data
+        tc_ExceptCode: Pointer; // points to except code
+        tc_TrapData: Pointer;   // points to trap data
+        tc_TrapCode: Pointer;   // points to trap code
+        tc_SPReg: Pointer;      // stack pointer
+        tc_SPLower: Pointer;    // stack lower bound
+        tc_SPUpper: Pointer;    // stack upper bound + 2
+        tc_Switch: Pointer;     // task losing CPU
+        tc_Launch: Pointer;     // task getting CPU
+        tc_MemEntry: TEList;    // allocated memory
+        tc_UserData: Pointer;   // per task data
+      );
   end;
   end;
 
 
 
 
@@ -1525,9 +1523,9 @@ type  // Checked OK 05.08.2011 ALB
   TExecBase = record
   TExecBase = record
     // lib structure for Exec
     // lib structure for Exec
     LIbNode     : TLibrary;
     LIbNode     : TLibrary;
-    
+
     // system constants
     // system constants
-    
+
     SoftVer     : Word; // obsolete
     SoftVer     : Word; // obsolete
     LowMemChkSum: SmallInt;
     LowMemChkSum: SmallInt;
     ChkBase     : PtrUInt;
     ChkBase     : PtrUInt;
@@ -1542,13 +1540,13 @@ type  // Checked OK 05.08.2011 ALB
     AlertData   : Pointer;
     AlertData   : Pointer;
     MaxExtMem   : Pointer; // Extended Memory Pointer (may be nil)
     MaxExtMem   : Pointer; // Extended Memory Pointer (may be nil)
     ChkSum      : Word;    // SoftVer to MaxExtMem
     ChkSum      : Word;    // SoftVer to MaxExtMem
-    
+
     // interrupts
     // interrupts
-    
+
     IntVects    : Array[0..15] Of TIntVector;
     IntVects    : Array[0..15] Of TIntVector;
-    
+
     // System Variables
     // System Variables
-    
+
     ThisTask    : PTask; // Pointer to currently running Task READONLY
     ThisTask    : PTask; // Pointer to currently running Task READONLY
     IdleCount   : DWord;
     IdleCount   : DWord;
     DispCount   : DWord;
     DispCount   : DWord;
@@ -1578,23 +1576,23 @@ type  // Checked OK 05.08.2011 ALB
     TaskReady   : TEList;
     TaskReady   : TEList;
     TaskWait    : TEList;
     TaskWait    : TEList;
     SoftInts    : Array[0..4] Of TSoftIntList;
     SoftInts    : Array[0..4] Of TSoftIntList;
-    
+
     //stuff
     //stuff
-    
+
     LastAlert   : Array[0..3] Of LongInt;
     LastAlert   : Array[0..3] Of LongInt;
 
 
     VBlankFrequency     : Byte;
     VBlankFrequency     : Byte;
     PowerSupplyFrequency: Byte;  // AROS PRIVATE: VBlankFreq * PowerSupplyFreq = Timer Tick Rate
     PowerSupplyFrequency: Byte;  // AROS PRIVATE: VBlankFreq * PowerSupplyFreq = Timer Tick Rate
     SemaphoreList       : TEList;
     SemaphoreList       : TEList;
-    
+
     // Kickstart
     // Kickstart
-    
+
     KickMemPtr          : Pointer;
     KickMemPtr          : Pointer;
     KickTagPtr          : Pointer;
     KickTagPtr          : Pointer;
     KickCheckSum        : Pointer;
     KickCheckSum        : Pointer;
-    
+
     // Miscellaneous stuff
     // Miscellaneous stuff
-    
+
     ex_Pad0             : Word;
     ex_Pad0             : Word;
     ex_LaunchPoint      : PtrUInt;
     ex_LaunchPoint      : PtrUInt;
     ex_RamLibPrivate    : Pointer;
     ex_RamLibPrivate    : Pointer;
@@ -1746,7 +1744,7 @@ const  // Checked OK 05.08.2011 ALB
 // AttnFlags
 // AttnFlags
   ARF_AttnSwitch      = (1 shl 7);  // Delayed Switch() pending
   ARF_AttnSwitch      = (1 shl 7);  // Delayed Switch() pending
   ARF_AttnDispatch    = (1 shl 15); // Delayed Dispatch() pending
   ARF_AttnDispatch    = (1 shl 15); // Delayed Dispatch() pending
-  
+
 const
 const
   { *
   { *
     * Execbase list IDs
     * Execbase list IDs