Update to version 20040624

Add ppc system emulation

PR:		ports/68298
Submitted by:	maintainer
This commit is contained in:
Kirill Ponomarev 2004-06-25 07:37:31 +00:00
parent 7dde05340b
commit 897e5e8fb6
Notes: svn2git 2021-03-31 03:12:20 +00:00
svn path=/head/; revision=112204
10 changed files with 314 additions and 8 deletions

View file

@ -6,10 +6,10 @@
# #
PORTNAME= qemu PORTNAME= qemu
PORTVERSION= 0.5.5.s.20040622 PORTVERSION= 0.5.5.s.20040624
CATEGORIES= emulators CATEGORIES= emulators
MASTER_SITES= http://dad-answers.com/qemu/FreeBSD/ MASTER_SITES= http://dad-answers.com/qemu/FreeBSD/
DISTNAME= ${PORTNAME}-snapshot-2004-06-22_23 DISTNAME= ${PORTNAME}-snapshot-2004-06-24_23
MAINTAINER= nox@jelal.kn-bremen.de MAINTAINER= nox@jelal.kn-bremen.de
COMMENT= QEMU CPU Emulator COMMENT= QEMU CPU Emulator

View file

@ -1,2 +1,2 @@
MD5 (qemu-snapshot-2004-06-22_23.tar.bz2) = 1ee0aa7cb03979d1696e6c2dd1115425 MD5 (qemu-snapshot-2004-06-24_23.tar.bz2) = cc23ade5426a2caf2289999189c1e92c
SIZE (qemu-snapshot-2004-06-22_23.tar.bz2) = 711054 SIZE (qemu-snapshot-2004-06-24_23.tar.bz2) = 711284

View file

