vm: util.S not used currently; leave it out.
[minix.git] / kernel / glo.h
blobd3042d3dd359b09f384f7791e4637cf9a7193326
1 #ifndef GLO_H
2 #define GLO_H
4 /* Global variables used in the kernel. This file contains the declarations;
5 * storage space for the variables is allocated in table.c, because EXTERN is
6 * defined as extern unless the _TABLE definition is seen. We rely on the
7 * compiler's default initialization (0) for several global variables.
8 */
9 #ifdef _TABLE
10 #undef EXTERN
11 #define EXTERN
12 #endif
14 #include <minix/config.h>
15 #include <machine/archtypes.h>
16 #include "archconst.h"
17 #include "config.h"
18 #include "debug.h"
20 /* Kernel information structures. This groups vital kernel information. */
21 EXTERN struct kinfo kinfo; /* kernel information for users */
22 EXTERN struct machine machine; /* machine information for users */
23 EXTERN struct kmessages kmess; /* diagnostic messages in kernel */
24 EXTERN struct k_randomness krandom; /* gather kernel random information */
25 EXTERN struct loadinfo kloadinfo; /* status of load average */
27 /* Process scheduling information and the kernel reentry count. */
28 EXTERN struct proc *proc_ptr; /* pointer to currently running process */
29 EXTERN struct proc *bill_ptr; /* process to bill for clock ticks */
30 EXTERN struct proc *vmrequest; /* first process on vmrequest queue */
31 EXTERN struct proc *pagefaults; /* first process on pagefault queue */
32 EXTERN unsigned lost_ticks; /* clock ticks counted outside clock task */
35 /* Interrupt related variables. */
36 EXTERN irq_hook_t irq_hooks[NR_IRQ_HOOKS]; /* hooks for general use */
37 EXTERN int irq_actids[NR_IRQ_VECTORS]; /* IRQ ID bits active */
38 EXTERN int irq_use; /* map of all in-use irq's */
39 EXTERN u32_t system_hz; /* HZ value */
41 /* Miscellaneous. */
42 EXTERN reg_t mon_ss, mon_sp; /* boot monitor stack */
43 EXTERN int mon_return; /* true if we can return to monitor */
44 EXTERN int do_serial_debug;
45 EXTERN time_t boottime;
46 EXTERN char params_buffer[512]; /* boot monitor parameters */
47 EXTERN int minix_panicing;
48 EXTERN int locklevel;
49 EXTERN char fpu_presence;
50 EXTERN char osfxsr_feature; /* FXSAVE/FXRSTOR instructions support (SSEx) */
51 EXTERN int verboseboot; /* verbose boot, init'ed in cstart */
52 #define MAGICTEST 0xC0FFEE23
53 EXTERN u32_t magictest; /* global magic number */
55 #if DEBUG_TRACE
56 EXTERN int verboseflags;
57 #endif
59 #ifdef CONFIG_APIC
60 EXTERN int config_no_apic; /* optionaly turn off apic */
61 #endif
63 EXTERN unsigned cpu_hz[CONFIG_MAX_CPUS];
65 #define cpu_set_freq(cpu, freq) do {cpu_hz[cpu] = freq;} while (0)
66 #define cpu_get_freq(cpu) cpu_hz[cpu]
68 /* VM */
69 EXTERN int vm_running;
70 EXTERN int catch_pagefaults;
71 EXTERN struct proc *ptproc;
73 /* Timing */
74 EXTERN util_timingdata_t timingdata[TIMING_CATEGORIES];
76 /* Variables that are initialized elsewhere are just extern here. */
77 extern struct boot_image image[]; /* system image processes */
78 extern char *t_stack[]; /* task stack space */
79 extern struct segdesc_s gdt[]; /* global descriptor table */
81 EXTERN volatile int serial_debug_active;
83 #endif /* GLO_H */