diff --git a/reactos/base/services/eventlog/eventlog.h b/reactos/base/services/eventlog/eventlog.h index 11db027eb09..54c2b305e90 100644 --- a/reactos/base/services/eventlog/eventlog.h +++ b/reactos/base/services/eventlog/eventlog.h @@ -162,9 +162,9 @@ PBYTE LogfAllocAndBuildNewRecord(LPDWORD lpRecSize, DWORD dwDataSize, LPVOID lpRawData); -__inline void LogfFreeRecord(LPVOID Rec); - /* eventlog.c */ +extern HANDLE MyHeap; + VOID PRINT_HEADER(PFILE_HEADER header); VOID PRINT_RECORD(PEVENTLOGRECORD pRec); @@ -185,4 +185,9 @@ NTSTATUS ProcessPortMessage(VOID); /* rpc.c */ DWORD WINAPI RpcThreadRoutine(LPVOID lpParameter); +static __inline void LogfFreeRecord(LPVOID Rec) +{ + HeapFree(MyHeap, 0, Rec); +} + #endif /* __EVENTLOG_H__ */ diff --git a/reactos/base/services/eventlog/file.c b/reactos/base/services/eventlog/file.c index 807f997b44d..82dce7cc43a 100644 --- a/reactos/base/services/eventlog/file.c +++ b/reactos/base/services/eventlog/file.c @@ -14,7 +14,6 @@ static LIST_ENTRY LogFileListHead; static CRITICAL_SECTION LogFileListCs; -extern HANDLE MyHeap; /* FUNCTIONS ****************************************************************/ @@ -898,8 +897,3 @@ PBYTE LogfAllocAndBuildNewRecord(LPDWORD lpRecSize, *lpRecSize = dwRecSize; return Buffer; } - -__inline void LogfFreeRecord(LPVOID Rec) -{ - HeapFree(MyHeap, 0, Rec); -} diff --git a/reactos/base/services/eventlog/logport.c b/reactos/base/services/eventlog/logport.c index b909489aa12..0db58ac3083 100644 --- a/reactos/base/services/eventlog/logport.c +++ b/reactos/base/services/eventlog/logport.c @@ -15,7 +15,6 @@ HANDLE ConnectPortHandle = NULL; HANDLE MessagePortHandle = NULL; -extern HANDLE MyHeap; extern BOOL onLiveCD; /* FUNCTIONS ****************************************************************/ diff --git a/reactos/hal/halx86/include/apic.h b/reactos/hal/halx86/include/apic.h index 92497b82251..453b32fee4d 100644 --- a/reactos/hal/halx86/include/apic.h +++ b/reactos/hal/halx86/include/apic.h @@ -93,10 +93,10 @@ #define APIC_LVT_VECTOR (0xFF << 0) /* Vector */ #define APIC_LVT_DS (0x1 << 12) /* Delivery Status */ -#define APIC_LVT_REMOTE_IRR (0x1 << 14) /* Remote IRR */ -#define APIC_LVT_LEVEL_TRIGGER (0x1 << 15) /* Lvel Triggered */ -#define APIC_LVT_MASKED (0x1 << 16) /* Mask */ -#define APIC_LVT_PERIODIC (0x1 << 17) /* Timer Mode */ +#define APIC_LVT_REMOTE_IRR (0x1 << 14) /* Remote IRR */ +#define APIC_LVT_LEVEL_TRIGGER (0x1 << 15) /* Lvel Triggered */ +#define APIC_LVT_MASKED (0x1 << 16) /* Mask */ +#define APIC_LVT_PERIODIC (0x1 << 17) /* Timer Mode */ #define APIC_LVT3_DM (0x7 << 8) #define APIC_LVT3_IIPP (0x1 << 13) @@ -117,10 +117,10 @@ #define APIC_LVT_VECTOR (0xFF << 0) /* Vector */ #define APIC_LVT_DS (0x1 << 12) /* Delivery Status */ -#define APIC_LVT_REMOTE_IRR (0x1 << 14) /* Remote IRR */ -#define APIC_LVT_LEVEL_TRIGGER (0x1 << 15) /* Lvel Triggered */ -#define APIC_LVT_MASKED (0x1 << 16) /* Mask */ -#define APIC_LVT_PERIODIC (0x1 << 17) /* Timer Mode */ +#define APIC_LVT_REMOTE_IRR (0x1 << 14) /* Remote IRR */ +#define APIC_LVT_LEVEL_TRIGGER (0x1 << 15) /* Lvel Triggered */ +#define APIC_LVT_MASKED (0x1 << 16) /* Mask */ +#define APIC_LVT_PERIODIC (0x1 << 17) /* Timer Mode */ #define APIC_LVT3_DM (0x7 << 8) #define APIC_LVT3_IIPP (0x1 << 13) @@ -185,30 +185,92 @@ typedef struct _CPU_INFO } CPU_INFO, *PCPU_INFO; extern ULONG CPUCount; /* Total number of CPUs */ -extern ULONG BootCPU; /* Bootstrap processor */ +extern ULONG BootCPU; /* Bootstrap processor */ extern ULONG OnlineCPUs; /* Bitmask of online CPUs */ extern CPU_INFO CPUMap[MAX_CPU]; /* Map of all CPUs in the system */ +extern PULONG APICBase; /* Virtual address of local APIC */ +extern ULONG lastregr[MAX_CPU]; /* For debugging */ +extern ULONG lastvalr[MAX_CPU]; +extern ULONG lastregw[MAX_CPU]; +extern ULONG lastvalw[MAX_CPU]; /* Prototypes */ - -__inline VOID APICWrite(ULONG Offset, ULONG Value); -__inline ULONG APICRead(ULONG Offset); VOID APICSendIPI(ULONG Target, ULONG Mode); VOID APICSetup(VOID); VOID HaliInitBSP(VOID); VOID APICSyncArbIDs(VOID); -__inline VOID APICSendEOI(VOID); VOID APICCalibrateTimer(ULONG CPU); VOID HaliStartApplicationProcessor(ULONG Cpu, ULONG Stack); +static __inline ULONG _APICRead(ULONG Offset) +{ + PULONG p; + + p = (PULONG)((ULONG)APICBase + Offset); + return *p; +} + +#if 0 +static __inline VOID APICWrite(ULONG Offset, + ULONG Value) +{ + PULONG p; + + p = (PULONG)((ULONG)APICBase + Offset); + + *p = Value; +} +#else +static __inline VOID APICWrite(ULONG Offset, + ULONG Value) +{ + PULONG p; + ULONG CPU = (_APICRead(APIC_ID) & APIC_ID_MASK) >> 24; + + lastregw[CPU] = Offset; + lastvalw[CPU] = Value; + + p = (PULONG)((ULONG)APICBase + Offset); + + *p = Value; +} +#endif + +#if 0 +static __inline ULONG APICRead(ULONG Offset) +{ + PULONG p; + + p = (PULONG)((ULONG)APICBase + Offset); + return *p; +} +#else +static __inline ULONG APICRead(ULONG Offset) +{ + PULONG p; + ULONG CPU = (_APICRead(APIC_ID) & APIC_ID_MASK) >> 24; + + lastregr[CPU] = Offset; + lastvalr[CPU] = 0; + + p = (PULONG)((ULONG)APICBase + Offset); + + lastvalr[CPU] = *p; + return lastvalr[CPU]; +} +#endif + static __inline ULONG ThisCPU(VOID) { return (APICRead(APIC_ID) & APIC_ID_MASK) >> 24; } +static __inline VOID APICSendEOI(VOID) +{ + // Send the EOI + APICWrite(APIC_EOI, 0); +} -#endif - +#endif /* __INTERNAL_HAL_APIC_H */ /* EOF */ - diff --git a/reactos/hal/halx86/mp/apic.c b/reactos/hal/halx86/mp/apic.c index 80c1184f420..3cf72b05665 100644 --- a/reactos/hal/halx86/mp/apic.c +++ b/reactos/hal/halx86/mp/apic.c @@ -223,72 +223,6 @@ VOID APICDisable(VOID) APICWrite(APIC_SIVR, tmp); } - -__inline ULONG _APICRead(ULONG Offset) -{ - PULONG p; - - p = (PULONG)((ULONG)APICBase + Offset); - return *p; -} - -#if 0 -__inline VOID APICWrite(ULONG Offset, - ULONG Value) -{ - PULONG p; - - p = (PULONG)((ULONG)APICBase + Offset); - - *p = Value; -} -#else -__inline VOID APICWrite(ULONG Offset, - ULONG Value) -{ - PULONG p; - ULONG CPU = (_APICRead(APIC_ID) & APIC_ID_MASK) >> 24; - - lastregw[CPU] = Offset; - lastvalw[CPU] = Value; - - p = (PULONG)((ULONG)APICBase + Offset); - - *p = Value; -} -#endif - - -#if 0 -__inline ULONG APICRead(ULONG Offset) -{ - PULONG p; - - p = (PULONG)((ULONG)APICBase + Offset); - return *p; -} -#else -__inline ULONG APICRead(ULONG Offset) -{ - PULONG p; - ULONG CPU = (_APICRead(APIC_ID) & APIC_ID_MASK) >> 24; - - lastregr[CPU] = Offset; - lastvalr[CPU] = 0; - - p = (PULONG)((ULONG)APICBase + Offset); - - lastvalr[CPU] = *p; - return lastvalr[CPU]; -} -#endif - -__inline VOID APICSendEOI(VOID) -{ - // Send the EOI - APICWrite(APIC_EOI, 0); -} - static VOID APICDumpBit(ULONG base) { ULONG v, i, j; @@ -319,7 +253,6 @@ VOID APICDump(VOID) ULONG CPU = ThisCPU();; - r1 = lastregr[CPU]; r2 = lastvalr[CPU]; w1 = lastregw[CPU];