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-aa231
-rw-r--r--emulators/qemu-devel/files/patch-ab16
-rw-r--r--emulators/qemu-devel/files/patch-ac10
-rw-r--r--emulators/qemu-devel/files/patch-audio::audio.c12
-rw-r--r--emulators/qemu-devel/files/patch-audio::ossaudio.c11
-rw-r--r--emulators/qemu-devel/files/patch-bc12
-rw-r--r--emulators/qemu-devel/files/patch-bd10
-rw-r--r--emulators/qemu-devel/files/patch-be12
-rw-r--r--emulators/qemu-devel/files/patch-bf37
-rw-r--r--emulators/qemu-devel/files/patch-bg25
-rw-r--r--emulators/qemu-devel/files/patch-bh91
-rw-r--r--emulators/qemu-devel/files/patch-bk190
-rw-r--r--emulators/qemu-devel/files/patch-block.c71
-rw-r--r--emulators/qemu-devel/files/patch-bt103
-rw-r--r--emulators/qemu-devel/files/patch-target-sparc::op_helper.c8
15 files changed, 0 insertions, 839 deletions
diff --git a/emulators/qemu-devel/files/patch-aa b/emulators/qemu-devel/files/patch-aa
deleted file mode 100644
index 305e6af8ef11..000000000000
--- a/emulators/qemu-devel/files/patch-aa
+++ /dev/null
@@ -1,231 +0,0 @@
-diff -urd --exclude=CVS ../cvs/qemu/Makefile qemu-0.5.5/Makefile
---- ../cvs/qemu/Makefile Mon May 17 21:06:42 2004
-+++ qemu-0.5.5/Makefile Sun May 30 05:26:19 2004
-@@ -70,7 +70,7 @@
-
- # documentation
- %.html: %.texi
-- texi2html -monolithic -number $<
-+ -texi2html -monolithic -number $<
-
- qemu.1: qemu-doc.texi
- ./texi2pod.pl $< qemu.pod
-Only in qemu-0.5.5: qemu.1
-diff -urd --exclude=CVS ../cvs/qemu/target-i386/cpu.h qemu-0.5.5/target-i386/cpu.h
---- ../cvs/qemu/target-i386/cpu.h Thu May 20 15:01:56 2004
-+++ qemu-0.5.5/target-i386/cpu.h Sun May 30 05:16:10 2004
-@@ -259,7 +259,7 @@
- CC_OP_NB,
- };
-
--#if (defined(__i386__) || defined(__x86_64__)) && !defined(_BSD)
-+#if defined(__i386__) || defined(__x86_64__)
- #define USE_X86LDOUBLE
- #endif
-
-diff -urd --exclude=CVS ../cvs/qemu/target-i386/exec.h qemu-0.5.5/target-i386/exec.h
---- ../cvs/qemu/target-i386/exec.h Sat May 29 12:08:52 2004
-+++ qemu-0.5.5/target-i386/exec.h Sun May 30 05:19:43 2004
-@@ -293,6 +293,22 @@
-
- #endif /* !defined(CONFIG_USER_ONLY) */
-
-+#if defined(_BSD) && defined(USE_X86LDOUBLE)
-+#include <math.h>
-+/*int rintl(long double __x);
-+long int lrintl(long double __x);
-+long long int llrintl(long double __x);
-+long double powl(long double __x, long double __y);
-+long double logl(long double __x);
-+long double tanl(long double __x);
-+long double atan2l(long double __y, long double __x);
-+long double ceill(long double __x);
-+long double floorl(long double __x);
-+long double sqrtl(long double __x);
-+long double sinl(long double __x);
-+long double cosl(long double __x);*/
-+#endif
-+
- #ifdef USE_X86LDOUBLE
- /* use long double functions */
- #define lrint lrintl
-@@ -310,7 +326,7 @@
- #define rint rintl
- #endif
-
--#if !defined(_BSD)
-+#if !defined(_BSD) || defined(USE_X86LDOUBLE)
- extern int lrint(CPU86_LDouble x);
- extern int64_t llrint(CPU86_LDouble x);
- #else
-diff -urd --exclude=CVS ../cvs/qemu/target-i386/op.c qemu-0.5.5/target-i386/op.c
---- ../cvs/qemu/target-i386/op.c Sat May 29 12:08:52 2004
-+++ qemu-0.5.5/target-i386/op.c Sun May 30 05:40:54 2004
-@@ -1304,6 +1304,149 @@
- functions comes from the LGPL'ed x86 emulator found in the Willows
- TWIN windows emulator. */
-
-+#if defined(_BSD) && defined(USE_X86LDOUBLE)
-+
-+CPU86_LDouble rintl(CPU86_LDouble __x) {
-+ CPU86_LDouble __rintres;
-+ __asm__ __volatile__
-+ ("fistp %0"
-+ : "=m" (__rintres) : "t" (__x) : "st");
-+ return __rintres;
-+}
-+
-+int lrintl(CPU86_LDouble __x) {
-+ int __lrintres;
-+ __asm__ __volatile__
-+ ("fistpl %0"
-+ : "=m" (__lrintres) : "t" (__x) : "st");
-+ return __lrintres;
-+}
-+
-+
-+int64_t llrintl(CPU86_LDouble __x) {
-+ int64_t __llrintres;
-+ __asm__ __volatile__
-+ ("fistpll %0"
-+ : "=m" (__llrintres) : "t" (__x) : "st");
-+ return __llrintres;
-+}
-+
-+CPU86_LDouble powl(CPU86_LDouble __x, CPU86_LDouble __y) {
-+ register CPU86_LDouble __value;
-+ register long double __exponent;
-+ __extension__ long long int __p = (long long int) __y;
-+ if (__x == 0.0)
-+ {
-+ if (__y > 0.0)
-+ return __y == (double) __p && (__p & 1) != 0 ? __x : 0.0;
-+ else if (__y < 0.0)
-+ return (__y == (double) __p && (-__p & 1) != 0
-+ ? 1.0 / __x : 1.0 / fabs (__x));
-+ }
-+ if (__y == (double) __p)
-+ {
-+ long double __r = 1.0;
-+ if (__p == 0)
-+ return 1.0;
-+ if (__p < 0)
-+ {
-+ __p = -__p;
-+ __x = 1.0 / __x;
-+ }
-+ while (1)
-+ {
-+ if (__p & 1)
-+ __r *= __x;
-+ __p >>= 1;
-+ if (__p == 0)
-+ return __r;
-+ __x *= __x;
-+ }
-+ /* NOTREACHED */
-+ }
-+ __asm __volatile__
-+ ("fyl2x" : "=t" (__value) : "0" (__x), "u" (1.0) : "st(1)");
-+ __asm __volatile__
-+ ("fmul %%st(1) # y * log2(x)\n\t"
-+ "fst %%st(1)\n\t"
-+ "frndint # int(y * log2(x))\n\t"
-+ "fxch\n\t"
-+ "fsub %%st(1) # fract(y * log2(x))\n\t"
-+ "f2xm1 # 2^(fract(y * log2(x))) - 1\n\t"
-+ : "=t" (__value), "=u" (__exponent) : "0" (__y), "1" (__value));
-+ __value += 1.0;
-+ __asm __volatile__
-+ ("fscale"
-+ : "=t" (__value) : "0" (__value), "u" (__exponent));
-+ return __value;
-+}
-+
-+CPU86_LDouble logl(CPU86_LDouble __x) {
-+ register CPU86_LDouble __result;
-+ __asm __volatile__ ("fldln2; fxch; fyl2x" : "=t" (__result) : "0" (__x) : "st(1)");
-+ return __result;
-+}
-+
-+CPU86_LDouble tanl(CPU86_LDouble __x) {
-+ register CPU86_LDouble __value;
-+ register CPU86_LDouble __value2 __attribute__ ((__unused__));
-+ __asm __volatile__
-+ ("fptan"
-+ : "=t" (__value2), "=u" (__value) : "0" (__x));
-+ return __value;
-+}
-+
-+CPU86_LDouble atan2l(CPU86_LDouble __y, CPU86_LDouble __x) {
-+ register CPU86_LDouble __value;
-+ __asm __volatile__
-+ ("fpatan"
-+ : "=t" (__value) : "0" (__x), "u" (__y) : "st(1)");
-+ return __value;
-+}
-+
-+CPU86_LDouble ceill(CPU86_LDouble __x) {
-+ register CPU86_LDouble __value;
-+ __volatile unsigned short int __cw;
-+ __volatile unsigned short int __cwtmp;
-+ __asm __volatile ("fnstcw %0" : "=m" (__cw));
-+ __cwtmp = (__cw & 0xf3ff) | 0x0800; /* rounding up */
-+ __asm __volatile ("fldcw %0" : : "m" (__cwtmp));
-+ __asm __volatile ("frndint" : "=t" (__value) : "0" (__x));
-+ __asm __volatile ("fldcw %0" : : "m" (__cw));
-+ return __value;
-+}
-+
-+CPU86_LDouble floorl(CPU86_LDouble __x) {
-+ register CPU86_LDouble __value;
-+ __volatile unsigned short int __cw;
-+ __volatile unsigned short int __cwtmp;
-+ __asm __volatile ("fnstcw %0" : "=m" (__cw));
-+ __cwtmp = (__cw & 0xf3ff) | 0x0400; /* rounding down */
-+ __asm __volatile ("fldcw %0" : : "m" (__cwtmp));
-+ __asm __volatile ("frndint" : "=t" (__value) : "0" (__x));
-+ __asm __volatile ("fldcw %0" : : "m" (__cw));
-+ return __value;
-+}
-+
-+CPU86_LDouble sqrtl(CPU86_LDouble __x) {
-+ register CPU86_LDouble __result;
-+ __asm __volatile__ ("fsqrt" : "=t" (__result) : "0" (__x));
-+ return __result;
-+}
-+
-+CPU86_LDouble sinl(CPU86_LDouble __x) {
-+ register CPU86_LDouble __result;
-+ __asm __volatile__ ("fsin" : "=t" (__result) : "0" (__x));
-+ return __result;
-+}
-+
-+CPU86_LDouble cosl(CPU86_LDouble __x) {
-+ register CPU86_LDouble __result;
-+ __asm __volatile__ ("fcos" : "=t" (__result) : "0" (__x));
-+ return __result;
-+}
-+#endif
-+
- #if defined(__powerpc__)
- extern CPU86_LDouble copysign(CPU86_LDouble, CPU86_LDouble);
-
-diff -urd --exclude=CVS ../cvs/qemu/vl.c qemu-0.5.5/vl.c
---- ../cvs/qemu/vl.c Wed May 26 23:12:06 2004
-+++ qemu-0.5.5/vl.c Sun May 30 05:30:56 2004
-@@ -662,6 +662,14 @@
- case QEMU_TIMER_REALTIME:
- #ifdef _WIN32
- return GetTickCount();
-+#elif defined(_BSD)
-+ {
-+ struct timeval r;
-+ if (!gettimeofday(&r, NULL)) {
-+ return ((CLK_TCK * 1000LL) * (int64_t)r.tv_sec
-+ + ((int64_t)r.tv_usec * CLK_TCK) / 1000) / timer_freq;
-+ }
-+ }
- #else
- {
- struct tms tp;
diff --git a/emulators/qemu-devel/files/patch-ab b/emulators/qemu-devel/files/patch-ab
deleted file mode 100644
index 79b428ba1091..000000000000
--- a/emulators/qemu-devel/files/patch-ab
+++ /dev/null
@@ -1,16 +0,0 @@
-Index: qemu-snapshot-2004-05-30_23-40/target-i386/op.c
-@@ -1307,11 +1307,9 @@
- #if defined(_BSD) && defined(USE_X86LDOUBLE)
-
- CPU86_LDouble rintl(CPU86_LDouble __x) {
-- CPU86_LDouble __rintres;
-- __asm__ __volatile__
-- ("fistp %0"
-- : "=m" (__rintres) : "t" (__x) : "st");
-- return __rintres;
-+ register CPU86_LDouble __result;
-+ __asm __volatile__ ("frndint" : "=t" (__result) : "0" (__x));
-+ return __result;
- }
-
- int lrintl(CPU86_LDouble __x) {
diff --git a/emulators/qemu-devel/files/patch-ac b/emulators/qemu-devel/files/patch-ac
deleted file mode 100644
index 3c9a9db2b58b..000000000000
--- a/emulators/qemu-devel/files/patch-ac
+++ /dev/null
@@ -1,10 +0,0 @@
-Index: qemu/configure
-@@ -204,7 +204,7 @@
-
- if test -z "$sdl" ; then
-
--sdl_config="sdl-config"
-+sdl_config="sdl11-config"
- sdl=no
- sdl_static=no
-
diff --git a/emulators/qemu-devel/files/patch-audio::audio.c b/emulators/qemu-devel/files/patch-audio::audio.c
deleted file mode 100644
index 0b50a522e6fd..000000000000
--- a/emulators/qemu-devel/files/patch-audio::audio.c
+++ /dev/null
@@ -1,12 +0,0 @@
-Index: qemu/audio/audio.c
-@@ -28,6 +28,10 @@
-
- #include "audio/audio_int.h"
-
-+#ifndef INT16_MAX
-+#define INT16_MAX 0x7fff
-+#endif
-+
- #define dolog(...) AUD_log ("audio", __VA_ARGS__)
- #ifdef DEBUG
- #define ldebug(...) dolog (__VA_ARGS__)
diff --git a/emulators/qemu-devel/files/patch-audio::ossaudio.c b/emulators/qemu-devel/files/patch-audio::ossaudio.c
deleted file mode 100644
index 8fc9e99b9153..000000000000
--- a/emulators/qemu-devel/files/patch-audio::ossaudio.c
+++ /dev/null
@@ -1,11 +0,0 @@
-Index: qemu/audio/ossaudio.c
-@@ -21,8 +21,8 @@
- * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
- * THE SOFTWARE.
- */
--#include <sys/mman.h>
- #include <sys/types.h>
-+#include <sys/mman.h>
- #include <sys/ioctl.h>
- #include <sys/soundcard.h>
- #include <assert.h>
diff --git a/emulators/qemu-devel/files/patch-bc b/emulators/qemu-devel/files/patch-bc
deleted file mode 100644
index 7ad83440d48b..000000000000
--- a/emulators/qemu-devel/files/patch-bc
+++ /dev/null
@@ -1,12 +0,0 @@
-Index: qemu/i386-dis.c
-@@ -2896,6 +2896,10 @@
- OP_E (bytemode, sizeflag);
- }
-
-+#ifndef PRIx64
-+#define PRIx64 "llx"
-+#endif
-+
- static void
- print_operand_value (buf, hex, disp)
- char *buf;
diff --git a/emulators/qemu-devel/files/patch-bd b/emulators/qemu-devel/files/patch-bd
deleted file mode 100644
index 3f85d63c03a1..000000000000
--- a/emulators/qemu-devel/files/patch-bd
+++ /dev/null
@@ -1,10 +0,0 @@
-Index: qemu/configure
-@@ -286,7 +286,7 @@
- if test -z "$prefix" ; then
- prefix="/usr/local"
- fi
--mandir="$prefix/share/man"
-+mandir="$prefix/man"
- datadir="$prefix/share/qemu"
- docdir="$prefix/share/doc/qemu"
- bindir="$prefix/bin"
diff --git a/emulators/qemu-devel/files/patch-be b/emulators/qemu-devel/files/patch-be
deleted file mode 100644
index 6c9a95892ade..000000000000
--- a/emulators/qemu-devel/files/patch-be
+++ /dev/null
@@ -1,12 +0,0 @@
-Index: qemu/vl.c
-@@ -666,8 +667,8 @@
- {
- struct timeval r;
- if (!gettimeofday(&r, NULL)) {
-- return ((CLK_TCK * 1000LL) * (int64_t)r.tv_sec
-- + ((int64_t)r.tv_usec * CLK_TCK) / 1000) / timer_freq;
-+ return ((timer_freq * 1000LL) * (int64_t)r.tv_sec
-+ + ((int64_t)r.tv_usec * timer_freq) / 1000) / timer_freq;
- }
- }
- #else
diff --git a/emulators/qemu-devel/files/patch-bf b/emulators/qemu-devel/files/patch-bf
deleted file mode 100644
index 57cc889e3119..000000000000
--- a/emulators/qemu-devel/files/patch-bf
+++ /dev/null
@@ -1,37 +0,0 @@
-Index: qemu/slirp/slirp_config.h
-@@ -86,7 +86,7 @@
- #undef BAD_SPRINTF
-
- /* Define if you have readv */
--#undef HAVE_READV
-+#define HAVE_READV
-
- /* Define if iovec needs to be declared */
- #undef DECLARE_IOVEC
-@@ -95,7 +95,7 @@
- #undef DECLARE_SPRINTF
-
- /* Define if you have a POSIX.1 sys/wait.h */
--#undef HAVE_SYS_WAIT_H
-+#define HAVE_SYS_WAIT_H
-
- /* Define if you have sys/select.h */
- #define HAVE_SYS_SELECT_H
-@@ -107,7 +107,7 @@
- #define HAVE_ARPA_INET_H
-
- /* Define if you have sys/signal.h */
--#undef HAVE_SYS_SIGNAL_H
-+#define HAVE_SYS_SIGNAL_H
-
- /* Define if you have sys/stropts.h */
- #undef HAVE_SYS_STROPTS_H
-@@ -180,7 +180,7 @@
- #undef HAVE_GRANTPT
-
- /* Define if you have fchmod */
--#undef HAVE_FCHMOD
-+#define HAVE_FCHMOD
-
- /* Define if you have <sys/type32.h> */
- #undef HAVE_SYS_TYPES32_H
diff --git a/emulators/qemu-devel/files/patch-bg b/emulators/qemu-devel/files/patch-bg
deleted file mode 100644
index 57a9ef32df97..000000000000
--- a/emulators/qemu-devel/files/patch-bg
+++ /dev/null
@@ -1,25 +0,0 @@
-Index: qemu/Makefile.target
-@@ -179,7 +179,7 @@
-
- #########################################################
-
--DEFINES+=-D_GNU_SOURCE -D_FILE_OFFSET_BITS=64 -D_LARGEFILE_SOURCE
-+DEFINES+=-D_GNU_SOURCE -D_FILE_OFFSET_BITS=64 -D_LARGEFILE_SOURCE -DSMBD=\"${LOCALBASE}/sbin/smbd\"
- LIBS+=-lm
- ifndef CONFIG_USER_ONLY
- LIBS+=-lz
-Index: qemu/vl.c
-@@ -1560,8 +1560,13 @@
- fclose(f);
- atexit(smb_exit);
-
-+#ifdef __FreeBSD__
-+ snprintf(smb_cmdline, sizeof(smb_cmdline), SMBD " -s %s",
-+ smb_conf);
-+#else
- snprintf(smb_cmdline, sizeof(smb_cmdline), "/usr/sbin/smbd -s %s",
- smb_conf);
-+#endif
-
- slirp_add_exec(0, smb_cmdline, 4, 139);
- }
diff --git a/emulators/qemu-devel/files/patch-bh b/emulators/qemu-devel/files/patch-bh
deleted file mode 100644
index 52dff1c7160e..000000000000
--- a/emulators/qemu-devel/files/patch-bh
+++ /dev/null
@@ -1,91 +0,0 @@
-Index: qemu/dyngen-exec.h
-===================================================================
-RCS file: /cvsroot/qemu/qemu/dyngen-exec.h,v
-retrieving revision 1.12
-diff -w -u -d -r1.12 dyngen-exec.h
---- dyngen-exec.h 12 May 2004 19:32:15 -0000 1.12
-+++ dyngen-exec.h 21 May 2004 15:00:41 -0000
-@@ -21,6 +21,8 @@
- #define __DYNGEN_EXEC_H__
-
- #include <stddef.h>
-+#include <stdio.h>
-+#include "config.h"
-
- typedef unsigned char uint8_t;
- typedef unsigned short uint16_t;
-@@ -54,9 +56,6 @@
- #define UINT32_MAX (4294967295U)
- #define UINT64_MAX ((uint64_t)(18446744073709551615))
-
--typedef struct FILE FILE;
--extern int fprintf(FILE *, const char *, ...);
--extern int printf(const char *, ...);
- #undef NULL
- #define NULL 0
- #ifdef _BSD
-Index: qemu/target-ppc/op_helper.c
-===================================================================
-RCS file: /cvsroot/qemu/qemu/target-ppc/op_helper.c,v
-retrieving revision 1.6
-diff -w -u -d -r1.6 op_helper.c
---- target-ppc/op_helper.c 21 May 2004 12:59:31 -0000 1.6
-+++ target-ppc/op_helper.c 21 May 2004 15:00:49 -0000
-@@ -210,6 +210,22 @@
- }
- /* TODO: update FEX & VX */
- /* Set rounding mode */
-+#ifdef _BSD
-+ switch(env->fpscr[0] & 0x3) {
-+ case 0:
-+ fpsetround(FP_RN);
-+ break;
-+ case 1:
-+ fpsetround(FP_RZ);
-+ break;
-+ case 2:
-+ fpsetround(FP_RP);
-+ break;
-+ case 3:
-+ fpsetround(FP_RM);
-+ break;
-+ }
-+#else
- switch (env->fpscr[0] & 0x3) {
- case 0:
- /* Best approximation (round to nearest) */
-@@ -228,6 +244,7 @@
- fesetround(FE_DOWNWARD);
- break;
- }
-+#endif
- }
-
- void do_fctiw (void)
-@@ -253,9 +270,13 @@
- double d;
- uint64_t i;
- } *p = (void *)&FT1;
-+#ifdef _BSD
-+ int cround = fpgetround();
-+ fpsetround(FP_RZ);
-+#else
- int cround = fegetround();
--
- fesetround(FE_TOWARDZERO);
-+#endif
- if (FT0 > (double)0x7FFFFFFF)
- p->i = 0x7FFFFFFFULL << 32;
- else if (FT0 < -(double)0x80000000)
-@@ -264,7 +285,11 @@
- p->i = 0;
- p->i |= (uint32_t)FT0;
- FT0 = p->d;
-+#ifdef _BSD
-+ fpsetround(cround);
-+#else
- fesetround(cround);
-+#endif
- }
-
- void do_fnmadds (void)
diff --git a/emulators/qemu-devel/files/patch-bk b/emulators/qemu-devel/files/patch-bk
deleted file mode 100644
index 09281f31aef2..000000000000
--- a/emulators/qemu-devel/files/patch-bk
+++ /dev/null
@@ -1,190 +0,0 @@
-Index: qemu/slirp/bootp.c
-@@ -29,11 +29,12 @@
-
- #define START_ADDR 15
-
--#define LEASE_TIME (24 * 3600)
-+#define LEASE_TIME (120)
-
- typedef struct {
- uint8_t allocated;
- uint8_t macaddr[6];
-+ int time;
- } BOOTPClient;
-
- BOOTPClient bootp_clients[NB_ADDR];
-@@ -68,26 +69,54 @@
- {
- BOOTPClient *bc;
- int i;
-+ int now=time(NULL);
-
- for(i = 0; i < NB_ADDR; i++) {
- if (!memcmp(macaddr, bootp_clients[i].macaddr, 6))
- goto found;
- }
-+ for(i = 0; i < NB_ADDR; i++) {
-+ if (now-bootp_clients[i].time > 3*LEASE_TIME)
-+ goto found;
-+ }
- return NULL;
- found:
- bc = &bootp_clients[i];
-- bc->allocated = 1;
- paddr->s_addr = htonl(ntohl(special_addr.s_addr) | (i + START_ADDR));
- return bc;
- }
-
-+static BOOTPClient *find_reqaddr(struct in_addr *paddr, struct in_addr *reqaddr, const uint8_t *macaddr)
-+{
-+ BOOTPClient *bc=NULL;
-+ int i;
-+ /*check the net prefix*/
-+ if ((ntohl(reqaddr->s_addr) & 0xffffff00) ==
-+ (ntohl(special_addr.s_addr) & 0xffffff00)) {
-+ i=(ntohl(reqaddr->s_addr) & 0xff) - START_ADDR;
-+ if (i>=0 && i< NB_ADDR) {
-+ bc = &bootp_clients[i];
-+ if (bc->allocated &&
-+ (memcmp(macaddr, bootp_clients[i].macaddr, 6)==0)) {
-+ paddr->s_addr = reqaddr->s_addr;
-+ return bc;
-+ }
-+ else
-+ bc=NULL;
-+ }
-+ }
-+ return bc;
-+}
-+
-+
- static void dhcp_decode(const uint8_t *buf, int size,
-- int *pmsg_type)
-+ int *pmsg_type, struct sockaddr_in *preqaddr)
- {
- const uint8_t *p, *p_end;
- int len, tag;
-
- *pmsg_type = 0;
-+ preqaddr->sin_addr.s_addr=htonl(0L);
-
- p = buf;
- p_end = buf + size;
-@@ -114,6 +143,10 @@
- if (len >= 1)
- *pmsg_type = p[0];
- break;
-+ case RFC2132_REQ_ADDR:
-+ if (len == 4) {
-+ memcpy(&(preqaddr->sin_addr),p,4);
-+ }
- default:
- break;
- }
-@@ -127,14 +160,14 @@
- BOOTPClient *bc;
- struct mbuf *m;
- struct bootp_t *rbp;
-- struct sockaddr_in saddr, daddr;
-+ struct sockaddr_in saddr, daddr, reqaddr;
- struct in_addr dns_addr;
- int dhcp_msg_type, val;
-- uint8_t *q;
-+ uint8_t *q,replytype;
-
- /* extract exact DHCP msg type */
-- dhcp_decode(bp->bp_vend, DHCP_OPT_LEN, &dhcp_msg_type);
-- dprintf("bootp packet op=%d msgtype=%d\n", bp->bp_op, dhcp_msg_type);
-+ dhcp_decode(bp->bp_vend, DHCP_OPT_LEN, &dhcp_msg_type,&reqaddr);
-+ dprintf("bootp packet op=%d msgtype=%d reqaddr=%x\n", bp->bp_op, dhcp_msg_type,ntohl(reqaddr.sin_addr.s_addr));
-
- if (dhcp_msg_type == 0)
- dhcp_msg_type = DHCPREQUEST; /* Force reply for old BOOTP clients */
-@@ -152,21 +185,18 @@
- m->m_data += sizeof(struct udpiphdr);
- memset(rbp, 0, sizeof(struct bootp_t));
-
-- if (dhcp_msg_type == DHCPDISCOVER) {
-- new_addr:
-- bc = get_new_addr(&daddr.sin_addr);
-- if (!bc) {
-- dprintf("no address left\n");
-- return;
-- }
-- memcpy(bc->macaddr, client_ethaddr, 6);
-- } else {
-- bc = find_addr(&daddr.sin_addr, bp->bp_hwaddr);
-- if (!bc) {
-- /* if never assigned, behaves as if it was already
-- assigned (windows fix because it remembers its address) */
-- goto new_addr;
-- }
-+ bc=NULL;
-+ daddr.sin_addr.s_addr=htonl(0L);
-+ if (dhcp_msg_type == DHCPREQUEST) {
-+ if (reqaddr.sin_addr.s_addr != htonl(0L))
-+ bc = find_reqaddr(&daddr.sin_addr, &reqaddr.sin_addr, bp->bp_hwaddr);
-+ else
-+ bc = find_addr(&daddr.sin_addr, bp->bp_hwaddr);
-+ }
-+ else if (dhcp_msg_type == DHCPDISCOVER) {
-+ bc = find_addr(&daddr.sin_addr, bp->bp_hwaddr);
-+ if (!bc)
-+ bc = get_new_addr(&daddr.sin_addr);
- }
- dprintf("offered addr=%08x\n", ntohl(daddr.sin_addr.s_addr));
-
-@@ -181,25 +211,27 @@
- rbp->bp_hlen = 6;
- memcpy(rbp->bp_hwaddr, bp->bp_hwaddr, 6);
-
-- rbp->bp_yiaddr = daddr.sin_addr; /* Client IP address */
-- rbp->bp_siaddr = saddr.sin_addr; /* Server IP address */
-+ rbp->bp_yiaddr = daddr.sin_addr; /* IP address */
-
- q = rbp->bp_vend;
- memcpy(q, rfc1533_cookie, 4);
- q += 4;
-
-- if (dhcp_msg_type == DHCPDISCOVER) {
-- *q++ = RFC2132_MSG_TYPE;
-- *q++ = 1;
-- *q++ = DHCPOFFER;
-- } else if (dhcp_msg_type == DHCPREQUEST) {
-+ if (bc != NULL) {
-+ memcpy(bc->macaddr, client_ethaddr, 6);
-+ bc->allocated = 1;
-+ bc->time = time(NULL);
-+ replytype=(dhcp_msg_type == DHCPDISCOVER)?DHCPOFFER:DHCPACK;
-+ }
-+ else
-+ replytype=DHCPNACK;
-+
- *q++ = RFC2132_MSG_TYPE;
- *q++ = 1;
-- *q++ = DHCPACK;
-- }
-+ *q++ = replytype;
-
-- if (dhcp_msg_type == DHCPDISCOVER ||
-- dhcp_msg_type == DHCPREQUEST) {
-+ if ((dhcp_msg_type == DHCPDISCOVER ||
-+ dhcp_msg_type == DHCPREQUEST) && replytype!=DHCPNACK) {
- *q++ = RFC2132_SRV_ID;
- *q++ = 4;
- memcpy(q, &saddr.sin_addr, 4);
-Index: qemu/slirp/bootp.h
-===================================================================
-RCS file: /cvsroot/qemu/qemu/slirp/bootp.h,v
-retrieving revision 1.1
-diff -u -r1.1 bootp.h
---- slirp/bootp.h 22 Apr 2004 00:10:47 -0000 1.1
-+++ slirp/bootp.h 5 Jun 2004 19:34:22 -0000
-@@ -71,6 +71,7 @@
- #define DHCPOFFER 2
- #define DHCPREQUEST 3
- #define DHCPACK 5
-+#define DHCPNACK 6
-
- #define RFC1533_VENDOR_MAJOR 0
- #define RFC1533_VENDOR_MINOR 0
diff --git a/emulators/qemu-devel/files/patch-block.c b/emulators/qemu-devel/files/patch-block.c
deleted file mode 100644
index c924d2d96039..000000000000
--- a/emulators/qemu-devel/files/patch-block.c
+++ /dev/null
@@ -1,71 +0,0 @@
-Index: qemu/block.c
-@@ -21,6 +21,17 @@
- * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
- * THE SOFTWARE.
- */
-+
-+#include "config-host.h"
-+
-+#ifdef _BSD
-+#include <sys/types.h>
-+#include <sys/stat.h>
-+#include <sys/ioctl.h>
-+#include <sys/queue.h>
-+#include <sys/disk.h>
-+#endif
-+
- #include "vl.h"
- #include "block_int.h"
-
-@@ -103,14 +103,25 @@
- {
- int fd, ret, score, score_max;
- BlockDriver *drv1, *drv;
-- uint8_t buf[1024];
-+ uint8_t *buf;
-+ size_t bufsize = 1024;
-+ u_int sectorsize = 512;
-
- fd = open(filename, O_RDONLY | O_BINARY | O_LARGEFILE);
- if (fd < 0)
- return NULL;
-- ret = read(fd, buf, sizeof(buf));
-+#ifdef DIOCGSECTORSIZE
-+ if (!ioctl(fd, DIOCGSECTORSIZE, &sectorsize) &&
-+ sectorsize > bufsize)
-+ bufsize = sectorsize;
-+#endif
-+ buf = malloc(bufsize);
-+ if (!buf)
-+ return NULL;
-+ ret = read(fd, buf, bufsize);
- if (ret < 0) {
- close(fd);
-+ free(buf);
- return NULL;
- }
- close(fd);
-@@ -124,6 +135,7 @@
- drv = drv1;
- }
- }
-+ free(buf);
- return drv;
- }
-
-@@ -522,6 +533,15 @@
- return -1;
- bs->read_only = 1;
- }
-+#ifdef _BSD
-+ struct stat sb;
-+ if (!fstat(fd,&sb) && (S_IFCHR & sb.st_mode)) {
-+#ifdef DIOCGMEDIASIZE
-+ if (ioctl(fd, DIOCGMEDIASIZE, (off_t *)&size))
-+#endif
-+ size = lseek(fd, 0LL, SEEK_END);
-+ } else
-+#endif
- size = lseek(fd, 0, SEEK_END);
- bs->total_sectors = size / 512;
- s->fd = fd;
diff --git a/emulators/qemu-devel/files/patch-bt b/emulators/qemu-devel/files/patch-bt
deleted file mode 100644
index 62e8924722b3..000000000000
--- a/emulators/qemu-devel/files/patch-bt
+++ /dev/null
@@ -1,103 +0,0 @@
-Index: qemu/vl.c
-@@ -43,6 +43,9 @@
- #ifndef __APPLE__
- #include <libutil.h>
- #endif
-+#ifdef __FreeBSD__
-+#include <sys/module.h>
-+#endif
- #else
- #include <linux/if.h>
- #include <linux/if_tun.h>
-@@ -1059,6 +1062,34 @@
-
- #endif /* CONFIG_SLIRP */
-
-+#ifdef __FreeBSD__
-+#define LOAD_QUIETLY 1
-+#define LOAD_VERBOSLY 2
-+
-+int
-+loadmodules(int how, const char *module, ...)
-+{
-+ int loaded = 0;
-+ va_list ap;
-+
-+ va_start(ap, module);
-+#ifndef NO_MODULES
-+ while (module != NULL) {
-+ if (modfind(module) == -1) {
-+ if (kldload(module) == -1) {
-+ if (how == LOAD_VERBOSLY)
-+ fprintf(stderr, "%s: Cannot load module\n", module);
-+ } else
-+ loaded++;
-+ }
-+ module = va_arg(ap, const char *);
-+ }
-+ va_end(ap);
-+#endif
-+ return loaded;
-+}
-+#endif
-+
- #if !defined(_WIN32)
- #ifdef _BSD
- static int tun_open(char *ifname, int ifname_size)
-@@ -1067,11 +1098,55 @@
- char *dev;
- struct stat s;
-
-+#ifdef __FreeBSD__
-+ int i, kldtried = 0, enoentcount = 0, err = 0;
-+ char dname[100];
-+#ifdef USE_DEVTAP
-+ /*
-+ * 5.x has /dev/tap, but that seems to just blindly increase its
-+ * couter on every open() for some people(??), i.e. on every qemu run.
-+ */
-+ i = -1;
-+#else
-+ i = 0;
-+#endif
-+ for (; i < 10; i++) {
-+ if (i == -1)
-+ strcpy(dname, "/dev/tap");
-+ else
-+ snprintf(dname, sizeof dname, "%s%d",
-+ "/dev/tap", i);
-+ fd = open(dname, O_RDWR);
-+ if (fd >= 0)
-+ break;
-+ else if (errno == ENXIO || errno == ENOENT) {
-+ if (i == 0 && !kldtried++) {
-+ /*
-+ * Attempt to load the tunnel interface KLD if it isn't loaded
-+ * already.
-+ */
-+ if (loadmodules(LOAD_VERBOSLY, "if_tap", NULL))
-+ i = -1;
-+ continue;
-+ }
-+ if (errno != ENOENT || ++enoentcount > 3) {
-+ err = errno;
-+ break;
-+ }
-+ } else
-+ err = errno;
-+ }
-+ if (fd < 0) {
-+ fprintf(stderr, "warning: could not open %s (%s): no virtual network emulation\n", dname, strerror(err));
-+ return -1;
-+ }
-+#else
- fd = open("/dev/tap", O_RDWR);
- if (fd < 0) {
-- fprintf(stderr, "warning: could not open /dev/tap: no virtual network emulation\n");
-+ fprintf(stderr, "warning: could not open /dev/tap (%s): no virtual network emulation\n", strerror(errno));
- return -1;
- }
-+#endif
-
- fstat(fd, &s);
- dev = devname(s.st_rdev, S_IFCHR);
diff --git a/emulators/qemu-devel/files/patch-target-sparc::op_helper.c b/emulators/qemu-devel/files/patch-target-sparc::op_helper.c
deleted file mode 100644
index e621a1337ad1..000000000000
--- a/emulators/qemu-devel/files/patch-target-sparc::op_helper.c
+++ /dev/null
@@ -1,8 +0,0 @@
---- qemu/target-sparc/op_helper.c.orig Mon Oct 11 02:46:24 2004
-+++ qemu/target-sparc/op_helper.c Thu Oct 28 23:28:57 2004
-@@ -1,5 +1,4 @@
- #include <math.h>
--#include <fenv.h>
- #include "exec.h"
-
- #ifdef USE_INT_TO_FLOAT_HELPERS