Index: rtl/inc/except.inc
===================================================================
--- rtl/inc/except.inc	(revision 17159)
+++ rtl/inc/except.inc	(working copy)
@@ -26,12 +26,6 @@
   cFinalizeFrame  = 2;
 
 Type
-  PExceptAddr = ^TExceptAddr;
-  TExceptAddr = record
-    buf       : pjmp_buf;
-    next      : PExceptAddr;
-    frametype : Longint;
-  end;
 
   TExceptObjectClass = Class of TObject;
 
@@ -48,6 +42,29 @@
 end;
 
 
+// Used for microthreading context switching
+
+Function GetExceptionAddrStack : PExceptAddr;
+begin
+  Result := ExceptAddrStack;
+end;
+
+Function GetExceptionObjectStack : PExceptObject;
+begin
+  Result := ExceptObjectStack;
+end;
+
+procedure SetExceptionAddrStack(Value : PExceptAddr);
+begin
+  ExceptAddrStack := Value;
+end;
+
+procedure SetExceptionObjectStack(Value : PExceptObject);
+begin
+  ExceptObjectStack := Value;
+end;
+
+
 function AcquireExceptionObject: Pointer;
 var
   _ExceptObjectStack : PExceptObject;
Index: rtl/inc/objpash.inc
===================================================================
--- rtl/inc/objpash.inc	(revision 17159)
+++ rtl/inc/objpash.inc	(working copy)
@@ -141,7 +141,7 @@
                   D4 : array[0..7] of byte;
                  );
              3 : ( { uuid fields according to RFC4122 }
-                  time_low : dword;			// The low field of the timestamp
+                  time_low : dword;     // The low field of the timestamp
                   time_mid : word;                      // The middle field of the timestamp
                   time_hi_and_version : word;           // The high field of the timestamp multiplexed with the version number
                   clock_seq_hi_and_reserved : byte;     // The high field of the clock sequence multiplexed with the variant
@@ -326,12 +326,26 @@
          Frames     : PPointer;
        end;
 
-    Const
+           
+      PExceptAddr = ^TExceptAddr;
+      TExceptAddr = record
+        buf       : pjmp_buf;
+        next      : PExceptAddr;
+        frametype : Longint;
+      end; 
+     
+     Const
        ExceptProc : TExceptProc = Nil;
        RaiseProc : TExceptProc = Nil;
        RaiseMaxFrameCount : Longint = 16;
 
     Function RaiseList : PExceptObject;
+    
+    // Used for microthreading context switching
+    Function GetExceptionAddrStack : PExceptAddr;
+    Function GetExceptionObjectStack : PExceptObject;
+    procedure SetExceptionAddrStack(Value : PExceptAddr);
+    procedure SetExceptionObjectStack(Value : PExceptObject); 
 
     { @abstract(increase exception reference count)
       When leaving an except block, the exception object is normally
