/*-
- * Copyright (c) 1982, 1986, 1989 The Regents of the University of California.
- * All rights reserved.
+ * Copyright (c) 1982, 1986, 1989, 1993
+ * The Regents of the University of California. All rights reserved.
*
- * %sccs.include.proprietary.c%
+ * This module is believed to contain source code proprietary to AT&T.
+ * Use and redistribution is subject to the Berkeley Software License
+ * Agreement and your Software Agreement with AT&T (Western Electric).
*
- * @(#)sys_process.c 7.38 (Berkeley) %G%
+ * @(#)sys_process.c 8.1 (Berkeley) 6/10/93
*/
#define IPCREG
}
#define PHYSOFF(p, o) ((caddr_t)(p) + (o))
+#if defined(hp300) || defined(luna68k)
+#define PHYSALIGNED(a) (((int)(a) & (sizeof(short) - 1)) == 0)
+#else
+#define PHYSALIGNED(a) (((int)(a) & (sizeof(int) - 1)) == 0)
+#endif
#if defined(i386)
#undef PC
case PT_READ_U: /* read the child's u. */
i = (int)ipc.ip_addr;
- if ((u_int) i > ctob(UPAGES)-sizeof(int) || (i & 1) != 0)
+ if ((u_int) i > ctob(UPAGES)-sizeof(int) || !PHYSALIGNED(i))
goto error;
ipc.ip_data = *(int *)PHYSOFF(p->p_addr, i);
break;
case PT_WRITE_U: /* write the child's u. */
i = (int)ipc.ip_addr;
#ifdef mips
- poff = (int *)PHYSOFF(curproc->p_addr, i);
+ poff = (int *)PHYSOFF(p->p_addr, i);
#else
poff = (int *)PHYSOFF(kstack, i);
#endif