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

cpu.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/arm/cpu.c
00005  * PURPOSE:         Implements routines for ARM CPU support
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 ULONG KeFixedTbEntries;
00018 ULONG KiDmaIoCoherency;
00019 ULONG KeIcacheFlushCount = 0;
00020 ULONG KeDcacheFlushCount;
00021 ULONG KeLargestCacheLine = 64; // FIXME: It depends
00022 
00023 /* FUNCTIONS ******************************************************************/
00024 
00025 VOID
00026 KiFlushSingleTb(IN BOOLEAN Invalid,
00027                 IN PVOID Virtual)
00028 {
00029     //
00030     // Just invalidate it
00031     //
00032     KeArmInvalidateTlbEntry(Virtual);
00033 }
00034 
00035 VOID
00036 KeFlushTb(VOID)
00037 {
00038     //
00039     // Flush the entire TLB
00040     //
00041     KeArmFlushTlb();
00042 }
00043 
00044 VOID
00045 NTAPI
00046 KeFlushCurrentTb(VOID)
00047 {
00048     //
00049     // Rename?
00050     //
00051     KeFlushTb();
00052 }
00053 
00054 VOID
00055 FASTCALL
00056 KeZeroPages(IN PVOID Address,
00057             IN ULONG Size)
00058 {
00059     /* Not using XMMI in this routine */
00060     RtlZeroMemory(Address, Size);
00061 }
00062 
00063 VOID
00064 NTAPI
00065 KiSaveProcessorControlState(OUT PKPROCESSOR_STATE ProcessorState)
00066 {
00067     //
00068     // Save some critical stuff we use
00069     //
00070     ProcessorState->SpecialRegisters.ControlRegister = KeArmControlRegisterGet();
00071     ProcessorState->SpecialRegisters.LockdownRegister = KeArmLockdownRegisterGet();
00072     ProcessorState->SpecialRegisters.CacheRegister = KeArmCacheRegisterGet();
00073     ProcessorState->SpecialRegisters.StatusRegister = KeArmStatusRegisterGet();
00074 }
00075 
00076 BOOLEAN
00077 NTAPI
00078 KeInvalidateAllCaches(VOID)
00079 {
00080     //
00081     // Invalidate D cache and I cache
00082     //
00083     KeArmInvalidateAllCaches();
00084     return TRUE;
00085 }
00086 
00087 
00088 /* PUBLIC FUNCTIONS ***********************************************************/
00089 
00090 /*
00091  * @implemented
00092  */
00093 ULONG
00094 NTAPI
00095 KeGetRecommendedSharedDataAlignment(VOID)
00096 {
00097     /* Return the global variable */
00098     return KeLargestCacheLine;
00099 }
00100 
00101 /*
00102  * @implemented
00103  */
00104 VOID
00105 NTAPI
00106 KeFlushEntireTb(IN BOOLEAN Invalid,
00107                 IN BOOLEAN AllProcessors)
00108 {
00109     KIRQL OldIrql;
00110 
00111     //
00112     // Raise the IRQL for the TB Flush
00113     //
00114     OldIrql = KeRaiseIrqlToSynchLevel();
00115 
00116     //
00117     // Flush the TB for the Current CPU
00118     //
00119     KeFlushCurrentTb();
00120 
00121     //
00122     // Return to Original IRQL
00123     //
00124     KeLowerIrql(OldIrql);
00125 }
00126 
00127 /*
00128  * @implemented
00129  */
00130 VOID
00131 NTAPI
00132 KeSetDmaIoCoherency(IN ULONG Coherency)
00133 {
00134     //
00135     // Save the coherency globally
00136     //
00137     KiDmaIoCoherency = Coherency;
00138 }
00139 
00140 /*
00141  * @implemented
00142  */
00143 KAFFINITY
00144 NTAPI
00145 KeQueryActiveProcessors(VOID)
00146 {
00147     PAGED_CODE();
00148 
00149     //
00150     // Simply return the number of active processors
00151     //
00152     return KeActiveProcessors;
00153 }
00154 
00155 /*
00156  * @implemented
00157  */
00158 VOID
00159 __cdecl
00160 KeSaveStateForHibernate(IN PKPROCESSOR_STATE State)
00161 {
00162     //
00163     // Capture the context
00164     //
00165     RtlCaptureContext(&State->ContextFrame);
00166 
00167     //
00168     // Capture the control state
00169     //
00170     KiSaveProcessorControlState(State);
00171 }
00172 
00173 /*
00174  * @implemented
00175  */
00176 NTSTATUS
00177 NTAPI
00178 KeSaveFloatingPointState(OUT PKFLOATING_SAVE Save)
00179 {
00180     //
00181     // Nothing to do on ARM
00182     //
00183     return STATUS_SUCCESS;
00184 }
00185 
00186 /*
00187  * @implemented
00188  */
00189 NTSTATUS
00190 NTAPI
00191 KeRestoreFloatingPointState(IN PKFLOATING_SAVE Save)
00192 {
00193     //
00194     // Nothing to do on ARM
00195     //
00196     return STATUS_SUCCESS;
00197 }
00198 
00199 /* SYSTEM CALLS NOT VALID ON THIS CPU *****************************************/
00200 
00201 /*
00202  * @implemented
00203  */
00204 NTSTATUS
00205 NTAPI
00206 NtVdmControl(IN ULONG ControlCode,
00207              IN PVOID ControlData)
00208 {
00209     //
00210     // Does not exist on ARM
00211     //
00212     return STATUS_NOT_IMPLEMENTED;
00213 }
00214 
00215 NTSTATUS
00216 NTAPI
00217 NtSetLdtEntries(IN ULONG Selector1,
00218                 IN LDT_ENTRY LdtEntry1,
00219                 IN ULONG Selector2,
00220                 IN LDT_ENTRY LdtEntry2)
00221 {
00222     //
00223     // Does not exist on ARM
00224     //
00225     return STATUS_NOT_IMPLEMENTED;
00226 }

Generated on Sun May 27 2012 04:37:30 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.