4 #include <minix/sysutil.h>
6 /* Global variables used in the kernel. This file contains the declarations;
7 * storage space for the variables is allocated in table.c, because EXTERN is
8 * defined as extern unless the _TABLE definition is seen. We rely on the
9 * compiler's default initialization (0) for several global variables.
16 #include <minix/config.h>
17 #include <archtypes.h>
21 /* Variables relating to shutting down MINIX. */
22 EXTERN
char kernel_exception
; /* TRUE after system exceptions */
23 EXTERN
char shutdown_started
; /* TRUE after shutdowns / reboots */
25 /* Kernel information structures. This groups vital kernel information. */
26 EXTERN
struct kinfo kinfo
; /* kernel information for users */
27 EXTERN
struct machine machine
; /* machine information for users */
28 EXTERN
struct kmessages kmess
; /* diagnostic messages in kernel */
29 EXTERN
struct k_randomness krandom
; /* gather kernel random information */
30 EXTERN
struct loadinfo kloadinfo
; /* status of load average */
32 /* Process scheduling information and the kernel reentry count. */
33 EXTERN
struct proc
*proc_ptr
; /* pointer to currently running process */
34 EXTERN
struct proc
*next_ptr
; /* next process to run after restart() */
35 EXTERN
struct proc
*prev_ptr
;
36 EXTERN
struct proc
*bill_ptr
; /* process to bill for clock ticks */
37 EXTERN
struct proc
*vmrestart
; /* first process on vmrestart queue */
38 EXTERN
struct proc
*vmrequest
; /* first process on vmrequest queue */
39 EXTERN
struct proc
*pagefaults
; /* first process on pagefault queue */
40 EXTERN
char k_reenter
; /* kernel reentry count (entry count less 1) */
41 EXTERN
unsigned lost_ticks
; /* clock ticks counted outside clock task */
44 /* Interrupt related variables. */
45 EXTERN irq_hook_t irq_hooks
[NR_IRQ_HOOKS
]; /* hooks for general use */
46 EXTERN
int irq_actids
[NR_IRQ_VECTORS
]; /* IRQ ID bits active */
47 EXTERN
int irq_use
; /* map of all in-use irq's */
48 EXTERN u32_t system_hz
; /* HZ value */
51 EXTERN reg_t mon_ss
, mon_sp
; /* boot monitor stack */
52 EXTERN
int mon_return
; /* true if we can return to monitor */
53 EXTERN
int do_serial_debug
;
54 EXTERN endpoint_t who_e
; /* message source endpoint */
55 EXTERN
int who_p
; /* message source proc */
56 EXTERN
int sys_call_code
; /* kernel call number in SYSTEM */
57 EXTERN
time_t boottime
;
58 EXTERN
char params_buffer
[512]; /* boot monitor parameters */
59 EXTERN
int minix_panicing
;
61 #define MAGICTEST 0xC0FFEE23
62 EXTERN u32_t magictest
; /* global magic number */
65 EXTERN
int verboseflags
;
69 EXTERN
int vm_running
;
70 EXTERN
int catch_pagefaults
;
71 EXTERN
struct proc
*ptproc
;
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 */