Skip to contentSkip to conversation

Merge mips64 and mipsn32

PATCH In review Paul Brook 2 participants 3 messages Feb 10, 2012

lore
Share & tools
lore

Paul Brook

author
#0 lore raw

PATCH 1/1 Merge mips64 and mipsn32

Make MIPS N32 be a variant of mips64, rather than a new architecture in its own right. This matches how sparc/ppc work, and makes TARGET_MIPS64 the right thing to check for a 64-bit mips core.

As side-effect of this is that linux-user/mipsn32 gets merged into linux-user/mips64. I consider this to be a feature as anything differences other than the syscall numbers are probably bugs.

---
 configure                          |    3 +-
 linux-user/mips64/syscall.h        |   14 +-
 linux-user/mips64/syscall_nr.h     |  312 +-----------------------------------
 linux-user/mips64/syscall_nr32.h   |  311 +++++++++++++++++++++++++++++++++++
 linux-user/mips64/syscall_nr64.h   |  306 +++++++++++++++++++++++++++++++++++
 linux-user/mipsn32/syscall.h       |  224 --------------------------
 linux-user/mipsn32/syscall_nr.h    |  311 -----------------------------------
 linux-user/mipsn32/target_signal.h |   29 ----
 linux-user/mipsn32/termbits.h      |  245 ----------------------------
 linux-user/syscall_defs.h          |   79 +---------
 10 files changed, 636 insertions(+), 1198 deletions(-)
 create mode 100644 linux-user/mips64/syscall_nr32.h
 create mode 100644 linux-user/mips64/syscall_nr64.h
 delete mode 100644 linux-user/mipsn32/syscall.h
 delete mode 100644 linux-user/mipsn32/syscall_nr.h
 delete mode 100644 linux-user/mipsn32/target_signal.h
 delete mode 100644 linux-user/mipsn32/termbits.h
configure +2 -1
index faa65a8..7fd6f02 100755
@@ -3491,9 +3491,10 @@ case "$target_arch2" in
     target_phys_bits=64
   ;;
   mipsn32|mipsn32el)
-    TARGET_ARCH=mipsn32
+    TARGET_ARCH=mips64
     TARGET_BASE_ARCH=mips
     echo "TARGET_ABI_MIPSN32=y" >> $config_target_mak
+    echo "TARGET_ABI32=y" >> $config_target_mak
     target_phys_bits=64
   ;;
   mips64|mips64el)
linux-user/mips64/syscall.h +7 -7
index e436ea5..ebe98f2 100644
@@ -4,15 +4,15 @@
 
 struct target_pt_regs {
 	/* Saved main processor registers. */
-	abi_ulong regs[32];
+	target_ulong regs[32];
 
 	/* Saved special registers. */
-	abi_ulong cp0_status;
-	abi_ulong lo;
-	abi_ulong hi;
-	abi_ulong cp0_badvaddr;
-	abi_ulong cp0_cause;
-	abi_ulong cp0_epc;
+	target_ulong cp0_status;
+	target_ulong lo;
+	target_ulong hi;
+	target_ulong cp0_badvaddr;
+	target_ulong cp0_cause;
+	target_ulong cp0_epc;
 };
 
 /* Target errno definitions taken from asm-mips/errno.h */
linux-user/mips64/syscall_nr.h +6 -306

312 lines not on this page · raw message

linux-user/mips64/syscall_nr32.h new file +311 -0

311 lines not on this page · raw message

linux-user/mips64/syscall_nr64.h new file +306 -0

306 lines not on this page · raw message

linux-user/mipsn32/syscall.h deleted +0 -224

224 lines not on this page · raw message

linux-user/mipsn32/syscall_nr.h deleted +0 -311

311 lines not on this page · raw message

