diff options
author | Per Fogelstrom <pefo@cvs.openbsd.org> | 2004-09-09 22:21:42 +0000 |
---|---|---|
committer | Per Fogelstrom <pefo@cvs.openbsd.org> | 2004-09-09 22:21:42 +0000 |
commit | 6c3ce8600ec35afdbb168a95bc787f1a247392a0 (patch) | |
tree | 8bbdd687c55e26c2328a5c3c96089c62e77b27ab /sys | |
parent | 3e2fc1bb21e67310e10ff7c7ea903a52d1d146c5 (diff) |
these should have gone in with the other 64 bit changes
Diffstat (limited to 'sys')
-rw-r--r-- | sys/arch/mips64/include/arcbios.h | 8 | ||||
-rw-r--r-- | sys/arch/mips64/include/asm.h | 35 | ||||
-rw-r--r-- | sys/arch/mips64/include/cpu.h | 19 | ||||
-rw-r--r-- | sys/arch/mips64/include/cpustate.h | 36 | ||||
-rw-r--r-- | sys/arch/mips64/include/db_machdep.h | 3 | ||||
-rw-r--r-- | sys/arch/mips64/include/param.h | 17 | ||||
-rw-r--r-- | sys/arch/mips64/include/regdef.h | 21 | ||||
-rw-r--r-- | sys/arch/mips64/include/vmparam.h | 4 |
8 files changed, 84 insertions, 59 deletions
diff --git a/sys/arch/mips64/include/arcbios.h b/sys/arch/mips64/include/arcbios.h index 8afec23d466..5efb4947d02 100644 --- a/sys/arch/mips64/include/arcbios.h +++ b/sys/arch/mips64/include/arcbios.h @@ -1,4 +1,4 @@ -/* $OpenBSD: arcbios.h,v 1.4 2004/08/15 10:36:17 pefo Exp $ */ +/* $OpenBSD: arcbios.h,v 1.5 2004/09/09 22:21:41 pefo Exp $ */ /*- * Copyright (c) 1996 M. Warner Losh. All rights reserved. * @@ -108,7 +108,7 @@ typedef struct arc_config u_int32_t affinity_mask; u_int32_t config_data_len; u_int32_t id_len; - char *id; + int32_t id; } arc_config_t; typedef enum arc_status @@ -340,7 +340,11 @@ typedef struct arc_param_blk /**/ caddr_t adapter0_vect; /* ?? */ } arc_param_blk_t; +#ifdef _LP64 +#define ArcBiosBase ((arc_param_blk_t *) 0xffffffff80001000) +#else #define ArcBiosBase ((arc_param_blk_t *) 0x80001000) +#endif #define ArcBios (ArcBiosBase->firmware_vect) diff --git a/sys/arch/mips64/include/asm.h b/sys/arch/mips64/include/asm.h index 895c0417b01..d403fd67ac5 100644 --- a/sys/arch/mips64/include/asm.h +++ b/sys/arch/mips64/include/asm.h @@ -1,4 +1,4 @@ -/* $OpenBSD: asm.h,v 1.3 2004/08/10 21:10:56 pefo Exp $ */ +/* $OpenBSD: asm.h,v 1.4 2004/09/09 22:21:41 pefo Exp $ */ /* * Copyright (c) 2001-2002 Opsycon AB (www.opsycon.se / www.opsycon.com) @@ -97,6 +97,8 @@ #define SAVE_GP(x) \ .cprestore x +#define SETUP_GP64(gpoff, name) +#define RESTORE_GP64 #endif #if (_MIPS_SIM == _ABI64) || (_MIPS_SIM == _ABIN32) @@ -104,20 +106,25 @@ #define SETUP_GP #define SAVE_GP(x) +#define SETUP_GP64(gpoff, name) \ + .cpsetup t9, gpoff, name +#define RESTORE_GP64 \ + .cpreturn #endif +#define MKFSIZ(narg,locals) (((narg+locals)*REGSZ+31)&(~31)) + #else /* defined(ABICALLS) && !defined(_KERNEL) */ #define NARGSAVE 4 #define SETUP_GP #define SAVE_GP(x) -#endif - #define ALIGNSZ 16 /* Stack layout alignment */ - #define FRAMESZ(sz) (((sz) + (ALIGNSZ-1)) & ~(ALIGNSZ-1)) +#endif + /* * Basic register operations based on selected ISA */ @@ -129,7 +136,6 @@ #define CF_SZ 24 /* Call frame size */ #define CF_ARGSZ 16 /* Call frame arg size */ #define CF_RA_OFFS 20 /* Call ra save offset */ -#define _MIPS_SZPTR 32 #endif #if (_MIPS_ISA == _MIPS_ISA_MIPS3 || _MIPS_ISA == _MIPS_ISA_MIPS4) @@ -140,10 +146,9 @@ #define CF_SZ 48 /* Call frame size (multiple of ALIGNSZ) */ #define CF_ARGSZ 32 /* Call frame arg size */ #define CF_RA_OFFS 40 /* Call ra save offset */ -#define _MIPS_SZPTR 64 #endif -#if (_MIPS_SZPTR == 32) +#ifndef __LP64__ #define PTR_L lw #define PTR_S sw #define PTR_SUB sub @@ -155,9 +160,7 @@ #define PTR_SLL sll #define PTR_SRL srl #define PTR_VAL .word -#endif - -#if (_MIPS_SZPTR == 64) +#else #define PTR_L ld #define PTR_S sd #define PTR_ADD dadd @@ -194,16 +197,16 @@ #endif /* - * LEAF(x) + * LEAF(x, fsize) * * Declare a leaf routine. */ -#define LEAF(x) \ +#define LEAF(x, fsize) \ .align 3; \ .globl x; \ .ent x, 0; \ x: ; \ - .frame sp, 0, ra; \ + .frame sp, fsize, ra; \ SETUP_GP \ MCOUNT @@ -216,12 +219,12 @@ x: * * Declare a non-profiled leaf routine. */ -#define NLEAF(x) \ +#define NLEAF(x, fsize) \ .align 3; \ .globl x; \ .ent x, 0; \ x: ; \ - .frame sp, 0, ra; \ + .frame sp, fsize, ra; \ SETUP_GP /* @@ -264,7 +267,7 @@ x: ; \ * Macros to panic and printf from assembly language. */ #define PANIC(msg) \ - la a0, 9f; \ + LA a0, 9f; \ jal panic; \ nop ; \ MSG(msg) diff --git a/sys/arch/mips64/include/cpu.h b/sys/arch/mips64/include/cpu.h index 7c24e6d6756..087f5899398 100644 --- a/sys/arch/mips64/include/cpu.h +++ b/sys/arch/mips64/include/cpu.h @@ -1,4 +1,4 @@ -/* $OpenBSD: cpu.h,v 1.4 2004/08/15 12:07:28 pefo Exp $ */ +/* $OpenBSD: cpu.h,v 1.5 2004/09/09 22:21:41 pefo Exp $ */ /*- * Copyright (c) 1992, 1993 @@ -51,10 +51,17 @@ #include <machine/psl.h> +#ifdef __LP64__ #define KSEG0_BASE 0xffffffff80000000 #define KSEG1_BASE 0xffffffffa0000000 #define KSSEG_BASE 0xffffffffc0000000 #define KSEG3_BASE 0xffffffffe0000000 +#else +#define KSEG0_BASE 0x80000000 +#define KSEG1_BASE 0xa0000000 +#define KSSEG_BASE 0xc0000000 +#define KSEG3_BASE 0xe0000000 +#endif #define KSEG_SIZE 0x20000000 #define KSEG0_TO_PHYS(x) ((u_long)(x) & 0x1fffffff) @@ -157,11 +164,11 @@ /* * Location of exception vectors. */ -#define RESET_EXC_VEC 0xffffffffbfc00000 -#define TLB_MISS_EXC_VEC 0xffffffff80000000 -#define XTLB_MISS_EXC_VEC 0xffffffff80000080 -#define CACHE_ERR_EXC_VEC 0xffffffff80000100 -#define GEN_EXC_VEC 0xffffffff80000180 +#define RESET_EXC_VEC (KSEG0_BASE + 0x3fc00000) +#define TLB_MISS_EXC_VEC (KSEG0_BASE + 0x00000000) +#define XTLB_MISS_EXC_VEC (KSEG0_BASE + 0x00000080) +#define CACHE_ERR_EXC_VEC (KSEG0_BASE + 0x00000100) +#define GEN_EXC_VEC (KSEG0_BASE + 0x00000180) /* * Coprocessor 0 registers: diff --git a/sys/arch/mips64/include/cpustate.h b/sys/arch/mips64/include/cpustate.h index 96c46597835..ea6eba697d1 100644 --- a/sys/arch/mips64/include/cpustate.h +++ b/sys/arch/mips64/include/cpustate.h @@ -1,4 +1,4 @@ -/* $OpenBSD: cpustate.h,v 1.3 2004/08/10 21:10:56 pefo Exp $ */ +/* $OpenBSD: cpustate.h,v 1.4 2004/09/09 22:21:41 pefo Exp $ */ /* * Copyright (c) 2002-2003 Opsycon AB (www.opsycon.se / www.opsycon.com) @@ -42,6 +42,8 @@ * a1 will have saved STATUS_REG on return. * a3 will have the exception pc on 'return'. * No traps, no interrupts if frame = k1 or k0! + * Temp regs are saved with their register number so + * branch emulation etc works properly. */ #define SAVE_CPU(frame, bo) \ SAVE_REG(AT, AST, frame, bo) ;\ @@ -51,14 +53,14 @@ SAVE_REG(a1, A1, frame, bo) ;\ SAVE_REG(a2, A2, frame, bo) ;\ SAVE_REG(a3, A3, frame, bo) ;\ - SAVE_REG(t0, T0, frame, bo) ;\ - SAVE_REG(t1, T1, frame, bo) ;\ - SAVE_REG(t2, T2, frame, bo) ;\ - SAVE_REG(t3, T3, frame, bo) ;\ - SAVE_REG(t4, T4, frame, bo) ;\ - SAVE_REG(t5, T5, frame, bo) ;\ - SAVE_REG(t6, T6, frame, bo) ;\ - SAVE_REG(t7, T7, frame, bo) ;\ + SAVE_REG($8, T0, frame, bo) ;\ + SAVE_REG($9, T1, frame, bo) ;\ + SAVE_REG($10, T2, frame, bo) ;\ + SAVE_REG($11, T3, frame, bo) ;\ + SAVE_REG($12, T4, frame, bo) ;\ + SAVE_REG($13, T5, frame, bo) ;\ + SAVE_REG($14, T6, frame, bo) ;\ + SAVE_REG($15 T7, frame, bo) ;\ SAVE_REG(t8, T8, frame, bo) ;\ SAVE_REG(t9, T9, frame, bo) ;\ SAVE_REG(gp, GP, frame, bo) ;\ @@ -112,14 +114,14 @@ RESTORE_REG(a1, A1, frame, bo) ;\ RESTORE_REG(a2, A2, frame, bo) ;\ RESTORE_REG(a3, A3, frame, bo) ;\ - RESTORE_REG(t0, T0, frame, bo) ;\ - RESTORE_REG(t1, T1, frame, bo) ;\ - RESTORE_REG(t2, T2, frame, bo) ;\ - RESTORE_REG(t3, T3, frame, bo) ;\ - RESTORE_REG(t4, T4, frame, bo) ;\ - RESTORE_REG(t5, T5, frame, bo) ;\ - RESTORE_REG(t6, T6, frame, bo) ;\ - RESTORE_REG(t7, T7, frame, bo) ;\ + RESTORE_REG($8, T0, frame, bo) ;\ + RESTORE_REG($9, T1, frame, bo) ;\ + RESTORE_REG($10, T2, frame, bo) ;\ + RESTORE_REG($11, T3, frame, bo) ;\ + RESTORE_REG($12, T4, frame, bo) ;\ + RESTORE_REG($13, T5, frame, bo) ;\ + RESTORE_REG($14, T6, frame, bo) ;\ + RESTORE_REG($15, T7, frame, bo) ;\ RESTORE_REG(t8, T8, frame, bo) ;\ RESTORE_REG(t9, T9, frame, bo) ;\ RESTORE_REG(gp, GP, frame, bo) ;\ diff --git a/sys/arch/mips64/include/db_machdep.h b/sys/arch/mips64/include/db_machdep.h index 731ec862147..090c09b024c 100644 --- a/sys/arch/mips64/include/db_machdep.h +++ b/sys/arch/mips64/include/db_machdep.h @@ -1,4 +1,4 @@ -/* $OpenBSD: db_machdep.h,v 1.3 2004/08/10 20:28:13 deraadt Exp $ */ +/* $OpenBSD: db_machdep.h,v 1.4 2004/09/09 22:21:41 pefo Exp $ */ /* * Copyright (c) 1998-2003 Opsycon AB (www.opsycon.se) @@ -36,7 +36,6 @@ #define DB_MACHINE_COMMANDS /* We have machine specific commands */ #define DB_ELF_SYMBOLS /* Elf style symbol table support */ #define DB_NO_AOUT /* For crying out loud! */ -#define DB_ELFSIZE 32 /* This is the size of symtab stuff */ typedef struct trap_frame db_regs_t; db_regs_t ddb_regs; diff --git a/sys/arch/mips64/include/param.h b/sys/arch/mips64/include/param.h index 303fc110592..35779a1f785 100644 --- a/sys/arch/mips64/include/param.h +++ b/sys/arch/mips64/include/param.h @@ -1,4 +1,4 @@ -/* $OpenBSD: param.h,v 1.3 2004/08/10 20:28:13 deraadt Exp $ */ +/* $OpenBSD: param.h,v 1.4 2004/09/09 22:21:41 pefo Exp $ */ /* * Copyright (c) 1988 University of Utah. @@ -75,7 +75,7 @@ #define SEGOFSET (NBSEG-1) /* byte offset into segment */ #define SEGSHIFT 22 /* LOG2(NBSEG) */ -#if (_MIPS_SZPTR == 64) +#ifdef __LP64__ #define KERNBASE 0xffffffff80000000L /* start of kernel virtual */ #else #define KERNBASE 0x80000000 /* start of kernel virtual */ @@ -91,24 +91,15 @@ #define SSIZE 1 /* initial stack size/NBPG */ #define SINCR 1 /* increment of stack/NBPG */ -#if (_MIPS_SZPTR == 64) -#define UPAGES 4 /* pages of u-area */ +#ifdef __LP64__ +#define UPAGES 4 /* pages of u-area */ #else #define UPAGES 2 /* pages of u-area */ #endif -#if 0 -#define UVPN (UADDR>>PGSHIFT)/* virtual page number of u */ -#define KERNELSTACK (UADDR+UPAGES*NBPG) /* top of kernel stack */ -#define UADDR 0xffffc000 /* address of u */ -#define UADDR 0xffffffffffffa000 /* address of u */ -#endif - #define USPACE (UPAGES*NBPG) /* size of u-area in bytes */ #define USPACE_ALIGN (2*NBPG) /* u-area alignment 0-none */ -#define PMAP_NEW - /* * Constants related to network buffer management. * MCLBYTES must be no larger than PAGE_SIZE (the software page size), and, diff --git a/sys/arch/mips64/include/regdef.h b/sys/arch/mips64/include/regdef.h index eec78c9b745..2b21ccd5751 100644 --- a/sys/arch/mips64/include/regdef.h +++ b/sys/arch/mips64/include/regdef.h @@ -1,4 +1,4 @@ -/* $OpenBSD: regdef.h,v 1.1 2004/08/06 20:56:02 pefo Exp $ */ +/* $OpenBSD: regdef.h,v 1.2 2004/09/09 22:21:41 pefo Exp $ */ /* * Copyright (c) 1992, 1993 @@ -49,6 +49,20 @@ #define a1 $5 #define a2 $6 #define a3 $7 +#if defined(__mips_n32) || defined(__mips_n64) +#define a4 $8 /* expanded register arguments */ +#define a5 $9 +#define a6 $10 +#define a7 $11 +#define ta0 $8 /* alias */ +#define ta1 $9 +#define ta2 $10 +#define ta3 $11 +#define t0 $12 /* temp registers (not saved across subroutine calls) */ +#define t1 $13 +#define t2 $14 +#define t3 $15 +#else #define t0 $8 /* temp registers (not saved across subroutine calls) */ #define t1 $9 #define t2 $10 @@ -57,6 +71,11 @@ #define t5 $13 #define t6 $14 #define t7 $15 +#define ta0 $12 /* alias */ +#define ta1 $13 +#define ta2 $14 +#define ta3 $15 +#endif #define s0 $16 /* saved across subroutine calls (callee saved) */ #define s1 $17 #define s2 $18 diff --git a/sys/arch/mips64/include/vmparam.h b/sys/arch/mips64/include/vmparam.h index 613ea017150..7484d6832dd 100644 --- a/sys/arch/mips64/include/vmparam.h +++ b/sys/arch/mips64/include/vmparam.h @@ -1,4 +1,4 @@ -/* $OpenBSD: vmparam.h,v 1.3 2004/09/09 10:25:50 miod Exp $ */ +/* $OpenBSD: vmparam.h,v 1.4 2004/09/09 22:21:41 pefo Exp $ */ /* $NetBSD: vmparam.h,v 1.5 1994/10/26 21:10:10 cgd Exp $ */ /* @@ -107,7 +107,7 @@ /* user/kernel map constants */ -#if (_MIPS_SZPTR == 64) +#ifdef __LP64__ #define VM_MIN_ADDRESS ((vaddr_t)0x0000000000000000L) #define VM_MAXUSER_ADDRESS ((vaddr_t)0x0000000080000000L) #define VM_MAX_ADDRESS ((vaddr_t)0x0000000080000000L) |