From 19ffad76922be60466e826de1416f0fa20dd6052 Mon Sep 17 00:00:00 2001 From: Arun Thomas Date: Mon, 6 Aug 2012 13:00:21 +0200 Subject: [PATCH] Remove ACK EM_WSIZE/EM_PSIZE macro usage --- commands/mdb/mdb.h | 2 +- commands/mdb/mdbdis86.c | 11 ----------- commands/mdb/sym.c | 12 ------------ drivers/at_wini/at_wini.c | 2 -- drivers/at_wini/at_wini.h | 4 ---- include/arch/i386/include/ansi.h | 4 ---- include/arch/i386/include/signal.h | 2 -- include/minix/ioctl.h | 10 ---------- include/minix/sys_config.h | 5 ----- include/sys/syslimits.h | 4 ---- kernel/system/do_sigreturn.c | 2 -- kernel/system/do_trace.c | 2 -- lib/libc/minix/malloc.c | 8 -------- lib/libc/sys-minix/environ.c | 4 ---- lib/libexec/exec_aout.c | 5 +---- lib/libminc/malloc.c | 8 -------- 16 files changed, 2 insertions(+), 83 deletions(-) diff --git a/commands/mdb/mdb.h b/commands/mdb/mdb.h index 73032dedb..1541230f1 100644 --- a/commands/mdb/mdb.h +++ b/commands/mdb/mdb.h @@ -68,7 +68,7 @@ #define PC_OFF ((long)&((struct proc *)0)->p_reg.pc) #endif -#define ADDRSIZE _WORD_SIZE +#define ADDRSIZE (sizeof(void *)) #define BITSIZE(size) (8 * (size)) #define INTSIZE (sizeof(int)) /* not quite right for cross-debugger */ #define LONGSIZE (sizeof(long)) diff --git a/commands/mdb/mdbdis86.c b/commands/mdb/mdbdis86.c index dcb1c8998..5e7c8c0b3 100644 --- a/commands/mdb/mdbdis86.c +++ b/commands/mdb/mdbdis86.c @@ -931,11 +931,7 @@ opcode_pt wordflags; else if (mod == MEM2_MOD) { outbyte('+'); -#if (_WORD_SIZE == 4) out32offset(); -#else - outgetaddr(); -#endif } outbyte(RINDIRECT); if (hasize == 16 && rm == 4 && index == 4 && ss != 0) @@ -950,8 +946,6 @@ static void outf1() outbyte(')'); } -#if (_WORD_SIZE == 4) - static void out32offset() { off_t off; @@ -963,7 +957,6 @@ static void out32offset() outh32(off); } -#endif static void outfishy() { @@ -1425,11 +1418,7 @@ long addr; int count; int symflg; { -#if (_WORD_SIZE == 4) bits32 = TRUE; /* Set mode */ -#else - bits32 = FALSE; -#endif uptr.off = addr; uptr.base = 0; /* not known */ while ( count-- != 0 && show1instruction() ) diff --git a/commands/mdb/sym.c b/commands/mdb/sym.c index fe0c8e3dc..2c2b14941 100644 --- a/commands/mdb/sym.c +++ b/commands/mdb/sym.c @@ -115,12 +115,8 @@ long magic; /* Check CPU */ #if defined(__i386__) -#if (_WORD_SIZE == 4) if (hdr->a_cpu != A_I80386) -#else - if (hdr->a_cpu != A_I8086) #endif -#endif { Printf("mdb: invalid cpu in exec header - %04x\n", hdr->a_cpu); @@ -213,11 +209,7 @@ int allflag; schar += 'A' - 'a'; outbyte( schar ); outspace(); -#if (_WORD_SIZE == 2) - outh16( (u16_t) sp->n_value ); -#else outh32( sp->n_value ); -#endif outbyte('\n'); } } @@ -460,11 +452,7 @@ char *cmd; for ( ; s <= send; ++s ) outspace(); outbyte( schar ); outspace(); -#if (_WORD_SIZE == 2) - outh16( (u16_t) sp->n_value ); -#else outh32( sp->n_value ); -#endif outbyte('\n'); } } diff --git a/drivers/at_wini/at_wini.c b/drivers/at_wini/at_wini.c index d8e0d5a18..6e1f1fb86 100644 --- a/drivers/at_wini/at_wini.c +++ b/drivers/at_wini/at_wini.c @@ -2170,9 +2170,7 @@ int do_dma; */ sys_setalarm(wakeup_ticks, 0); -#if _WORD_SIZE > 2 if (cnt > 0xFFFE) cnt = 0xFFFE; /* Max data per interrupt. */ -#endif w_command = ATAPI_PACKETCMD; pv_set(outbyte[0], wn->base_cmd + REG_FEAT, do_dma ? FEAT_DMA : 0); diff --git a/drivers/at_wini/at_wini.h b/drivers/at_wini/at_wini.h index e5d3f0e4d..868c8cd0d 100644 --- a/drivers/at_wini/at_wini.h +++ b/drivers/at_wini/at_wini.h @@ -191,11 +191,7 @@ /* Miscellaneous. */ #define MAX_DRIVES 8 #define COMPAT_DRIVES 4 -#if _WORD_SIZE > 2 #define MAX_SECS 256 /* controller can transfer this many sectors */ -#else -#define MAX_SECS 127 /* but not to a 16 bit process */ -#endif #define MAX_ERRORS 4 /* how often to try rd/wt before quitting */ #define NR_MINORS (MAX_DRIVES * DEV_PER_DRIVE) #define SUB_PER_DRIVE (NR_PARTITIONS * NR_PARTITIONS) diff --git a/include/arch/i386/include/ansi.h b/include/arch/i386/include/ansi.h index 9c1cfe470..e26337e64 100644 --- a/include/arch/i386/include/ansi.h +++ b/include/arch/i386/include/ansi.h @@ -52,11 +52,7 @@ #define _BSD_CLOCK_T_ long -#if _EM_PSIZE == _EM_WSIZE #define _BSD_PTRDIFF_T_ int -#else /* _EM_PSIZE == _EM_LSIZE */ -#define _BSD_PTRDIFF_T_ long -#endif #define _BSD_SIZE_T_ unsigned int #define _BSD_SSIZE_T_ int diff --git a/include/arch/i386/include/signal.h b/include/arch/i386/include/signal.h index d8f696f52..cf07f6277 100644 --- a/include/arch/i386/include/signal.h +++ b/include/arch/i386/include/signal.h @@ -33,10 +33,8 @@ struct sigcontext { union fpu_state_u sc_fpu_state; }; -#if _WORD_SIZE == 4 #define sc_gs sc_regs.gs #define sc_fs sc_regs.fs -#endif /* _WORD_SIZE == 4 */ #define sc_es sc_regs.es #define sc_ds sc_regs.ds #define sc_di sc_regs.di diff --git a/include/minix/ioctl.h b/include/minix/ioctl.h index c71f672ec..1ea5c9221 100644 --- a/include/minix/ioctl.h +++ b/include/minix/ioctl.h @@ -13,7 +13,6 @@ #include #endif -#if _EM_WSIZE >= 4 /* Ioctls have the command encoded in the low-order word, and the size * of the parameter in the high-order word. The 3 high bits of the high- * order word are used to encode the in/out/void status of the parameter. @@ -56,15 +55,6 @@ #define _MINIX_IOCTL_BIG(i) ((i) & _IOC_BIG) #define _MINIX_IOCTL_SIZE_BIG(i) (((i) >> 8) & _IOCPARM_MASK_BIG) -#else -/* No fancy encoding on a 16-bit machine. */ - -#define _IO(x,y) ((x << 8) | y) -#define _IOR(x,y,t) _IO(x,y) -#define _IOW(x,y,t) _IO(x,y) -#define _IORW(x,y,t) _IO(x,y) -#endif - __BEGIN_DECLS int ioctl(int _fd, int _request, void *_data); __END_DECLS diff --git a/include/minix/sys_config.h b/include/minix/sys_config.h index deb28ea9c..d1789a9f6 100644 --- a/include/minix/sys_config.h +++ b/include/minix/sys_config.h @@ -4,11 +4,6 @@ /*===========================================================================* * This section contains user-settable parameters * *===========================================================================*/ -/* Word size in bytes (a constant equal to sizeof(int)). */ -#if __ACK__ || __GNUC__ -#define _WORD_SIZE _EM_WSIZE -#define _PTR_SIZE _EM_WSIZE -#endif #define _NR_PROCS 256 #define _NR_SYS_PROCS 64 diff --git a/include/sys/syslimits.h b/include/sys/syslimits.h index a795e03b7..c5a8b7ed4 100644 --- a/include/sys/syslimits.h +++ b/include/sys/syslimits.h @@ -12,11 +12,7 @@ #if defined(_POSIX_C_SOURCE) || defined(_XOPEN_SOURCE) || \ defined(_NETBSD_SOURCE) -#if _EM_WSIZE > 2 #define ARG_MAX 262144 /* # bytes of args + environ for exec() */ -#else -#define ARG_MAX 4096 /* args + environ on small machines */ -#endif #ifndef CHILD_MAX #define CHILD_MAX _NO_LIMIT /* max simultaneous processes */ diff --git a/kernel/system/do_sigreturn.c b/kernel/system/do_sigreturn.c index 616b60ac6..090557fd0 100644 --- a/kernel/system/do_sigreturn.c +++ b/kernel/system/do_sigreturn.c @@ -44,10 +44,8 @@ int do_sigreturn(struct proc * caller, message * m_ptr) sc.sc_ds = rp->p_reg.ds; sc.sc_es = rp->p_reg.es; sc.sc_ss = rp->p_reg.ss; -#if _WORD_SIZE == 4 sc.sc_fs = rp->p_reg.fs; sc.sc_gs = rp->p_reg.gs; -#endif #endif /* Restore the registers. */ diff --git a/kernel/system/do_trace.c b/kernel/system/do_trace.c index 57031e234..10dd4bcb9 100644 --- a/kernel/system/do_trace.c +++ b/kernel/system/do_trace.c @@ -143,10 +143,8 @@ int do_trace(struct proc * caller, message * m_ptr) if (i == (int) &((struct proc *) 0)->p_reg.cs || i == (int) &((struct proc *) 0)->p_reg.ds || i == (int) &((struct proc *) 0)->p_reg.es || -#if _WORD_SIZE == 4 i == (int) &((struct proc *) 0)->p_reg.gs || i == (int) &((struct proc *) 0)->p_reg.fs || -#endif i == (int) &((struct proc *) 0)->p_reg.ss) return(EFAULT); #endif diff --git a/lib/libc/minix/malloc.c b/lib/libc/minix/malloc.c index 32922bd68..7f3ba5737 100644 --- a/lib/libc/minix/malloc.c +++ b/lib/libc/minix/malloc.c @@ -23,17 +23,9 @@ static int no_debug = -1; if (no_debug == 0) { statement; } \ } -#if _EM_WSIZE == _EM_PSIZE #define ptrint int -#else -#define ptrint long -#endif -#if _EM_PSIZE == 2 -#define BRKSIZE 1024 -#else #define BRKSIZE 4096 -#endif #ifdef ALIGN_EIGHT_BYTES #define PTRSIZE 8 #else diff --git a/lib/libc/sys-minix/environ.c b/lib/libc/sys-minix/environ.c index 7e7fe73b0..7c254fa45 100644 --- a/lib/libc/sys-minix/environ.c +++ b/lib/libc/sys-minix/environ.c @@ -13,8 +13,4 @@ * the bytes in the pointer are the same, just in case. */ -#if _EM_PSIZE==2 -char **environ = (char **) 0x5353; -#else char **environ = (char **) 0x53535353; -#endif diff --git a/lib/libexec/exec_aout.c b/lib/libexec/exec_aout.c index b952ad4db..f3eda79c8 100644 --- a/lib/libexec/exec_aout.c +++ b/lib/libexec/exec_aout.c @@ -57,10 +57,7 @@ int read_header_aout( /* Check magic number, cpu type, and flags. */ if (BADMAG(*hdr)) return(ENOEXEC); -#if (defined(__i386__) && _WORD_SIZE == 2) - if (hdr->a_cpu != A_I8086) return(ENOEXEC); -#endif -#if (defined(__i386__) && _WORD_SIZE == 4) +#if defined(__i386__) 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/libminc/malloc.c b/lib/libminc/malloc.c index 2ea43adec..7b06e2121 100644 --- a/lib/libminc/malloc.c +++ b/lib/libminc/malloc.c @@ -16,17 +16,9 @@ #define CHECK_DBG(statement) -#if _EM_WSIZE == _EM_PSIZE #define ptrint int -#else -#define ptrint long -#endif -#if _EM_PSIZE == 2 -#define BRKSIZE 1024 -#else #define BRKSIZE 4096 -#endif #ifdef ALIGN_EIGHT_BYTES #define PTRSIZE 8 #else