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

@ -356,7 +356,7 @@ int all;
#endif #endif
else if (ADDA(off)) else if (ADDA(off))
off = ADDA_CNT(ptrace(T_GETINS, curpid, pc + 2, 0L)) + bp; off = ADDA_CNT(ptrace(T_GETINS, curpid, pc + 2, 0L)) + bp;
#if (CHIP == INTEL) #if defined(__i386__)
else if (INCSP2(off)) else if (INCSP2(off))
off = bp + 2*INTSIZE; off = bp + 2*INTSIZE;
else if (POPBX2(off)) else if (POPBX2(off))

View file

@ -48,12 +48,10 @@
#undef printf /* defined as printk in <minix/const.h> */ #undef printf /* defined as printk in <minix/const.h> */
#if (_MINIX_CHIP == _CHIP_INTEL) #if defined(__i386__)
#if (MACHINE == IBM_PC)
#define MINIX_PC #define MINIX_PC
#else #else
#error "only the MINIX_PC 1.5.x and later versions works on *86's" #error "Unsupported arch"
#endif
#endif #endif
#ifdef MINIX_ST #ifdef MINIX_ST
@ -81,19 +79,11 @@
#define CSEG 0x2E /* 8088 through 80386 */ #define CSEG 0x2E /* 8088 through 80386 */
#define DSEG 0x3E #define DSEG 0x3E
#if (_MINIX_CHIP == _CHIP_INTEL ) #if defined(__i386__)
#ifdef __i86
#define N_REG16 2
#endif
#ifdef __i386
#define N_REG16 4 /* 16 bit registers at start of stackframe */ #define N_REG16 4 /* 16 bit registers at start of stackframe */
#endif #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) #define ADDA(l) ((u16_t) (l) == 0xC481)
#ifdef __i386 #ifdef __i386

View file

