ReactOS Fundraising Campaign 2012
 
€ 4,410 / € 30,000

Information | Donate

Home | Info | Community | Development | myReactOS | Contact Us

  1. Home
  2. Community
  3. Development
  4. myReactOS
  5. Fundraiser 2012

  1. Main Page
  2. Alphabetical List
  3. Data Structures
  4. Directories
  5. File List
  6. Data Fields
  7. Globals
  8. Related Pages

ReactOS Development > Doxygen

context.c
Go to the documentation of this file.
00001 /*
00002  * PROJECT:         ReactOS Kernel
00003  * LICENSE:         BSD - See COPYING.ARM in the top level directory
00004  * FILE:            ntoskrnl/ke/i386/context.c
00005  * PURPOSE:         Context Switching Related Code
00006  * PROGRAMMERS:     ReactOS Portable Systems Group
00007  */
00008 
00009 /* INCLUDES *******************************************************************/
00010 
00011 #include <ntoskrnl.h>
00012 #define NDEBUG
00013 #include <debug.h>
00014 
00015 /* GLOBALS ********************************************************************/
00016 
00017 /* FUNCTIONS ******************************************************************/
00018 
00019 VOID
00020 NTAPI
00021 KiSwapProcess(IN PKPROCESS NewProcess,
00022               IN PKPROCESS OldProcess)
00023 {
00024     PKIPCR Pcr = (PKIPCR)KeGetPcr();
00025 #ifdef CONFIG_SMP
00026     LONG SetMember;
00027     
00028     /* Update active processor mask */
00029     SetMember = (LONG)Pcr->SetMember;
00030     InterlockedXor((PLONG)&NewProcess->ActiveProcessors, SetMember);
00031     InterlockedXor((PLONG)&OldProcess->ActiveProcessors, SetMember);
00032 #endif
00033 
00034     /* Check for new LDT */
00035     if (NewProcess->LdtDescriptor.LimitLow != OldProcess->LdtDescriptor.LimitLow)
00036     {
00037         /* Not handled yet */
00038         UNIMPLEMENTED;
00039         while (TRUE);
00040     }
00041     
00042     /* Update CR3 */
00043     __writecr3(NewProcess->DirectoryTableBase[0]);
00044     
00045     /* Clear GS */
00046     Ke386SetGs(0);
00047     
00048     /* Update IOPM offset */
00049     Pcr->TSS->IoMapBase = NewProcess->IopmOffset;
00050 }
00051 

Generated on Sat May 26 2012 04:18:59 for ReactOS by doxygen 1.7.6.1

ReactOS is a registered trademark or a trademark of ReactOS Foundation in the United States and other countries.