Replace MACHINE/CHIP macros with compiler macros

This commit is contained in:
Arun Thomas
2012-08-06 12:55:50 +02:00
parent 5919360736
commit 6723dcfab7
27 changed files with 45 additions and 148 deletions

View File

@@ -3,7 +3,7 @@
#ifndef _INTERRUPT_H
#define _INTERRUPT_H
#if (CHIP == INTEL)
#if defined(__i386__)
/* 8259A interrupt controller ports. */
#define INT_CTL 0x20 /* I/O port for interrupt controller */

View File

@@ -3,7 +3,7 @@
#ifndef _PORTS_H
#define _PORTS_H
#if (CHIP == INTEL)
#if defined(__i386__)
/* Miscellaneous ports. */
#define PCR 0x65 /* Planar Control Register */
@@ -12,6 +12,6 @@
#define TIMER2 0x42 /* I/O port for timer channel 2 */
#define TIMER_MODE 0x43 /* I/O port for timer mode control */
#endif /* (CHIP == INTEL) */
#endif /* defined(__i386__) */
#endif /* _PORTS_H */

View File

@@ -17,15 +17,8 @@
*
*/
/* 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
/* 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.

View File

@@ -1,10 +1,6 @@
#ifndef _MINIX_CONST_H
#define _MINIX_CONST_H
#ifndef _MINIX_CHIP
#error _MINIX_CHIP is not defined
#endif
/* The UNUSED annotation tells the compiler or lint not to complain
* about an unused variable or function parameter.
*
@@ -79,11 +75,11 @@
#define HAVE_SCATTERED_IO 1 /* scattered I/O is now standard */
/* Memory is allocated in clicks. */
#if (_MINIX_CHIP == _CHIP_INTEL)
#if defined(__i386__)
#define CLICK_SIZE 4096 /* unit in which memory is allocated */
#define CLICK_SHIFT 12 /* log2 of CLICK_SIZE */
#else
#error No reasonable CHIP setting.
#error Unsupported arch
#endif
/* Click alignment macros. */

View File

@@ -4,10 +4,6 @@
/*===========================================================================*
* This section contains user-settable parameters *
*===========================================================================*/
#define _MINIX_MACHINE _MACHINE_IBM_PC
#define _MACHINE_IBM_PC 1 /* any 8088 or 80x86-based system */
/* Word size in bytes (a constant equal to sizeof(int)). */
#if __ACK__ || __GNUC__
#define _WORD_SIZE _EM_WSIZE
@@ -17,38 +13,14 @@
#define _NR_PROCS 256
#define _NR_SYS_PROCS 64
/* 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
#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
/* Kernel debug checks */
#define DEBUG_LOCK_CHECK 1 /* Interrupt Lock/unlock sanity checking. */