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.
14 #include <minix/config.h>
15 #include <minix/ipcconst.h>
16 #include <machine/archtypes.h>
17 #include "archconst.h"
21 /* Kernel information structures. This groups vital kernel information. */
22 extern struct kinfo kinfo
; /* kernel information for users */
23 extern struct machine machine
; /* machine information for users */
24 extern struct kmessages kmessages
; /* diagnostic messages in kernel */
25 extern struct loadinfo loadinfo
; /* status of load average */
26 extern struct minix_kerninfo minix_kerninfo
;
28 EXTERN
struct k_randomness krandom
; /* gather kernel random information */
30 EXTERN vir_bytes minix_kerninfo_user
;
32 #define kmess kmessages
33 #define kloadinfo loadinfo
35 /* Process scheduling information and the kernel reentry count. */
36 EXTERN
struct proc
*vmrequest
; /* first process on vmrequest queue */
37 EXTERN
unsigned lost_ticks
; /* clock ticks counted outside clock task */
38 EXTERN
char *ipc_call_names
[IPCNO_HIGHEST
+1]; /* human-readable call names */
39 EXTERN
struct proc
*kbill_kcall
; /* process that made kernel call */
40 EXTERN
struct proc
*kbill_ipc
; /* process that invoked ipc */
42 /* Interrupt related variables. */
43 EXTERN irq_hook_t irq_hooks
[NR_IRQ_HOOKS
]; /* hooks for general use */
44 EXTERN
int irq_actids
[NR_IRQ_VECTORS
]; /* IRQ ID bits active */
45 EXTERN
int irq_use
; /* map of all in-use irq's */
46 EXTERN u32_t system_hz
; /* HZ value */
49 EXTERN
time_t boottime
;
50 EXTERN
int verboseboot
; /* verbose boot, init'ed in cstart */
53 EXTERN
int verboseflags
;
57 EXTERN
int config_no_apic
; /* optionally turn off apic */
58 EXTERN
int config_apic_timer_x
; /* apic timer slowdown factor */
61 EXTERN u64_t cpu_hz
[CONFIG_MAX_CPUS
];
63 #define cpu_set_freq(cpu, freq) do {cpu_hz[cpu] = freq;} while (0)
64 #define cpu_get_freq(cpu) cpu_hz[cpu]
67 EXTERN
int config_no_smp
; /* optionally turn off SMP */
71 EXTERN
int vm_running
;
72 EXTERN
int catch_pagefaults
;
73 EXTERN
int kernel_may_alloc
;
75 /* Variables that are initialized elsewhere are just extern here. */
76 extern struct boot_image image
[NR_BOOT_PROCS
]; /* system image processes */
78 EXTERN
volatile int serial_debug_active
;
80 EXTERN
struct cpu_info cpu_info
[CONFIG_MAX_CPUS
];
83 EXTERN u64_t kernel_ticks
[CONFIG_MAX_CPUS
];
84 EXTERN u64_t bkl_ticks
[CONFIG_MAX_CPUS
];
85 EXTERN
unsigned bkl_tries
[CONFIG_MAX_CPUS
];
86 EXTERN
unsigned bkl_succ
[CONFIG_MAX_CPUS
];
89 EXTERN
int minix_feature_flags
;