summaryrefslogtreecommitdiff
path: root/emulators/qemu-devel/files
diff options
context:
space:
mode:
Diffstat (limited to 'emulators/qemu-devel/files')
-rw-r--r--emulators/qemu-devel/files/patch-cache-utils.c26
-rw-r--r--emulators/qemu-devel/files/patch-cpu-exec.c35
-rw-r--r--emulators/qemu-devel/files/patch-ppc.ld77
-rw-r--r--emulators/qemu-devel/files/patch-tcg-ppc-tcg_target.h11
-rw-r--r--emulators/qemu-devel/files/revert-fbsd-libmath-patch14
5 files changed, 163 insertions, 0 deletions
diff --git a/emulators/qemu-devel/files/patch-cache-utils.c b/emulators/qemu-devel/files/patch-cache-utils.c
new file mode 100644
index 000000000000..fee6ca6a929a
--- /dev/null
+++ b/emulators/qemu-devel/files/patch-cache-utils.c
@@ -0,0 +1,26 @@
+--- a/cache-utils.c
++++ b/cache-utils.c
+@@ -57,6 +57,23 @@
+ }
+ #endif
+
++#ifdef __FreeBSD__
++#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)
+ {
diff --git a/emulators/qemu-devel/files/patch-cpu-exec.c b/emulators/qemu-devel/files/patch-cpu-exec.c
new file mode 100644
index 000000000000..3c40fa38eb97
--- /dev/null
+++ b/emulators/qemu-devel/files/patch-cpu-exec.c
@@ -0,0 +1,35 @@
+--- a/cpu-exec.c
++++ b/cpu-exec.c
+@@ -933,6 +933,20 @@
+ # define TRAP_sig(context) REG_sig(trap, context)
+ #endif /* linux */
+
++#ifdef __FreeBSD__
++#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__ */
++
+ #ifdef __APPLE__
+ # include <sys/ucontext.h>
+ typedef struct ucontext SIGCONTEXT;
+@@ -962,7 +976,11 @@
+ void *puc)
+ {
+ siginfo_t *info = pinfo;
++#if defined (__FreeBSD__)
++ ucontext_t *uc = puc;
++#else
+ struct ucontext *uc = puc;
++#endif
+ unsigned long pc;
+ int is_write;
+
diff --git a/emulators/qemu-devel/files/patch-ppc.ld b/emulators/qemu-devel/files/patch-ppc.ld
new file mode 100644
index 000000000000..ea911953ab06
--- /dev/null
+++ b/emulators/qemu-devel/files/patch-ppc.ld
@@ -0,0 +1,77 @@
+--- a/ppc.ld
++++ b/ppc.ld
+@@ -79,36 +79,34 @@
+ }
+ .sbss2 : { *(.sbss2 .sbss2.* .gnu.linkonce.sb2.*) }
+ .eh_frame_hdr : { *(.eh_frame_hdr) }
+- .eh_frame : ONLY_IF_RO { KEEP (*(.eh_frame)) }
+- .gcc_except_table : ONLY_IF_RO { *(.gcc_except_table .gcc_except_table.*) }
+ /* Adjust the address for the data segment. We want to adjust up to
+ the same address within the page on the next page up. */
+ . = ALIGN (0x10000) - ((0x10000 - .) & (0x10000 - 1)); . = DATA_SEGMENT_ALIGN (0x10000, 0x1000);
+ /* Exception handling */
+- .eh_frame : ONLY_IF_RW { KEEP (*(.eh_frame)) }
+- .gcc_except_table : ONLY_IF_RW { *(.gcc_except_table .gcc_except_table.*) }
++ .eh_frame : { KEEP (*(.eh_frame)) }
++ .gcc_except_table : { *(.gcc_except_table .gcc_except_table.*) }
+ /* Thread Local Storage sections */
+ .tdata : { *(.tdata .tdata.* .gnu.linkonce.td.*) }
+ .tbss : { *(.tbss .tbss.* .gnu.linkonce.tb.*) *(.tcommon) }
+ .preinit_array :
+ {
+- PROVIDE_HIDDEN (__preinit_array_start = .);
++ PROVIDE (__preinit_array_start = .);
+ KEEP (*(.preinit_array))
+- PROVIDE_HIDDEN (__preinit_array_end = .);
++ PROVIDE (__preinit_array_end = .);
+ }
+ .init_array :
+ {
+- PROVIDE_HIDDEN (__init_array_start = .);
++ PROVIDE (__init_array_start = .);
+ KEEP (*(SORT(.init_array.*)))
+ KEEP (*(.init_array))
+- PROVIDE_HIDDEN (__init_array_end = .);
++ PROVIDE(__init_array_end = .);
+ }
+ .fini_array :
+ {
+- PROVIDE_HIDDEN (__fini_array_start = .);
++ PROVIDE (__fini_array_start = .);
+ KEEP (*(.fini_array))
+ KEEP (*(SORT(.fini_array.*)))
+- PROVIDE_HIDDEN (__fini_array_end = .);
++ PROVIDE (__fini_array_end = .);
+ }
+ .ctors :
+ {
+@@ -142,9 +140,8 @@
+ .got1 : { *(.got1) }
+ .got2 : { *(.got2) }
+ .dynamic : { *(.dynamic) }
+- .got : SPECIAL { *(.got) }
+- . = DATA_SEGMENT_RELRO_END (0, .);
+- .plt : SPECIAL { *(.plt) }
++ .got : { *(.got) }
++ .plt : { *(.plt) }
+ .data :
+ {
+ *(.data .data.* .gnu.linkonce.d.*)
+@@ -152,7 +149,7 @@
+ SORT(CONSTRUCTORS)
+ }
+ .data1 : { *(.data1) }
+- .got : SPECIAL { *(.got) }
++ .got : { *(.got) }
+ /* We want the small data sections together, so single-instruction offsets
+ can access them all, and initialized data all before uninitialized, so
+ we can shorten the on-disk segment size. */
+@@ -171,7 +168,7 @@
+ *(.scommon)
+ PROVIDE (__sbss_end = .); PROVIDE (___sbss_end = .);
+ }
+- .plt : SPECIAL { *(.plt) }
++ .plt : { *(.plt) }
+ .bss :
+ {
+ *(.dynbss)
diff --git a/emulators/qemu-devel/files/patch-tcg-ppc-tcg_target.h b/emulators/qemu-devel/files/patch-tcg-ppc-tcg_target.h
new file mode 100644
index 000000000000..1816317ac330
--- /dev/null
+++ b/emulators/qemu-devel/files/patch-tcg-ppc-tcg_target.h
@@ -0,0 +1,11 @@
+--- 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__
+ #define TCG_TARGET_CALL_ALIGN_ARGS 1
+ #define TCG_TARGET_CALL_STACK_OFFSET 8
+ #else
diff --git a/emulators/qemu-devel/files/revert-fbsd-libmath-patch b/emulators/qemu-devel/files/revert-fbsd-libmath-patch
new file mode 100644
index 000000000000..d7adf8ddc743
--- /dev/null
+++ b/emulators/qemu-devel/files/revert-fbsd-libmath-patch
@@ -0,0 +1,14 @@
+--- Makefile.orig 2010-02-06 20:59:24.000000000 +0100
++++ Makefile 2010-02-06 21:00:17.000000000 +0100
+@@ -62,10 +62,7 @@
+
+ -include config-all-devices.mak
+
+-build-all: $(DOCS) $(TOOLS) bsd/libmath.a recurse-all
+-
+-bsd/libmath.a:
+- ( cd bsd ; unset MAKEFLAGS ; $(BSD_MAKE) CC=$(CC) )
++build-all: $(DOCS) $(TOOLS) recurse-all
+
+ config-host.h: config-host.h-timestamp
+ config-host.h-timestamp: config-host.mak