From 6723dcfab79044b2013c3a5ccf0228b652d7bd73 Mon Sep 17 00:00:00 2001 From: Arun Thomas Date: Mon, 6 Aug 2012 12:55:50 +0200 Subject: [PATCH] Replace MACHINE/CHIP macros with compiler macros --- commands/mdb/mdb.c | 2 +- commands/mdb/mdb.h | 18 ++------- commands/mdb/sym.c | 5 +-- commands/mined/mined.h | 2 +- commands/mined/mined1.c | 53 +-------------------------- drivers/tty/rs232.c | 10 ++--- drivers/tty/tty.c | 4 +- drivers/tty/tty.h | 4 +- include/arch/i386/include/interrupt.h | 2 +- include/arch/i386/include/ports.h | 4 +- include/minix/config.h | 7 ---- include/minix/const.h | 8 +--- include/minix/sys_config.h | 28 -------------- kernel/system.c | 2 +- kernel/system/do_fork.c | 6 +-- kernel/system/do_mcontext.c | 6 +-- kernel/system/do_sigreturn.c | 4 +- kernel/system/do_sigsend.c | 2 +- kernel/system/do_trace.c | 2 +- lib/libaudiodriver/audio_fw.c | 6 +-- lib/libc/sys-minix/_ucontext.c | 2 +- lib/libexec/exec_aout.c | 4 +- lib/libmthread/allocate.c | 2 +- servers/is/dmp_kernel.c | 4 +- servers/pm/main.c | 2 +- test/test59.c | 2 +- usr.sbin/mkfs.mfs/mkfs.c | 2 +- 27 files changed, 45 insertions(+), 148 deletions(-) diff --git a/commands/mdb/mdb.c b/commands/mdb/mdb.c index fca2bcda8..c5a579038 100644 --- a/commands/mdb/mdb.c +++ b/commands/mdb/mdb.c @@ -356,7 +356,7 @@ int all; #endif else if (ADDA(off)) off = ADDA_CNT(ptrace(T_GETINS, curpid, pc + 2, 0L)) + bp; -#if (CHIP == INTEL) +#if defined(__i386__) else if (INCSP2(off)) off = bp + 2*INTSIZE; else if (POPBX2(off)) diff --git a/commands/mdb/mdb.h b/commands/mdb/mdb.h index c7a563609..73032dedb 100644 --- a/commands/mdb/mdb.h +++ b/commands/mdb/mdb.h @@ -48,12 +48,10 @@ #undef printf /* defined as printk in */ -#if (_MINIX_CHIP == _CHIP_INTEL) -#if (MACHINE == IBM_PC) +#if defined(__i386__) #define MINIX_PC #else -#error "only the MINIX_PC 1.5.x and later versions works on *86's" -#endif +#error "Unsupported arch" #endif #ifdef MINIX_ST @@ -81,19 +79,11 @@ #define CSEG 0x2E /* 8088 through 80386 */ #define DSEG 0x3E -#if (_MINIX_CHIP == _CHIP_INTEL ) -#ifdef __i86 -#define N_REG16 2 -#endif -#ifdef __i386 +#if defined(__i386__) #define N_REG16 4 /* 16 bit registers at start of stackframe */ #endif -#ifndef N_REG16 -#error "N_REG16 not defined" -#endif -#endif -#if (_MINIX_CHIP == _CHIP_INTEL ) +#if defined(__i386__) #define ADDA(l) ((u16_t) (l) == 0xC481) #ifdef __i386 diff --git a/commands/mdb/sym.c b/commands/mdb/sym.c index bf213123d..fe0c8e3dc 100644 --- a/commands/mdb/sym.c +++ b/commands/mdb/sym.c @@ -114,15 +114,12 @@ long magic; } /* Check CPU */ -#if (CHIP == INTEL) +#if defined(__i386__) #if (_WORD_SIZE == 4) if (hdr->a_cpu != A_I80386) #else if (hdr->a_cpu != A_I8086) #endif -#endif -#if (CHIP == M68000) - if (hdr->a_cpu != A_M68K) #endif { Printf("mdb: invalid cpu in exec header - %04x\n", diff --git a/commands/mined/mined.h b/commands/mined/mined.h index 6b77d8dbc..fad5acfeb 100644 --- a/commands/mined/mined.h +++ b/commands/mined/mined.h @@ -54,7 +54,7 @@ extern char *pos_string; /* Absolute cursor positioning */ #define STD_OUT 1 /* File descriptor for terminal */ -#if (CHIP == INTEL) +#if defined(__i386__) #define MEMORY_SIZE (50 * 1024) /* Size of data space to malloc */ #endif diff --git a/commands/mined/mined1.c b/commands/mined/mined1.c index b4ed0ac49..6ac7eaef9 100644 --- a/commands/mined/mined1.c +++ b/commands/mined/mined1.c @@ -1539,50 +1539,16 @@ void XT() void (*escfunc(c))() int c; { -#if (CHIP == M68000) -#ifndef COMPAT - int ch; -#endif -#endif if (c == '[') { /* Start of ASCII escape sequence. */ c = getchar(); -#if (CHIP == M68000) -#ifndef COMPAT - if ((c >= '0') && (c <= '9')) ch = getchar(); - /* ch is either a tilde or a second digit */ -#endif -#endif switch (c) { case 'H': return(HO); case 'A': return(UP); case 'B': return(DN); case 'C': return(RT); case 'D': return(LF); -#if (CHIP == M68000) -#ifndef COMPAT - /* F1 = ESC [ 1 ~ */ - /* F2 = ESC [ 2 ~ */ - /* F3 = ESC [ 3 ~ */ - /* F4 = ESC [ 4 ~ */ - /* F5 = ESC [ 5 ~ */ - /* F6 = ESC [ 6 ~ */ - /* F7 = ESC [ 17 ~ */ - /* F8 = ESC [ 18 ~ */ - case '1': - switch (ch) { - case '~': return(SF); - case '7': (void) getchar(); return(MA); - case '8': (void) getchar(); return(CTL); - } - case '2': return(SR); - case '3': return(PD); - case '4': return(PU); - case '5': return(FS); - case '6': return(EF); -#endif -#endif -#if (CHIP == INTEL) +#if defined(__i386__) case 'G': return(FS); case 'S': return(SR); case 'T': return(SF); @@ -1593,23 +1559,6 @@ int c; } return(I); } -#if (CHIP == M68000) -#ifdef COMPAT - if (c == 'O') { - /* Start of ASCII function key escape sequence. */ - switch (getchar()) { - case 'P': return(SF); - case 'Q': return(SR); - case 'R': return(PD); - case 'S': return(PU); - case 'T': return(FS); - case 'U': return(EF); - case 'V': return(MA); - case 'W': return(CTL); - } - } -#endif -#endif return(I); } diff --git a/drivers/tty/rs232.c b/drivers/tty/rs232.c index f9b586301..b345c686e 100644 --- a/drivers/tty/rs232.c +++ b/drivers/tty/rs232.c @@ -139,7 +139,7 @@ typedef struct rs232 { char *ohead; /* next free spot in output buffer */ char *otail; /* next char to output */ -#if (MACHINE == IBM_PC) +#if defined(__i386__) port_t xmit_port; /* i/o ports */ port_t recv_port; port_t div_low_port; @@ -168,7 +168,7 @@ typedef struct rs232 { static rs232_t rs_lines[NR_RS_LINES]; -#if (MACHINE == IBM_PC) +#if defined(__i386__) /* 8250 base addresses. */ static port_t addr_8250[] = { 0x3F8, /* COM1 */ @@ -352,7 +352,7 @@ static void rs_config(rs232_t *rs) speed_t speed; int divisor; } s2d[] = { -#if (MACHINE == IBM_PC) +#if defined(__i386__) { B50, UART_FREQ / 50 }, #endif { B75, UART_FREQ / 75 }, @@ -363,14 +363,14 @@ static void rs_config(rs232_t *rs) { B300, UART_FREQ / 300 }, { B600, UART_FREQ / 600 }, { B1200, UART_FREQ / 1200 }, -#if (MACHINE == IBM_PC) +#if defined(__i386__) { B1800, UART_FREQ / 1800 }, #endif { B2400, UART_FREQ / 2400 }, { B4800, UART_FREQ / 4800 }, { B9600, UART_FREQ / 9600 }, { B19200, UART_FREQ / 19200 }, -#if (MACHINE == IBM_PC) +#if defined(__i386__) { B38400, UART_FREQ / 38400 }, { B57600, UART_FREQ / 57600 }, { B115200, UART_FREQ / 115200L }, diff --git a/drivers/tty/tty.c b/drivers/tty/tty.c index d5f3696a1..f03304620 100644 --- a/drivers/tty/tty.c +++ b/drivers/tty/tty.c @@ -588,7 +588,7 @@ message *m_ptr; /* pointer to message sent to task */ size = sizeof(struct winsize); break; -#if (MACHINE == IBM_PC) +#if defined(__i386__) case KIOCSMAP: /* load keymap (Minix extension) */ size = sizeof(keymap_t); break; @@ -681,7 +681,7 @@ message *m_ptr; /* pointer to message sent to task */ sigchar(tp, SIGWINCH, 0); break; -#if (MACHINE == IBM_PC) +#if defined(__i386__) case KIOCSMAP: /* Load a new keymap (only /dev/console). */ if (isconsole(tp)) r = kbd_loadmap(m_ptr); diff --git a/drivers/tty/tty.h b/drivers/tty/tty.h index df69a3a46..311befbc6 100644 --- a/drivers/tty/tty.h +++ b/drivers/tty/tty.h @@ -154,7 +154,7 @@ int select_retry(struct tty *tp); void rs_init(struct tty *tp); void rs_interrupt(message *m); -#if (CHIP == INTEL) +#if defined(__i386__) /* console.c */ void kputc(int c); void cons_stop(void); @@ -183,5 +183,5 @@ void pty_init(struct tty *tp); void select_retry_pty(struct tty *tp); int pty_status(message *m_ptr); -#endif /* (CHIP == INTEL) */ +#endif /* defined(__i386__) */ diff --git a/include/arch/i386/include/interrupt.h b/include/arch/i386/include/interrupt.h index 649cc084a..f7442f897 100644 --- a/include/arch/i386/include/interrupt.h +++ b/include/arch/i386/include/interrupt.h @@ -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 */ diff --git a/include/arch/i386/include/ports.h b/include/arch/i386/include/ports.h index 3c04395bd..2a25f155d 100644 --- a/include/arch/i386/include/ports.h +++ b/include/arch/i386/include/ports.h @@ -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 */ diff --git a/include/minix/config.h b/include/minix/config.h index 9018639f2..35036b934 100644 --- a/include/minix/config.h +++ b/include/minix/config.h @@ -17,15 +17,8 @@ * */ -/* The MACHINE (called _MINIX_MACHINE) setting can be done - * in . - */ #include -#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. diff --git a/include/minix/const.h b/include/minix/const.h index ed69a300e..f1ed4bc7d 100644 --- a/include/minix/const.h +++ b/include/minix/const.h @@ -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. */ diff --git a/include/minix/sys_config.h b/include/minix/sys_config.h index 168923cab..deb28ea9c 100644 --- a/include/minix/sys_config.h +++ b/include/minix/sys_config.h @@ -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 please define _MINIX_MACHINE" -#endif - -#ifndef _MINIX_CHIP -error "In 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. */ diff --git a/kernel/system.c b/kernel/system.c index b1dd9337e..8cd81c94b 100644 --- a/kernel/system.c +++ b/kernel/system.c @@ -250,7 +250,7 @@ void system_init(void) map(SYS_PROFBUF, do_profbuf); /* announce locations to kernel */ /* i386-specific. */ -#if _MINIX_CHIP == _CHIP_INTEL +#if defined(__i386__) map(SYS_READBIOS, do_readbios); /* read from BIOS locations */ map(SYS_IOPENABLE, do_iopenable); /* Enable I/O */ map(SYS_SDEVIO, do_sdevio); /* phys_insb, _insw, _outsb, _outsw */ diff --git a/kernel/system/do_fork.c b/kernel/system/do_fork.c index e7ef19a23..1ba3369a0 100644 --- a/kernel/system/do_fork.c +++ b/kernel/system/do_fork.c @@ -25,7 +25,7 @@ int do_fork(struct proc * caller, message * m_ptr) { /* Handle sys_fork(). PR_ENDPT has forked. The child is PR_SLOT. */ -#if (_MINIX_CHIP == _CHIP_INTEL) +#if defined(__i386__) char *old_fpu_save_area_p; #endif register struct proc *rpc; /* child process pointer */ @@ -53,11 +53,11 @@ int do_fork(struct proc * caller, message * m_ptr) save_fpu(rpp); /* Copy parent 'proc' struct to child. And reinitialize some fields. */ gen = _ENDPOINT_G(rpc->p_endpoint); -#if (_MINIX_CHIP == _CHIP_INTEL) +#if defined(__i386__) old_fpu_save_area_p = rpc->p_seg.fpu_state; #endif *rpc = *rpp; /* copy 'proc' struct */ -#if (_MINIX_CHIP == _CHIP_INTEL) +#if defined(__i386__) rpc->p_seg.fpu_state = old_fpu_save_area_p; if(proc_used_fpu(rpp)) memcpy(rpc->p_seg.fpu_state, rpp->p_seg.fpu_state, FPU_XFP_SIZE); diff --git a/kernel/system/do_mcontext.c b/kernel/system/do_mcontext.c index da0b91014..c72ac6fd7 100644 --- a/kernel/system/do_mcontext.c +++ b/kernel/system/do_mcontext.c @@ -28,7 +28,7 @@ int do_getmcontext(struct proc * caller, message * m_ptr) if (iskerneln(proc_nr)) return(EPERM); rp = proc_addr(proc_nr); -#if (_MINIX_CHIP == _CHIP_INTEL) +#if defined(__i386__) if (!proc_used_fpu(rp)) return(OK); /* No state to copy */ #endif @@ -38,7 +38,7 @@ int do_getmcontext(struct proc * caller, message * m_ptr) (vir_bytes) &mc, (phys_bytes) sizeof(struct __mcontext))) != OK) return(r); -#if (_MINIX_CHIP == _CHIP_INTEL) +#if defined(__i386__) /* Copy FPU state */ mc.mc_fpu_flags = 0; if (proc_used_fpu(rp)) { @@ -79,7 +79,7 @@ int do_setmcontext(struct proc * caller, message * m_ptr) (vir_bytes) &mc, (phys_bytes) sizeof(struct __mcontext))) != OK) return(r); -#if (_MINIX_CHIP == _CHIP_INTEL) +#if defined(__i386__) /* Copy FPU state */ if (mc.mc_fpu_flags & MF_FPU_INITIALIZED) { rp->p_misc_flags |= MF_FPU_INITIALIZED; diff --git a/kernel/system/do_sigreturn.c b/kernel/system/do_sigreturn.c index 6edc492fb..616b60ac6 100644 --- a/kernel/system/do_sigreturn.c +++ b/kernel/system/do_sigreturn.c @@ -38,7 +38,7 @@ int do_sigreturn(struct proc * caller, message * m_ptr) sc.sc_psw = (sc.sc_psw & X86_FLAGS_USER) | (rp->p_reg.psw & ~X86_FLAGS_USER); -#if (_MINIX_CHIP == _CHIP_INTEL) +#if defined(__i386__) /* Don't panic kernel if user gave bad selectors. */ sc.sc_cs = rp->p_reg.cs; sc.sc_ds = rp->p_reg.ds; @@ -52,7 +52,7 @@ int do_sigreturn(struct proc * caller, message * m_ptr) /* Restore the registers. */ memcpy(&rp->p_reg, &sc.sc_regs, sizeof(sigregs)); -#if (_MINIX_CHIP == _CHIP_INTEL) +#if defined(__i386__) if(sc.sc_flags & MF_FPU_INITIALIZED) { memcpy(rp->p_seg.fpu_state, &sc.sc_fpu_state, FPU_XFP_SIZE); diff --git a/kernel/system/do_sigsend.c b/kernel/system/do_sigsend.c index c712f2cb8..873c0ab4c 100644 --- a/kernel/system/do_sigsend.c +++ b/kernel/system/do_sigsend.c @@ -42,7 +42,7 @@ int do_sigsend(struct proc * caller, message * m_ptr) /* Copy the registers to the sigcontext structure. */ memcpy(&sc.sc_regs, (char *) &rp->p_reg, sizeof(sigregs)); - #if (_MINIX_CHIP == _CHIP_INTEL) + #if defined(__i386__) if(proc_used_fpu(rp)) { /* save the FPU context before saving it to the sig context */ save_fpu(rp); diff --git a/kernel/system/do_trace.c b/kernel/system/do_trace.c index 48dbae360..57031e234 100644 --- a/kernel/system/do_trace.c +++ b/kernel/system/do_trace.c @@ -135,7 +135,7 @@ int do_trace(struct proc * caller, message * m_ptr) tr_addr > sizeof(struct stackframe_s) - sizeof(reg_t)) return(EFAULT); i = (int) tr_addr; -#if (_MINIX_CHIP == _CHIP_INTEL) +#if defined(__i386__) /* Altering segment registers might crash the kernel when it * tries to load them prior to restarting a process, so do * not allow it. diff --git a/lib/libaudiodriver/audio_fw.c b/lib/libaudiodriver/audio_fw.c index 6ff932c5d..d576f356d 100644 --- a/lib/libaudiodriver/audio_fw.c +++ b/lib/libaudiodriver/audio_fw.c @@ -904,7 +904,7 @@ static void data_to_user(sub_dev_t *sub_dev_ptr) static int init_buffers(sub_dev_t *sub_dev_ptr) { -#if (CHIP == INTEL) +#if defined(__i386__) char *base; size_t size; unsigned left; @@ -954,10 +954,10 @@ static int init_buffers(sub_dev_t *sub_dev_ptr) sub_dev_ptr->DmaSize, sub_dev_ptr->Nr); return OK; -#else /* CHIP != INTEL */ +#else /* !defined(__i386__) */ printf("%s: init_buffers() failed, CHIP != INTEL", drv.DriverName); return EIO; -#endif /* CHIP == INTEL */ +#endif /* defined(__i386__) */ } diff --git a/lib/libc/sys-minix/_ucontext.c b/lib/libc/sys-minix/_ucontext.c index 58a287352..9b9a8013f 100644 --- a/lib/libc/sys-minix/_ucontext.c +++ b/lib/libc/sys-minix/_ucontext.c @@ -88,7 +88,7 @@ void makecontext(ucontext_t *ucp, void (*func)(void), int argc, ...) } if (ucp->uc_mcontext.mc_magic == MCF_MAGIC) { -#if (_MINIX_CHIP == _CHIP_INTEL) +#if defined(__i386__) /* The caller provides a pointer to a stack that we can use to run our context on. When the context starts, control is given to a wrapped start routine, which calls a function and cleans up the stack diff --git a/lib/libexec/exec_aout.c b/lib/libexec/exec_aout.c index 50e588e73..b952ad4db 100644 --- a/lib/libexec/exec_aout.c +++ b/lib/libexec/exec_aout.c @@ -57,10 +57,10 @@ int read_header_aout( /* Check magic number, cpu type, and flags. */ if (BADMAG(*hdr)) return(ENOEXEC); -#if (CHIP == INTEL && _WORD_SIZE == 2) +#if (defined(__i386__) && _WORD_SIZE == 2) if (hdr->a_cpu != A_I8086) return(ENOEXEC); #endif -#if (CHIP == INTEL && _WORD_SIZE == 4) +#if (defined(__i386__) && _WORD_SIZE == 4) if (hdr->a_cpu != A_I80386) return(ENOEXEC); #endif if ((hdr->a_flags & ~(A_NSYM | A_EXEC | A_SEP)) != 0) return(ENOEXEC); diff --git a/lib/libmthread/allocate.c b/lib/libmthread/allocate.c index 3eb1f0610..34c689522 100644 --- a/lib/libmthread/allocate.c +++ b/lib/libmthread/allocate.c @@ -409,7 +409,7 @@ void *arg; if (stackaddr == MAP_FAILED) mthread_panic("Failed to allocate stack to thread"); -#if (_MINIX_CHIP == _CHIP_INTEL) +#if defined(__i386__) guard_start = stackaddr; guard_end = stackaddr + MTHREAD_GUARDSIZE; guarded_stacksize = stackaddr + stacksize - guard_end; diff --git a/servers/is/dmp_kernel.c b/servers/is/dmp_kernel.c index e6ee1791f..bf8234f1c 100644 --- a/servers/is/dmp_kernel.c +++ b/servers/is/dmp_kernel.c @@ -311,7 +311,7 @@ static char *p_rts_flags_str(int flags) /*===========================================================================* * proctab_dmp * *===========================================================================*/ -#if (CHIP == INTEL) +#if defined(__i386__) void proctab_dmp() { /* Proc table dump */ @@ -339,7 +339,7 @@ void proctab_dmp() printf("\n"); } } -#endif /* (CHIP == INTEL) */ +#endif /* defined(__i386__) */ /*===========================================================================* * procstack_dmp * diff --git a/servers/pm/main.c b/servers/pm/main.c index 50228c48e..a7981019a 100644 --- a/servers/pm/main.c +++ b/servers/pm/main.c @@ -285,7 +285,7 @@ static int sef_cb_init_fresh(int UNUSED(type), sef_init_info_t *UNUSED(info)) if (sendrec(VFS_PROC_NR, &mess) != OK || mess.m_type != OK) panic("can't sync up with VFS"); -#if (CHIP == INTEL) +#if defined(__i386__) uts_val.machine[0] = 'i'; strcpy(uts_val.machine + 1, itoa(getprocessor())); #endif diff --git a/test/test59.c b/test/test59.c index 6850fe69e..9a78d4632 100644 --- a/test/test59.c +++ b/test/test59.c @@ -740,7 +740,7 @@ static void test_attributes(void) /* Verify stack hypothesis; we assume a stack is used from the top and grows * downwards. */ -#if (_MINIX_CHIP == _CHIP_INTEL) +#if defined(__i386__) if (stackp[0] != MAGIC) err(11, 66); /* End of the stack */ for (i = no_ints - 1 - 16; i < no_ints; i++) if (stackp[i] != MAGIC) stack_untouched = 0; diff --git a/usr.sbin/mkfs.mfs/mkfs.c b/usr.sbin/mkfs.mfs/mkfs.c index 89eaa5926..ea980be57 100644 --- a/usr.sbin/mkfs.mfs/mkfs.c +++ b/usr.sbin/mkfs.mfs/mkfs.c @@ -24,7 +24,7 @@ #include "const.h" #include "type.h" #include "mfsdir.h" -#if (defined(__minix) && MACHINE == IBM_PC) +#if (defined(__minix) && defined(__i386__)) #include #include #include -- 2.44.0