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 <archtypes.h>
18 /* Variables relating to shutting down MINIX. */
19 EXTERN
char kernel_exception
; /* TRUE after system exceptions */
20 EXTERN
char shutdown_started
; /* TRUE after shutdowns / reboots */
22 /* Kernel information structures. This groups vital kernel information. */
23 EXTERN phys_bytes aout
; /* address of a.out headers */
24 EXTERN
struct kinfo kinfo
; /* kernel information for users */
25 EXTERN
struct machine machine
; /* machine information for users */
26 EXTERN
struct kmessages kmess
; /* diagnostic messages in kernel */
27 EXTERN
struct randomness krandom
; /* gather kernel random information */
28 EXTERN
struct loadinfo kloadinfo
; /* status of load average */
30 /* Process scheduling information and the kernel reentry count. */
31 EXTERN
struct proc
*prev_ptr
; /* previously running process */
32 EXTERN
struct proc
*proc_ptr
; /* pointer to currently running process */
33 EXTERN
struct proc
*next_ptr
; /* next process to run after restart() */
34 EXTERN
struct proc
*bill_ptr
; /* process to bill for clock ticks */
35 EXTERN
char k_reenter
; /* kernel reentry count (entry count less 1) */
36 EXTERN
unsigned lost_ticks
; /* clock ticks counted outside clock task */
39 /* Interrupt related variables. */
40 EXTERN irq_hook_t irq_hooks
[NR_IRQ_HOOKS
]; /* hooks for general use */
41 EXTERN
int irq_actids
[NR_IRQ_VECTORS
]; /* IRQ ID bits active */
42 EXTERN
int irq_use
; /* map of all in-use irq's */
44 EXTERN
struct ipc_stats
46 unsigned long deadproc
;
47 unsigned long bad_endpoint
;
48 unsigned long dst_not_allowed
;
49 unsigned long bad_call
;
50 unsigned long call_not_allowed
;
51 unsigned long bad_buffer
;
52 unsigned long deadlock
;
53 unsigned long not_ready
;
54 unsigned long src_died
;
55 unsigned long dst_died
;
56 unsigned long no_priv
;
57 unsigned long bad_size
;
58 unsigned long bad_senda
;
61 extern endpoint_t ipc_stats_target
;
63 EXTERN
struct system_stats
65 unsigned long bad_req
;
66 unsigned long not_allowed
;
71 EXTERN reg_t mon_ss
, mon_sp
; /* boot monitor stack */
72 EXTERN
int mon_return
; /* true if we can return to monitor */
73 EXTERN
int do_serial_debug
;
74 EXTERN endpoint_t who_e
; /* message source endpoint */
75 EXTERN
int who_p
; /* message source proc */
76 EXTERN
int sys_call_code
; /* kernel call number in SYSTEM */
77 EXTERN
time_t boottime
;
80 EXTERN phys_bytes vm_base
;
81 EXTERN phys_bytes vm_size
;
82 EXTERN phys_bytes vm_mem_high
;
84 /* Variables that are initialized elsewhere are just extern here. */
85 extern struct boot_image image
[]; /* system image processes */
86 extern char *t_stack
[]; /* task stack space */
87 extern struct segdesc_s gdt
[]; /* global descriptor table */
89 EXTERN
_PROTOTYPE( void (*level0_func
), (void) );