This commit was generated by cvs2svn to compensate for changes in r10,
[reactos.git] / reactos / include / internal / kernel.h
1 /*
2 * Various useful prototypes
3 */
4
5 #ifndef __KERNEL_H
6 #define __KERNEL_H
7
8 #include <windows.h>
9 #include <ddk/ntddk.h>
10
11 #include <internal/linkage.h>
12 #include <stdarg.h>
13
14 /*
15 * Use these to place a function in a specific section of the executable
16 */
17 #define PLACE_IN_SECTION(s) __attribute__((section (s)))
18 #define INIT_FUNCTION (PLACE_IN_SECTION("init"))
19 #define PAGE_LOCKED_FUNCTION (PLACE_IN_SECTION("pagelk"))
20 #define PAGE_UNLOCKED_FUNCTION (PLACE_IN_SECTION("pagepo"))
21
22 /*
23 * Maximum size of the kmalloc area (this is totally arbitary)
24 */
25 #define NONPAGED_POOL_SIZE (4*1024*1024)
26
27 VOID KiInterruptDispatch(unsigned int irq);
28 VOID KiDispatchInterrupt(unsigned int irq);
29 VOID KeTimerInterrupt(VOID);
30
31 /*
32 * Defines a descriptor as it appears in the processor tables
33 */
34 typedef struct
35 {
36 unsigned int a;
37 unsigned int b;
38 } descriptor;
39
40 extern descriptor idt[256];
41 extern descriptor gdt[256];
42
43 /*
44 * printf style functions
45 */
46 asmlinkage void printk(const char* fmt, ...);
47 int vsprintf(char *buf, const char *fmt, va_list args);
48 int sprintf(char* buf, const char* fmt, ...);
49
50 typedef struct
51 {
52 /*
53 * Magic value (useless really)
54 */
55 unsigned int magic;
56
57 /*
58 * Cursor position
59 */
60 unsigned int cursorx;
61 unsigned int cursory;
62
63 /*
64 * Number of files (including the kernel) loaded
65 */
66 unsigned int nr_files;
67
68 /*
69 * Range of physical memory being used by the system
70 */
71 unsigned int start_mem;
72 unsigned int end_mem;
73
74 /*
75 * List of module lengths (terminated by a 0)
76 */
77 unsigned int module_length[64];
78 } boot_param;
79
80
81 /*
82 * Initalization functions (called once by main())
83 */
84 void MmInitalize(boot_param* bp);
85 void InitalizeExceptions(void);
86 void InitalizeIRQ(void);
87 void InitializeTimer(void);
88 void InitConsole(boot_param* bp);
89 void KeInitDpc(void);
90 void HalInit(boot_param* bp);
91 void IoInit(void);
92 void ObjNamespcInit(void);
93 void PsMgrInit(void);
94 void KeInitializeBugCheck(void);
95 VOID KeInitializeDispatcher(VOID);
96 void TstBegin(void);
97 void KeCalibrateTimerLoop(void);
98
99 /*
100 * FUNCTION: Called to execute queued dpcs
101 */
102 void KeDrainDpcQueue(void);
103
104 void KeExpireTimers(void);
105
106 typedef unsigned int (exception_hook)(CONTEXT* c, unsigned int exp);
107 asmlinkage unsigned int ExHookException(exception_hook fn, UINT exp);
108
109 #endif