-# $NetBSD: files,v 1.69 1995/10/04 23:33:14 pk Exp $
+# $NetBSD: files,v 1.70 1995/11/25 00:37:39 cgd Exp $
# @(#)files.newconf 7.5 (Berkeley) 5/10/93
file isofs/cd9660/cd9660_vnops.c cd9660
file kern/exec_aout.c
file kern/exec_conf.c
-file kern/exec_ecoff.c compat_ultrix compat_osf1
+file kern/exec_ecoff.c compat_ultrix compat_osf1 exec_ecoff
file kern/exec_elf.c compat_svr4 compat_linux
file kern/exec_script.c
file kern/exec_subr.c
-/* $NetBSD: db_command.c,v 1.13 1994/10/09 08:29:59 mycroft Exp $ */
+/* $NetBSD: db_command.c,v 1.15 1995/10/26 14:52:33 gwr Exp $ */
/*
* Mach Operating System
#include <sys/param.h>
#include <sys/proc.h>
+#include <vm/vm.h>
+
#include <machine/db_machdep.h> /* type definitions */
#include <ddb/db_lex.h>
if (modif[0] == 'f')
full = TRUE;
- _vm_map_print(addr, full, db_printf);
+ _vm_map_print((vm_map_t)addr, full, db_printf);
}
/*ARGSUSED*/
if (modif[0] == 'f')
full = TRUE;
- _vm_object_print(addr, full, db_printf);
+ _vm_object_print((vm_object_t)addr, full, db_printf);
}
/*
-/* $NetBSD: db_output.c,v 1.8 1994/06/29 22:41:41 deraadt Exp $ */
+/* $NetBSD: db_output.c,v 1.9 1995/10/16 05:28:16 mycroft Exp $ */
/*
* Mach Operating System
extern int db_radix;
/*VARARGS1*/
+void
#ifdef __STDC__
db_printf(char *fmt, ...)
#else
/* alternate name */
/*VARARGS1*/
+void
#ifdef __STDC__
kdbprintf(char *fmt, ...)
#else
-/* $NetBSD: db_output.h,v 1.5 1994/10/09 08:19:36 mycroft Exp $ */
+/* $NetBSD: db_output.h,v 1.6 1995/10/16 05:28:17 mycroft Exp $ */
/*
* Mach Operating System
void db_force_whitespace __P((void));
int db_print_position __P((void));
void db_end_line __P((void));
-int db_printf __P((char *, ...));
+void db_printf __P((const char *, ...));
-/* $NetBSD: db_sym.c,v 1.9 1995/05/24 20:21:00 gwr Exp $ */
+/* $NetBSD: db_sym.c,v 1.11 1995/11/24 22:13:08 cgd Exp $ */
/*
* Mach Operating System
*/
extern char end[];
-unsigned int db_lastsym = (int)end;
-unsigned int db_maxoff = 0x10000000;
+unsigned long db_lastsym = (long)end;
+db_expr_t db_maxoff = 0x10000000;
void
-# $NetBSD: Makefile,v 1.23 1995/10/07 09:56:54 mycroft Exp $
+# $NetBSD: Makefile,v 1.24 1995/10/20 01:10:06 cgd Exp $
LIB= kern
NOPIC=
DIR=${KERNREL}${KERNDIR}
+CC= ${KERNCC}
+CFLAGS= -I${DIR}/arch/${MACHINE_ARCH} \
+ ${KERNCFLAGS:S/-D_KERNEL//:S@-I.@-I${KERNREL}.@g}
+
.if exists (${DIR}/arch/${MACHINE_ARCH}/Makefile.inc)
.PATH: ${DIR}/arch/${MACHINE_ARCH}
.include "${DIR}/arch/${MACHINE_ARCH}/Makefile.inc"
.PATH: ${DIR}
-CC = ${KERNCC}
-CFLAGS += -I${DIR}/arch/${MACHINE_ARCH} \
- ${KERNCFLAGS:S/-D_KERNEL//:S@-I.@-I${KERNREL}.@g}
-
.if (${MACHINE_ARCH} != "alpha")
# Quad support
SRCS+= adddi3.c anddi3.c ashldi3.c ashrdi3.c cmpdi2.c divdi3.c iordi3.c \
-# $Id: Makefile.inc,v 1.1.1.1 1995/10/18 08:52:51 deraadt Exp $
+# $NetBSD: Makefile.inc,v 1.3 1995/10/20 01:15:37 cgd Exp $
SRCS+= __main.c imax.c imin.c lmax.c lmin.c max.c min.c ulmax.c ulmin.c \
- bcmp.c bzero.c ffs.c strcat.c strcmp.c strcpy.c strlen.c strncmp.c \
+ bcmp.c bzero.S ffs.c strcat.c strcmp.c strcpy.c strlen.c strncmp.c \
strncpy.c scanc.c skpc.c locc.c htonl.c htons.c ntohl.c ntohs.c \
random.c
--- /dev/null
+/* $NetBSD: bzero.S,v 1.1 1995/10/20 01:16:02 cgd Exp $ */
+
+/*
+ * Copyright (c) 1995 Carnegie-Mellon University.
+ * All rights reserved.
+ *
+ * Author: Trevor Blackwell
+ *
+ * Permission to use, copy, modify and distribute this software and
+ * its documentation is hereby granted, provided that both the copyright
+ * notice and this permission notice appear in all copies of the
+ * software, derivative works or modified versions, and any portions
+ * thereof, and that both notices appear in supporting documentation.
+ *
+ * CARNEGIE MELLON ALLOWS FREE USE OF THIS SOFTWARE IN ITS "AS IS"
+ * CONDITION. CARNEGIE MELLON DISCLAIMS ANY LIABILITY OF ANY KIND
+ * FOR ANY DAMAGES WHATSOEVER RESULTING FROM THE USE OF THIS SOFTWARE.
+ *
+ * Carnegie Mellon requests users of this software to return to
+ *
+ * Software Distribution Coordinator or Software.Distribution@CS.CMU.EDU
+ * School of Computer Science
+ * Carnegie Mellon University
+ * Pittsburgh PA 15213-3890
+ *
+ * any improvements or extensions that they make and grant Carnegie the
+ * rights to redistribute these changes.
+ */
+
+#include "DEFS.h"
+
+LEAF(bzero,2)
+ ble a1,bzero_done
+ bic a1,63,t3 /* t3 is # bytes to do 64 bytes at a time */
+
+ /* If nothing in first word, ignore it */
+ subq zero,a0,t0
+ and t0,7,t0 /* t0 = (0-size)%8 */
+ beq t0,bzero_nostart1
+
+ cmpult a1,t0,t1 /* if size > size%8 goto noshort */
+ beq t1,bzero_noshort
+
+ /*
+ * The whole thing is less than a word.
+ * Mask off 1..7 bytes, and finish.
+ */
+ ldq_u t2,0(a0)
+ lda t0,-1(zero) /* t0=-1 */
+ mskql t0,a1,t0 /* Get ff in bytes (a0%8)..((a0+a1-1)%8) */
+ insql t0,a0,t0
+ bic t2,t0,t2 /* zero those bytes in word */
+ stq_u t2,0(a0)
+ RET
+
+bzero_noshort:
+ /* Handle the first partial word */
+ ldq_u t2,0(a0)
+ subq a1,t0,a1
+ mskql t2,a0,t2 /* zero bytes (a0%8)..7 in word */
+ stq_u t2,0(a0)
+
+ addq a0,t0,a0 /* round a0 up to next word */
+ bic a1,63,t3 /* recalc t3 (# bytes to do 64 bytes at a
+ time) */
+
+bzero_nostart1:
+ /*
+ * Loop, zeroing 64 bytes at a time
+ */
+ beq t3,bzero_lp_done
+bzero_lp:
+ stq zero,0(a0)
+ stq zero,8(a0)
+ stq zero,16(a0)
+ stq zero,24(a0)
+ subq t3,64,t3
+ stq zero,32(a0)
+ stq zero,40(a0)
+ stq zero,48(a0)
+ stq zero,56(a0)
+ addq a0,64,a0
+ bne t3,bzero_lp
+
+bzero_lp_done:
+ /*
+ * Handle the last 0..7 words.
+ * We mask off the low bits, so we don't need an extra
+ * compare instruction for the loop (just a bne. heh-heh)
+ */
+ and a1,0x38,t4
+ beq t4,bzero_finish_lp_done
+bzero_finish_lp:
+ stq zero,0(a0)
+ subq t4,8,t4
+ addq a0,8,a0
+ bne t4,bzero_finish_lp
+
+ /* Do the last partial word */
+bzero_finish_lp_done:
+ and a1,7,t5 /* 0..7 bytes left */
+ beq t5,bzero_done /* mskqh won't change t0 if t5==0, but I
+ don't want to touch, say, a new VM page */
+ ldq t0,0(a0)
+ mskqh t0,t5,t0
+ stq t0,0(a0)
+bzero_done:
+ RET
+
+ END(bzero)
-/* $NetBSD: divrem.m4,v 1.2 1995/03/03 01:14:11 cgd Exp $ */
+/* $NetBSD: divrem.m4,v 1.3 1995/10/20 00:53:28 cgd Exp $ */
/*
* Copyright (c) 1994, 1995 Carnegie-Mellon University.
* M4 Parameters
* NAME name of function to generate
* OP OP=div: t10 / t11 -> t12; OP=rem: t10 % t11 -> t12
- * S S=true: signed; S=false: unsigned [XXX NOT YET]
+ * S S=true: signed; S=false: unsigned
* WORDSIZE total number of bits
*/
define(I, `t1')
define(CC, `t2')
define(T_0, `t3')
-ifelse(S, `true', `define(SIGN, `t4')')
+ifelse(S, `true', `define(NEG, `t4')')
#include "DEFS.h"
LEAF(NAME, 0) /* XXX */
- lda sp, -48(sp)
+ lda sp, -64(sp)
stq BIT, 0(sp)
stq I, 8(sp)
stq CC, 16(sp)
stq T_0, 24(sp)
ifelse(S, `true',
-` stq SIGN, 32(sp)')
+` stq NEG, 32(sp)')
+ stq A, 40(sp)
+ stq B, 48(sp)
mov zero, RESULT /* Initialize result to zero */
ifelse(S, `true',
`
/* Compute sign of result. If either is negative, this is easy. */
- or A, B, SIGN /* not the sign, but... */
- bgt SIGN, Ldoit /* neither negative? do it! */
+ or A, B, NEG /* not the sign, but... */
+ srl NEG, WORDSIZE - 1, NEG /* rather, or of high bits */
+ blbc NEG, Ldoit /* neither negative? do it! */
ifelse(OP, `div',
-` xor A, B, SIGN /* THIS is the sign! */
-', ` mov A, SIGN /* sign follows A. */
+` xor A, B, NEG /* THIS is the sign! */
+', ` mov A, NEG /* sign follows A. */
')
- bge A, LnegB /* see if A is negative */
+ srl NEG, WORDSIZE - 1, NEG /* make negation the low bit. */
+
+ srl A, WORDSIZE - 1, I /* is A negative? */
+ blbc I, LnegB /* no. */
/* A is negative; flip it. */
+ifelse(WORDSIZE, `32', `
+ /* top 32 bits may be random junk */
+ zap A, 0xf0, A
+')
subq zero, A, A
- bge B, Ldoit /* see if B is negative */
+ srl B, WORDSIZE - 1, I /* is B negative? */
+ blbc I, Ldoit /* no. */
LnegB:
/* B is definitely negative, no matter how we got here. */
+ifelse(WORDSIZE, `32', `
+ /* top 32 bits may be random junk */
+ zap B, 0xf0, B
+')
subq zero, B, B
Ldoit:
-', `
+')
ifelse(WORDSIZE, `32', `
/*
- * Clear the top 32 bits of each operand, as the compiler may
- * have sign extended them, if the 31st bit was set.
+ * Clear the top 32 bits of each operand, as they may
+ * sign extension (if negated above), or random junk.
*/
zap A, 0xf0, A
zap B, 0xf0, B
-')' )
+')
/* kill the special cases. */
- beq B, Ldotrap /* division by zero! XXX */
+ beq B, Ldotrap /* division by zero! */
1: cmpult A, B, CC /* A < B? */
/* RESULT is already zero, from above. A is untouched. */
`
/* Check to see if we should negate it. */
subqv zero, RESULT, T_0
- cmovlt SIGN, T_0, RESULT
+ cmovlbs NEG, T_0, RESULT
')
ldq BIT, 0(sp)
ldq CC, 16(sp)
ldq T_0, 24(sp)
ifelse(S, `true',
-` ldq SIGN, 32(sp)')
- lda sp, 48(sp)
+` ldq NEG, 32(sp)')
+ ldq A, 40(sp)
+ ldq B, 48(sp)
+ lda sp, 64(sp)
ret zero, (t9), 1
Ldotrap:
-# $NetBSD: Makefile.inc,v 1.5.2.1 1995/10/13 20:29:29 phil Exp $
+# $NetBSD: Makefile.inc,v 1.6 1995/11/30 01:00:10 jtc Exp $
SRCS+= __main.c imax.c imin.c lmax.c lmin.c max.c min.c ulmax.c ulmin.c \
bcmp.c ffs.c strcat.c strcmp.c strcpy.c strlen.c strncmp.c strncpy.c \
--- /dev/null
+/* $NetBSD: setjmp.S,v 1.3 1995/11/30 01:00:12 jtc Exp $ */
+
+/*
+ * Copyright (c) 1992 Helsinki University of Technology
+ * All Rights Reserved.
+ *
+ * Permission to use, copy, modify and distribute this software and its
+ * documentation is hereby granted, provided that both the copyright
+ * notice and this permission notice appear in all copies of the
+ * software, derivative works or modified versions, and any portions
+ * thereof, and that both notices appear in supporting documentation.
+ *
+ * HELSINKI UNIVERSITY OF TECHNOLOGY ALLOWS FREE USE OF THIS SOFTWARE IN
+ * ITS "AS IS" CONDITION. HELSINKI UNIVERSITY OF TECHNOLOGY DISCLAIMS ANY
+ * LIABILITY OF ANY KIND FOR ANY DAMAGES WHATSOEVER RESULTING FROM THE
+ * USE OF THIS SOFTWARE.
+ */
+/*
+ * HISTORY
+ * 29-Apr-92 Johannes Helander (jvh) at Helsinki University of Technology
+ * Created.
+ */
+
+#include <machine/asm.h>
+#include <machine/jmpbuf.h>
+
+ENTRY(setjmp)
+ movqd 0, tos
+ bsr EX(sigblock)
+ adjspb -4
+ movd 4(sp), r2 /* jmp_buf */
+ movd 0(sp), JMP_BUF_PC(r2) /* pc of caller */
+ movd r0, JMP_BUF_SIGMASK(r2) /* save mask */
+
+ sprd sp, JMP_BUF_SP(r2)
+ sprd fp, JMP_BUF_FP(r2)
+ sprd sb, JMP_BUF_SB(r2)
+ movd r3, JMP_BUF_R3(r2) /* save registers r3-r7 */
+ movd r4, JMP_BUF_R4(r2)
+ movd r5, JMP_BUF_R5(r2)
+ movd r6, JMP_BUF_R6(r2)
+ movd r7, JMP_BUF_R7(r2)
+
+ movqd 0, r0
+ ret 0
+
+ENTRY(longjmp)
+ movd 4(sp),r2 /* jmp_buf */
+ movd JMP_BUF_SIGMASK(r2), tos /* restore mask */
+ bsr EX(sigsetmask)
+ adjspb -4
+ movd 4(sp), r2 /* jmp_buf */
+ movd 8(sp), r0 /* value */
+
+ lprd sp, JMP_BUF_SP(r2)
+ lprd fp, JMP_BUF_FP(r2)
+ lprd sb, JMP_BUF_SB(r2)
+ movd JMP_BUF_R3(r2), r3 /* load registers r3-r7 */
+ movd JMP_BUF_R4(r2), r4
+ movd JMP_BUF_R5(r2), r5
+ movd JMP_BUF_R6(r2), r6
+ movd JMP_BUF_R7(r2), r7
+ movd JMP_BUF_PC(r2), 0(sp) /* patch return pc */
+
+ cmpqd 0, r0
+ bne nonzero
+ movqd 1, r0
+nonzero:
+ ret 0
+
-/* $NetBSD: quad.h,v 1.4.2.1 1995/10/12 15:17:26 jtc Exp $ */
+/* $NetBSD: quad.h,v 1.5 1995/10/12 15:13:58 jtc Exp $ */
/*-
* Copyright (c) 1992, 1993