PATCH: Building qemu on OpenSolaris 2009.06 (SPARC) host
Hello brave qemu developers!
Attached are a few patches that will enable qemu to build on a OpenSolaris 2009.06 host.
Please consider to apply them to the repository.
Regards
Palle
fpu/softfloat-native.h +1 -1
@@ -21,7 +21,7 @@*/ #if defined(CONFIG_SOLARIS ) && \ ((CONFIG_SOLARIS_VERSION <=9 ) || \ - ((CONFIG_SOLARIS_VERSION >=10 ) && (__GNUC__ <4 ))) \ + ((CONFIG_SOLARIS_VERSION ==10 ) && (__GNUC__ <4 ))) \ || (defined(__OpenBSD__) && (OpenBSD <200811 ))/* * C99 7.12.3 classification macros
net/tap-solaris.c +1 -0
@@ -23,6 +23,7 @@*/ #include "net/tap.h" +#include "sysemu.h" #include <sys/stat.h> #include <sys/ethernet.h>
target-sparc/cpu.h +6 -1
@@ -83,6 +83,7 @@#define PSR_OVF (1 << PSR_OVF_SHIFT)#define PSR_CARRY_SHIFT 20#define PSR_CARRY (1 << PSR_CARRY_SHIFT) +#if !defined(CONFIG_SOLARIS )#define PSR_ICC (PSR_NEG|PSR_ZERO|PSR_OVF|PSR_CARRY)#define PSR_EF (1<<12)#define PSR_PIL 0xf00
@@ -90,6 +91,7 @@#define PSR_PS (1<<6)#define PSR_ET (1<<5)#define PSR_CWP 0x1f +#endif #define CC_SRC (env->cc_src)#define CC_SRC2 (env->cc_src2)
@@ -129,8 +131,9 @@ enum {#define PS_IE (1<<1)#define PS_AG (1<<0)/* v9, zero on UA2007 */ +#if !defined(CONFIG_SOLARIS )#define FPRS_FEF (1<<2) - +#endif #define HS_PRIV (1<<2)#endif
@@ -187,7 +190,9 @@ enum {#define FSR_FTT_INVAL_FPR (6ULL << 14)#define FSR_FCC1_SHIFT 11 +#if !defined(CONFIG_SOLARIS )#define FSR_FCC1 (1ULL << FSR_FCC1_SHIFT) +#endif #define FSR_FCC0_SHIFT 10#define FSR_FCC0 (1ULL << FSR_FCC0_SHIFT)
Hello,
Am 26.11.2009 um 21:39 schrieb Palle Lyckegaard:
Quoted 1 line
Attached are a few patches that will enable qemu to build on a OpenSolaris 2009.06 host.
I can ack the softfloat part (fixes redefinition warnings) and the tap part (fixes an unresolved symbol TFR).
But what does the cpu.h part fix?
Andreas
Quoted 6 lines · Andreas Färber
I can ack the softfloat part (fixes redefinition warnings) and the tap part (fixes an unresolved symbol TFR).
But what does the
cpu.hpart fix?Andreas
Hi Andreas,
the cpu.h part is an attempt to avoid warnings about e.g. PSR_EF being redefined in /usr/include/v7/sys/privregs.h on my OpenSolaris 2009.06 SPARC host.
Other redefines are PSR_ICC, PSR_PIL, PSR_S, ...
I consider the softfloat and the tap parts the most important of the three patches.
/Palle
Hi Palle,
Am 28.11.2009 um 21:03 schrieb Palle Lyckegaard:
Quoted 9 lines · Andreas Färber
Quoted 4 lines
I can ack the softfloat part (fixes redefinition warnings) and the tap part (fixes an unresolved symbol TFR).
But what does the
cpu.hpart fix?the
cpu.hpart is an attempt to avoid warnings about e.g.PSR_EFbeing redefined in/usr/include/v7/sys/privregs.hon my OpenSolaris 2009.06 SPARC host.Other redefines are
PSR_ICC,PSR_PIL,PSR_S, ...
Not having that v7 dir on amd64 here, did you check whether their values are really defined identically? If not, it may be necessary to either #undef them first or to prefix them with TARGET_ as done for the user emulators...
Andreas
Quoted 4 lines · Andreas Färber
Not having that v7 dir on amd64 here, did you check whether their values are really defined identically? If not, it may be necessary to either #undef them first or to prefix them with
TARGET_as done for the user emulators...
In which files are TARGET_ examples found (linux-user/strace.c?)
Am 29.11.2009 um 13:34 schrieb Palle Lyckegaard:
Quoted 8 lines · Andreas Färber
Quoted 5 lines
Not having that v7 dir on amd64 here, did you check whether their values are really defined identically? If not, it may be necessary to either #undef them first or to prefix them with
TARGET_as done for the user emulators...In which files are
TARGET_examples found (linux-user/strace.c?)
Yes, for example. grep -r came up with this line among many others:
./linux-user/x86_64/termbits.h:#define TARGET_TIOCPKT_NOSTOP 16
I.e. if unavoidable, instead of #define PSR_XXX 123 one might need to #define TARGET_PSR_XXX 123 and change *all* uses of PSR_XXX to TARGET_PSR_XXX, so that Sun's and QEMU's definitions can live side by side. If your approach or #undef works correctly, that would seem less intrusive, therefore my question.
Andreas
Quoted 2 lines · Andreas Färber
I.e. if unavoidable, instead of #define
PSR_XXX123 one might need to #defineTARGET_PSR_XXX123 and change *all* uses ofPSR_XXXtoTARGET_PSR_XXX, so that Sun's and QEMU's definitions can live side by side. If your approach or #undef works correctly, that would seem less intrusive, therefore my question.
So far I've located only the definitions FSR_FCC1 and FPSR_FEF as being differently defined in qemu and OpenSolaris SPARC.
In order to be as little intrusive as possible I will rework my patch for the cpu.h file so
- where the definitions in qemu and Solaris are equal: guard with an "if !defined(CONFIG_SOLARIS)"
- where the definitions in qemu and Solaris are not equal: add a TARGET_ prefix to the definitions
/Palle
Quoted 12 lines · Palle Lyckegaard
Quoted 6 lines · Andreas Färber
I.e. if unavoidable, instead of #define
PSR_XXX123 one might need to #defineTARGET_PSR_XXX123 and change *all* uses ofPSR_XXXtoTARGET_PSR_XXX, so that Sun's and QEMU's definitions can live side by side. If your approach or #undef works correctly, that would seem less intrusive, therefore my question.So far I've located only the definitions
FSR_FCC1andFPSR_FEFas being differently defined in qemu and OpenSolaris SPARC.
Quoted 6 lines
In order to be as little intrusive as possible I will rework my patch for the
cpu.hfile so
- where the definitions in qemu and Solaris are equal: guard with an "if !defined(CONFIG_SOLARIS)"
- where the definitions in qemu and Solaris are not equal: add aTARGET_prefix to the definitions
It's cleaner just to rename.
PSR_* are also used for Sparc64 %xcc and %icc, so ICC_ or something similar would be better.