linux-user/mipsn32/target_signal.h deleted +0 -29
deleted file mode 100644
index ff20d9e..0000000
@@ -1,29 +0,0 @@
-#ifndef TARGET_SIGNAL_H
-#define TARGET_SIGNAL_H
-
-#include "cpu.h"
-
-/* this struct defines a stack used during syscall handling */
-
-typedef struct target_sigaltstack {
-	int32_t ss_sp;
-	uint32_t ss_size;
-	int32_t ss_flags;
-} target_stack_t;
-
-
-/*
- * sigaltstack controls
- */
-#define TARGET_SS_ONSTACK     1
-#define TARGET_SS_DISABLE     2
-
-#define TARGET_MINSIGSTKSZ    2048
-#define TARGET_SIGSTKSZ       8192
-
-static inline target_ulong get_sp_from_cpustate(CPUMIPSState *state)
-{
-    return state->active_tc.gpr[29];
-}
-
-#endif /* TARGET_SIGNAL_H */
linux-user/mipsn32/termbits.h deleted +0 -245

245 lines not on this page · raw message

linux-user/syscall_defs.h +4 -75

103 lines not on this page · raw message

Signature · 1 line
1.7.8.3
#1 lore raw

Am 10.02.2012 12:23, schrieb Paul Brook:

Quoted 19 lines

Make MIPS N32 be a variant of mips64, rather than a new architecture in its own right. This matches how sparc/ppc work, and makes TARGET_MIPS64 the right thing to check for a 64-bit mips core.

As side-effect of this is that linux-user/mipsn32 gets merged into linux-user/mips64. I consider this to be a feature as anything differences other than the syscall numbers are probably bugs.

---
 configure                          |    3 +-
 linux-user/mips64/syscall.h        |   14 +-
 linux-user/mips64/syscall_nr.h     |  312 +-----------------------------------
 linux-user/mips64/syscall_nr32.h   |  311 +++++++++++++++++++++++++++++++++++
 linux-user/mips64/syscall_nr64.h   |  306 +++++++++++++++++++++++++++++++++++
 linux-user/mipsn32/syscall.h       |  224 --------------------------
 linux-user/mipsn32/syscall_nr.h    |  311 -----------------------------------
 linux-user/mipsn32/target_signal.h |   29 ----
 linux-user/mipsn32/termbits.h      |  245 ----------------------------
Quoted 8 lines
 linux-user/syscall_defs.h          |   79 +---------
 10 files changed, 636 insertions(+), 1198 deletions(-)
 create mode 100644 linux-user/mips64/syscall_nr32.h
 create mode 100644 linux-user/mips64/syscall_nr64.h
 delete mode 100644 linux-user/mipsn32/syscall.h
 delete mode 100644 linux-user/mipsn32/syscall_nr.h
 delete mode 100644 linux-user/mipsn32/target_signal.h
 delete mode 100644 linux-user/mipsn32/termbits.h

Note: Richard Henderson and me had been looking into code sharing among the MIPS ABIs for signal handling in response to a half-done Octeon mips64 patchset.

There's an unfinished RFC of mine from December or so, feel free to pick that up or to come up with a better idea!

Andreas

Signature · 2 lines
SUSE LINUX Products GmbH, Maxfeldstr. 5, 90409 Nürnberg, Germany
GF: Jeff Hawn, Jennifer Guild, Felix Imendörffer; HRB 16746 AG Nürnberg
author
#2 lore raw
Quoted 7 lines
Quoted 7 lines

Make MIPS N32 be a variant of mips64, rather than a new architecture in its own right. This matches how sparc/ppc work, and makes TARGET_MIPS64 the right thing to check for a 64-bit mips core.

As side-effect of this is that linux-user/mipsn32 gets merged into linux-user/mips64. I consider this to be a feature as anything differences other than the syscall numbers are probably bugs.

Quoted 7 lines

...
Note: Richard Henderson and me had been looking into code sharing among the MIPS ABIs for signal handling in response to a half-done Octeon mips64 patchset.

There's an unfinished RFC of mine from December or so, feel free to pick that up or to come up with a better idea!

Yeah, I found those and have a couple of other patches I need to reconcile and push out. I haven't looked at the signal handling bits.

Paul