@ -0,0 +1,37 @@
Index: qemu/qemu-mkcow.c
@@ -21,6 +21,8 @@
* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
* THE SOFTWARE.
*/
+#include "config-host.h"
+
#include <stdlib.h>
#include <stdio.h>
#include <stdarg.h>
@@ -36,6 +38,12 @@
#include <sys/stat.h>
#include <netinet/in.h>
+#ifdef _BSD
+#include <sys/types.h>
+#include <sys/ioctl.h>
+#include <sys/disk.h>
+#endif
+
#include "cow.h"
#include "bswap.h"
@@ -56,6 +64,13 @@ int cow_create(int cow_fd, const char *i
perror(image_filename);
exit(1);
}
+#ifdef _BSD
+ struct stat sb;
+ if (!fstat(fd,&sb) && (S_IFCHR & sb.st_mode)) {
+ if (ioctl(fd, DIOCGMEDIASIZE, (off_t *)&image_sectors))
+ image_sectors = lseek(fd, 0LL, SEEK_END);
+ } else
+#endif
image_sectors = lseek64(fd, 0, SEEK_END);
if (fstat(fd, &st) != 0) {
close(fd);

View file

@ -0,0 +1,115 @@
Index: qemu/configure
===================================================================
RCS file: /cvsroot/qemu/qemu/configure,v
retrieving revision 1.39
diff -w -u -d -r1.39 configure
--- configure 20 May 2004 13:23:39 -0000 1.39
+++ configure 21 May 2004 15:00:41 -0000
@@ -93,7 +93,7 @@
if [ "$bsd" = "yes" ] ; then
make="gmake"
- target_list="i386-softmmu"
+ target_list="i386-softmmu ppc-softmmu"
fi
# find source path
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)
@@ -379,7 +404,6 @@
/*****************************************************************************/
/* Special helpers for debug */
-extern FILE *stdout;
void dump_state (void)
{

View file

@ -1,5 +1,6 @@
bin/qemu bin/qemu
bin/qemu-mkcow bin/qemu-mkcow
bin/qemu-system-ppc
bin/vmdk2raw bin/vmdk2raw
%%PORTDOCS%%%%DOCSDIR%%/qemu-doc.html %%PORTDOCS%%%%DOCSDIR%%/qemu-doc.html
%%PORTDOCS%%%%DOCSDIR%%/qemu-tech.html %%PORTDOCS%%%%DOCSDIR%%/qemu-tech.html

View file

@ -6,10 +6,10 @@
# #
PORTNAME= qemu PORTNAME= qemu
PORTVERSION= 0.5.5.s.20040622 PORTVERSION= 0.5.5.s.20040624
CATEGORIES= emulators CATEGORIES= emulators
MASTER_SITES= http://dad-answers.com/qemu/FreeBSD/ MASTER_SITES= http://dad-answers.com/qemu/FreeBSD/
DISTNAME= ${PORTNAME}-snapshot-2004-06-22_23 DISTNAME= ${PORTNAME}-snapshot-2004-06-24_23
MAINTAINER= nox@jelal.kn-bremen.de MAINTAINER= nox@jelal.kn-bremen.de
COMMENT= QEMU CPU Emulator COMMENT= QEMU CPU Emulator

View file

@ -1,2 +1,2 @@
MD5 (qemu-snapshot-2004-06-22_23.tar.bz2) = 1ee0aa7cb03979d1696e6c2dd1115425 MD5 (qemu-snapshot-2004-06-24_23.tar.bz2) = cc23ade5426a2caf2289999189c1e92c
SIZE (qemu-snapshot-2004-06-22_23.tar.bz2) = 711054 SIZE (qemu-snapshot-2004-06-24_23.tar.bz2) = 711284

View file

@ -0,0 +1,37 @@
Index: qemu/qemu-mkcow.c
@@ -21,6 +21,8 @@
* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
* THE SOFTWARE.
*/
+#include "config-host.h"
+
#include <stdlib.h>
#include <stdio.h>
#include <stdarg.h>
@@ -36,6 +38,12 @@
#include <sys/stat.h>
#include <netinet/in.h>
+#ifdef _BSD
+#include <sys/types.h>
+#include <sys/ioctl.h>
+#include <sys/disk.h>
+#endif
+
#include "cow.h"
#include "bswap.h"
@@ -56,6 +64,13 @@ int cow_create(int cow_fd, const char *i
perror(image_filename);
exit(1);
}
+#ifdef _BSD
+ struct stat sb;
+ if (!fstat(fd,&sb) && (S_IFCHR & sb.st_mode)) {
+ if (ioctl(fd, DIOCGMEDIASIZE, (off_t *)&image_sectors))
+ image_sectors = lseek(fd, 0LL, SEEK_END);
+ } else
+#endif
image_sectors = lseek64(fd, 0, SEEK_END);
if (fstat(fd, &st) != 0) {
close(fd);

View file

@ -0,0 +1,115 @@
Index: qemu/configure
===================================================================
RCS file: /cvsroot/qemu/qemu/configure,v
retrieving revision 1.39
diff -w -u -d -r1.39 configure
--- configure 20 May 2004 13:23:39 -0000 1.39
+++ configure 21 May 2004 15:00:41 -0000
@@ -93,7 +93,7 @@
if [ "$bsd" = "yes" ] ; then
make="gmake"
- target_list="i386-softmmu"
+ target_list="i386-softmmu ppc-softmmu"
fi
# find source path
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)
@@ -379,7 +404,6 @@
/*****************************************************************************/
/* Special helpers for debug */
-extern FILE *stdout;
void dump_state (void)
{

View file

@ -1,5 +1,6 @@
bin/qemu bin/qemu
bin/qemu-mkcow bin/qemu-mkcow
bin/qemu-system-ppc
bin/vmdk2raw bin/vmdk2raw
%%PORTDOCS%%%%DOCSDIR%%/qemu-doc.html %%PORTDOCS%%%%DOCSDIR%%/qemu-doc.html
%%PORTDOCS%%%%DOCSDIR%%/qemu-tech.html %%PORTDOCS%%%%DOCSDIR%%/qemu-tech.html