Remove ACK EM_WSIZE/EM_PSIZE macro usage

This commit is contained in:
Arun Thomas 2012-08-06 13:00:21 +02:00
parent 6723dcfab7
commit 19ffad7692
16 changed files with 2 additions and 83 deletions

View file

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

View file

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

View file

@ -115,11 +115,7 @@ 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",
@ -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');
}
}

View file

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

View file

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

View file

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

View file

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

View file

@ -13,7 +13,6 @@
#include <minix/types.h>
#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

View file

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

View file

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

View file

@ -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. */

View file

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

View file

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

View file

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

View file

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

View file

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