From a412d4803c3d222da7064620a108b5a3ebfdd5ee Mon Sep 17 00:00:00 2001 From: ragge Date: Wed, 3 May 1995 19:53:40 +0000 Subject: [PATCH] mtpr support for 11/780 added. DELAY added. mcount() corrected. trapframe fixed to support all registers. --- sys/arch/vax/include/asm.h | 52 +++++++++++++++------------- sys/arch/vax/include/cpu.h | 5 +-- sys/arch/vax/include/disklabel.h | 5 +-- sys/arch/vax/include/mtpr.h | 19 +++++++++-- sys/arch/vax/include/param.h | 7 +++- sys/arch/vax/include/profile.h | 58 ++++++++++++-------------------- sys/arch/vax/include/trap.h | 8 ++++- 7 files changed, 82 insertions(+), 72 deletions(-) diff --git a/sys/arch/vax/include/asm.h b/sys/arch/vax/include/asm.h index 75d6a3052d38..e175b77bdc23 100644 --- a/sys/arch/vax/include/asm.h +++ b/sys/arch/vax/include/asm.h @@ -1,4 +1,4 @@ -/* $NetBSD: asm.h,v 1.2 1994/10/26 08:02:01 cgd Exp $ */ +/* $NetBSD: asm.h,v 1.3 1995/05/03 19:53:40 ragge Exp $ */ /*- * Copyright (c) 1990 The Regents of the University of California. @@ -36,37 +36,41 @@ * SUCH DAMAGE. * * @(#)asm.h 5.5 (Berkeley) 5/7/91 + * @(#)DEFS.h 5.3 (Berkeley) 6/1/90 */ -#ifndef _SYS_ASM_H_ -#define _SYS_ASM_H_ +#ifndef _MACHINE_ASM_H_ +#define _MACHINE_ASM_H_ -/* - * XXX assumes that arguments are not passed in %eax - */ - -#ifdef PROF -# define _BEGIN_ENTRY .data; 1:; .long 0; .text; .align 2 -# define _END_ENTRY moval 1b,r0; jsb mcount -#else -# define _BEGIN_ENTRY .text; .align 2 -# define _END_ENTRY -#endif +#define R0 0x001 +#define R1 0x002 +#define R2 0x004 +#define R3 0x008 +#define R4 0x010 +#define R5 0x020 +#define R6 0x040 +#define R7 0x080 +#define R8 0x100 +#define R9 0x200 +#define R10 0x400 +#define R11 0x800 #ifdef __STDC__ -# define _C_FUNC(x) _ ## x +# define _FUNC(x) _ ## x ## : +# define _GLOB(x) .globl _ ## x #else -# define _C_FUNC(x) _/**/x +# define _FUNC(x) _/**/x: +# define _GLOB(x) .globl _/**/x #endif -#define _ASM_FUNC(x) x -#define _ENTRY(x) .globl x; x: - -#define ENTRY(y) _BEGIN_ENTRY; _ENTRY(_C_FUNC(y)); _END_ENTRY -#define TWOENTRY(y,z) _BEGIN_ENTRY; _ENTRY(_C_FUNC(y)); _ENTRY(_C_FUNC(z)); \ - _END_ENTRY -#define ASENTRY(y) _BEGIN_ENTRY; _ENTRY(_ASM_FUNC(y)); _END_ENTRY +#ifdef PROF +#define ENTRY(x,regs) \ + _GLOB(x);.align 2;_FUNC(x);.word regs;jsb mcount; +#else +#define ENTRY(x,regs) \ + _GLOB(x);.align 2;_FUNC(x);.word regs; +#endif #define ASMSTR .asciz -#endif /* !_SYS_ASM_H_ */ +#endif /* !_MACHINE_ASM_H_ */ diff --git a/sys/arch/vax/include/cpu.h b/sys/arch/vax/include/cpu.h index 184ab42faca0..7d245e89f73e 100644 --- a/sys/arch/vax/include/cpu.h +++ b/sys/arch/vax/include/cpu.h @@ -1,4 +1,4 @@ -/* $NetBSD: cpu.h,v 1.7 1995/03/30 20:42:55 ragge Exp $ */ +/* $NetBSD: cpu.h,v 1.8 1995/05/03 19:53:42 ragge Exp $ */ /* * Copyright (c) 1994 Ludd, University of Lule}, Sweden @@ -59,9 +59,6 @@ struct clockframe { int ps; }; -#if !defined(VAX630) && !defined(VAX410) -#define todr() mfpr(PR_TODR) -#endif #define setsoftnet() mtpr(12,PR_SIRR) #define setsoftclock() mtpr(8,PR_SIRR) diff --git a/sys/arch/vax/include/disklabel.h b/sys/arch/vax/include/disklabel.h index 984672b0123c..e1505c58f6c6 100644 --- a/sys/arch/vax/include/disklabel.h +++ b/sys/arch/vax/include/disklabel.h @@ -1,4 +1,4 @@ -/* $NetBSD: disklabel.h,v 1.1 1994/10/14 18:27:33 cgd Exp $ */ +/* $NetBSD: disklabel.h,v 1.2 1995/05/03 19:53:44 ragge Exp $ */ /* * Copyright (c) 1994 Christopher G. Demetriou @@ -39,8 +39,9 @@ #define RAW_PART 3 /* raw partition: xx?c (XXX) */ /* Just a dummy */ +#ifndef LOCORE struct cpu_disklabel { int cd_dummy; /* must have one element. */ }; - +#endif #endif /* _MACHINE_DISKLABEL_H_ */ diff --git a/sys/arch/vax/include/mtpr.h b/sys/arch/vax/include/mtpr.h index 3351b01ef807..6da155b2f69d 100644 --- a/sys/arch/vax/include/mtpr.h +++ b/sys/arch/vax/include/mtpr.h @@ -1,4 +1,4 @@ -/* $NetBSD: mtpr.h,v 1.4 1995/02/13 00:43:24 ragge Exp $ */ +/* $NetBSD: mtpr.h,v 1.5 1995/05/03 19:53:45 ragge Exp $ */ /* * Copyright (c) 1994 Ludd, University of Lule}, Sweden. @@ -57,7 +57,7 @@ #define PR_SBR 12 /* System Base Register */ #define PR_SLR 13 /* System Limit Register */ #define PR_PCBB 16 /* Process Control Block Base */ -#define PR_SCBB 17 /* System Control Block Base */ +#define PR_SCBB 17 /* System Control Block Base */ #define PR_IPL 18 /* Interrupt Priority Level */ #define PR_ASTLVL 19 /* AST Level */ #define PR_SIRR 20 /* Software Interrupt Request */ @@ -81,11 +81,24 @@ #define PR_MCESR 38 /* Machiune Check Error Summary Register 11/750 */ #define PR_CAER 39 /* Cache Error Register 11/750 */ #define PR_ACCS 40 /* Accelerator control register */ -#define PR_ACCR 41 /* Accelerator Maintenance register */ +#define PR_SAVISP 41 /* Console Saved ISP */ +#define PR_SAVPC 42 /* Console Saved PC */ +#define PR_SAVPSL 43 /* Console Saved PSL */ +#define PR_WCSA 44 /* WCS Address */ +#define PR_WCSB 45 /* WCS Data */ +#define PR_SBIFS 48 /* SBI Fault/Status */ +#define PR_SBIS 49 /* SBI Silo */ +#define PR_SBISC 50 /* SBI Silo Comparator */ +#define PR_SBIMT 51 /* SBI Silo Maintenance */ +#define PR_SBIER 52 /* SBI Error Register */ +#define PR_SBITA 53 /* SBI Timeout Address Register */ +#define PR_SBIQC 54 /* SBI Quadword Clear */ #define PR_IUR 55 /* Initialize Unibus Register 11/750 */ #define PR_MAPEN 56 /* Memory Management Enable */ #define PR_TBIA 57 /* Trans. Buf. Invalidate All */ #define PR_TBIS 58 /* Trans. Buf. Invalidate Single */ +#define PR_TBDATA 59 /* Translation Buffer Data */ +#define PR_MBRK 60 /* Microprogram Break */ #define PR_PMR 61 /* Performance Monnitor Enable */ #define PR_SID 62 /* System ID Register */ #define PR_TBCHK 63 /* Translation Buffer Check */ diff --git a/sys/arch/vax/include/param.h b/sys/arch/vax/include/param.h index ce0e993f5cd2..752ce4ce2f2b 100644 --- a/sys/arch/vax/include/param.h +++ b/sys/arch/vax/include/param.h @@ -1,4 +1,4 @@ -/* $NetBSD: param.h,v 1.7 1995/03/30 20:43:00 ragge Exp $ */ +/* $NetBSD: param.h,v 1.8 1995/05/03 19:53:46 ragge Exp $ */ /*- * Copyright (c) 1990 The Regents of the University of California. @@ -197,4 +197,9 @@ #define vmapbuf(p,q) #define vunmapbuf(p,q) +#if !defined(VAX630) && !defined(VAX410) +#define todr() mfpr(PR_TODR) +#endif +#define DELAY(x) {int N=todr()+(x/1000)+1;while(todr()!=N);} + #endif /* _VAX_PARAM_H_ */ diff --git a/sys/arch/vax/include/profile.h b/sys/arch/vax/include/profile.h index 6a783d0d78a7..b30569adb478 100644 --- a/sys/arch/vax/include/profile.h +++ b/sys/arch/vax/include/profile.h @@ -1,6 +1,6 @@ -/* $NetBSD: profile.h,v 1.2 1995/03/30 20:43:04 ragge Exp $ */ +/* $NetBSD: profile.h,v 1.3 1995/05/03 19:53:47 ragge Exp $ */ /* - * Copyright (c) 1995 Ludd, University of Lule}, Sweden. + * Copyright (c) 1992 The Regents of the University of California. * All rights reserved. * * Redistribution and use in source and binary forms, with or without @@ -13,46 +13,31 @@ * documentation and/or other materials provided with the distribution. * 3. All advertising materials mentioning features or use of this software * must display the following acknowledgement: - * This product includes software developed at Ludd, University of Lule}. - * 4. The name of the author may not be used to endorse or promote products - * derived from this software without specific prior written permission + * This product includes software developed by the University of + * California, Berkeley and its contributors. + * 4. Neither the name of the University nor the names of its contributors + * may be used to endorse or promote products derived from this software + * without specific prior written permission. * - * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR - * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES - * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. - * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, - * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT - * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, - * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY - * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT - * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF - * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND + * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE + * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE + * ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE + * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL + * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS + * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) + * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT + * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY + * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF + * SUCH DAMAGE. + * + * @(#)profile.h 7.1 (Berkeley) 7/16/92 */ - /* All bugs are subject to removal without further notice */ - - #define _MCOUNT_DECL static inline void _mcount #define MCOUNT \ -extern void mcount() asm("mcount"); \ -void \ -mcount() \ -{ \ - int selfpc, frompcindex; \ - /* \ - * find the return address for mcount, \ - * and the return address for mcount's caller. \ - * \ - * selfpc = pc pushed by mcount call \ - */ \ - asm("movl 0x10(fp),%0" : "=r" (selfpc)); \ - /* \ - * frompcindex = pc pushed by call into self. \ - */ \ - asm("movl 0xc(fp),%0;movl 0x10(%0),%0" : "=r" (frompcindex)); \ - _mcount(frompcindex, selfpc); \ -} +asm(".text; .globl mcount; mcount: pushl 16(fp); calls $1,__mcount; rsb"); #ifdef KERNEL /* @@ -62,4 +47,3 @@ mcount() \ #define MCOUNT_ENTER s = splhigh() #define MCOUNT_EXIT splx(s) #endif /* KERNEL */ - diff --git a/sys/arch/vax/include/trap.h b/sys/arch/vax/include/trap.h index 3466620feb37..728d6bd4e64f 100644 --- a/sys/arch/vax/include/trap.h +++ b/sys/arch/vax/include/trap.h @@ -1,4 +1,4 @@ -/* $NetBSD: trap.h,v 1.4 1995/02/13 00:43:32 ragge Exp $ */ +/* $NetBSD: trap.h,v 1.5 1995/05/03 19:53:48 ragge Exp $ */ /*- * Copyright (c) 1990 The Regents of the University of California. @@ -91,6 +91,12 @@ struct trapframe { int r3; int r4; int r5; + int r6; + int r7; + int r8; + int r9; + int r10; + int r11; int trap; /* Type of trap */ u_int code; /* Trap specific code */ u_int pc; /* User pc */