* [Qemu-devel] [PATCH 0/3] FreeBSD/ppc host patches
@ 2010-02-14 20:10 Juergen Lock
2010-02-14 20:12 ` [Qemu-devel] [PATCH 1/3] Add FreeBSD/ppc host ppc_init_cacheline_sizes() implementation Juergen Lock
` (2 more replies)
0 siblings, 3 replies; 21+ messages in thread
From: Juergen Lock @ 2010-02-14 20:10 UTC (permalink / raw)
To: qemu-devel
Hi!
These are patches submitted by Andreas Tobler to get qemu working on
FreeBSD/ppc hosts. There is one other patch to ppc.ld that's needed
because of FreeBSD's older binutils that probably should stay
FreeBSD-specific, here is the link to it in FreeBSD ports:
http://www.freebsd.org/cgi/cvsweb.cgi/ports/emulators/qemu-devel/files/patch-ppc.ld
1. Add FreeBSD/ppc host ppc_init_cacheline_sizes() implementation.
2. Add FreeBSD/ppc host ucontext definitions.
3. Add FreeBSD/ppc host TCG_TARGET_CALL_{ALIGN_ARGS,STACK_OFFSET} definitions.
^ permalink raw reply [flat|nested] 21+ messages in thread
* [Qemu-devel] [PATCH 1/3] Add FreeBSD/ppc host ppc_init_cacheline_sizes() implementation.
2010-02-14 20:10 [Qemu-devel] [PATCH 0/3] FreeBSD/ppc host patches Juergen Lock
@ 2010-02-14 20:12 ` Juergen Lock
2010-02-15 3:15 ` malc
2010-02-15 3:16 ` malc
2010-02-14 20:12 ` [Qemu-devel] [PATCH 2/3] Add FreeBSD/ppc host ucontext definitions Juergen Lock
2010-02-14 20:13 ` [Qemu-devel] [PATCH 3/3] Add FreeBSD/ppc host TCG_TARGET_CALL_{ALIGN_ARGS,STACK_OFFSET} definitions Juergen Lock
2 siblings, 2 replies; 21+ messages in thread
From: Juergen Lock @ 2010-02-14 20:12 UTC (permalink / raw)
To: qemu-devel
Submitted by: Andreas Tobler <andreast@fgznet.ch>
Signed-off-by: Juergen Lock <nox@jelal.kn-bremen.de>
--- a/cache-utils.c
+++ b/cache-utils.c
@@ -57,6 +57,23 @@
}
#endif
+#if defined(__FreeBSD__) || defined(__FreeBSD_kernel__)
+#include <stdio.h>
+#include <sys/types.h>
+#include <sys/sysctl.h>
+
+static void ppc_init_cacheline_sizes(void)
+{
+ size_t len = 4;
+ unsigned cacheline;
+
+ sysctlbyname ("machdep.cacheline_size", &cacheline, &len, NULL, 0);
+
+ qemu_cache_conf.dcache_bsize = cacheline;
+ qemu_cache_conf.icache_bsize = cacheline;
+}
+#endif
+
#ifdef __linux__
void qemu_cache_utils_init(char **envp)
{
^ permalink raw reply [flat|nested] 21+ messages in thread
* [Qemu-devel] [PATCH 2/3] Add FreeBSD/ppc host ucontext definitions.
2010-02-14 20:10 [Qemu-devel] [PATCH 0/3] FreeBSD/ppc host patches Juergen Lock
2010-02-14 20:12 ` [Qemu-devel] [PATCH 1/3] Add FreeBSD/ppc host ppc_init_cacheline_sizes() implementation Juergen Lock
@ 2010-02-14 20:12 ` Juergen Lock
2010-02-14 20:13 ` [Qemu-devel] [PATCH 3/3] Add FreeBSD/ppc host TCG_TARGET_CALL_{ALIGN_ARGS,STACK_OFFSET} definitions Juergen Lock
2 siblings, 0 replies; 21+ messages in thread
From: Juergen Lock @ 2010-02-14 20:12 UTC (permalink / raw)
To: qemu-devel
Submitted by: Andreas Tobler <andreast@fgznet.ch>
Signed-off-by: Juergen Lock <nox@jelal.kn-bremen.de>
--- a/cpu-exec.c
+++ b/cpu-exec.c
@@ -933,6 +933,20 @@
# define TRAP_sig(context) REG_sig(trap, context)
#endif /* linux */
+#if defined(__FreeBSD__) || defined(__FreeBSD_kernel__)
+#include <ucontext.h>
+# define IAR_sig(context) ((context)->uc_mcontext.mc_srr0)
+# define MSR_sig(context) ((context)->uc_mcontext.mc_srr1)
+# define CTR_sig(context) ((context)->uc_mcontext.mc_ctr)
+# define XER_sig(context) ((context)->uc_mcontext.mc_xer)
+# define LR_sig(context) ((context)->uc_mcontext.mc_lr)
+# define CR_sig(context) ((context)->uc_mcontext.mc_cr)
+/* Exception Registers access */
+# define DAR_sig(context) ((context)->uc_mcontext.mc_dar)
+# define DSISR_sig(context) ((context)->uc_mcontext.mc_dsisr)
+# define TRAP_sig(context) ((context)->uc_mcontext.mc_exc)
+#endif /* __FreeBSD__|| __FreeBSD_kernel__ */
+
#ifdef __APPLE__
# include <sys/ucontext.h>
typedef struct ucontext SIGCONTEXT;
@@ -962,7 +976,11 @@
void *puc)
{
siginfo_t *info = pinfo;
+#if defined(__FreeBSD__) || defined(__FreeBSD_kernel__)
+ ucontext_t *uc = puc;
+#else
struct ucontext *uc = puc;
+#endif
unsigned long pc;
int is_write;
^ permalink raw reply [flat|nested] 21+ messages in thread
* [Qemu-devel] [PATCH 3/3] Add FreeBSD/ppc host TCG_TARGET_CALL_{ALIGN_ARGS,STACK_OFFSET} definitions.
2010-02-14 20:10 [Qemu-devel] [PATCH 0/3] FreeBSD/ppc host patches Juergen Lock
2010-02-14 20:12 ` [Qemu-devel] [PATCH 1/3] Add FreeBSD/ppc host ppc_init_cacheline_sizes() implementation Juergen Lock
2010-02-14 20:12 ` [Qemu-devel] [PATCH 2/3] Add FreeBSD/ppc host ucontext definitions Juergen Lock
@ 2010-02-14 20:13 ` Juergen Lock
2010-02-16 21:14 ` [Qemu-devel] " Juergen Lock
2 siblings, 1 reply; 21+ messages in thread
From: Juergen Lock @ 2010-02-14 20:13 UTC (permalink / raw)
To: qemu-devel
Submitted by: Andreas Tobler <andreast@fgznet.ch>
Signed-off-by: Juergen Lock <nox@jelal.kn-bremen.de>
--- a/tcg/ppc/tcg-target.h
+++ b/tcg/ppc/tcg-target.h
@@ -69,7 +69,7 @@
#define TCG_TARGET_CALL_STACK_OFFSET 24
#elif defined _AIX
#define TCG_TARGET_CALL_STACK_OFFSET 52
-#elif defined __linux__
+#elif defined __linux__ || defined __FreeBSD__ || defined(__FreeBSD_kernel__)
#define TCG_TARGET_CALL_ALIGN_ARGS 1
#define TCG_TARGET_CALL_STACK_OFFSET 8
#else
^ permalink raw reply [flat|nested] 21+ messages in thread
* Re: [Qemu-devel] [PATCH 1/3] Add FreeBSD/ppc host ppc_init_cacheline_sizes() implementation.
2010-02-14 20:12 ` [Qemu-devel] [PATCH 1/3] Add FreeBSD/ppc host ppc_init_cacheline_sizes() implementation Juergen Lock
@ 2010-02-15 3:15 ` malc
2010-02-15 22:45 ` Juergen Lock
2010-02-15 3:16 ` malc
1 sibling, 1 reply; 21+ messages in thread
From: malc @ 2010-02-15 3:15 UTC (permalink / raw)
To: Juergen Lock; +Cc: qemu-devel
On Sun, 14 Feb 2010, Juergen Lock wrote:
> Submitted by: Andreas Tobler <andreast@fgznet.ch>
>
> Signed-off-by: Juergen Lock <nox@jelal.kn-bremen.de>
>
> --- a/cache-utils.c
> +++ b/cache-utils.c
> @@ -57,6 +57,23 @@
> }
> #endif
>
> +#if defined(__FreeBSD__) || defined(__FreeBSD_kernel__)
> +#include <stdio.h>
> +#include <sys/types.h>
> +#include <sys/sysctl.h>
> +
> +static void ppc_init_cacheline_sizes(void)
> +{
> + size_t len = 4;
> + unsigned cacheline;
> +
> + sysctlbyname ("machdep.cacheline_size", &cacheline, &len, NULL, 0);
Error handling missing.
> +
> + qemu_cache_conf.dcache_bsize = cacheline;
> + qemu_cache_conf.icache_bsize = cacheline;
> +}
> +#endif
> +
> #ifdef __linux__
> void qemu_cache_utils_init(char **envp)
> {
>
>
--
mailto:av1474@comtv.ru
^ permalink raw reply [flat|nested] 21+ messages in thread
* Re: [Qemu-devel] [PATCH 1/3] Add FreeBSD/ppc host ppc_init_cacheline_sizes() implementation.
2010-02-14 20:12 ` [Qemu-devel] [PATCH 1/3] Add FreeBSD/ppc host ppc_init_cacheline_sizes() implementation Juergen Lock
2010-02-15 3:15 ` malc
@ 2010-02-15 3:16 ` malc
2010-02-15 22:40 ` Juergen Lock
1 sibling, 1 reply; 21+ messages in thread
From: malc @ 2010-02-15 3:16 UTC (permalink / raw)
To: Juergen Lock; +Cc: qemu-devel
On Sun, 14 Feb 2010, Juergen Lock wrote:
> Submitted by: Andreas Tobler <andreast@fgznet.ch>
>
> Signed-off-by: Juergen Lock <nox@jelal.kn-bremen.de>
>
> --- a/cache-utils.c
> +++ b/cache-utils.c
> @@ -57,6 +57,23 @@
> }
> #endif
>
> +#if defined(__FreeBSD__) || defined(__FreeBSD_kernel__)
__FreeBSD_kernel__ is for something like Debian/kFreeBSD?
> +#include <stdio.h>
> +#include <sys/types.h>
> +#include <sys/sysctl.h>
> +
> +static void ppc_init_cacheline_sizes(void)
> +{
> + size_t len = 4;
> + unsigned cacheline;
> +
> + sysctlbyname ("machdep.cacheline_size", &cacheline, &len, NULL, 0);
> +
> + qemu_cache_conf.dcache_bsize = cacheline;
> + qemu_cache_conf.icache_bsize = cacheline;
> +}
> +#endif
> +
> #ifdef __linux__
> void qemu_cache_utils_init(char **envp)
> {
>
>
--
mailto:av1474@comtv.ru
^ permalink raw reply [flat|nested] 21+ messages in thread
* Re: [Qemu-devel] [PATCH 1/3] Add FreeBSD/ppc host ppc_init_cacheline_sizes() implementation.
2010-02-15 3:16 ` malc
@ 2010-02-15 22:40 ` Juergen Lock
2010-02-16 6:52 ` malc
0 siblings, 1 reply; 21+ messages in thread
From: Juergen Lock @ 2010-02-15 22:40 UTC (permalink / raw)
To: malc; +Cc: Juergen Lock, qemu-devel
On Mon, Feb 15, 2010 at 06:16:07AM +0300, malc wrote:
> On Sun, 14 Feb 2010, Juergen Lock wrote:
>
> > Submitted by: Andreas Tobler <andreast@fgznet.ch>
> >
> > Signed-off-by: Juergen Lock <nox@jelal.kn-bremen.de>
> >
> > --- a/cache-utils.c
> > +++ b/cache-utils.c
> > @@ -57,6 +57,23 @@
> > }
> > #endif
> >
> > +#if defined(__FreeBSD__) || defined(__FreeBSD_kernel__)
>
> __FreeBSD_kernel__ is for something like Debian/kFreeBSD?
Yep, it is. Support for it was added to qemu some time ago so I
figured I should do the same.
Cheers,
Juergen
^ permalink raw reply [flat|nested] 21+ messages in thread
* Re: [Qemu-devel] [PATCH 1/3] Add FreeBSD/ppc host ppc_init_cacheline_sizes() implementation.
2010-02-15 3:15 ` malc
@ 2010-02-15 22:45 ` Juergen Lock
0 siblings, 0 replies; 21+ messages in thread
From: Juergen Lock @ 2010-02-15 22:45 UTC (permalink / raw)
To: malc; +Cc: Juergen Lock, qemu-devel
On Mon, Feb 15, 2010 at 06:15:41AM +0300, malc wrote:
> On Sun, 14 Feb 2010, Juergen Lock wrote:
>
> > Submitted by: Andreas Tobler <andreast@fgznet.ch>
> >
> > Signed-off-by: Juergen Lock <nox@jelal.kn-bremen.de>
> >
> > --- a/cache-utils.c
> > +++ b/cache-utils.c
> > @@ -57,6 +57,23 @@
> > }
> > #endif
> >
> > +#if defined(__FreeBSD__) || defined(__FreeBSD_kernel__)
> > +#include <stdio.h>
> > +#include <sys/types.h>
> > +#include <sys/sysctl.h>
> > +
> > +static void ppc_init_cacheline_sizes(void)
> > +{
> > + size_t len = 4;
> > + unsigned cacheline;
> > +
> > + sysctlbyname ("machdep.cacheline_size", &cacheline, &len, NULL, 0);
>
> Error handling missing.
Mmh I suspect thats a sysctl that simply can't fail but of course checking
still doesn't hurt:
Submitted by: Andreas Tobler <andreast@fgznet.ch>
Signed-off-by: Juergen Lock <nox@jelal.kn-bremen.de>
--- a/cache-utils.c
+++ b/cache-utils.c
@@ -57,6 +57,27 @@ static void ppc_init_cacheline_sizes(voi
}
#endif
+#if defined(__FreeBSD__) || defined(__FreeBSD_kernel__)
+#include <stdio.h>
+#include <sys/types.h>
+#include <sys/sysctl.h>
+
+static void ppc_init_cacheline_sizes(void)
+{
+ size_t len = 4;
+ unsigned cacheline;
+
+ if (sysctlbyname ("machdep.cacheline_size", &cacheline, &len, NULL, 0)) {
+ fprintf(stderr, "sysctlbyname machdep.cacheline_size failed: %s\n",
+ strerror(errno));
+ exit(1);
+ }
+
+ qemu_cache_conf.dcache_bsize = cacheline;
+ qemu_cache_conf.icache_bsize = cacheline;
+}
+#endif
+
#ifdef __linux__
void qemu_cache_utils_init(char **envp)
{
^ permalink raw reply [flat|nested] 21+ messages in thread
* Re: [Qemu-devel] [PATCH 1/3] Add FreeBSD/ppc host ppc_init_cacheline_sizes() implementation.
2010-02-15 22:40 ` Juergen Lock
@ 2010-02-16 6:52 ` malc
2010-02-16 17:56 ` Juergen Lock
0 siblings, 1 reply; 21+ messages in thread
From: malc @ 2010-02-16 6:52 UTC (permalink / raw)
To: Juergen Lock; +Cc: qemu-devel
On Mon, 15 Feb 2010, Juergen Lock wrote:
> On Mon, Feb 15, 2010 at 06:16:07AM +0300, malc wrote:
> > On Sun, 14 Feb 2010, Juergen Lock wrote:
> >
> > > Submitted by: Andreas Tobler <andreast@fgznet.ch>
> > >
> > > Signed-off-by: Juergen Lock <nox@jelal.kn-bremen.de>
> > >
> > > --- a/cache-utils.c
> > > +++ b/cache-utils.c
> > > @@ -57,6 +57,23 @@
> > > }
> > > #endif
> > >
> > > +#if defined(__FreeBSD__) || defined(__FreeBSD_kernel__)
> >
> > __FreeBSD_kernel__ is for something like Debian/kFreeBSD?
>
> Yep, it is. Support for it was added to qemu some time ago so I
> figured I should do the same.
>
Perhaps it would be better to avoid this particular ifdefery and
just go with _CALL_SYSV, can you verify that:
~$ gcc -E -dM -x c /dev/null | grep SYSV
yields
#define _CALL_SYSV 1
on FreeBSD and Debian/kFreeBSD?
--
mailto:av1474@comtv.ru
^ permalink raw reply [flat|nested] 21+ messages in thread
* Re: [Qemu-devel] [PATCH 1/3] Add FreeBSD/ppc host ppc_init_cacheline_sizes() implementation.
2010-02-16 6:52 ` malc
@ 2010-02-16 17:56 ` Juergen Lock
2010-02-16 19:07 ` malc
0 siblings, 1 reply; 21+ messages in thread
From: Juergen Lock @ 2010-02-16 17:56 UTC (permalink / raw)
To: malc; +Cc: Juergen Lock, qemu-devel
On Tue, Feb 16, 2010 at 09:52:50AM +0300, malc wrote:
> On Mon, 15 Feb 2010, Juergen Lock wrote:
>
> > On Mon, Feb 15, 2010 at 06:16:07AM +0300, malc wrote:
> > > On Sun, 14 Feb 2010, Juergen Lock wrote:
> > >
> > > > Submitted by: Andreas Tobler <andreast@fgznet.ch>
> > > >
> > > > Signed-off-by: Juergen Lock <nox@jelal.kn-bremen.de>
> > > >
> > > > --- a/cache-utils.c
> > > > +++ b/cache-utils.c
> > > > @@ -57,6 +57,23 @@
> > > > }
> > > > #endif
> > > >
> > > > +#if defined(__FreeBSD__) || defined(__FreeBSD_kernel__)
> > >
> > > __FreeBSD_kernel__ is for something like Debian/kFreeBSD?
> >
> > Yep, it is. Support for it was added to qemu some time ago so I
> > figured I should do the same.
> >
>
> Perhaps it would be better to avoid this particular ifdefery and
> just go with _CALL_SYSV, can you verify that:
>
> ~$ gcc -E -dM -x c /dev/null | grep SYSV
>
> yields
>
> #define _CALL_SYSV 1
>
> on FreeBSD and Debian/kFreeBSD?
Nope, not found on FreeBSD. (Also I would kinda doubt that sysctl is
standardized?)
Cheers,
Juergen
^ permalink raw reply [flat|nested] 21+ messages in thread
* Re: [Qemu-devel] [PATCH 1/3] Add FreeBSD/ppc host ppc_init_cacheline_sizes() implementation.
2010-02-16 17:56 ` Juergen Lock
@ 2010-02-16 19:07 ` malc
2010-02-16 19:50 ` [Qemu-devel] " Paolo Bonzini
0 siblings, 1 reply; 21+ messages in thread
From: malc @ 2010-02-16 19:07 UTC (permalink / raw)
To: Juergen Lock; +Cc: qemu-devel
On Tue, 16 Feb 2010, Juergen Lock wrote:
> On Tue, Feb 16, 2010 at 09:52:50AM +0300, malc wrote:
> > On Mon, 15 Feb 2010, Juergen Lock wrote:
> >
> > > On Mon, Feb 15, 2010 at 06:16:07AM +0300, malc wrote:
> > > > On Sun, 14 Feb 2010, Juergen Lock wrote:
> > > >
> > > > > Submitted by: Andreas Tobler <andreast@fgznet.ch>
> > > > >
> > > > > Signed-off-by: Juergen Lock <nox@jelal.kn-bremen.de>
> > > > >
> > > > > --- a/cache-utils.c
> > > > > +++ b/cache-utils.c
> > > > > @@ -57,6 +57,23 @@
> > > > > }
> > > > > #endif
> > > > >
> > > > > +#if defined(__FreeBSD__) || defined(__FreeBSD_kernel__)
> > > >
> > > > __FreeBSD_kernel__ is for something like Debian/kFreeBSD?
> > >
> > > Yep, it is. Support for it was added to qemu some time ago so I
> > > figured I should do the same.
> > >
> >
> > Perhaps it would be better to avoid this particular ifdefery and
> > just go with _CALL_SYSV, can you verify that:
> >
> > ~$ gcc -E -dM -x c /dev/null | grep SYSV
> >
> > yields
> >
> > #define _CALL_SYSV 1
> >
> > on FreeBSD and Debian/kFreeBSD?
>
> Nope, not found on FreeBSD. (Also I would kinda doubt that sysctl is
> standardized?)
_CALL_SYSV means that calling convention is SysV one, nothing to do with
sysctl, and i wanted you/patch author to run it on FreeBSD/PPC...
--
mailto:av1474@comtv.ru
^ permalink raw reply [flat|nested] 21+ messages in thread
* [Qemu-devel] Re: [PATCH 1/3] Add FreeBSD/ppc host ppc_init_cacheline_sizes() implementation.
2010-02-16 19:07 ` malc
@ 2010-02-16 19:50 ` Paolo Bonzini
2010-02-16 20:34 ` Juergen Lock
0 siblings, 1 reply; 21+ messages in thread
From: Paolo Bonzini @ 2010-02-16 19:50 UTC (permalink / raw)
To: malc; +Cc: Juergen Lock, qemu-devel
>> Nope, not found on FreeBSD. (Also I would kinda doubt that sysctl is
>> standardized?)
>
> _CALL_SYSV means that calling convention is SysV one, nothing to do with
> sysctl, and i wanted you/patch author to run it on FreeBSD/PPC...
Yes, one of _CALL_SYSV, _CALL_AIX, _CALL_DARWIN is always defined by GCC
on PPC. Don't know about other compilers.
Paolo
^ permalink raw reply [flat|nested] 21+ messages in thread
* [Qemu-devel] Re: [PATCH 1/3] Add FreeBSD/ppc host ppc_init_cacheline_sizes() implementation.
2010-02-16 19:50 ` [Qemu-devel] " Paolo Bonzini
@ 2010-02-16 20:34 ` Juergen Lock
2010-02-16 21:19 ` Juergen Lock
0 siblings, 1 reply; 21+ messages in thread
From: Juergen Lock @ 2010-02-16 20:34 UTC (permalink / raw)
To: Paolo Bonzini; +Cc: Juergen Lock, qemu-devel
On Tue, Feb 16, 2010 at 08:50:49PM +0100, Paolo Bonzini wrote:
>
> >> Nope, not found on FreeBSD. (Also I would kinda doubt that sysctl is
> >> standardized?)
> >
> > _CALL_SYSV means that calling convention is SysV one, nothing to do with
> > sysctl, and i wanted you/patch author to run it on FreeBSD/PPC...
>
> Yes, one of _CALL_SYSV, _CALL_AIX, _CALL_DARWIN is always defined by GCC
> on PPC. Don't know about other compilers.
Aaah, now I understand, malc meant this patch:
[PATCH 3/3] Add FreeBSD/ppc host
TCG_TARGET_CALL_{ALIGN_ARGS,STACK_OFFSET} definitions.
not the ppc_init_cacheline_sizes() one, right? :)
Anyway, I'll pass the question on...
Juergen
^ permalink raw reply [flat|nested] 21+ messages in thread
* [Qemu-devel] Re: [PATCH 3/3] Add FreeBSD/ppc host TCG_TARGET_CALL_{ALIGN_ARGS,STACK_OFFSET} definitions.
2010-02-14 20:13 ` [Qemu-devel] [PATCH 3/3] Add FreeBSD/ppc host TCG_TARGET_CALL_{ALIGN_ARGS,STACK_OFFSET} definitions Juergen Lock
@ 2010-02-16 21:14 ` Juergen Lock
2010-04-06 16:28 ` [Qemu-devel] Re: [PATCH 3/3] Add FreeBSD/ppc host TCG_TARGET_CALL_{ALIGN_ARGS, STACK_OFFSET} definitions Andreas Färber
0 siblings, 1 reply; 21+ messages in thread
From: Juergen Lock @ 2010-02-16 21:14 UTC (permalink / raw)
To: Juergen Lock; +Cc: Paolo Bonzini, qemu-devel
On Sun, Feb 14, 2010 at 09:13:31PM +0100, Juergen Lock wrote:
> Submitted by: Andreas Tobler <andreast@fgznet.ch>
>
> Signed-off-by: Juergen Lock <nox@jelal.kn-bremen.de>
>
> --- a/tcg/ppc/tcg-target.h
> +++ b/tcg/ppc/tcg-target.h
> @@ -69,7 +69,7 @@
> #define TCG_TARGET_CALL_STACK_OFFSET 24
> #elif defined _AIX
> #define TCG_TARGET_CALL_STACK_OFFSET 52
> -#elif defined __linux__
> +#elif defined __linux__ || defined __FreeBSD__ || defined(__FreeBSD_kernel__)
> #define TCG_TARGET_CALL_ALIGN_ARGS 1
> #define TCG_TARGET_CALL_STACK_OFFSET 8
> #else
New version using ppc _CALL_* definitions after malc's comments:
Signed-off-by: Juergen Lock <nox@jelal.kn-bremen.de>
--- a/tcg/ppc/tcg-target.h
+++ b/tcg/ppc/tcg-target.h
@@ -65,11 +65,11 @@ enum {
/* used for function call generation */
#define TCG_REG_CALL_STACK TCG_REG_R1
#define TCG_TARGET_STACK_ALIGN 16
-#if defined __APPLE__
+#if defined _CALL_DARWIN
#define TCG_TARGET_CALL_STACK_OFFSET 24
-#elif defined _AIX
+#elif defined _CALL_AIX
#define TCG_TARGET_CALL_STACK_OFFSET 52
-#elif defined __linux__
+#elif defined _CALL_SYSV
#define TCG_TARGET_CALL_ALIGN_ARGS 1
#define TCG_TARGET_CALL_STACK_OFFSET 8
#else
^ permalink raw reply [flat|nested] 21+ messages in thread
* [Qemu-devel] Re: [PATCH 1/3] Add FreeBSD/ppc host ppc_init_cacheline_sizes() implementation.
2010-02-16 20:34 ` Juergen Lock
@ 2010-02-16 21:19 ` Juergen Lock
0 siblings, 0 replies; 21+ messages in thread
From: Juergen Lock @ 2010-02-16 21:19 UTC (permalink / raw)
To: Juergen Lock; +Cc: Paolo Bonzini, qemu-devel
On Tue, Feb 16, 2010 at 09:34:12PM +0100, Juergen Lock wrote:
> On Tue, Feb 16, 2010 at 08:50:49PM +0100, Paolo Bonzini wrote:
> >
> > >> Nope, not found on FreeBSD. (Also I would kinda doubt that sysctl is
> > >> standardized?)
> > >
> > > _CALL_SYSV means that calling convention is SysV one, nothing to do with
> > > sysctl, and i wanted you/patch author to run it on FreeBSD/PPC...
> >
> > Yes, one of _CALL_SYSV, _CALL_AIX, _CALL_DARWIN is always defined by GCC
> > on PPC. Don't know about other compilers.
>
> Aaah, now I understand, malc meant this patch:
> [PATCH 3/3] Add FreeBSD/ppc host
> TCG_TARGET_CALL_{ALIGN_ARGS,STACK_OFFSET} definitions.
> not the ppc_init_cacheline_sizes() one, right? :)
>
> Anyway, I'll pass the question on...
Yup, confirmed, _CALL_SYSV is defined on FreeBSD/ppc.
^ permalink raw reply [flat|nested] 21+ messages in thread
* Re: [Qemu-devel] Re: [PATCH 3/3] Add FreeBSD/ppc host TCG_TARGET_CALL_{ALIGN_ARGS, STACK_OFFSET} definitions.
2010-02-16 21:14 ` [Qemu-devel] " Juergen Lock
@ 2010-04-06 16:28 ` Andreas Färber
2010-04-06 17:14 ` [Qemu-devel] Re: [PATCH 3/3] Add FreeBSD/ppc host TCG_TARGET_CALL_{ALIGN_ARGS,STACK_OFFSET} definitions malc
0 siblings, 1 reply; 21+ messages in thread
From: Andreas Färber @ 2010-04-06 16:28 UTC (permalink / raw)
To: Juergen Lock, Vassili Karpov; +Cc: Paolo Bonzini, QEMU Developers
Am 16.02.2010 um 22:14 schrieb Juergen Lock:
> On Sun, Feb 14, 2010 at 09:13:31PM +0100, Juergen Lock wrote:
>> Submitted by: Andreas Tobler <andreast@fgznet.ch>
>>
>> Signed-off-by: Juergen Lock <nox@jelal.kn-bremen.de>
>>
>> --- a/tcg/ppc/tcg-target.h
>> +++ b/tcg/ppc/tcg-target.h
>> @@ -69,7 +69,7 @@
>> #define TCG_TARGET_CALL_STACK_OFFSET 24
>> #elif defined _AIX
>> #define TCG_TARGET_CALL_STACK_OFFSET 52
>> -#elif defined __linux__
>> +#elif defined __linux__ || defined __FreeBSD__ ||
>> defined(__FreeBSD_kernel__)
>> #define TCG_TARGET_CALL_ALIGN_ARGS 1
>> #define TCG_TARGET_CALL_STACK_OFFSET 8
>> #else
>
> New version using ppc _CALL_* definitions after malc's comments:
>
> Signed-off-by: Juergen Lock <nox@jelal.kn-bremen.de>
>
> --- a/tcg/ppc/tcg-target.h
> +++ b/tcg/ppc/tcg-target.h
> @@ -65,11 +65,11 @@ enum {
> /* used for function call generation */
> #define TCG_REG_CALL_STACK TCG_REG_R1
> #define TCG_TARGET_STACK_ALIGN 16
> -#if defined __APPLE__
> +#if defined _CALL_DARWIN
> #define TCG_TARGET_CALL_STACK_OFFSET 24
5da79c86a3744e3a901c7986c109dd06951befd2 broke compilation on Mac OS X
v10.5 ppc: Apparently _CALL_DARWIN is not defined, so it runs into the
#else.
Andreas
> -#elif defined _AIX
> +#elif defined _CALL_AIX
> #define TCG_TARGET_CALL_STACK_OFFSET 52
> -#elif defined __linux__
> +#elif defined _CALL_SYSV
> #define TCG_TARGET_CALL_ALIGN_ARGS 1
> #define TCG_TARGET_CALL_STACK_OFFSET 8
> #else
>
>
^ permalink raw reply [flat|nested] 21+ messages in thread
* Re: [Qemu-devel] Re: [PATCH 3/3] Add FreeBSD/ppc host TCG_TARGET_CALL_{ALIGN_ARGS,STACK_OFFSET} definitions.
2010-04-06 16:28 ` [Qemu-devel] Re: [PATCH 3/3] Add FreeBSD/ppc host TCG_TARGET_CALL_{ALIGN_ARGS, STACK_OFFSET} definitions Andreas Färber
@ 2010-04-06 17:14 ` malc
2010-04-06 17:19 ` [Qemu-devel] Re: [PATCH 3/3] Add FreeBSD/ppc host TCG_TARGET_CALL_{ALIGN_ARGS, STACK_OFFSET} definitions Andreas Färber
0 siblings, 1 reply; 21+ messages in thread
From: malc @ 2010-04-06 17:14 UTC (permalink / raw)
To: Andreas Färber; +Cc: Paolo Bonzini, Juergen Lock, QEMU Developers
On Tue, 6 Apr 2010, Andreas F?rber wrote:
>
> Am 16.02.2010 um 22:14 schrieb Juergen Lock:
>
> > On Sun, Feb 14, 2010 at 09:13:31PM +0100, Juergen Lock wrote:
> > > Submitted by: Andreas Tobler <andreast@fgznet.ch>
> > >
> > > Signed-off-by: Juergen Lock <nox@jelal.kn-bremen.de>
> > >
> > > --- a/tcg/ppc/tcg-target.h
> > > +++ b/tcg/ppc/tcg-target.h
> > > @@ -69,7 +69,7 @@
> > > #define TCG_TARGET_CALL_STACK_OFFSET 24
> > > #elif defined _AIX
> > > #define TCG_TARGET_CALL_STACK_OFFSET 52
> > > -#elif defined __linux__
> > > +#elif defined __linux__ || defined __FreeBSD__ ||
> > > defined(__FreeBSD_kernel__)
> > > #define TCG_TARGET_CALL_ALIGN_ARGS 1
> > > #define TCG_TARGET_CALL_STACK_OFFSET 8
> > > #else
> >
> > New version using ppc _CALL_* definitions after malc's comments:
> >
> > Signed-off-by: Juergen Lock <nox@jelal.kn-bremen.de>
> >
> > --- a/tcg/ppc/tcg-target.h
> > +++ b/tcg/ppc/tcg-target.h
> > @@ -65,11 +65,11 @@ enum {
> > /* used for function call generation */
> > #define TCG_REG_CALL_STACK TCG_REG_R1
> > #define TCG_TARGET_STACK_ALIGN 16
> > -#if defined __APPLE__
> > +#if defined _CALL_DARWIN
> > #define TCG_TARGET_CALL_STACK_OFFSET 24
>
> 5da79c86a3744e3a901c7986c109dd06951befd2 broke compilation on Mac OS X v10.5
> ppc: Apparently _CALL_DARWIN is not defined, so it runs into the #else.
Which gcc version?
>
> Andreas
>
> > -#elif defined _AIX
> > +#elif defined _CALL_AIX
> > #define TCG_TARGET_CALL_STACK_OFFSET 52
> > -#elif defined __linux__
> > +#elif defined _CALL_SYSV
> > #define TCG_TARGET_CALL_ALIGN_ARGS 1
> > #define TCG_TARGET_CALL_STACK_OFFSET 8
> > #else
> >
>
--
mailto:av1474@comtv.ru
^ permalink raw reply [flat|nested] 21+ messages in thread
* Re: [Qemu-devel] Re: [PATCH 3/3] Add FreeBSD/ppc host TCG_TARGET_CALL_{ALIGN_ARGS, STACK_OFFSET} definitions.
2010-04-06 17:14 ` [Qemu-devel] Re: [PATCH 3/3] Add FreeBSD/ppc host TCG_TARGET_CALL_{ALIGN_ARGS,STACK_OFFSET} definitions malc
@ 2010-04-06 17:19 ` Andreas Färber
2010-04-06 17:44 ` [Qemu-devel] Re: [PATCH 3/3] Add FreeBSD/ppc host TCG_TARGET_CALL_{ALIGN_ARGS,STACK_OFFSET} definitions malc
0 siblings, 1 reply; 21+ messages in thread
From: Andreas Färber @ 2010-04-06 17:19 UTC (permalink / raw)
To: malc; +Cc: Paolo Bonzini, Juergen Lock, QEMU Developers
Am 06.04.2010 um 19:14 schrieb malc:
> On Tue, 6 Apr 2010, Andreas F?rber wrote:
>
>> 5da79c86a3744e3a901c7986c109dd06951befd2 broke compilation on Mac
>> OS X v10.5
>> ppc: Apparently _CALL_DARWIN is not defined, so it runs into the
>> #else.
>
> Which gcc version?
powerpc-apple-darwin9-gcc-4.0.1 (GCC) 4.0.1 (Apple Inc. build 5465)
Andreas
^ permalink raw reply [flat|nested] 21+ messages in thread
* Re: [Qemu-devel] Re: [PATCH 3/3] Add FreeBSD/ppc host TCG_TARGET_CALL_{ALIGN_ARGS,STACK_OFFSET} definitions.
2010-04-06 17:19 ` [Qemu-devel] Re: [PATCH 3/3] Add FreeBSD/ppc host TCG_TARGET_CALL_{ALIGN_ARGS, STACK_OFFSET} definitions Andreas Färber
@ 2010-04-06 17:44 ` malc
2010-08-14 18:51 ` [Qemu-devel] [PATCH] TCG: Fix Darwin/ppc calling convention recognition Andreas Färber
0 siblings, 1 reply; 21+ messages in thread
From: malc @ 2010-04-06 17:44 UTC (permalink / raw)
To: Andreas Färber; +Cc: Paolo Bonzini, Juergen Lock, QEMU Developers
On Tue, 6 Apr 2010, Andreas F?rber wrote:
> Am 06.04.2010 um 19:14 schrieb malc:
>
> > On Tue, 6 Apr 2010, Andreas F?rber wrote:
> >
> > > 5da79c86a3744e3a901c7986c109dd06951befd2 broke compilation on Mac OS X
> > > v10.5
> > > ppc: Apparently _CALL_DARWIN is not defined, so it runs into the #else.
> >
> > Which gcc version?
>
> powerpc-apple-darwin9-gcc-4.0.1 (GCC) 4.0.1 (Apple Inc. build 5465)
I guess your only option is to cook up a patch since i don't have
development stuff on my Mac OS X (and i'm reluctant on reverting
the aforementioned commit)
--
mailto:av1474@comtv.ru
^ permalink raw reply [flat|nested] 21+ messages in thread
* [Qemu-devel] [PATCH] TCG: Fix Darwin/ppc calling convention recognition
2010-04-06 17:44 ` [Qemu-devel] Re: [PATCH 3/3] Add FreeBSD/ppc host TCG_TARGET_CALL_{ALIGN_ARGS,STACK_OFFSET} definitions malc
@ 2010-08-14 18:51 ` Andreas Färber
2010-08-14 20:41 ` [Qemu-devel] " malc
0 siblings, 1 reply; 21+ messages in thread
From: Andreas Färber @ 2010-08-14 18:51 UTC (permalink / raw)
To: qemu-devel; +Cc: Paolo Bonzini, Andreas Färber, Jürgen Lock
5da79c86a3744e3a901c7986c109dd06951befd2 broke compilation on Mac OS X v10.5 ppc.
Apple's GCC 4.0.1 does not define _CALL_DARWIN. Recognize __APPLE__ again as well.
Signed-off-by: Andreas Färber <andreas.faerber@web.de>
Cc: malc <av1474@comtv.ru>
Cc: Paolo Bonzini <pbonzini@redhat.com>
Cc: Jürgen Lock <nox@jelal.kn-bremen.de>
Cc: Stefan Weil <weil@mail.berlios.de>
---
Been using a similar patch for some time but apparently hadn't posted it yet...
Together with one of Cam's KVM-related patches this fixes the build for me.
Regards,
Andreas
tcg/ppc/tcg-target.h | 2 +-
1 files changed, 1 insertions(+), 1 deletions(-)
diff --git a/tcg/ppc/tcg-target.h b/tcg/ppc/tcg-target.h
index 5302428..a1f8599 100644
--- a/tcg/ppc/tcg-target.h
+++ b/tcg/ppc/tcg-target.h
@@ -65,7 +65,7 @@ enum {
/* used for function call generation */
#define TCG_REG_CALL_STACK TCG_REG_R1
#define TCG_TARGET_STACK_ALIGN 16
-#if defined _CALL_DARWIN
+#if defined _CALL_DARWIN || defined __APPLE__
#define TCG_TARGET_CALL_STACK_OFFSET 24
#elif defined _CALL_AIX
#define TCG_TARGET_CALL_STACK_OFFSET 52
--
1.7.0.4
^ permalink raw reply related [flat|nested] 21+ messages in thread
* [Qemu-devel] Re: [PATCH] TCG: Fix Darwin/ppc calling convention recognition
2010-08-14 18:51 ` [Qemu-devel] [PATCH] TCG: Fix Darwin/ppc calling convention recognition Andreas Färber
@ 2010-08-14 20:41 ` malc
0 siblings, 0 replies; 21+ messages in thread
From: malc @ 2010-08-14 20:41 UTC (permalink / raw)
To: Andreas Färber; +Cc: Paolo Bonzini, qemu-devel, Jürgen Lock
On Sat, 14 Aug 2010, Andreas F?rber wrote:
> 5da79c86a3744e3a901c7986c109dd06951befd2 broke compilation on Mac OS X
> v10.5 ppc. Apple's GCC 4.0.1 does not define _CALL_DARWIN. Recognize
> __APPLE__ again as well.
Thanks. Applied.
>
> Signed-off-by: Andreas F?rber <andreas.faerber@web.de>
> Cc: malc <av1474@comtv.ru>
> Cc: Paolo Bonzini <pbonzini@redhat.com>
> Cc: J?rgen Lock <nox@jelal.kn-bremen.de>
> Cc: Stefan Weil <weil@mail.berlios.de>
> ---
> Been using a similar patch for some time but apparently hadn't posted it yet...
> Together with one of Cam's KVM-related patches this fixes the build for me.
>
> Regards,
> Andreas
>
> tcg/ppc/tcg-target.h | 2 +-
> 1 files changed, 1 insertions(+), 1 deletions(-)
>
> diff --git a/tcg/ppc/tcg-target.h b/tcg/ppc/tcg-target.h
> index 5302428..a1f8599 100644
> --- a/tcg/ppc/tcg-target.h
> +++ b/tcg/ppc/tcg-target.h
> @@ -65,7 +65,7 @@ enum {
> /* used for function call generation */
> #define TCG_REG_CALL_STACK TCG_REG_R1
> #define TCG_TARGET_STACK_ALIGN 16
> -#if defined _CALL_DARWIN
> +#if defined _CALL_DARWIN || defined __APPLE__
> #define TCG_TARGET_CALL_STACK_OFFSET 24
> #elif defined _CALL_AIX
> #define TCG_TARGET_CALL_STACK_OFFSET 52
>
--
mailto:av1474@comtv.ru
^ permalink raw reply [flat|nested] 21+ messages in thread
end of thread, other threads:[~2010-08-14 20:42 UTC | newest]
Thread overview: 21+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2010-02-14 20:10 [Qemu-devel] [PATCH 0/3] FreeBSD/ppc host patches Juergen Lock
2010-02-14 20:12 ` [Qemu-devel] [PATCH 1/3] Add FreeBSD/ppc host ppc_init_cacheline_sizes() implementation Juergen Lock
2010-02-15 3:15 ` malc
2010-02-15 22:45 ` Juergen Lock
2010-02-15 3:16 ` malc
2010-02-15 22:40 ` Juergen Lock
2010-02-16 6:52 ` malc
2010-02-16 17:56 ` Juergen Lock
2010-02-16 19:07 ` malc
2010-02-16 19:50 ` [Qemu-devel] " Paolo Bonzini
2010-02-16 20:34 ` Juergen Lock
2010-02-16 21:19 ` Juergen Lock
2010-02-14 20:12 ` [Qemu-devel] [PATCH 2/3] Add FreeBSD/ppc host ucontext definitions Juergen Lock
2010-02-14 20:13 ` [Qemu-devel] [PATCH 3/3] Add FreeBSD/ppc host TCG_TARGET_CALL_{ALIGN_ARGS,STACK_OFFSET} definitions Juergen Lock
2010-02-16 21:14 ` [Qemu-devel] " Juergen Lock
2010-04-06 16:28 ` [Qemu-devel] Re: [PATCH 3/3] Add FreeBSD/ppc host TCG_TARGET_CALL_{ALIGN_ARGS, STACK_OFFSET} definitions Andreas Färber
2010-04-06 17:14 ` [Qemu-devel] Re: [PATCH 3/3] Add FreeBSD/ppc host TCG_TARGET_CALL_{ALIGN_ARGS,STACK_OFFSET} definitions malc
2010-04-06 17:19 ` [Qemu-devel] Re: [PATCH 3/3] Add FreeBSD/ppc host TCG_TARGET_CALL_{ALIGN_ARGS, STACK_OFFSET} definitions Andreas Färber
2010-04-06 17:44 ` [Qemu-devel] Re: [PATCH 3/3] Add FreeBSD/ppc host TCG_TARGET_CALL_{ALIGN_ARGS,STACK_OFFSET} definitions malc
2010-08-14 18:51 ` [Qemu-devel] [PATCH] TCG: Fix Darwin/ppc calling convention recognition Andreas Färber
2010-08-14 20:41 ` [Qemu-devel] " malc
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).