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 services */
23 extern struct machine machine
; /* machine info for services */
24 extern struct kmessages kmessages
; /* diagnostic messages in kernel */
25 extern struct loadinfo loadinfo
; /* status of load average */
26 extern struct kuserinfo kuserinfo
; /* kernel information for users */
27 extern struct arm_frclock arm_frclock
; /* ARM free-running timer info */
28 extern struct kclockinfo kclockinfo
; /* clock information */
29 extern struct minix_kerninfo minix_kerninfo
;
31 EXTERN
struct k_randomness krandom
; /* gather kernel random information */
33 EXTERN vir_bytes minix_kerninfo_user
;
35 #define kmess kmessages
36 #define kloadinfo loadinfo
38 #define system_hz (kclockinfo.hz) /* HZ value (alias) */
40 /* Process scheduling information and the kernel reentry count. */
41 EXTERN
struct proc
*vmrequest
; /* first process on vmrequest queue */
42 EXTERN
unsigned lost_ticks
; /* clock ticks counted outside clock task */
43 EXTERN
char *ipc_call_names
[IPCNO_HIGHEST
+1]; /* human-readable call names */
44 EXTERN
struct proc
*kbill_kcall
; /* process that made kernel call */
45 EXTERN
struct proc
*kbill_ipc
; /* process that invoked ipc */
47 /* Interrupt related variables. */
48 EXTERN irq_hook_t irq_hooks
[NR_IRQ_HOOKS
]; /* hooks for general use */
49 EXTERN
int irq_actids
[NR_IRQ_VECTORS
]; /* IRQ ID bits active */
50 EXTERN
int irq_use
; /* map of all in-use irq's */
53 EXTERN
int verboseboot
; /* verbose boot, init'ed in cstart */
56 EXTERN
int verboseflags
;
60 EXTERN
int config_no_apic
; /* optionally turn off apic */
61 EXTERN
int config_apic_timer_x
; /* apic timer slowdown factor */
64 EXTERN u64_t cpu_hz
[CONFIG_MAX_CPUS
];
66 #define cpu_set_freq(cpu, freq) do {cpu_hz[cpu] = freq;} while (0)
67 #define cpu_get_freq(cpu) cpu_hz[cpu]
70 EXTERN
int config_no_smp
; /* optionally turn off SMP */
74 EXTERN
int vm_running
;
75 EXTERN
int catch_pagefaults
;
76 EXTERN
int kernel_may_alloc
;
78 /* Variables that are initialized elsewhere are just extern here. */
79 extern struct boot_image image
[NR_BOOT_PROCS
]; /* system image processes */
81 EXTERN
volatile int serial_debug_active
;
83 EXTERN
struct cpu_info cpu_info
[CONFIG_MAX_CPUS
];
86 EXTERN u64_t kernel_ticks
[CONFIG_MAX_CPUS
];
87 EXTERN u64_t bkl_ticks
[CONFIG_MAX_CPUS
];
88 EXTERN
unsigned bkl_tries
[CONFIG_MAX_CPUS
];
89 EXTERN
unsigned bkl_succ
[CONFIG_MAX_CPUS
];
92 EXTERN
int minix_feature_flags
;