2005-04-21 16:53:53 +02:00
|
|
|
/* Global variables used in the kernel. This file contains the declarations;
|
|
|
|
* storage space for the variables is allocated in table.c, because EXTERN is
|
|
|
|
* defined as extern unless the _TABLE definition is seen.
|
|
|
|
*/
|
|
|
|
#ifdef _TABLE
|
|
|
|
#undef EXTERN
|
|
|
|
#define EXTERN
|
|
|
|
#endif
|
|
|
|
|
2005-06-01 11:37:52 +02:00
|
|
|
#include "const.h"
|
|
|
|
#include <minix/config.h>
|
|
|
|
|
2005-04-21 16:53:53 +02:00
|
|
|
/* MINIX' shutdown sequence uses watchdog timers to stop system services. The
|
|
|
|
* flag shutting_down must be initialized to FALSE. We rely on the compiler's
|
|
|
|
* default initialization (0) of global variables here.
|
|
|
|
*/
|
2005-05-24 16:35:58 +02:00
|
|
|
EXTERN char skip_stop_sequence; /* set to TRUE in case of an exception() */
|
|
|
|
EXTERN char shutting_down; /* TRUE if the system is shutting down */
|
2005-04-21 16:53:53 +02:00
|
|
|
EXTERN struct proc *shutdown_process; /* process awaiting shutdown of */
|
|
|
|
EXTERN timer_t shutdown_timer; /* watchdog function called after timeout */
|
|
|
|
|
2005-04-29 17:36:43 +02:00
|
|
|
/* Kernel information structures. This groups vital kernel information. */
|
2005-04-21 16:53:53 +02:00
|
|
|
EXTERN phys_bytes aout; /* address of a.out headers */
|
2005-04-29 17:36:43 +02:00
|
|
|
EXTERN struct kinfo kinfo; /* kernel information for users */
|
|
|
|
EXTERN struct machine machine; /* machine information for users */
|
|
|
|
EXTERN struct kmessages kmess; /* diagnostic messages in kernel */
|
|
|
|
EXTERN struct memory mem[NR_MEMS]; /* base and size of chunks of memory */
|
2005-04-21 16:53:53 +02:00
|
|
|
|
2005-05-24 16:35:58 +02:00
|
|
|
/* Process scheduling info and kernel entry count. */
|
2005-04-21 16:53:53 +02:00
|
|
|
EXTERN struct proc *proc_ptr; /* pointer to currently running process */
|
2005-05-24 16:35:58 +02:00
|
|
|
EXTERN struct proc *next_ptr; /* pointer to next process to run */
|
2005-05-24 12:06:17 +02:00
|
|
|
EXTERN char k_reenter; /* kernel reentry count (entry count less 1) */
|
|
|
|
EXTERN unsigned lost_ticks; /* clock ticks counted outside clock task */
|
2005-04-21 16:53:53 +02:00
|
|
|
|
2005-05-30 13:05:42 +02:00
|
|
|
/* Declare buffer space and a bit map for notification messages. */
|
|
|
|
EXTERN struct notification notify_buffer[NR_NOTIFY_BUFS];
|
|
|
|
EXTERN bitchunk_t notify_bitmap[BITMAP_CHUNKS(NR_NOTIFY_BUFS)];
|
|
|
|
|
|
|
|
|
2005-04-21 16:53:53 +02:00
|
|
|
#if (CHIP == INTEL)
|
|
|
|
|
|
|
|
/* Interrupt related variables. */
|
2005-05-02 16:30:04 +02:00
|
|
|
EXTERN irq_hook_t irq_hooks[NR_IRQ_HOOKS]; /* hooks for general use */
|
|
|
|
EXTERN irq_hook_t *irq_handlers[NR_IRQ_VECTORS];/* list of IRQ handlers */
|
2005-04-21 16:53:53 +02:00
|
|
|
EXTERN int irq_actids[NR_IRQ_VECTORS]; /* IRQ ID bits active */
|
|
|
|
EXTERN int irq_use; /* bit map of all in-use irq's */
|
|
|
|
|
2005-06-01 11:37:52 +02:00
|
|
|
/* lock() timing data. */
|
|
|
|
#if ENABLE_LOCK_TIMING
|
|
|
|
EXTERN struct lock_timedata timingdata[TIMING_CATEGORIES];
|
|
|
|
#endif
|
|
|
|
|
2005-04-21 16:53:53 +02:00
|
|
|
/* Miscellaneous. */
|
|
|
|
EXTERN reg_t mon_ss, mon_sp; /* monitor stack */
|
|
|
|
EXTERN int mon_return; /* true if return to the monitor possible */
|
|
|
|
|
|
|
|
/* Variables that are initialized elsewhere are just extern here. */
|
|
|
|
extern struct system_image image[]; /* system image processes (table.c) */
|
|
|
|
extern char *t_stack[]; /* stack space for kernel tasks (table.c) */
|
|
|
|
extern struct segdesc_s gdt[]; /* protected mode global descriptor (protect.c) */
|
|
|
|
|
|
|
|
EXTERN _PROTOTYPE( void (*level0_func), (void) );
|
|
|
|
#endif /* (CHIP == INTEL) */
|
|
|
|
|
|
|
|
#if (CHIP == M68000)
|
|
|
|
/* M68000 specific variables go here. */
|
|
|
|
#endif
|
|
|
|
|