2005-07-14 17:12:12 +02:00
|
|
|
#ifndef GLO_H
|
|
|
|
#define GLO_H
|
|
|
|
|
2009-01-09 17:15:15 +01:00
|
|
|
#include <minix/sysutil.h>
|
|
|
|
|
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
|
2005-06-03 15:55:06 +02:00
|
|
|
* defined as extern unless the _TABLE definition is seen. We rely on the
|
2005-07-14 17:12:12 +02:00
|
|
|
* compiler's default initialization (0) for several global variables.
|
2005-04-21 16:53:53 +02:00
|
|
|
*/
|
|
|
|
#ifdef _TABLE
|
|
|
|
#undef EXTERN
|
|
|
|
#define EXTERN
|
|
|
|
#endif
|
|
|
|
|
2005-06-01 11:37:52 +02:00
|
|
|
#include <minix/config.h>
|
Split of architecture-dependent and -independent functions for i386,
mainly in the kernel and headers. This split based on work by
Ingmar Alting <iaalting@cs.vu.nl> done for his Minix PowerPC architecture
port.
. kernel does not program the interrupt controller directly, do any
other architecture-dependent operations, or contain assembly any more,
but uses architecture-dependent functions in arch/$(ARCH)/.
. architecture-dependent constants and types defined in arch/$(ARCH)/include.
. <ibm/portio.h> moved to <minix/portio.h>, as they have become, for now,
architecture-independent functions.
. int86, sdevio, readbios, and iopenable are now i386-specific kernel calls
and live in arch/i386/do_* now.
. i386 arch now supports even less 86 code; e.g. mpx86.s and klib86.s have
gone, and 'machine.protected' is gone (and always taken to be 1 in i386).
If 86 support is to return, it should be a new architecture.
. prototypes for the architecture-dependent functions defined in
kernel/arch/$(ARCH)/*.c but used in kernel/ are in kernel/proto.h
. /etc/make.conf included in makefiles and shell scripts that need to
know the building architecture; it defines ARCH=<arch>, currently only
i386.
. some basic per-architecture build support outside of the kernel (lib)
. in clock.c, only dequeue a process if it was ready
. fixes for new include files
files deleted:
. mpx/klib.s - only for choosing between mpx/klib86 and -386
. klib86.s - only for 86
i386-specific files files moved (or arch-dependent stuff moved) to arch/i386/:
. mpx386.s (entry point)
. klib386.s
. sconst.h
. exception.c
. protect.c
. protect.h
. i8269.c
2006-12-22 16:22:27 +01:00
|
|
|
#include <archtypes.h>
|
2005-07-14 17:12:12 +02:00
|
|
|
#include "config.h"
|
2005-06-01 11:37:52 +02:00
|
|
|
|
2005-06-03 15:55:06 +02:00
|
|
|
/* Variables relating to shutting down MINIX. */
|
|
|
|
EXTERN char kernel_exception; /* TRUE after system exceptions */
|
2005-09-08 16:31:23 +02:00
|
|
|
EXTERN char shutdown_started; /* TRUE after shutdowns / reboots */
|
2005-04-21 16:53:53 +02:00
|
|
|
|
2005-04-29 17:36:43 +02:00
|
|
|
/* Kernel information structures. This groups vital kernel information. */
|
2005-06-03 15:55:06 +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 */
|
2009-04-02 17:24:44 +02:00
|
|
|
EXTERN struct k_randomness krandom; /* gather kernel random information */
|
2005-11-14 16:50:46 +01:00
|
|
|
EXTERN struct loadinfo kloadinfo; /* status of load average */
|
2005-04-21 16:53:53 +02:00
|
|
|
|
2005-06-03 15:55:06 +02:00
|
|
|
/* Process scheduling information and the kernel reentry count. */
|
2005-06-30 17:55:19 +02:00
|
|
|
EXTERN struct proc *prev_ptr; /* previously running process */
|
2005-04-21 16:53:53 +02:00
|
|
|
EXTERN struct proc *proc_ptr; /* pointer to currently running process */
|
2005-06-24 18:24:40 +02:00
|
|
|
EXTERN struct proc *next_ptr; /* next process to run after restart() */
|
|
|
|
EXTERN struct proc *bill_ptr; /* process to bill for clock ticks */
|
2008-11-19 13:26:10 +01:00
|
|
|
EXTERN struct proc *vmrestart; /* first process on vmrestart queue */
|
|
|
|
EXTERN struct proc *vmrequest; /* first process on vmrequest queue */
|
|
|
|
EXTERN struct proc *pagefaults; /* first process on pagefault queue */
|
|
|
|
EXTERN struct proc *softnotify; /* first process on softnotify queue */
|
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
|
|
|
|
|
|
|
|
|
|
|
/* Interrupt related variables. */
|
2005-05-02 16:30:04 +02:00
|
|
|
EXTERN irq_hook_t irq_hooks[NR_IRQ_HOOKS]; /* hooks for general use */
|
2005-04-21 16:53:53 +02:00
|
|
|
EXTERN int irq_actids[NR_IRQ_VECTORS]; /* IRQ ID bits active */
|
2005-06-03 15:55:06 +02:00
|
|
|
EXTERN int irq_use; /* map of all in-use irq's */
|
2008-12-11 15:12:52 +01:00
|
|
|
EXTERN u32_t system_hz; /* HZ value */
|
2005-04-21 16:53:53 +02:00
|
|
|
|
2008-02-22 13:36:46 +01:00
|
|
|
EXTERN struct ipc_stats
|
|
|
|
{
|
|
|
|
unsigned long deadproc;
|
|
|
|
unsigned long bad_endpoint;
|
|
|
|
unsigned long dst_not_allowed;
|
|
|
|
unsigned long bad_call;
|
|
|
|
unsigned long call_not_allowed;
|
|
|
|
unsigned long bad_buffer;
|
|
|
|
unsigned long deadlock;
|
|
|
|
unsigned long not_ready;
|
|
|
|
unsigned long src_died;
|
|
|
|
unsigned long dst_died;
|
|
|
|
unsigned long no_priv;
|
|
|
|
unsigned long bad_size;
|
|
|
|
unsigned long bad_senda;
|
|
|
|
u64_t total;
|
|
|
|
} ipc_stats;
|
|
|
|
extern endpoint_t ipc_stats_target;
|
|
|
|
|
|
|
|
EXTERN struct system_stats
|
|
|
|
{
|
|
|
|
unsigned long bad_req;
|
|
|
|
unsigned long not_allowed;
|
|
|
|
u64_t total;
|
|
|
|
} sys_stats;
|
|
|
|
|
2005-04-21 16:53:53 +02:00
|
|
|
/* Miscellaneous. */
|
2005-06-03 15:55:06 +02:00
|
|
|
EXTERN reg_t mon_ss, mon_sp; /* boot monitor stack */
|
|
|
|
EXTERN int mon_return; /* true if we can return to monitor */
|
2005-09-30 14:54:59 +02:00
|
|
|
EXTERN int do_serial_debug;
|
2006-06-20 11:57:00 +02:00
|
|
|
EXTERN endpoint_t who_e; /* message source endpoint */
|
|
|
|
EXTERN int who_p; /* message source proc */
|
|
|
|
EXTERN int sys_call_code; /* kernel call number in SYSTEM */
|
2007-08-07 14:21:40 +02:00
|
|
|
EXTERN time_t boottime;
|
2008-11-19 13:26:10 +01:00
|
|
|
EXTERN char params_buffer[512]; /* boot monitor parameters */
|
|
|
|
EXTERN int minix_panicing;
|
|
|
|
EXTERN int locklevel;
|
|
|
|
|
|
|
|
EXTERN unsigned long cr3switch;
|
|
|
|
EXTERN unsigned long cr3reload;
|
2005-09-30 14:54:59 +02:00
|
|
|
|
|
|
|
/* VM */
|
|
|
|
EXTERN phys_bytes vm_base;
|
|
|
|
EXTERN phys_bytes vm_size;
|
|
|
|
EXTERN phys_bytes vm_mem_high;
|
2008-11-19 13:26:10 +01:00
|
|
|
EXTERN int vm_running;
|
|
|
|
EXTERN int must_notify_vm;
|
|
|
|
|
|
|
|
/* Verbose flags (debugging). */
|
|
|
|
EXTERN int verbose_vm;
|
|
|
|
|
2009-01-09 17:15:15 +01:00
|
|
|
/* Timing */
|
2009-01-09 22:44:52 +01:00
|
|
|
EXTERN util_timingdata_t timingdata[TIMING_CATEGORIES];
|
2005-04-21 16:53:53 +02:00
|
|
|
|
|
|
|
/* Variables that are initialized elsewhere are just extern here. */
|
2005-07-29 17:26:23 +02:00
|
|
|
extern struct boot_image image[]; /* system image processes */
|
2005-06-03 15:55:06 +02:00
|
|
|
extern char *t_stack[]; /* task stack space */
|
|
|
|
extern struct segdesc_s gdt[]; /* global descriptor table */
|
2005-04-21 16:53:53 +02:00
|
|
|
|
|
|
|
EXTERN _PROTOTYPE( void (*level0_func), (void) );
|
|
|
|
|
2005-07-14 17:12:12 +02:00
|
|
|
#endif /* GLO_H */
|