Skip to content

Commit

Permalink
[NTOS:KE] Remove KiMask32Array
Browse files Browse the repository at this point in the history
It's useless and also broken in the way it is used. Replace it with a simple shift and make it correct for 64 bit.
  • Loading branch information
tkreuzer committed Nov 27, 2023
1 parent 51a8979 commit ed73da5
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 13 deletions.
5 changes: 2 additions & 3 deletions ntoskrnl/include/internal/ke.h
Original file line number Diff line number Diff line change
Expand Up @@ -137,7 +137,6 @@ extern LIST_ENTRY KiProcessInSwapListHead, KiProcessOutSwapListHead;
extern LIST_ENTRY KiStackInSwapListHead;
extern KEVENT KiSwapEvent;
extern PKPRCB KiProcessorBlock[];
extern ULONG KiMask32Array[MAXIMUM_PRIORITY];
extern ULONG_PTR KiIdleSummary;
extern PVOID KeUserApcDispatcher;
extern PVOID KeUserCallbackDispatcher;
Expand All @@ -156,8 +155,8 @@ extern VOID __cdecl KiInterruptTemplate(VOID);

/* MACROS *************************************************************************/

#define AFFINITY_MASK(Id) KiMask32Array[Id]
#define PRIORITY_MASK(Id) KiMask32Array[Id]
#define AFFINITY_MASK(ProcessorIndex) ((KAFFINITY)1 << (ProcessorIndex))
#define PRIORITY_MASK(Priority) (1UL << (Priority))

/* Tells us if the Timer or Event is a Syncronization or Notification Object */
#define TIMER_OR_EVENT_TYPE 0x7L
Expand Down
10 changes: 0 additions & 10 deletions ntoskrnl/ke/thrdobj.c
Original file line number Diff line number Diff line change
Expand Up @@ -15,16 +15,6 @@
extern EX_WORK_QUEUE ExWorkerQueue[MaximumWorkQueue];
extern LIST_ENTRY PspReaperListHead;

ULONG KiMask32Array[MAXIMUM_PRIORITY] =
{
0x1, 0x2, 0x4, 0x8, 0x10, 0x20,
0x40, 0x80, 0x100, 0x200, 0x400, 0x800,
0x1000, 0x2000, 0x4000, 0x8000, 0x10000, 0x20000,
0x40000, 0x80000, 0x100000, 0x200000, 0x400000, 0x800000,
0x1000000, 0x2000000, 0x4000000, 0x8000000, 0x10000000, 0x20000000,
0x40000000, 0x80000000
};

/* FUNCTIONS *****************************************************************/

UCHAR
Expand Down

0 comments on commit ed73da5

Please sign in to comment.