Module Name: src
Committed By: matt
Date: Sun Aug 16 03:33:58 UTC 2009
Modified Files:
src/sys/arch/mips/include [matt-nb5-mips64]: cdefs.h elf_machdep.h
isa_machdep.h locore.h mcontext.h pci_machdep.h psl.h regnum.h
setjmp.h signal.h stdarg.h types.h
Log Message:
Kill use of _MIPS_BSD_ABI - switch to __mips_<abi>
Use device_t where appropriate.
Remove magic numbers.
To generate a diff of this commit:
cvs rdiff -u -r1.12 -r1.12.78.1 src/sys/arch/mips/include/cdefs.h
cvs rdiff -u -r1.10 -r1.10.96.1 src/sys/arch/mips/include/elf_machdep.h
cvs rdiff -u -r1.3 -r1.3.18.1 src/sys/arch/mips/include/isa_machdep.h
cvs rdiff -u -r1.78.36.1 -r1.78.36.1.2.1 src/sys/arch/mips/include/locore.h
cvs rdiff -u -r1.8 -r1.8.18.1 src/sys/arch/mips/include/mcontext.h
cvs rdiff -u -r1.4 -r1.4.96.1 src/sys/arch/mips/include/pci_machdep.h
cvs rdiff -u -r1.17 -r1.17.96.1 src/sys/arch/mips/include/psl.h
cvs rdiff -u -r1.8 -r1.8.96.1 src/sys/arch/mips/include/regnum.h
cvs rdiff -u -r1.7 -r1.7.138.1 src/sys/arch/mips/include/setjmp.h
cvs rdiff -u -r1.27 -r1.27.92.1 src/sys/arch/mips/include/signal.h
cvs rdiff -u -r1.28 -r1.28.14.1 src/sys/arch/mips/include/stdarg.h
cvs rdiff -u -r1.43 -r1.43.36.1 src/sys/arch/mips/include/types.h
Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.
Modified files:
Index: src/sys/arch/mips/include/cdefs.h
diff -u src/sys/arch/mips/include/cdefs.h:1.12 src/sys/arch/mips/include/cdefs.h:1.12.78.1
--- src/sys/arch/mips/include/cdefs.h:1.12 Sun Aug 27 19:04:30 2006
+++ src/sys/arch/mips/include/cdefs.h Sun Aug 16 03:33:57 2009
@@ -1,4 +1,4 @@
-/* $NetBSD: cdefs.h,v 1.12 2006/08/27 19:04:30 matt Exp $ */
+/* $NetBSD: cdefs.h,v 1.12.78.1 2009/08/16 03:33:57 matt Exp $ */
/*
* Copyright (c) 1995 Carnegie-Mellon University.
@@ -30,6 +30,9 @@
#ifndef _MIPS_CDEFS_H_
#define _MIPS_CDEFS_H_
+/*
+ * These are depreciated. Use __mips_{o32,o64,n32,n64} instead.
+ */
/* MIPS Subprogram Interface Model */
#define _MIPS_SIM_ABIX32 4 /* 64 bit safe, ILP32 o32 model */
#define _MIPS_SIM_ABI64 3
Index: src/sys/arch/mips/include/elf_machdep.h
diff -u src/sys/arch/mips/include/elf_machdep.h:1.10 src/sys/arch/mips/include/elf_machdep.h:1.10.96.1
--- src/sys/arch/mips/include/elf_machdep.h:1.10 Sun Dec 11 12:18:09 2005
+++ src/sys/arch/mips/include/elf_machdep.h Sun Aug 16 03:33:57 2009
@@ -1,4 +1,4 @@
-/* $NetBSD: elf_machdep.h,v 1.10 2005/12/11 12:18:09 christos Exp $ */
+/* $NetBSD: elf_machdep.h,v 1.10.96.1 2009/08/16 03:33:57 matt Exp $ */
#define ELF32_MACHDEP_ID_CASES \
case EM_MIPS: \
@@ -62,10 +62,34 @@
#define R_MIPS_ADD_IMMEDIATE 34
#define R_MIPS_PJUMP 35
#define R_MIPS_RELGOT 36
+#define R_MIPS_JALR 37
+/* TLS relocations */
+#define R_MIPS_TLS_DTPMOD32 38
+#define R_MIPS_TLS_DTPREL32 39
+#define R_MIPS_TLS_DTPMOD64 40
+#define R_MIPS_TLS_DTPREL64 41
+#define R_MIPS_TLS_GD 42
+#define R_MIPS_TLS_LDM 43
+#define R_MIPS_TLS_DTPREL_HI16 44
+#define R_MIPS_TLS_DTPREL_LO16 45
+#define R_MIPS_TLS_GOTTPREL 46
+#define R_MIPS_TLS_TPREL32 47
+#define R_MIPS_TLS_TPREL64 48
+#define R_MIPS_TLS_TPREL_HI16 49
+#define R_MIPS_TLS_TPREL_LO16 50
-#define R_MIPS_max 37
+#define R_MIPS_max 51
#define R_TYPE(name) __CONCAT(R_MIPS_,name)
+#define R_MIPS16_min 100
+#define R_MIPS16_26 100
+#define R_MIPS16_GPREL 101
+#define R_MIPS16_GOT16 102
+#define R_MIPS16_CALL16 103
+#define R_MIPS16_HI16 104
+#define R_MIPS16_LO16 105
+#define R_MIPS16_max 106
+
/* mips dynamic tags */
@@ -86,6 +110,34 @@
#define DT_MIPS_HIPAGENO 0x70000014
#define DT_MIPS_RLD_MAP 0x70000016 /* address of loader map */
+/*
+ * ELF Flags
+ */
+#define EF_MIPS_PIC 0x00000002 /* Contains PIC code */
+#define EF_MIPS_CPIC 0x00000004 /* STD PIC calling sequence */
+#define EF_MIPS_ABI2 0x00000020 /* N32 */
+
+#define EF_MIPS_ARCH_ASE 0x0f000000 /* Architectural extensions */
+#define EF_MIPS_ARCH_MDMX 0x08000000 /* MDMX multimedia extension */
+#define EF_MIPS_ARCH_M16 0x04000000 /* MIPS-16 ISA extensions */
+
+#define EF_MIPS_ARCH 0x0f000000 /* Architecture field */
+#define EF_MIPS_ARCH_1 0x00000000 /* -mips1 code */
+#define EF_MIPS_ARCH_2 0x01000000 /* -mips2 code */
+#define EF_MIPS_ARCH_3 0x02000000 /* -mips3 code */
+#define EF_MIPS_ARCH_4 0x03000000 /* -mips4 code */
+#define EF_MIPS_ARCH_5 0x04000000 /* -mips5 code */
+#define EF_MIPS_ARCH_32 0x05000000 /* -mips32 code */
+#define EF_MIPS_ARCH_64 0x06000000 /* -mips64 code */
+#define EF_MIPS_ARCH_32R2 0x07000000 /* -mips32r2 code */
+#define EF_MIPS_ARCH_64R4 0x08000000 /* -mips64r2 code */
+
+#define EF_MIPS_ABI 0x0000f000
+#define EF_MIPS_ABI_O32 0x00001000
+#define EF_MIPS_ABI_O64 0x00002000
+#define EF_MIPS_ABI_EABI32 0x00003000
+#define EF_MIPS_ABI_EABI64 0x00004000
+
#ifdef _KERNEL
#ifdef _KERNEL_OPT
#include "opt_compat_netbsd.h"
Index: src/sys/arch/mips/include/isa_machdep.h
diff -u src/sys/arch/mips/include/isa_machdep.h:1.3 src/sys/arch/mips/include/isa_machdep.h:1.3.18.1
--- src/sys/arch/mips/include/isa_machdep.h:1.3 Mon Apr 28 20:23:28 2008
+++ src/sys/arch/mips/include/isa_machdep.h Sun Aug 16 03:33:57 2009
@@ -1,4 +1,4 @@
-/* $NetBSD: isa_machdep.h,v 1.3 2008/04/28 20:23:28 martin Exp $ */
+/* $NetBSD: isa_machdep.h,v 1.3.18.1 2009/08/16 03:33:57 matt Exp $ */
/*-
* Copyright (c) 2000, 2001 The NetBSD Foundation, Inc.
@@ -68,7 +68,7 @@
struct isa_dma_state ic_dmastate;
- void (*ic_attach_hook)(struct device *, struct device *,
+ void (*ic_attach_hook)(device_t, device_t,
struct isabus_attach_args *);
const struct evcnt *(*ic_intr_evcnt)(void *, int);
void *(*ic_intr_establish)(void *, int, int, int,
Index: src/sys/arch/mips/include/locore.h
diff -u src/sys/arch/mips/include/locore.h:1.78.36.1 src/sys/arch/mips/include/locore.h:1.78.36.1.2.1
--- src/sys/arch/mips/include/locore.h:1.78.36.1 Tue Jun 9 17:48:20 2009
+++ src/sys/arch/mips/include/locore.h Sun Aug 16 03:33:57 2009
@@ -1,4 +1,4 @@
-/* $NetBSD: locore.h,v 1.78.36.1 2009/06/09 17:48:20 snj Exp $ */
+/* $NetBSD: locore.h,v 1.78.36.1.2.1 2009/08/16 03:33:57 matt Exp $ */
/*
* Copyright 1996 The Board of Trustees of The Leland Stanford
@@ -138,8 +138,73 @@
void mips3_cp0_wired_write(uint32_t);
void mips3_cp0_pg_mask_write(uint32_t);
-uint64_t mips3_ld(uint64_t *);
+#if defined(__GNUC__) && !defined(__mips_o32)
+static inline uint64_t
+mips3_ld(const uint64_t *va)
+{
+ uint64_t rv;
+#if defined(__mips_o32)
+ uint32_t sr;
+
+ sr = mips_cp0_status_read();
+ mips_cp0_status_write(sr & ~MIPS_SR_INT_IE);
+
+ __asm volatile(
+ ".set push \n\t"
+ ".set mips3 \n\t"
+ ".set noreorder \n\t"
+ ".set noat \n\t"
+ "ld %M0,0(%1) \n\t"
+ "dsll32 %L0,%M0,0 \n\t"
+ "dsra32 %M0,%M0,0 \n\t" /* high word */
+ "dsra32 %L0,%L0,0 \n\t" /* low word */
+ "ld %0,0(%1) \n\t"
+ ".set pop"
+ : "=d"(rv)
+ : "r"(va));
+
+ mips_cp0_status_write(sr);
+#elif defined(_LP64)
+ rv = *va;
+#else
+ __asm volatile("ld %0,0(%1)" : "=d"(rv) : "r"(va));
+#endif
+
+ return rv;
+}
+static inline void
+mips3_sd(uint64_t *va, uint64_t v)
+{
+#if defined(__mips_o32)
+ uint32_t sr;
+
+ sr = mips_cp0_status_read();
+ mips_cp0_status_write(sr & ~MIPS_SR_INT_IE);
+
+ __asm volatile(
+ ".set push \n\t"
+ ".set mips3 \n\t"
+ ".set noreorder \n\t"
+ ".set noat \n\t"
+ "dsll32 %M0,%M0,0 \n\t"
+ "dsll32 %L0,%L0,0 \n\t"
+ "dsrl32 %L0,%L0,0 \n\t"
+ "or %0,%L0,%M0 \n\t"
+ "sd %0,0(%1) \n\t"
+ ".set pop"
+ : "=d"(v) : "0"(v), "r"(va));
+
+ mips_cp0_status_write(sr);
+#elif defined(_LP64)
+ *va = v;
+#else
+ __asm volatile("sd %0,0(%1)" :: "r"(v), "r"(va));
+#endif
+}
+#else
+uint64_t mips3_ld(uint64_t *va);
void mips3_sd(uint64_t *, uint64_t);
+#endif /* __GNUC__ */
#endif /* MIPS3 || MIPS4 || MIPS32 || MIPS64 */
#if defined(MIPS3) || defined(MIPS4) || defined(MIPS64)
@@ -151,58 +216,66 @@
static __inline uint32_t
mips3_lw_a64(uint64_t addr)
{
- uint32_t addrlo, addrhi;
uint32_t rv;
+#if defined(__mips_o32)
uint32_t sr;
sr = mips_cp0_status_read();
- mips_cp0_status_write(sr | MIPS3_SR_KX);
+ mips_cp0_status_write((sr & ~MIPS_SR_INT_IE) | MIPS3_SR_KX);
- addrlo = addr & 0xffffffff;
- addrhi = addr >> 32;
- __asm volatile (" \n\
- .set push \n\
- .set mips3 \n\
- .set noreorder \n\
- .set noat \n\
- dsll32 $3, %1, 0 \n\
- dsll32 $1, %2, 0 \n\
- dsrl32 $3, $3, 0 \n\
- or $1, $1, $3 \n\
- lw %0, 0($1) \n\
- .set pop \n\
- " : "=r"(rv) : "r"(addrlo), "r"(addrhi) : "$1", "$3" );
+ __asm volatile (
+ ".set push \n\t"
+ ".set mips3 \n\t"
+ ".set noreorder \n\t"
+ ".set noat \n\t"
+ "dsll32 %M1,%M1,0 \n\t"
+ "dsll32 %L1,%L1,0 \n\t"
+ "dsrl32 $L1,%L1,0 \n\t"
+ "or %1,%M1,%L1 \n\t"
+ "lw %0, 0(%1) \n\t"
+ ".set pop"
+ : "=r"(rv), "=d"(addr)
+ : "1"(addr)
+ );
mips_cp0_status_write(sr);
-
+#elif defined(_LP64)
+ rv = *(const uint32_t *)addr;
+#else
+ __asm volatile("lw %0, 0(%1)" : "=r"(rv) : "d"(addr));
+#endif
return (rv);
}
static __inline void
mips3_sw_a64(uint64_t addr, uint32_t val)
{
- uint32_t addrlo, addrhi;
+#if defined(__mips_o32)
uint32_t sr;
sr = mips_cp0_status_read();
- mips_cp0_status_write(sr | MIPS3_SR_KX);
+ mips_cp0_status_write((sr & ~MIPS_SR_INT_IE) | MIPS3_SR_KX);
- addrlo = addr & 0xffffffff;
- addrhi = addr >> 32;
- __asm volatile (" \n\
- .set push \n\
- .set mips3 \n\
- .set noreorder \n\
- .set noat \n\
- dsll32 $3, %1, 0 \n\
- dsll32 $1, %2, 0 \n\
- dsrl32 $3, $3, 0 \n\
- or $1, $1, $3 \n\
- sw %0, 0($1) \n\
- .set pop \n\
- " : : "r"(val), "r"(addrlo), "r"(addrhi) : "$1", "$3" );
+ __asm volatile (
+ ".set push \n\t"
+ ".set mips3 \n\t"
+ ".set noreorder \n\t"
+ ".set noat \n\t"
+ "dsll32 %M0,%M0,0 \n\t"
+ "dsll32 %L0,%L0,0 \n\t"
+ "dsrl32 $L0,%L0,0 \n\t"
+ "or %0,%M0,%L0 \n\t"
+ "sw %1, 0(%0) \n\t"
+ ".set pop"
+ : "=d"(addr): "r"(val), "0"(addr)
+ );
mips_cp0_status_write(sr);
+#elif defined(_LP64)
+ *(uint32_t *)addr = val;
+#else
+ __asm volatile("sw %1, 0(%0)" :: "d"(addr), "r"(val));
+#endif
}
#endif /* MIPS3 || MIPS4 || MIPS64 */
@@ -395,8 +468,15 @@
*/
struct kernframe {
+#if defined(__mips_o32) || defined(__mips_o64)
register_t cf_args[4 + 1];
+#if defined(__mips_o32)
register_t cf_pad; /* (for 8 word alignment) */
+#endif
+#endif
+#if defined(__mips_n32) || defined(__mips_n64)
+ register_t cf_args[8 + 1];
+#endif
register_t cf_sp;
register_t cf_ra;
struct trapframe cf_frame;
Index: src/sys/arch/mips/include/mcontext.h
diff -u src/sys/arch/mips/include/mcontext.h:1.8 src/sys/arch/mips/include/mcontext.h:1.8.18.1
--- src/sys/arch/mips/include/mcontext.h:1.8 Mon Apr 28 20:23:28 2008
+++ src/sys/arch/mips/include/mcontext.h Sun Aug 16 03:33:58 2009
@@ -1,4 +1,4 @@
-/* $NetBSD: mcontext.h,v 1.8 2008/04/28 20:23:28 martin Exp $ */
+/* $NetBSD: mcontext.h,v 1.8.18.1 2009/08/16 03:33:58 matt Exp $ */
/*-
* Copyright (c) 1999, 2002 The NetBSD Foundation, Inc.
@@ -129,15 +129,6 @@
#define _UC_MACHINE_PAD 16 /* Padding appended to ucontext_t */
-/*
- * Offsets relative to ucontext_t; intended to be used by assembly stubs.
- */
-#if !defined(_MIPS_BSD_API) || _MIPS_BSD_API == _MIPS_BSD_API_LP32
-#define _OFFSETOF_UC_GREGS 40
-#else
-#define _OFFSETOF_UC_GREGS 56
-#endif
-
#define _UC_SETSTACK 0x00010000
#define _UC_CLRSTACK 0x00020000
Index: src/sys/arch/mips/include/pci_machdep.h
diff -u src/sys/arch/mips/include/pci_machdep.h:1.4 src/sys/arch/mips/include/pci_machdep.h:1.4.96.1
--- src/sys/arch/mips/include/pci_machdep.h:1.4 Sun Dec 11 12:18:09 2005
+++ src/sys/arch/mips/include/pci_machdep.h Sun Aug 16 03:33:58 2009
@@ -1,4 +1,4 @@
-/* $NetBSD: pci_machdep.h,v 1.4 2005/12/11 12:18:09 christos Exp $ */
+/* $NetBSD: pci_machdep.h,v 1.4.96.1 2009/08/16 03:33:58 matt Exp $ */
/*
* Copyright (c) 1996 Carnegie-Mellon University.
@@ -50,8 +50,8 @@
*/
struct mips_pci_chipset {
void *pc_conf_v;
- void (*pc_attach_hook)(struct device *,
- struct device *, struct pcibus_attach_args *);
+ void (*pc_attach_hook)(device_t, device_t,
+ struct pcibus_attach_args *);
int (*pc_bus_maxdevs)(void *, int);
pcitag_t (*pc_make_tag)(void *, int, int, int);
void (*pc_decompose_tag)(void *, pcitag_t, int *,
@@ -73,7 +73,7 @@
#ifdef __HAVE_PCIIDE_MACHDEP_COMPAT_INTR_ESTABLISH
void *(*pc_pciide_compat_intr_establish)(void *,
- struct device *, struct pci_attach_args *, int,
+ device_t, struct pci_attach_args *, int,
int (*)(void *), void *);
#endif
};
Index: src/sys/arch/mips/include/psl.h
diff -u src/sys/arch/mips/include/psl.h:1.17 src/sys/arch/mips/include/psl.h:1.17.96.1
--- src/sys/arch/mips/include/psl.h:1.17 Sun Dec 11 12:18:09 2005
+++ src/sys/arch/mips/include/psl.h Sun Aug 16 03:33:58 2009
@@ -1,4 +1,4 @@
-/* $NetBSD: psl.h,v 1.17 2005/12/11 12:18:09 christos Exp $ */
+/* $NetBSD: psl.h,v 1.17.96.1 2009/08/16 03:33:58 matt Exp $ */
/*
* Copyright (c) 1992, 1993
@@ -47,7 +47,7 @@
*/
#define MIPS3_PSL_LOWIPL (MIPS3_INT_MASK | MIPS_SR_INT_IE)
-#if defined(_MIPS_BSD_API) && _MIPS_BSD_API != _MIPS_BSD_API_LP32
+#if !defined(__mips_o32)
#define MIPS3_PSL_XFLAGS (MIPS3_SR_XX | MIPS3_SR_UX)
#else
#define MIPS3_PSL_XFLAGS (0)
Index: src/sys/arch/mips/include/regnum.h
diff -u src/sys/arch/mips/include/regnum.h:1.8 src/sys/arch/mips/include/regnum.h:1.8.96.1
--- src/sys/arch/mips/include/regnum.h:1.8 Sun Dec 11 12:18:09 2005
+++ src/sys/arch/mips/include/regnum.h Sun Aug 16 03:33:58 2009
@@ -1,4 +1,4 @@
-/* $NetBSD: regnum.h,v 1.8 2005/12/11 12:18:09 christos Exp $ */
+/* $NetBSD: regnum.h,v 1.8.96.1 2009/08/16 03:33:58 matt Exp $ */
/*
* Copyright (c) 1992, 1993
@@ -81,53 +81,51 @@
* registers relative to ZERO.
* Usage is p->p_regs[XX].
*/
-#define _R_ZERO 0
-#define _R_AST 1
-#define _R_V0 2
-#define _R_V1 3
-#define _R_A0 4
-#define _R_A1 5
-#define _R_A2 6
-#define _R_A3 7
+#define _R_ZERO 0 /* hardware zero */
+#define _R_AST 1 /* caller-saved */
+#define _R_V0 2 /* caller-saved */
+#define _R_V1 3 /* caller-saved */
+#define _R_A0 4 /* caller-saved */
+#define _R_A1 5 /* caller-saved */
+#define _R_A2 6 /* caller-saved */
+#define _R_A3 7 /* caller-saved */
#if defined(__mips_n32) || defined(__mips_n64)
-#define _R_A4 8
-#define _R_A5 9
-#define _R_A6 10
-#define _R_A7 11
-#define _R_T0 12
-#define _R_T1 13
-#define _R_T2 14
-#define _R_T3 15
+#define _R_A4 8 /* caller-saved */
+#define _R_A5 9 /* caller-saved */
+#define _R_A6 10 /* caller-saved */
+#define _R_A7 11 /* caller-saved */
+#define _R_T0 12 /* caller-saved */
+#define _R_T1 13 /* caller-saved */
+#define _R_T2 14 /* caller-saved */
+#define _R_T3 15 /* caller-saved */
#else
-#define _R_T0 8
-#define _R_T1 9
-#define _R_T2 10
-#define _R_T3 11
-#define _R_T4 12
-#define _R_T5 13
-#define _R_T6 14
-#define _R_T7 15
+#define _R_T0 8 /* caller-saved */
+#define _R_T1 9 /* caller-saved */
+#define _R_T2 10 /* caller-saved */
+#define _R_T3 11 /* caller-saved */
+#define _R_T4 12 /* caller-saved */
+#define _R_T5 13 /* caller-saved */
+#define _R_T6 14 /* caller-saved */
+#define _R_T7 15 /* caller-saved */
#endif /* __mips_n32 || __mips_n64 */
-#define _R_S0 16
-#define _R_S1 17
-#define _R_S2 18
-#define _R_S3 19
-#define _R_S4 20
-#define _R_S5 21
-#define _R_S6 22
-#define _R_S7 23
-#define _R_T8 24
-#define _R_T9 25
-#define _R_K0 26
-#define _R_K1 27
-#define _R_GP 28
-#define _R_SP 29
-#define _R_S8 30
-#define _R_RA 31
+#define _R_S0 16 /* CALLEE-saved */
+#define _R_S1 17 /* CALLEE-saved */
+#define _R_S2 18 /* CALLEE-saved */
+#define _R_S3 19 /* CALLEE-saved */
+#define _R_S4 20 /* CALLEE-saved */
+#define _R_S5 21 /* CALLEE-saved */
+#define _R_S6 22 /* CALLEE-saved */
+#define _R_S7 23 /* CALLEE-saved */
+#define _R_T8 24 /* caller-saved */
+#define _R_T9 25 /* caller-saved */
+#define _R_K0 26 /* kernel reserved */
+#define _R_K1 27 /* kernel reserved */
+#define _R_GP 28 /* CALLEE-saved */
+#define _R_SP 29 /* CALLEE-saved */
+#define _R_S8 30 /* CALLEE-saved */
+#define _R_RA 31 /* caller-saved */
#define _R_SR 32
-#ifndef _KERNEL /* clashes with netccitt/pk.h */
#define _R_PS _R_SR /* alias for SR */
-#endif
/* See <mips/regdef.h> for an explanation. */
#if defined(__mips_n32) || defined(__mips_n64)
Index: src/sys/arch/mips/include/setjmp.h
diff -u src/sys/arch/mips/include/setjmp.h:1.7 src/sys/arch/mips/include/setjmp.h:1.7.138.1
--- src/sys/arch/mips/include/setjmp.h:1.7 Tue Mar 5 14:17:16 2002
+++ src/sys/arch/mips/include/setjmp.h Sun Aug 16 03:33:58 2009
@@ -1,4 +1,4 @@
-/* $NetBSD: setjmp.h,v 1.7 2002/03/05 14:17:16 simonb Exp $ */
+/* $NetBSD: setjmp.h,v 1.7.138.1 2009/08/16 03:33:58 matt Exp $ */
/*
* mips/setjmp.h: machine dependent setjmp-related information.
@@ -7,10 +7,11 @@
* struct sigcontext to restore it.
*/
-#include <machine/cdefs.h> /* for API selection */
-
-#if !defined(_MIPS_BSD_API) || _MIPS_BSD_API == _MIPS_BSD_API_LP32
+#if defined(__mips_o32)
#define _JBLEN 87 /* XXX Naively 84; 87 for compatibility */
#else
-#define _JBLEN 120
+#define _JBLEN (87 + 33) /* 32 more FP registers */
+#ifdef __mips_n32
+#define _BSD_JBSLOT_T_ long long
+#endif
#endif
Index: src/sys/arch/mips/include/signal.h
diff -u src/sys/arch/mips/include/signal.h:1.27 src/sys/arch/mips/include/signal.h:1.27.92.1
--- src/sys/arch/mips/include/signal.h:1.27 Sun Dec 11 12:18:09 2005
+++ src/sys/arch/mips/include/signal.h Sun Aug 16 03:33:58 2009
@@ -1,4 +1,4 @@
-/* $NetBSD: signal.h,v 1.27 2005/12/11 12:18:09 christos Exp $ */
+/* $NetBSD: signal.h,v 1.27.92.1 2009/08/16 03:33:58 matt Exp $ */
/*
* Copyright (c) 1992, 1993
@@ -93,27 +93,12 @@
mips_reg_t sc_regs[32]; /* processor regs 0 to 31 */
mips_reg_t mullo, mulhi;/* mullo and mulhi registers... */
int sc_fpused; /* fp has been used */
- int sc_fpregs[33]; /* fp regs 0 to 31 and csr */
+ mips_fpreg_t sc_fpregs[33]; /* fp regs 0 to 31 and csr */
int sc_fpc_eir; /* floating point exception instruction reg */
- int sc_xxx[8]; /* XXX reserved */
+ long sc_xxx[8]; /* XXX reserved */
sigset_t sc_mask; /* signal mask to restore (new style) */
};
#endif /* _LIBC || _KERNEL */
#endif /* !_LANGUAGE_ASSEMBLY */
-#if defined(_LIBC)
-/*
- * Hard code these to make people think twice about breaking compatibility.
- * These macros are generated independently for the kernel.
- */
-#if !defined(_MIPS_BSD_API) || _MIPS_BSD_API == _MIPS_BSD_API_LP32
-#define _OFFSETOF_SC_REGS 12
-#define _OFFSETOF_SC_FPREGS 152
-#define _OFFSETOF_SC_MASK 320
-#else
-#define _OFFSETOF_SC_REGS 16
-#define _OFFSETOF_SC_FPREGS 292
-#define _OFFSETOF_SC_MASK 460
-#endif
-#endif /* _LIBC */
#endif /* !_MIPS_SIGNAL_H_ */
Index: src/sys/arch/mips/include/stdarg.h
diff -u src/sys/arch/mips/include/stdarg.h:1.28 src/sys/arch/mips/include/stdarg.h:1.28.14.1
--- src/sys/arch/mips/include/stdarg.h:1.28 Sat Jun 21 00:56:39 2008
+++ src/sys/arch/mips/include/stdarg.h Sun Aug 16 03:33:58 2009
@@ -1,4 +1,4 @@
-/* $NetBSD: stdarg.h,v 1.28 2008/06/21 00:56:39 gmcgarry Exp $ */
+/* $NetBSD: stdarg.h,v 1.28.14.1 2009/08/16 03:33:58 matt Exp $ */
/*-
* Copyright (c) 1992, 1993
@@ -62,10 +62,10 @@
#else
-#if defined(_MIPS_BSD_API) && \
- !((_MIPS_BSD_API == _MIPS_BSD_API_LP32) || \
- (_MIPS_BSD_API == _MIPS_BSD_API_LP32_64CLEAN))
-#error stdargs.h does not work with 64 bit ABIs
+#if defined(__mips_n32)
+#error stdarg.h does not work with the N32 ABI with this compiler
+#elif defined(__mips_n64)
+#error stdarg.h does not work with the N64 ABI with this compiler
#endif
#define va_start(ap, last) \
Index: src/sys/arch/mips/include/types.h
diff -u src/sys/arch/mips/include/types.h:1.43 src/sys/arch/mips/include/types.h:1.43.36.1
--- src/sys/arch/mips/include/types.h:1.43 Thu Nov 29 00:58:03 2007
+++ src/sys/arch/mips/include/types.h Sun Aug 16 03:33:58 2009
@@ -1,4 +1,4 @@
-/* $NetBSD: types.h,v 1.43 2007/11/29 00:58:03 ad Exp $ */
+/* $NetBSD: types.h,v 1.43.36.1 2009/08/16 03:33:58 matt Exp $ */
/*-
* Copyright (c) 1992, 1993
@@ -47,18 +47,18 @@
* the rest of the operating system as possible.
*/
-#if defined(_MIPS_BSD_API) && _MIPS_BSD_API != _MIPS_BSD_API_LP32
-typedef long long mips_reg_t;
-typedef unsigned long long mips_ureg_t;
-#if _MIPS_BSD_API != _MIPS_BSD_API_LP32 && _MIPS_BSD_API != _MIPS_BSD_API_LP32_64CLEAN
-typedef long long mips_fpreg_t;
+#if !defined(__mips_o32)
+typedef long long mips_reg_t;
+typedef unsigned long long mips_ureg_t;
+#if defined(__mips_o64)
+typedef int mips_fpreg_t;
#else
-typedef int mips_fpreg_t;
+typedef long long mips_fpreg_t;
#endif
#else
-typedef long mips_reg_t;
-typedef unsigned long mips_ureg_t;
-typedef long mips_fpreg_t;
+typedef long mips_reg_t;
+typedef unsigned long mips_ureg_t;
+typedef long mips_fpreg_t;
#endif
/* NB: This should probably be if defined(_KERNEL) */
@@ -67,11 +67,11 @@
typedef unsigned long long paddr_t;
typedef unsigned long long psize_t;
#else
-typedef unsigned long paddr_t;
-typedef unsigned long psize_t;
+typedef unsigned long paddr_t;
+typedef unsigned long psize_t;
#endif
-typedef unsigned long vaddr_t;
-typedef unsigned long vsize_t;
+typedef unsigned long vaddr_t;
+typedef unsigned long vsize_t;
#endif
/* Make sure this is signed; we need pointers to be sign-extended. */