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
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))

View File

@@ -48,12 +48,10 @@
#undef printf /* defined as printk in <minix/const.h> */
#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

View File

@@ -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",

View File

@@ -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

View File

@@ -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);
}