* It is divided up into two main sections. The first section contains
* user-settable parameters. In the second section, various internal system
* parameters are set based on the user-settable parameters.
+ *
+ * Parts of config.h have been moved to sys_config.h, which can be included
+ * by other include files that wish to get at the configuration data, but
+ * don't want to pollute the users namespace. Some editable values have
+ * gone there.
+ *
*/
-/*===========================================================================*
- * This section contains user-settable parameters *
- *===========================================================================*/
-#define MACHINE IBM_PC /* Must be one of the names listed below */
-
-#define IBM_PC 1 /* any 8088 or 80x86-based system */
-#define SUN_4 40 /* any Sun SPARC-based system */
-#define SUN_4_60 40 /* Sun-4/60 (aka SparcStation 1 or Campus) */
-#define ATARI 60 /* ATARI ST/STe/TT (68000/68030) */
-#define MACINTOSH 62 /* Apple Macintosh (68000) */
-
-/* Word size in bytes (a constant equal to sizeof(int)). */
-#if __ACK__
-#define _WORD_SIZE _EM_WSIZE
-#define _PTR_SIZE _EM_WSIZE
-#endif
+/* The MACHINE (called _MINIX_MACHINE) setting can be done
+ * in <minix/machine.h>.
+ */
+#include <minix/sys_config.h>
+
+#define MACHINE _MINIX_MACHINE
+
+#define IBM_PC _MACHINE_IBM_PC
+#define SUN_4 _MACHINE_SUN_4
+#define SUN_4_60 _MACHINE_SUN_4_60
+#define ATARI _MACHINE_ATARI
+#define MACINTOSH _MACHINE_MACINTOSH
/* Number of slots in the process table for non-kernel processes. The number
* of system processes defines how many processes with special privileges
* there can be. User processes share the same properties and count for one.
+ *
+ * These can be changed in sys_config.h.
*/
-#define NR_PROCS 64
-#define NR_SYS_PROCS 32
+#define NR_PROCS _NR_PROCS
+#define NR_SYS_PROCS _NR_SYS_PROCS
/* The buffer cache should be made as large as you can afford. */
#if (MACHINE == IBM_PC && _WORD_SIZE == 2)
* indicative of more than just the CPU. For example, machines for which
* CHIP == INTEL are expected to have 8259A interrrupt controllers and the
* other properties of IBM PC/XT/AT/386 types machines in general. */
-#define INTEL 1 /* CHIP type for PC, XT, AT, 386 and clones */
-#define M68000 2 /* CHIP type for Atari, Amiga, Macintosh */
-#define SPARC 3 /* CHIP type for SUN-4 (e.g. SPARCstation) */
+#define INTEL _CHIP_INTEL /* CHIP type for PC, XT, AT, 386 and clones */
+#define M68000 _CHIP_M68000 /* CHIP type for Atari, Amiga, Macintosh */
+#define SPARC _CHIP_SPARC /* CHIP type for SUN-4 (e.g. SPARCstation) */
/* Set the FP_FORMAT type based on the machine selected, either hw or sw */
-#define FP_NONE 0 /* no floating point support */
-#define FP_IEEE 1 /* conform IEEE floating point standard */
+#define FP_NONE _FP_NONE /* no floating point support */
+#define FP_IEEE _FP_IEEE /* conform IEEE floating point standard */
-#if (MACHINE == IBM_PC)
-#define CHIP INTEL
-#endif
+/* _MINIX_CHIP is defined in sys_config.h. */
+#define CHIP _MINIX_CHIP
-#if (MACHINE == ATARI) || (MACHINE == MACINTOSH)
-#define CHIP M68000
-#endif
+/* _MINIX_FP_FORMAT is defined in sys_config.h. */
+#define FP_FORMAT _MINIX_FP_FORMAT
-#if (MACHINE == SUN_4) || (MACHINE == SUN_4_60)
-#define CHIP SPARC
-#define FP_FORMAT FP_IEEE
-#endif
-
-#if (MACHINE == ATARI) || (MACHINE == SUN_4)
-#define ASKDEV 1 /* ask for boot device */
-#define FASTLOAD 1 /* use multiple block transfers to init ram */
-#endif
-
-#if (ATARI_TYPE == TT) /* and all other 68030's */
-#define FPP
-#endif
-
-#ifndef FP_FORMAT
-#define FP_FORMAT FP_NONE
-#endif
-
-#ifndef MACHINE
-error "In <minix/config.h> please define MACHINE"
-#endif
-
-#ifndef CHIP
-error "In <minix/config.h> please define MACHINE to have a legal value"
-#endif
-
-#if (MACHINE == 0)
-error "MACHINE has incorrect value (0)"
-#endif
+/* _ASKDEV and _FASTLOAD are defined in sys_config.h. */
+#define ASKDEV _ASKDEV
+#define FASTLOAD _FASTLOAD
#endif /* _CONFIG_H */
#ifndef _DEVIO_H
#define _DEVIO_H
-#include <minix/config.h> /* needed to include <minix/type.h> */
+#include <minix/sys_config.h> /* needed to include <minix/type.h> */
#include <sys/types.h> /* u8_t, u16_t, u32_t needed */
typedef u16_t port_t;
#ifndef _DMAP_H
#define _DMAP_H
-#include <minix/config.h>
+#include <minix/sys_config.h>
#include <minix/ipc.h>
/*===========================================================================*
--- /dev/null
+#ifndef _MINIX_SYS_CONFIG_H
+#define _MINIX_SYS_CONFIG_H 1
+
+/*===========================================================================*
+ * This section contains user-settable parameters *
+ *===========================================================================*/
+#define _MINIX_MACHINE _MACHINE_IBM_PC
+
+#define _MACHINE_IBM_PC 1 /* any 8088 or 80x86-based system */
+#define _MACHINE_SUN_4 40 /* any Sun SPARC-based system */
+#define _MACHINE_SUN_4_60 40 /* Sun-4/60 (aka SparcStation 1 or Campus) */
+#define _MACHINE_ATARI 60 /* ATARI ST/STe/TT (68000/68030) */
+#define _MACHINE_MACINTOSH 62 /* Apple Macintosh (68000) */
+
+/* Word size in bytes (a constant equal to sizeof(int)). */
+#if __ACK__
+#define _WORD_SIZE _EM_WSIZE
+#define _PTR_SIZE _EM_WSIZE
+#endif
+
+#define _NR_PROCS 64
+#define _NR_SYS_PROCS 32
+
+/* Set the CHIP type based on the machine selected. The symbol CHIP is actually
+ * indicative of more than just the CPU. For example, machines for which
+ * CHIP == INTEL are expected to have 8259A interrrupt controllers and the
+ * other properties of IBM PC/XT/AT/386 types machines in general. */
+#define _CHIP_INTEL 1 /* CHIP type for PC, XT, AT, 386 and clones */
+#define _CHIP_M68000 2 /* CHIP type for Atari, Amiga, Macintosh */
+#define _CHIP_SPARC 3 /* CHIP type for SUN-4 (e.g. SPARCstation) */
+
+/* Set the FP_FORMAT type based on the machine selected, either hw or sw */
+#define _FP_NONE 0 /* no floating point support */
+#define _FP_IEEE 1 /* conform IEEE floating point standard */
+
+#if (_MINIX_MACHINE == _MACHINE_IBM_PC)
+#define _MINIX_CHIP _CHIP_INTEL
+#endif
+
+#if (_MINIX_MACHINE == _MACHINE_ATARI) || (_MINIX_MACHINE == _MACHINE_MACINTOSH)
+#define _MINIX_CHIP _CHIP_M68000
+#endif
+
+#if (_MINIX_MACHINE == _MACHINE_SUN_4) || (_MINIX_MACHINE == _MACHINE_SUN_4_60)
+#define _MINIX_CHIP _CHIP_SPARC
+#define _MINIX_FP_FORMAT _FP_IEEE
+#endif
+
+#if (_MINIX_MACHINE == _MACHINE_ATARI) || (_MINIX_MACHINE == _MACHINE_SUN_4)
+#define _ASKDEV 1 /* ask for boot device */
+#define _FASTLOAD 1 /* use multiple block transfers to init ram */
+#endif
+
+#ifndef _MINIX_FP_FORMAT
+#define _MINIX_FP_FORMAT _FP_NONE
+#endif
+
+#ifndef _MINIX_MACHINE
+error "In <minix/sys_config.h> please define _MINIX_MACHINE"
+#endif
+
+#ifndef _MINIX_CHIP
+error "In <minix/sys_config.h> please define _MINIX_MACHINE to have a legal value"
+#endif
+
+#if (_MINIX_MACHINE == 0)
+error "_MINIX_MACHINE has incorrect value (0)"
+#endif
+
+#endif /* _MINIX_SYS_CONFIG_H */
#ifndef _TYPE_H
#define _TYPE_H
-#ifndef _CONFIG_H
-#include <minix/config.h>
+#ifndef _MINIX_SYS_CONFIG_H
+#include <minix/sys_config.h>
#endif
#ifndef _TYPES_H
typedef unsigned long phys_bytes; /* physical addr/length in bytes */
typedef unsigned int phys_clicks; /* physical addr/length in clicks */
-#if (CHIP == INTEL)
+#if (_MINIX_CHIP == _CHIP_INTEL)
typedef unsigned int vir_bytes; /* virtual addresses and lengths in bytes */
#endif
-#if (CHIP == M68000)
+#if (_MINIX_CHIP == _CHIP_M68000)
typedef unsigned long vir_bytes;/* virtual addresses and lengths in bytes */
#endif
-#if (CHIP == SPARC)
+#if (_MINIX_CHIP == _CHIP_SPARC)
typedef unsigned long vir_bytes;/* virtual addresses and lengths in bytes */
#endif
#ifndef _NET__HTON_H
#define _NET__HTON_H
-#include <minix/config.h>
+#include <minix/sys_config.h>
extern u16_t _tmp;
extern u32_t _tmp_l;
/* Find out about the byte order. */
/* assume <minix/config.h> is included, let's check */
-#if (CHIP == 0)
-#include "CHIP macro not set, include <minix/config.h>"
+#if (_MINIX_CHIP == 0)
+#include "_MINIX_CHIP macro not set, include <minix/config.h>"
#endif
-#if (CHIP == INTEL)
+#if (_MINIX_CHIP == _CHIP_INTEL)
#define LITTLE_ENDIAN 1
#endif
-#if (CHIP == M68000 || CHIP == SPARC)
+#if (_MINIX_CHIP == _CHIP_M68000 || _MINIX_CHIP == _CHIP_SPARC)
#define BIG_ENDIAN 1
#endif
#ifndef _MINIX__TYPES_H
#include <sys/types.h>
#endif
-#include <minix/config.h>
+#include <minix/sys_config.h>
#if (_WORD_SIZE != 2 && _WORD_SIZE != 4) || \
(_PTR_SIZE != _WORD_SIZE && _PTR_SIZE != 2*_WORD_SIZE)
#include <ansi.h>
#endif
-#ifndef _CONFIG_H
-#include <minix/config.h>
+#ifndef _MINIX_SYS_CONFIG_H
+#include <minix/sys_config.h>
#endif
-#if !defined(CHIP)
+#if !defined(_MINIX_CHIP)
#include "error, configuration is not known"
#endif
* by the kernel's context switching code. Floating point registers should
* be added in a different struct.
*/
-#if (CHIP == INTEL)
+#if (_MINIX_CHIP == _CHIP_INTEL)
struct sigregs {
#if _WORD_SIZE == 4
short sr_gs;
};
#else
-#if (CHIP == M68000)
+#if (_MINIX_CHIP == _CHIP_M68000)
struct sigregs {
long sr_retreg; /* d0 */
long sr_d1;
short sr_dummy; /* make size multiple of 4 for system.c */
};
#else
-#include "error, CHIP is not supported"
+#include "error, _MINIX_CHIP is not supported"
#endif
-#endif /* CHIP == INTEL */
+#endif /* _MINIX_CHIP == _CHIP_INTEL */
struct sigcontext {
int sc_flags; /* sigstack state to restore */
struct sigregs sc_regs; /* register set to restore */
};
-#if (CHIP == INTEL)
+#if (_MINIX_CHIP == _CHIP_INTEL)
#if _WORD_SIZE == 4
#define sc_gs sc_regs.sr_gs
#define sc_fs sc_regs.sr_fs
#define sc_psw sc_regs.sr_psw
#define sc_sp sc_regs.sr_sp
#define sc_ss sc_regs.sr_ss
-#endif /* CHIP == INTEL */
+#endif /* _MINIX_CHIP == _CHIP_INTEL */
-#if (CHIP == M68000)
+#if (_MINIX_CHIP == M68000)
#define sc_retreg sc_regs.sr_retreg
#define sc_d1 sc_regs.sr_d1
#define sc_d2 sc_regs.sr_d2
#define sc_sp sc_regs.sr_sp
#define sc_pc sc_regs.sr_pc
#define sc_psw sc_regs.sr_psw
-#endif /* CHIP == M68000 */
+#endif /* _MINIX_CHIP == M68000 */
/* Values for sc_flags. Must agree with <minix/jmp_buf.h>. */
#define SC_SIGCONTEXT 2 /* nonzero when signal context is included */