@ -114,15 +114,12 @@ long magic;
} }
/* Check CPU */ /* Check CPU */
#if (CHIP == INTEL) #if defined(__i386__)
#if (_WORD_SIZE == 4) #if (_WORD_SIZE == 4)
if (hdr->a_cpu != A_I80386) if (hdr->a_cpu != A_I80386)
#else #else
if (hdr->a_cpu != A_I8086) if (hdr->a_cpu != A_I8086)
#endif #endif
#endif
#if (CHIP == M68000)
if (hdr->a_cpu != A_M68K)
#endif #endif
{ {
Printf("mdb: invalid cpu in exec header - %04x\n", Printf("mdb: invalid cpu in exec header - %04x\n",

View file

@ -54,7 +54,7 @@ extern char *pos_string; /* Absolute cursor positioning */
#define STD_OUT 1 /* File descriptor for terminal */ #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 */ #define MEMORY_SIZE (50 * 1024) /* Size of data space to malloc */
#endif #endif

View file

@ -1539,50 +1539,16 @@ void XT()
void (*escfunc(c))() void (*escfunc(c))()
int c; int c;
{ {
#if (CHIP == M68000)
#ifndef COMPAT
int ch;
#endif
#endif
if (c == '[') { if (c == '[') {
/* Start of ASCII escape sequence. */ /* Start of ASCII escape sequence. */
c = getchar(); 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) { switch (c) {
case 'H': return(HO); case 'H': return(HO);
case 'A': return(UP); case 'A': return(UP);
case 'B': return(DN); case 'B': return(DN);
case 'C': return(RT); case 'C': return(RT);
case 'D': return(LF); case 'D': return(LF);
#if (CHIP == M68000) #if defined(__i386__)
#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)
case 'G': return(FS); case 'G': return(FS);
case 'S': return(SR); case 'S': return(SR);
case 'T': return(SF); case 'T': return(SF);
@ -1593,23 +1559,6 @@ int c;
} }
return(I); 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); return(I);
} }

View file

@ -139,7 +139,7 @@ typedef struct rs232 {
char *ohead; /* next free spot in output buffer */ char *ohead; /* next free spot in output buffer */
char *otail; /* next char to output */ char *otail; /* next char to output */
#if (MACHINE == IBM_PC) #if defined(__i386__)
port_t xmit_port; /* i/o ports */ port_t xmit_port; /* i/o ports */
port_t recv_port; port_t recv_port;
port_t div_low_port; port_t div_low_port;
@ -168,7 +168,7 @@ typedef struct rs232 {
static rs232_t rs_lines[NR_RS_LINES]; static rs232_t rs_lines[NR_RS_LINES];
#if (MACHINE == IBM_PC) #if defined(__i386__)
/* 8250 base addresses. */ /* 8250 base addresses. */
static port_t addr_8250[] = { static port_t addr_8250[] = {
0x3F8, /* COM1 */ 0x3F8, /* COM1 */
@ -352,7 +352,7 @@ static void rs_config(rs232_t *rs)
speed_t speed; speed_t speed;
int divisor; int divisor;
} s2d[] = { } s2d[] = {
#if (MACHINE == IBM_PC) #if defined(__i386__)
{ B50, UART_FREQ / 50 }, { B50, UART_FREQ / 50 },
#endif #endif
{ B75, UART_FREQ / 75 }, { B75, UART_FREQ / 75 },
@ -363,14 +363,14 @@ static void rs_config(rs232_t *rs)
{ B300, UART_FREQ / 300 }, { B300, UART_FREQ / 300 },
{ B600, UART_FREQ / 600 }, { B600, UART_FREQ / 600 },
{ B1200, UART_FREQ / 1200 }, { B1200, UART_FREQ / 1200 },
#if (MACHINE == IBM_PC) #if defined(__i386__)
{ B1800, UART_FREQ / 1800 }, { B1800, UART_FREQ / 1800 },
#endif #endif
{ B2400, UART_FREQ / 2400 }, { B2400, UART_FREQ / 2400 },
{ B4800, UART_FREQ / 4800 }, { B4800, UART_FREQ / 4800 },
{ B9600, UART_FREQ / 9600 }, { B9600, UART_FREQ / 9600 },
{ B19200, UART_FREQ / 19200 }, { B19200, UART_FREQ / 19200 },
#if (MACHINE == IBM_PC) #if defined(__i386__)
{ B38400, UART_FREQ / 38400 }, { B38400, UART_FREQ / 38400 },
{ B57600, UART_FREQ / 57600 }, { B57600, UART_FREQ / 57600 },
{ B115200, UART_FREQ / 115200L }, { B115200, UART_FREQ / 115200L },

View file

@ -588,7 +588,7 @@ message *m_ptr; /* pointer to message sent to task */
size = sizeof(struct winsize); size = sizeof(struct winsize);
break; break;
#if (MACHINE == IBM_PC) #if defined(__i386__)
case KIOCSMAP: /* load keymap (Minix extension) */ case KIOCSMAP: /* load keymap (Minix extension) */
size = sizeof(keymap_t); size = sizeof(keymap_t);
break; break;
@ -681,7 +681,7 @@ message *m_ptr; /* pointer to message sent to task */
sigchar(tp, SIGWINCH, 0); sigchar(tp, SIGWINCH, 0);
break; break;
#if (MACHINE == IBM_PC) #if defined(__i386__)
case KIOCSMAP: case KIOCSMAP:
/* Load a new keymap (only /dev/console). */ /* Load a new keymap (only /dev/console). */
if (isconsole(tp)) r = kbd_loadmap(m_ptr); if (isconsole(tp)) r = kbd_loadmap(m_ptr);

View file

@ -154,7 +154,7 @@ int select_retry(struct tty *tp);
void rs_init(struct tty *tp); void rs_init(struct tty *tp);
void rs_interrupt(message *m); void rs_interrupt(message *m);
#if (CHIP == INTEL) #if defined(__i386__)
/* console.c */ /* console.c */
void kputc(int c); void kputc(int c);
void cons_stop(void); void cons_stop(void);
@ -183,5 +183,5 @@ void pty_init(struct tty *tp);
void select_retry_pty(struct tty *tp); void select_retry_pty(struct tty *tp);
int pty_status(message *m_ptr); int pty_status(message *m_ptr);
#endif /* (CHIP == INTEL) */ #endif /* defined(__i386__) */

View file

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

View file

@ -3,7 +3,7 @@
#ifndef _PORTS_H #ifndef _PORTS_H
#define _PORTS_H #define _PORTS_H
#if (CHIP == INTEL) #if defined(__i386__)
/* Miscellaneous ports. */ /* Miscellaneous ports. */
#define PCR 0x65 /* Planar Control Register */ #define PCR 0x65 /* Planar Control Register */
@ -12,6 +12,6 @@
#define TIMER2 0x42 /* I/O port for timer channel 2 */ #define TIMER2 0x42 /* I/O port for timer channel 2 */
#define TIMER_MODE 0x43 /* I/O port for timer mode control */ #define TIMER_MODE 0x43 /* I/O port for timer mode control */
#endif /* (CHIP == INTEL) */ #endif /* defined(__i386__) */
#endif /* _PORTS_H */ #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> #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 /* Number of slots in the process table for non-kernel processes. The number
* of system processes defines how many processes with special privileges * of system processes defines how many processes with special privileges
* there can be. User processes share the same properties and count for one. * there can be. User processes share the same properties and count for one.

View file

@ -1,10 +1,6 @@
#ifndef _MINIX_CONST_H #ifndef _MINIX_CONST_H
#define _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 /* The UNUSED annotation tells the compiler or lint not to complain
* about an unused variable or function parameter. * about an unused variable or function parameter.
* *
@ -79,11 +75,11 @@
#define HAVE_SCATTERED_IO 1 /* scattered I/O is now standard */ #define HAVE_SCATTERED_IO 1 /* scattered I/O is now standard */
/* Memory is allocated in clicks. */ /* 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_SIZE 4096 /* unit in which memory is allocated */
#define CLICK_SHIFT 12 /* log2 of CLICK_SIZE */ #define CLICK_SHIFT 12 /* log2 of CLICK_SIZE */
#else #else
#error No reasonable CHIP setting. #error Unsupported arch
#endif #endif
/* Click alignment macros. */ /* Click alignment macros. */

View file

@ -4,10 +4,6 @@
/*===========================================================================* /*===========================================================================*
* This section contains user-settable parameters * * 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)). */ /* Word size in bytes (a constant equal to sizeof(int)). */
#if __ACK__ || __GNUC__ #if __ACK__ || __GNUC__
#define _WORD_SIZE _EM_WSIZE #define _WORD_SIZE _EM_WSIZE
@ -17,38 +13,14 @@
#define _NR_PROCS 256 #define _NR_PROCS 256
#define _NR_SYS_PROCS 64 #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 */ /* Set the FP_FORMAT type based on the machine selected, either hw or sw */
#define _FP_NONE 0 /* no floating point support */ #define _FP_NONE 0 /* no floating point support */
#define _FP_IEEE 1 /* conform IEEE floating point standard */ #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 #ifndef _MINIX_FP_FORMAT
#define _MINIX_FP_FORMAT _FP_NONE #define _MINIX_FP_FORMAT _FP_NONE
#endif #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 */ /* Kernel debug checks */
#define DEBUG_LOCK_CHECK 1 /* Interrupt Lock/unlock sanity checking. */ #define DEBUG_LOCK_CHECK 1 /* Interrupt Lock/unlock sanity checking. */

View file

@ -250,7 +250,7 @@ void system_init(void)
map(SYS_PROFBUF, do_profbuf); /* announce locations to kernel */ map(SYS_PROFBUF, do_profbuf); /* announce locations to kernel */
/* i386-specific. */ /* i386-specific. */
#if _MINIX_CHIP == _CHIP_INTEL #if defined(__i386__)
map(SYS_READBIOS, do_readbios); /* read from BIOS locations */ map(SYS_READBIOS, do_readbios); /* read from BIOS locations */
map(SYS_IOPENABLE, do_iopenable); /* Enable I/O */ map(SYS_IOPENABLE, do_iopenable); /* Enable I/O */
map(SYS_SDEVIO, do_sdevio); /* phys_insb, _insw, _outsb, _outsw */ map(SYS_SDEVIO, do_sdevio); /* phys_insb, _insw, _outsb, _outsw */

View file

@ -25,7 +25,7 @@
int do_fork(struct proc * caller, message * m_ptr) int do_fork(struct proc * caller, message * m_ptr)
{ {
/* Handle sys_fork(). PR_ENDPT has forked. The child is PR_SLOT. */ /* 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; char *old_fpu_save_area_p;
#endif #endif
register struct proc *rpc; /* child process pointer */ register struct proc *rpc; /* child process pointer */
@ -53,11 +53,11 @@ int do_fork(struct proc * caller, message * m_ptr)
save_fpu(rpp); save_fpu(rpp);
/* Copy parent 'proc' struct to child. And reinitialize some fields. */ /* Copy parent 'proc' struct to child. And reinitialize some fields. */
gen = _ENDPOINT_G(rpc->p_endpoint); gen = _ENDPOINT_G(rpc->p_endpoint);
#if (_MINIX_CHIP == _CHIP_INTEL) #if defined(__i386__)
old_fpu_save_area_p = rpc->p_seg.fpu_state; old_fpu_save_area_p = rpc->p_seg.fpu_state;
#endif #endif
*rpc = *rpp; /* copy 'proc' struct */ *rpc = *rpp; /* copy 'proc' struct */
#if (_MINIX_CHIP == _CHIP_INTEL) #if defined(__i386__)
rpc->p_seg.fpu_state = old_fpu_save_area_p; rpc->p_seg.fpu_state = old_fpu_save_area_p;
if(proc_used_fpu(rpp)) if(proc_used_fpu(rpp))
memcpy(rpc->p_seg.fpu_state, rpp->p_seg.fpu_state, FPU_XFP_SIZE); memcpy(rpc->p_seg.fpu_state, rpp->p_seg.fpu_state, FPU_XFP_SIZE);

View file

@ -28,7 +28,7 @@ int do_getmcontext(struct proc * caller, message * m_ptr)
if (iskerneln(proc_nr)) return(EPERM); if (iskerneln(proc_nr)) return(EPERM);
rp = proc_addr(proc_nr); rp = proc_addr(proc_nr);
#if (_MINIX_CHIP == _CHIP_INTEL) #if defined(__i386__)
if (!proc_used_fpu(rp)) if (!proc_used_fpu(rp))
return(OK); /* No state to copy */ return(OK); /* No state to copy */
#endif #endif
@ -38,7 +38,7 @@ int do_getmcontext(struct proc * caller, message * m_ptr)
(vir_bytes) &mc, (phys_bytes) sizeof(struct __mcontext))) != OK) (vir_bytes) &mc, (phys_bytes) sizeof(struct __mcontext))) != OK)
return(r); return(r);
#if (_MINIX_CHIP == _CHIP_INTEL) #if defined(__i386__)
/* Copy FPU state */ /* Copy FPU state */
mc.mc_fpu_flags = 0; mc.mc_fpu_flags = 0;
if (proc_used_fpu(rp)) { 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) (vir_bytes) &mc, (phys_bytes) sizeof(struct __mcontext))) != OK)
return(r); return(r);
#if (_MINIX_CHIP == _CHIP_INTEL) #if defined(__i386__)
/* Copy FPU state */ /* Copy FPU state */
if (mc.mc_fpu_flags & MF_FPU_INITIALIZED) { if (mc.mc_fpu_flags & MF_FPU_INITIALIZED) {
rp->p_misc_flags |= MF_FPU_INITIALIZED; rp->p_misc_flags |= MF_FPU_INITIALIZED;

View file

@ -38,7 +38,7 @@ int do_sigreturn(struct proc * caller, message * m_ptr)
sc.sc_psw = (sc.sc_psw & X86_FLAGS_USER) | sc.sc_psw = (sc.sc_psw & X86_FLAGS_USER) |
(rp->p_reg.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. */ /* Don't panic kernel if user gave bad selectors. */
sc.sc_cs = rp->p_reg.cs; sc.sc_cs = rp->p_reg.cs;
sc.sc_ds = rp->p_reg.ds; sc.sc_ds = rp->p_reg.ds;
@ -52,7 +52,7 @@ int do_sigreturn(struct proc * caller, message * m_ptr)
/* Restore the registers. */ /* Restore the registers. */
memcpy(&rp->p_reg, &sc.sc_regs, sizeof(sigregs)); memcpy(&rp->p_reg, &sc.sc_regs, sizeof(sigregs));
#if (_MINIX_CHIP == _CHIP_INTEL) #if defined(__i386__)
if(sc.sc_flags & MF_FPU_INITIALIZED) if(sc.sc_flags & MF_FPU_INITIALIZED)
{ {
memcpy(rp->p_seg.fpu_state, &sc.sc_fpu_state, FPU_XFP_SIZE); memcpy(rp->p_seg.fpu_state, &sc.sc_fpu_state, FPU_XFP_SIZE);

View file

@ -42,7 +42,7 @@ int do_sigsend(struct proc * caller, message * m_ptr)
/* Copy the registers to the sigcontext structure. */ /* Copy the registers to the sigcontext structure. */
memcpy(&sc.sc_regs, (char *) &rp->p_reg, sizeof(sigregs)); memcpy(&sc.sc_regs, (char *) &rp->p_reg, sizeof(sigregs));
#if (_MINIX_CHIP == _CHIP_INTEL) #if defined(__i386__)
if(proc_used_fpu(rp)) { if(proc_used_fpu(rp)) {
/* save the FPU context before saving it to the sig context */ /* save the FPU context before saving it to the sig context */
save_fpu(rp); save_fpu(rp);

View file

@ -135,7 +135,7 @@ int do_trace(struct proc * caller, message * m_ptr)
tr_addr > sizeof(struct stackframe_s) - sizeof(reg_t)) tr_addr > sizeof(struct stackframe_s) - sizeof(reg_t))
return(EFAULT); return(EFAULT);
i = (int) tr_addr; i = (int) tr_addr;
#if (_MINIX_CHIP == _CHIP_INTEL) #if defined(__i386__)
/* Altering segment registers might crash the kernel when it /* Altering segment registers might crash the kernel when it
* tries to load them prior to restarting a process, so do * tries to load them prior to restarting a process, so do
* not allow it. * not allow it.

View file

@ -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) static int init_buffers(sub_dev_t *sub_dev_ptr)
{ {
#if (CHIP == INTEL) #if defined(__i386__)
char *base; char *base;
size_t size; size_t size;
unsigned left; unsigned left;
@ -954,10 +954,10 @@ static int init_buffers(sub_dev_t *sub_dev_ptr)
sub_dev_ptr->DmaSize, sub_dev_ptr->Nr); sub_dev_ptr->DmaSize, sub_dev_ptr->Nr);
return OK; return OK;
#else /* CHIP != INTEL */ #else /* !defined(__i386__) */
printf("%s: init_buffers() failed, CHIP != INTEL", drv.DriverName); printf("%s: init_buffers() failed, CHIP != INTEL", drv.DriverName);
return EIO; return EIO;
#endif /* CHIP == INTEL */ #endif /* defined(__i386__) */
} }

View file

@ -88,7 +88,7 @@ void makecontext(ucontext_t *ucp, void (*func)(void), int argc, ...)
} }
if (ucp->uc_mcontext.mc_magic == MCF_MAGIC) { 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 /* 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 context on. When the context starts, control is given to a wrapped
start routine, which calls a function and cleans up the stack start routine, which calls a function and cleans up the stack

View file

@ -57,10 +57,10 @@ int read_header_aout(
/* Check magic number, cpu type, and flags. */ /* Check magic number, cpu type, and flags. */
if (BADMAG(*hdr)) return(ENOEXEC); 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); if (hdr->a_cpu != A_I8086) return(ENOEXEC);
#endif #endif
#if (CHIP == INTEL && _WORD_SIZE == 4) #if (defined(__i386__) && _WORD_SIZE == 4)
if (hdr->a_cpu != A_I80386) return(ENOEXEC); if (hdr->a_cpu != A_I80386) return(ENOEXEC);
#endif #endif
if ((hdr->a_flags & ~(A_NSYM | A_EXEC | A_SEP)) != 0) return(ENOEXEC); if ((hdr->a_flags & ~(A_NSYM | A_EXEC | A_SEP)) != 0) return(ENOEXEC);

View file

@ -409,7 +409,7 @@ void *arg;
if (stackaddr == MAP_FAILED) if (stackaddr == MAP_FAILED)
mthread_panic("Failed to allocate stack to thread"); mthread_panic("Failed to allocate stack to thread");
#if (_MINIX_CHIP == _CHIP_INTEL) #if defined(__i386__)
guard_start = stackaddr; guard_start = stackaddr;
guard_end = stackaddr + MTHREAD_GUARDSIZE; guard_end = stackaddr + MTHREAD_GUARDSIZE;
guarded_stacksize = stackaddr + stacksize - guard_end; guarded_stacksize = stackaddr + stacksize - guard_end;

View file

@ -311,7 +311,7 @@ static char *p_rts_flags_str(int flags)
/*===========================================================================* /*===========================================================================*
* proctab_dmp * * proctab_dmp *
*===========================================================================*/ *===========================================================================*/
#if (CHIP == INTEL) #if defined(__i386__)
void proctab_dmp() void proctab_dmp()
{ {
/* Proc table dump */ /* Proc table dump */
@ -339,7 +339,7 @@ void proctab_dmp()
printf("\n"); printf("\n");
} }
} }
#endif /* (CHIP == INTEL) */ #endif /* defined(__i386__) */
/*===========================================================================* /*===========================================================================*
* procstack_dmp * * procstack_dmp *

View file

@ -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) if (sendrec(VFS_PROC_NR, &mess) != OK || mess.m_type != OK)
panic("can't sync up with VFS"); panic("can't sync up with VFS");
#if (CHIP == INTEL) #if defined(__i386__)
uts_val.machine[0] = 'i'; uts_val.machine[0] = 'i';
strcpy(uts_val.machine + 1, itoa(getprocessor())); strcpy(uts_val.machine + 1, itoa(getprocessor()));
#endif #endif

View file

@ -740,7 +740,7 @@ static void test_attributes(void)
/* Verify stack hypothesis; we assume a stack is used from the top and grows /* Verify stack hypothesis; we assume a stack is used from the top and grows
* downwards. * downwards.
*/ */
#if (_MINIX_CHIP == _CHIP_INTEL) #if defined(__i386__)
if (stackp[0] != MAGIC) err(11, 66); /* End of the stack */ if (stackp[0] != MAGIC) err(11, 66); /* End of the stack */
for (i = no_ints - 1 - 16; i < no_ints; i++) for (i = no_ints - 1 - 16; i < no_ints; i++)
if (stackp[i] != MAGIC) stack_untouched = 0; if (stackp[i] != MAGIC) stack_untouched = 0;

View file

@ -24,7 +24,7 @@
#include "const.h" #include "const.h"
#include "type.h" #include "type.h"
#include "mfsdir.h" #include "mfsdir.h"
#if (defined(__minix) && MACHINE == IBM_PC) #if (defined(__minix) && defined(__i386__))
#include <minix/partition.h> #include <minix/partition.h>
#include <minix/u64.h> #include <minix/u64.h>
#include <sys/ioctl.h> #include <sys/ioctl.h>