3be1d7028461b436aac5d7a05e1167f4f2071cc9
[reactos.git] / reactos / ntoskrnl / include / internal / ps.h
1 /*
2 * ReactOS kernel
3 * Copyright (C) 2000 David Welch <welch@cwcom.net>
4 *
5 * This program is free software; you can redistribute it and/or modify
6 * it under the terms of the GNU General Public License as published by
7 * the Free Software Foundation; either version 2 of the License, or
8 * (at your option) any later version.
9 *
10 * This program is distributed in the hope that it will be useful,
11 * but WITHOUT ANY WARRANTY; without even the implied warranty of
12 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
13 * GNU General Public License for more details.
14 *
15 * You should have received a copy of the GNU General Public License
16 * along with this program; if not, write to the Free Software
17 * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
18 */
19 /* $Id: ps.h,v 1.35 2002/07/04 19:56:35 dwelch Exp $
20 *
21 * FILE: ntoskrnl/ke/kthread.c
22 * PURPOSE: Process manager definitions
23 * PROGRAMMER: David Welch (welch@cwcom.net)
24 * UPDATE HISTORY:
25 * Created 22/05/98
26 */
27
28 #ifndef __INCLUDE_INTERNAL_PS_H
29 #define __INCLUDE_INTERNAL_PS_H
30
31 /*
32 * Defines for accessing KPCR and KTHREAD structure members
33 */
34 #define KTHREAD_INITIAL_STACK 0x18
35 #define KTHREAD_STACK_LIMIT 0x1C
36 #define KTHREAD_TEB 0x20
37 #define KTHREAD_KERNEL_STACK 0x28
38 #define KTHREAD_PREVIOUS_MODE 0x137
39 #define KTHREAD_TRAP_FRAME 0x128
40 #define KTHREAD_CALLBACK_STACK 0x120
41
42 #define ETHREAD_THREADS_PROCESS 0x258
43
44 #define KPROCESS_DIRECTORY_TABLE_BASE 0x18
45
46 #define KPCR_BASE 0xFF000000
47
48 #define KPCR_EXCEPTION_LIST 0x0
49 #define KPCR_SELF 0x18
50 #define KPCR_TSS 0x28
51 #define KPCR_CURRENT_THREAD 0x124
52
53 #ifndef __ASM__
54
55 #include <internal/mm.h>
56 #include <napi/teb.h>
57
58 struct _KTHREAD;
59 struct _KTRAPFRAME;
60
61 /* FIXME: This does not work if we have more than 24 IRQs (ie. more than one I/O APIC) */
62 #define VECTOR2IRQ(vector) (((vector) - 0x31) / 8)
63 #define VECTOR2IRQL(vector) (4 + VECTOR2IRQ(vector))
64
65 /*
66 * Processor Control Region
67 */
68 typedef struct _KPCR
69 {
70 PVOID ExceptionList; /* 00 */
71 PVOID StackBase; /* 04 */
72 PVOID StackLimit; /* 08 */
73 PVOID SubSystemTib; /* 0C */
74 PVOID Reserved1; /* 10 */
75 PVOID ArbitraryUserPointer; /* 14 */
76 struct _KPCR* Self; /* 18 */
77 UCHAR ProcessorNumber; /* 1C */
78 KIRQL Irql; /* 1D */
79 UCHAR Reserved2[0x2]; /* 1E */
80 PUSHORT IDT; /* 20 */
81 PUSHORT GDT; /* 24 */
82 KTSS* TSS; /* 28 */
83 UCHAR Reserved3[0xF8]; /* 2C */
84 struct _KTHREAD* CurrentThread; /* 124 */
85 } __attribute__((packed)) KPCR, *PKPCR;
86
87 static inline PKPCR KeGetCurrentKPCR(VOID)
88 {
89 ULONG value;
90
91 __asm__ __volatile__ ("movl %%fs:0x18, %0\n\t"
92 : "=r" (value)
93 : /* no inputs */
94 );
95 return((PKPCR)value);
96 }
97
98 #define KeGetCurrentProcessorNumber() (KeGetCurrentKPCR()->ProcessorNumber)
99
100 extern HANDLE SystemProcessHandle;
101
102 extern LCID PsDefaultThreadLocaleId;
103 extern LCID PsDefaultSystemLocaleId;
104
105
106 typedef struct _KAPC_STATE
107 {
108 LIST_ENTRY ApcListHead[2];
109 struct _KPROCESS* Process;
110 UCHAR KernelApcInProgress;
111 UCHAR KernelApcPending;
112 USHORT UserApcPending;
113 } __attribute__((packed)) KAPC_STATE, *PKAPC_STATE;
114
115 typedef struct _KTHREAD
116 {
117 /* For waiting on thread exit */
118 DISPATCHER_HEADER DispatcherHeader; /* 00 */
119
120 /* List of mutants owned by the thread */
121 LIST_ENTRY MutantListHead; /* 10 */
122 PVOID InitialStack; /* 18 */
123 ULONG StackLimit; /* 1C */
124
125 /* Pointer to the thread's environment block in user memory */
126 PTEB Teb; /* 20 */
127
128 /* Pointer to the thread's TLS array */
129 PVOID TlsArray; /* 24 */
130 PVOID KernelStack; /* 28 */
131 UCHAR DebugActive; /* 2C */
132
133 /* Thread state (one of THREAD_STATE_xxx constants below) */
134 UCHAR State; /* 2D */
135 UCHAR Alerted[2]; /* 2E */
136 UCHAR Iopl; /* 30 */
137 UCHAR NpxState; /* 31 */
138 UCHAR Saturation; /* 32 */
139 CHAR Priority; /* 33 */
140 KAPC_STATE ApcState; /* 34 */
141 ULONG ContextSwitches; /* 4C */
142 ULONG WaitStatus; /* 50 */
143 KIRQL WaitIrql; /* 54 */
144 UCHAR WaitMode; /* 55 */
145 UCHAR WaitNext; /* 56 */
146 UCHAR WaitReason; /* 57 */
147 PKWAIT_BLOCK WaitBlockList; /* 58 */
148 LIST_ENTRY WaitListEntry; /* 5C */
149 ULONG WaitTime; /* 64 */
150 CHAR BasePriority; /* 68 */
151 UCHAR DecrementCount; /* 69 */
152 UCHAR PriorityDecrement; /* 6A */
153 UCHAR Quantum; /* 6B */
154 KWAIT_BLOCK WaitBlock[4]; /* 6C */
155 PVOID LegoData; /* CC */
156 LONG KernelApcDisable; /* D0 */
157 KAFFINITY UserAffinity; /* D4 */
158 UCHAR SystemAffinityActive;/* D8 */
159 UCHAR Pad[7]; /* D9 */
160 PKQUEUE Queue; /* E0 */
161 KSPIN_LOCK ApcQueueLock; /* E4 */
162 KTIMER Timer; /* E8 */
163 LIST_ENTRY QueueListEntry; /* 110 */
164 KAFFINITY Affinity; /* 118 */
165 UCHAR Preempted; /* 11C */
166 UCHAR ProcessReadyQueue; /* 11D */
167 UCHAR KernelStackResident; /* 11E */
168 UCHAR NextProcessor; /* 11F */
169 PVOID CallbackStack; /* 120 */
170 BOOL Win32Thread; /* 124 */
171 struct _KTRAP_FRAME* TrapFrame; /* 128 */
172 PVOID ApcStatePointer[2]; /* 12C */
173 UCHAR EnableStackSwap; /* 134 */
174 UCHAR LargeStack; /* 135 */
175 UCHAR ResourceIndex; /* 136 */
176 UCHAR PreviousMode; /* 137 */
177 ULONG KernelTime; /* 138 */
178 ULONG UserTime; /* 13C */
179 KAPC_STATE SavedApcState; /* 140 */
180 UCHAR Alertable; /* 158 */
181 UCHAR ApcStateIndex; /* 159 */
182 UCHAR ApcQueueable; /* 15A */
183 UCHAR AutoAlignment; /* 15B */
184 PVOID StackBase; /* 15C */
185 KAPC SuspendApc; /* 160 */
186 KSEMAPHORE SuspendSemaphore; /* 190 */
187 LIST_ENTRY ThreadListEntry; /* 1A4 */
188 CHAR FreezeCount; /* 1AC */
189 UCHAR SuspendCount; /* 1AD */
190 UCHAR IdealProcessor; /* 1AE */
191 UCHAR DisableBoost; /* 1AF */
192
193 /*
194 * Below here are thread structure members that are specific to ReactOS
195 */
196
197 /* Added by Phillip Susi for list of threads in a process */
198 LIST_ENTRY ProcessThreadListEntry; /* 1B0 */
199
200 /* Added by Phillip Susi for internal KeAddThreadTimeout() implementation */
201 KDPC TimerDpc; /* 1B8 */
202
203 /* Record the last EIP value when the thread is suspended */
204 ULONG LastEip; /* 1D8 */
205 } __attribute__((packed)) KTHREAD, *PKTHREAD;
206
207 // According to documentation the stack should have a commited [ 1 page ] and
208 // a reserved part [ 1 M ] but can be specified otherwise in the image file.
209
210
211
212
213
214
215
216 // TopLevelIrp can be one of the following values:
217 // FIXME I belong somewhere else
218
219 #define FSRTL_FSP_TOP_LEVEL_IRP (0x01)
220 #define FSRTL_CACHE_TOP_LEVEL_IRP (0x02)
221 #define FSRTL_MOD_WRITE_TOP_LEVEL_IRP (0x03)
222 #define FSRTL_FAST_IO_TOP_LEVEL_IRP (0x04)
223 #define FSRTL_MAX_TOP_LEVEL_IRP_FLAG (0x04)
224
225 typedef struct _TOP_LEVEL_IRP
226 {
227 PIRP TopLevelIrp;
228 ULONG TopLevelIrpConst;
229 } TOP_LEVEL_IRP;
230
231 typedef struct
232 {
233 PACCESS_TOKEN Token; // 0x0
234 UCHAR Unknown1; // 0x4
235 UCHAR Unknown2; // 0x5
236 UCHAR Pad[2]; // 0x6
237 SECURITY_IMPERSONATION_LEVEL Level; // 0x8
238 } PS_IMPERSONATION_INFO, *PPS_IMPERSONATION_INFO;
239
240
241 typedef struct _ETHREAD
242 {
243 KTHREAD Tcb; /* 000 */
244 TIME CreateTime; /* 1B0/1DC */
245 union
246 {
247 TIME ExitTime; /* 1B8/1E4 */
248 LIST_ENTRY LpcReplyChain; /* 1B8/1E4 */
249 } u1;
250 NTSTATUS ExitStatus; /* 1C0/1EC */
251 LIST_ENTRY PostBlockList; /* 1C4/1F0 */
252 LIST_ENTRY TerminationPortList; /* 1CC/1F8 */
253 KSPIN_LOCK ActiveTimerListLock; /* 1D4/200 */
254 LIST_ENTRY ActiveTimerListHead; /* 1D8/204 */
255 CLIENT_ID Cid; /* 1E0/20C */
256 KSEMAPHORE LpcReplySemaphore; /* 1E8/214 */
257 PVOID LpcReplyMessage; /* 1FC/228 */
258 PLARGE_INTEGER LpcReplyMessageId; /* 200/22C */
259 ULONG PerformanceCounterLow; /* 204/230 */
260 PPS_IMPERSONATION_INFO ImpersonationInfo; /* 208/234 */
261 LIST_ENTRY IrpList; /* 20C/238 */
262 TOP_LEVEL_IRP* TopLevelIrp; /* 214/240 */
263 PDEVICE_OBJECT DeviceToVerify; /* 218/244 */
264 ULONG ReadClusterSize; /* 21C/248 */
265 UCHAR ForwardClusterOnly; /* 220/24C */
266 UCHAR DisablePageFaultClustering; /* 221/24D */
267 UCHAR DeadThread; /* 222/24E */
268 UCHAR HasTerminated; /* 223/24F */
269 PVOID EventPair; /* 224/250 */
270 ACCESS_MASK GrantedAccess; /* 228/254 */
271 struct _EPROCESS* ThreadsProcess; /* 22C/258 */
272 PKSTART_ROUTINE StartAddress; /* 230/25C */
273 union
274 {
275 LPTHREAD_START_ROUTINE Win32StartAddress; /* 234/260 */
276 ULONG LpcReceiveMessageId; /* 234/260 */
277 } u2;
278 UCHAR LpcExitThreadCalled; /* 238/264 */
279 UCHAR HardErrorsAreDisabled; /* 239/265 */
280 UCHAR LpcReceivedMsgIdValid; /* 23A/266 */
281 UCHAR ActiveImpersonationInfo; /* 23B/267 */
282 ULONG PerformanceCountHigh; /* 23C/268 */
283
284 /*
285 * Added by David Welch (welch@cwcom.net)
286 */
287 struct _EPROCESS* OldProcess; /* 240/26C */
288
289 struct _W32THREAD* Win32Thread;
290
291 } __attribute__((packed)) ETHREAD, *PETHREAD;
292
293
294 typedef struct _KPROCESS
295 {
296 /* So it's possible to wait for the process to terminate */
297 DISPATCHER_HEADER DispatcherHeader; /* 000 */
298 /*
299 * Presumably a list of profile objects associated with this process,
300 * currently unused.
301 */
302 LIST_ENTRY ProfileListHead; /* 010 */
303 /*
304 * We use the first member of this array to hold the physical address of
305 * the page directory for this process.
306 */
307 PHYSICAL_ADDRESS DirectoryTableBase; /* 018 */
308 /*
309 * Presumably a descriptor for the process's LDT, currently unused.
310 */
311 ULONG LdtDescriptor[2]; /* 020 */
312 /*
313 * Presumably for processing int 0x21 from V86 mode DOS, currently
314 * unused.
315 */
316 ULONG Int21Descriptor[2]; /* 028 */
317 /* Don't know. */
318 USHORT IopmOffset; /* 030 */
319 /*
320 * Presumably I/O privilege level to be used for this process, currently
321 * unused.
322 */
323 UCHAR Iopl; /* 032 */
324 /* Set if this process is a virtual dos machine? */
325 UCHAR VdmFlag; /* 033 */
326 /* Bitmask of the processors being used by this process's threads? */
327 ULONG ActiveProcessors; /* 034 */
328 /* Aggregate of the time this process's threads have spent in kernel mode? */
329 ULONG KernelTime; /* 038 */
330 /* Aggregate of the time this process's threads have spent in user mode? */
331 ULONG UserTime; /* 03C */
332 /* List of this process's threads that are ready for execution? */
333 LIST_ENTRY ReadyListHead; /* 040 */
334 /* List of this process's threads that have their stacks swapped out? */
335 LIST_ENTRY SwapListEntry; /* 048 */
336 /* List of this process's threads? */
337 LIST_ENTRY ThreadListHead; /* 050 */
338 /* Maybe a lock for this data structure, the type is assumed. */
339 KSPIN_LOCK ProcessLock; /* 058 */
340 /* Default affinity mask for this process's threads? */
341 ULONG Affinity; /* 05C */
342 /* Count of the stacks allocated for this process's threads? */
343 USHORT StackCount; /* 060 */
344 /* Base priority for this process's threads? */
345 KPRIORITY BasePriority; /* 062 */
346 /* Default quantum for this process's threads */
347 UCHAR ThreadQuantum; /* 063 */
348 /* Unknown. */
349 UCHAR AutoAlignment; /* 064 */
350 /* Process execution state, currently either active or terminated. */
351 UCHAR State; /* 065 */
352 /* Seed for generating thread ids for this process's threads? */
353 UCHAR ThreadSeed; /* 066 */
354 /* Disable priority boosts? */
355 UCHAR DisableBoost; /* 067 */
356 } KPROCESS, *PKPROCESS;
357
358 struct _EPROCESS
359 {
360 /* Microkernel specific process state. */
361 KPROCESS Pcb; /* 000 */
362 /* Exit status of the process. */
363 NTSTATUS ExitStatus; /* 068 */
364 /* Unknown. */
365 KEVENT LockEvent; /* 06C */
366 /* Unknown. */
367 ULONG LockCount; /* 07C */
368 /* Time of process creation. */
369 TIME CreateTime; /* 080 */
370 /* Time of process exit. */
371 TIME ExitTime; /* 088 */
372 /* Unknown. */
373 PVOID LockOwner; /* 090 */
374 /* Process id. */
375 ULONG UniqueProcessId; /* 094 */
376 /* Unknown. */
377 LIST_ENTRY ActiveProcessLinks; /* 098 */
378 /* Unknown. */
379 ULONG QuotaPeakPoolUsage[2]; /* 0A0 */
380 /* Unknown. */
381 ULONG QuotaPoolUsage[2]; /* 0A8 */
382 /* Unknown. */
383 ULONG PagefileUsage; /* 0B0 */
384 /* Unknown. */
385 ULONG CommitCharge; /* 0B4 */
386 /* Unknown. */
387 ULONG PeakPagefileUsage; /* 0B8 */
388 /* Unknown. */
389 ULONG PeakVirtualSize; /* 0BC */
390 /* Unknown. */
391 LARGE_INTEGER VirtualSize; /* 0C0 */
392 struct
393 {
394 ULONG LastTrimTime;
395 ULONG LastTrimFaultCount;
396 ULONG PageFaultCount;
397 ULONG PeakWorkingSetSize;
398 ULONG WorkingSetSize;
399 ULONG MinimumWorkingSetSize;
400 ULONG MaximumWorkingSetSize;
401 ULONG VmWorkingSetList;
402 LIST_ENTRY WorkingSetExpansionList;
403 UCHAR AllowWorkingSetAdjustment;
404 UCHAR AddressSpaceBeingDeleted;
405 UCHAR ForegroundPrioritySwitch;
406 UCHAR MemoryPriority;
407 } Vm;
408 PVOID LastProtoPteFault;
409 struct _EPORT* DebugPort;
410 struct _EPORT* ExceptionPort;
411 PVOID ObjectTable;
412 PVOID Token;
413 // FAST_MUTEX WorkingSetLock;
414 KMUTEX WorkingSetLock;
415 PVOID WorkingSetPage;
416 UCHAR ProcessOutswapEnabled;
417 UCHAR ProcessOutswapped;
418 UCHAR AddressSpaceInitialized;
419 UCHAR AddressSpaceDeleted;
420 FAST_MUTEX AddressCreationLock;
421 KSPIN_LOCK HyperSpaceLock;
422 PETHREAD ForkInProgress;
423 USHORT VmOperation;
424 UCHAR ForkWasSuccessful;
425 UCHAR MmAgressiveWsTrimMask;
426 PKEVENT VmOperationEvent;
427 PVOID PageDirectoryPte;
428 ULONG LastFaultCount;
429 PVOID VadRoot;
430 PVOID VadHint;
431 PVOID CloneRoot;
432 ULONG NumberOfPrivatePages;
433 ULONG NumberOfLockedPages;
434 USHORT NextProcessColour;
435 UCHAR ExitProcessCalled;
436 UCHAR CreateProcessReported;
437 HANDLE SectionHandle;
438 PPEB Peb;
439 PVOID SectionBaseAddress;
440 PVOID QuotaBlock;
441 NTSTATUS LastThreadExitStatus;
442 PVOID WorkingSetWatch;
443 HANDLE InheritedFromUniqueProcessId;
444 ACCESS_MASK GrantedAccess;
445 ULONG DefaultHardErrorProcessing;
446 PVOID LdtInformation;
447 ULONG VadFreeHint;
448 PVOID VdmObjects;
449 KMUTANT ProcessMutant;
450 CHAR ImageFileName[16];
451 ULONG VmTrimFaultValue;
452 UCHAR SetTimerResolution;
453 UCHAR PriorityClass;
454 UCHAR SubSystemMinorVersion;
455 UCHAR SubSystemMajorVersion;
456 USHORT SubSystemVersion;
457 struct _W32PROCESS* Win32Process;
458 HANDLE Win32WindowStation;
459
460 /*
461 * Added by David Welch (welch@mcmail.com)
462 */
463 HANDLE Win32Desktop;
464 MADDRESS_SPACE AddressSpace;
465 HANDLE_TABLE HandleTable;
466 LIST_ENTRY ProcessListEntry;
467
468 /*
469 * Added by Philip Susi for list of threads in process
470 */
471 LIST_ENTRY ThreadListHead;
472 };
473
474 #define PROCESS_STATE_TERMINATED (1)
475 #define PROCESS_STATE_ACTIVE (2)
476
477 VOID PiInitDefaultLocale(VOID);
478 VOID PiInitProcessManager(VOID);
479 VOID PiShutdownProcessManager(VOID);
480 VOID PsInitThreadManagment(VOID);
481 VOID PsInitProcessManagment(VOID);
482 VOID PsInitIdleThread(VOID);
483 VOID PsDispatchThreadNoLock(ULONG NewThreadStatus);
484 VOID PiTerminateProcessThreads(PEPROCESS Process, NTSTATUS ExitStatus);
485 VOID PsTerminateOtherThread(PETHREAD Thread, NTSTATUS ExitStatus);
486 VOID PsReleaseThread(PETHREAD Thread);
487 VOID PsBeginThread(PKSTART_ROUTINE StartRoutine, PVOID StartContext);
488 VOID PsBeginThreadWithContextInternal(VOID);
489 VOID PiKillMostProcesses(VOID);
490 NTSTATUS STDCALL PiTerminateProcess(PEPROCESS Process, NTSTATUS ExitStatus);
491 ULONG PsUnfreezeThread(PETHREAD Thread, PNTSTATUS WaitStatus);
492 ULONG PsFreezeThread(PETHREAD Thread, PNTSTATUS WaitStatus,
493 UCHAR Alertable, ULONG WaitMode);
494 VOID PiInitApcManagement(VOID);
495 VOID STDCALL PiDeleteThread(PVOID ObjectBody);
496 VOID STDCALL PiCloseThread(PVOID ObjectBody, ULONG HandleCount);
497 VOID PsReapThreads(VOID);
498 NTSTATUS
499 PsInitializeThread(HANDLE ProcessHandle,
500 PETHREAD* ThreadPtr,
501 PHANDLE ThreadHandle,
502 ACCESS_MASK DesiredAccess,
503 POBJECT_ATTRIBUTES ObjectAttributes,
504 BOOLEAN First);
505
506 PACCESS_TOKEN PsReferenceEffectiveToken(PETHREAD Thread,
507 PTOKEN_TYPE TokenType,
508 PUCHAR b,
509 PSECURITY_IMPERSONATION_LEVEL Level);
510
511 NTSTATUS PsOpenTokenOfProcess(HANDLE ProcessHandle,
512 PACCESS_TOKEN* Token);
513
514 NTSTATUS PsSuspendThread(PETHREAD Thread, PULONG PreviousCount);
515 NTSTATUS PsResumeThread(PETHREAD Thread, PULONG PreviousCount);
516
517
518 #define THREAD_STATE_INVALID (0)
519 #define THREAD_STATE_RUNNABLE (1)
520 #define THREAD_STATE_RUNNING (2)
521 #define THREAD_STATE_SUSPENDED (3)
522 #define THREAD_STATE_FROZEN (4)
523 #define THREAD_STATE_TERMINATED_1 (5)
524 #define THREAD_STATE_TERMINATED_2 (6)
525 #define THREAD_STATE_BLOCKED (7)
526 #define THREAD_STATE_MAX (8)
527
528
529 /*
530 * Internal thread priorities, added by Phillip Susi
531 * TODO: rebalence these to make use of all priorities... the ones above 16 can not all be used right now
532 */
533
534 #define PROCESS_PRIO_IDLE 3
535 #define PROCESS_PRIO_NORMAL 8
536 #define PROCESS_PRIO_HIGH 13
537 #define PROCESS_PRIO_RT 18
538
539
540 VOID
541 KeInitializeThread(PKPROCESS Process, PKTHREAD Thread, BOOLEAN First);
542 NTSTATUS KeReleaseThread(PETHREAD Thread);
543 NTSTATUS
544 Ke386InitThread(PKTHREAD Thread, PKSTART_ROUTINE fn, PVOID StartContext);
545 NTSTATUS
546 Ke386InitThreadWithContext(PKTHREAD Thread, PCONTEXT Context);
547 VOID STDCALL PiDeleteProcess(PVOID ObjectBody);
548 VOID PsReapThreads(VOID);
549 VOID PsUnfreezeOtherThread(PETHREAD Thread);
550 VOID PsFreezeOtherThread(PETHREAD Thread);
551 VOID PsFreezeProcessThreads(PEPROCESS Process);
552 VOID PsUnfreezeProcessThreads(PEPROCESS Process);
553 PEPROCESS PsGetNextProcess(PEPROCESS OldProcess);
554 VOID
555 Ki386ContextSwitch(PKTHREAD NewThread, PKTHREAD OldThread);
556 VOID
557 PsBlockThread(PNTSTATUS Status, UCHAR Alertable, ULONG WaitMode,
558 BOOLEAN DispatcherLock, KIRQL WaitIrql);
559 VOID
560 PsUnblockThread(PETHREAD Thread, PNTSTATUS WaitStatus);
561 VOID
562 PsApplicationProcessorInit(VOID);
563 VOID
564 PsPrepareForApplicationProcessorInit(ULONG Id);
565 NTSTATUS STDCALL
566 PsIdleThreadMain(PVOID Context);
567
568 VOID STDCALL
569 PiSuspendThreadRundownRoutine(PKAPC Apc);
570 VOID STDCALL
571 PiSuspendThreadKernelRoutine(PKAPC Apc,
572 PKNORMAL_ROUTINE* NormalRoutine,
573 PVOID* NormalContext,
574 PVOID* SystemArgument1,
575 PVOID* SystemArguemnt2);
576 VOID STDCALL
577 PiSuspendThreadNormalRoutine(PVOID NormalContext,
578 PVOID SystemArgument1,
579 PVOID SystemArgument2);
580
581 VOID STDCALL
582 PiTimeoutThread(struct _KDPC *dpc,
583 PVOID Context,
584 PVOID arg1,
585 PVOID arg2);
586
587 VOID STDCALL
588 PsDispatchThread(ULONG NewThreadStatus);
589
590 #endif /* ASSEMBLER */
591
592 #endif /* __INCLUDE_INTERNAL_PS_H */