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

armddk.h
Go to the documentation of this file.
00001 #ifndef _ARMDDK_
00002 #define _ARMDDK_
00003 
00004 //
00005 // Page size
00006 //
00007 #ifndef PAGE_SIZE
00008 #define PAGE_SIZE 0x1000
00009 #endif
00010 
00011 #ifndef _WINNT_H
00012 //
00013 // IRQLs
00014 //
00015 #define PASSIVE_LEVEL                     0
00016 #define LOW_LEVEL                         0
00017 #define APC_LEVEL                         1
00018 #define DISPATCH_LEVEL                    2
00019 #define SYNCH_LEVEL                       DISPATCH_LEVEL
00020 #define PROFILE_LEVEL                     27
00021 #define CLOCK1_LEVEL                      28
00022 #define CLOCK2_LEVEL                      28
00023 #define IPI_LEVEL                         29
00024 #define POWER_LEVEL                       30
00025 #define HIGH_LEVEL                        31
00026 #endif
00027 
00028 //
00029 // FIXME: mmtypes.h?
00030 //
00031 #define KIP0PCRADDRESS          0xFFDFF000
00032 #define KI_USER_SHARED_DATA     0xFFDF0000
00033 #define USPCR                   0x7FFF0000
00034 #define PCR                     ((KPCR * const)KIP0PCRADDRESS)
00035 #define USERPCR                 ((volatile KPCR * const)USPCR)
00036 #define KeGetPcr()              PCR
00037 #ifndef _WINNT_H
00038 #define SharedUserData          ((KUSER_SHARED_DATA * const)KI_USER_SHARED_DATA)
00039 
00040 //
00041 // Address space layout
00042 //
00043 extern PVOID MmHighestUserAddress;
00044 extern PVOID MmSystemRangeStart;
00045 extern ULONG_PTR MmUserProbeAddress;
00046 #define MM_HIGHEST_USER_ADDRESS           MmHighestUserAddress
00047 #define MM_SYSTEM_RANGE_START             MmSystemRangeStart
00048 #define MM_USER_PROBE_ADDRESS             MmUserProbeAddress
00049 #define MM_LOWEST_USER_ADDRESS            (PVOID)0x10000
00050 #define MM_LOWEST_SYSTEM_ADDRESS          (PVOID)0xC0800000
00051 
00052 //
00053 // Maximum IRQs
00054 //
00055 #define MAXIMUM_VECTOR          16
00056 
00057 #define KERNEL_STACK_SIZE                   12288
00058 #define KERNEL_LARGE_STACK_SIZE             61440
00059 #define KERNEL_LARGE_STACK_COMMIT           12288
00060 
00061 //
00062 // Used to contain PFNs and PFN counts
00063 //
00064 //typedef ULONG PFN_COUNT;
00065 //typedef ULONG PFN_NUMBER, *PPFN_NUMBER;
00066 //typedef LONG SPFN_NUMBER, *PSPFN_NUMBER;
00067 
00068 //
00069 // Stub
00070 //
00071 typedef struct _KFLOATING_SAVE
00072 {
00073     ULONG Reserved;
00074 } KFLOATING_SAVE, *PKFLOATING_SAVE;
00075 
00076 /* The following flags control the contents of the CONTEXT structure. */
00077 #define CONTEXT_ARM    0x0000040
00078 #define CONTEXT_CONTROL         (CONTEXT_ARM | 0x00000001L)
00079 #define CONTEXT_INTEGER         (CONTEXT_ARM | 0x00000002L)
00080 #define CONTEXT_FULL (CONTEXT_CONTROL | CONTEXT_INTEGER)
00081 
00082 typedef struct _CONTEXT {
00083     /* The flags values within this flag control the contents of
00084        a CONTEXT record.
00085 
00086        If the context record is used as an input parameter, then
00087        for each portion of the context record controlled by a flag
00088        whose value is set, it is assumed that that portion of the
00089        context record contains valid context. If the context record
00090        is being used to modify a thread's context, then only that
00091        portion of the threads context will be modified.
00092 
00093        If the context record is used as an IN OUT parameter to capture
00094        the context of a thread, then only those portions of the thread's
00095        context corresponding to set flags will be returned.
00096 
00097        The context record is never used as an OUT only parameter. */
00098 
00099     ULONG ContextFlags;
00100 
00101     /* This section is specified/returned if the ContextFlags word contains
00102        the flag CONTEXT_INTEGER. */
00103     ULONG R0;
00104     ULONG R1;
00105     ULONG R2;
00106     ULONG R3;
00107     ULONG R4;
00108     ULONG R5;
00109     ULONG R6;
00110     ULONG R7;
00111     ULONG R8;
00112     ULONG R9;
00113     ULONG R10;
00114     ULONG R11;
00115     ULONG R12;
00116 
00117     ULONG Sp;
00118     ULONG Lr;
00119     ULONG Pc;
00120     ULONG Psr;
00121 } CONTEXT;
00122 #endif
00123 
00124 //
00125 // Processor Control Region
00126 //
00127 #ifdef _WINNT_H
00128 #define KIRQL ULONG
00129 #endif
00130 
00131 typedef struct _NT_TIB_KPCR {
00132     struct _EXCEPTION_REGISTRATION_RECORD *ExceptionList;
00133     PVOID StackBase;
00134     PVOID StackLimit;
00135     PVOID SubSystemTib;
00136     _ANONYMOUS_UNION union {
00137         PVOID FiberData;
00138         ULONG Version;
00139     } DUMMYUNIONNAME;
00140     PVOID ArbitraryUserPointer;
00141     struct _NT_TIB_KPCR *Self;
00142 } NT_TIB_KPCR,*PNT_TIB_KPCR;
00143 
00144 typedef struct _KPCR
00145 {
00146     union
00147     {
00148         NT_TIB_KPCR NtTib;
00149         struct
00150         {
00151             struct _EXCEPTION_REGISTRATION_RECORD *Used_ExceptionList; // Unused
00152             PVOID Used_StackBase; // Unused
00153             PVOID PerfGlobalGroupMask;
00154             PVOID TssCopy; // Unused
00155             ULONG ContextSwitches;
00156             KAFFINITY SetMemberCopy; // Unused
00157             PVOID Used_Self;
00158         };
00159     };
00160     struct _KPCR *Self;
00161     struct _KPRCB *Prcb;
00162     KIRQL Irql;
00163     ULONG IRR; // Unused
00164     ULONG IrrActive; // Unused
00165     ULONG IDR; // Unused
00166     PVOID KdVersionBlock;
00167     PVOID IDT; // Unused
00168     PVOID GDT; // Unused
00169     PVOID TSS; // Unused
00170     USHORT MajorVersion;
00171     USHORT MinorVersion;
00172     KAFFINITY SetMember;
00173     ULONG StallScaleFactor;
00174     UCHAR SpareUnused;
00175     UCHAR Number;
00176     UCHAR Spare0;
00177     UCHAR SecondLevelCacheAssociativity;
00178     ULONG VdmAlert;
00179     ULONG KernelReserved[14];
00180     ULONG SecondLevelCacheSize;
00181     ULONG HalReserved[16];
00182 } KPCR, *PKPCR;
00183 
00184 //
00185 // Get the current TEB
00186 //
00187 FORCEINLINE
00188 struct _TEB* NtCurrentTeb(VOID)
00189 {
00190     return (struct _TEB*)USERPCR->Used_Self;
00191 }
00192 
00193 NTSYSAPI
00194 struct _KTHREAD*
00195 NTAPI
00196 KeGetCurrentThread(VOID);
00197 
00198 FORCEINLINE
00199 NTSTATUS
00200 KeSaveFloatingPointState(PVOID FloatingState)
00201 {
00202   UNREFERENCED_PARAMETER(FloatingState);
00203   return STATUS_SUCCESS;
00204 }
00205 
00206 FORCEINLINE
00207 NTSTATUS
00208 KeRestoreFloatingPointState(PVOID FloatingState)
00209 {
00210   UNREFERENCED_PARAMETER(FloatingState);
00211   return STATUS_SUCCESS;
00212 }
00213 
00214 extern volatile struct _KSYSTEM_TIME KeTickCount;
00215 
00216 #ifndef YieldProcessor
00217 #define YieldProcessor __yield
00218 #endif
00219 
00220 #define ASSERT_BREAKPOINT BREAKPOINT_COMMAND_STRING + 1
00221 
00222 #define DbgRaiseAssertionFailure() __break(ASSERT_BREAKPOINT)
00223 
00224 #define PCR_MINOR_VERSION 1
00225 #define PCR_MAJOR_VERSION 1
00226 
00227 #define RESULT_ZERO     0
00228 #define RESULT_NEGATIVE 1
00229 #define RESULT_POSITIVE 2
00230 
00231 DECLSPEC_IMPORT
00232 VOID
00233 __fastcall
00234 KfReleaseSpinLock(
00235   IN OUT ULONG_PTR* SpinLock,
00236   IN KIRQL NewIrql);
00237 
00238 DECLSPEC_IMPORT
00239 KIRQL
00240 __fastcall
00241 KfAcquireSpinLock(
00242   IN OUT ULONG_PTR* SpinLock);
00243 
00244 #ifndef _WINNT_H
00245 //
00246 // IRQL Support on ARM is similar to MIPS/ALPHA
00247 //
00248 KIRQL
00249 KfRaiseIrql(
00250     IN KIRQL NewIrql
00251 );
00252 
00253 VOID
00254 KfLowerIrql(
00255     IN KIRQL NewIrql
00256 );
00257 
00258 KIRQL
00259 KeRaiseIrqlToSynchLevel(
00260     VOID
00261 );
00262 
00263 KIRQL
00264 KeRaiseIrqlToDpcLevel(
00265     VOID
00266 );
00267 
00268 #define KeLowerIrql(NewIrql) KfLowerIrql(NewIrql)
00269 #define KeRaiseIrql(NewIrql, OldIrql) *(OldIrql) = KfRaiseIrql(NewIrql)
00270 
00271 NTHALAPI
00272 KIRQL
00273 FASTCALL
00274 KfAcquireSpinLock(
00275   IN OUT PKSPIN_LOCK SpinLock);
00276 #define KeAcquireSpinLock(a,b) *(b) = KfAcquireSpinLock(a)
00277 
00278 NTHALAPI
00279 VOID
00280 FASTCALL
00281 KfReleaseSpinLock(
00282   IN OUT PKSPIN_LOCK SpinLock,
00283   IN KIRQL NewIrql);
00284 #define KeReleaseSpinLock(a,b) KfReleaseSpinLock(a,b)
00285 
00286 NTKERNELAPI
00287 VOID
00288 FASTCALL
00289 KefAcquireSpinLockAtDpcLevel(
00290   IN OUT PKSPIN_LOCK SpinLock);
00291 #define KeAcquireSpinLockAtDpcLevel(SpinLock) KefAcquireSpinLockAtDpcLevel(SpinLock)
00292 
00293 NTKERNELAPI
00294 VOID
00295 FASTCALL
00296 KefReleaseSpinLockFromDpcLevel(
00297   IN OUT PKSPIN_LOCK SpinLock);
00298 #define KeReleaseSpinLockFromDpcLevel(SpinLock) KefReleaseSpinLockFromDpcLevel(SpinLock)
00299 
00300 //
00301 // Cache clean and flush
00302 //
00303 VOID
00304 HalSweepDcache(
00305     VOID
00306 );
00307 
00308 VOID
00309 HalSweepIcache(
00310     VOID
00311 );
00312 
00313 FORCEINLINE
00314 VOID
00315 _KeQueryTickCount(
00316   OUT PLARGE_INTEGER CurrentCount)
00317 {
00318   for (;;) {
00319 #ifdef NONAMELESSUNION
00320     CurrentCount->s.HighPart = KeTickCount.High1Time;
00321     CurrentCount->s.LowPart = KeTickCount.LowPart;
00322     if (CurrentCount->s.HighPart == KeTickCount.High2Time) break;
00323 #else
00324     CurrentCount->HighPart = KeTickCount.High1Time;
00325     CurrentCount->LowPart = KeTickCount.LowPart;
00326     if (CurrentCount->HighPart == KeTickCount.High2Time) break;
00327 #endif
00328     YieldProcessor();
00329   }
00330 }
00331 #define KeQueryTickCount(CurrentCount) _KeQueryTickCount(CurrentCount)
00332 #endif
00333 
00334 //
00335 // Intrinsics
00336 //
00337 #define InterlockedDecrement _InterlockedDecrement
00338 #define InterlockedIncrement _InterlockedIncrement
00339 #define InterlockedExchange  _InterlockedExchange
00340 #endif

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