[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Qemu-devel] portable to old compiler and kernel
From: |
Vladimir N. Oleynik |
Subject: |
[Qemu-devel] portable to old compiler and kernel |
Date: |
Mon, 17 May 2004 13:34:40 +0400 |
User-agent: |
Mozilla/5.0 (X11; U; Linux i686; en-US; rv:1.6) Gecko/20040117 |
Hi.
I make qemu 0.5.5 with egcs and kernel 2.2.X with changes:
1) target-i386.c have duplicate initialize (egcs stoped with errors):
[INDEX_op_cmpxchgb_T0_T1_EAX_cc] = CC_OSZAPC,
[INDEX_op_cmpxchgw_T0_T1_EAX_cc] = CC_OSZAPC,
[INDEX_op_cmpxchgl_T0_T1_EAX_cc] = CC_OSZAPC,
and with generate from
DEF_WRITEF( )
2) oss.c, hw/ dma.c fdc.c sb16.c
change macros
#define lwarn(...)
#define linfo(...)
#define ldebug(...)
to
#define lwarn(...)
#define linfo(args...)
#define ldebug(args...)
3) hw/fdc.c
#define FLOPPY_ERROR(fmt, args...) \
do { printf("FLOPPY ERROR: %s: " fmt, __func__ , ##args); } while (0)
to
#define FLOPPY_ERROR(fmt, args...) \
do { printf("FLOPPY ERROR: %s: " fmt, __FUNCTION__ , ##args); } while (0)
4) my glibc have declaration with "int" type from signal.h, I unset from vl.c
//extern void __sigaction();
My kernel 2.2.X dont have linux/if_tun.h
I make new preprocessor CONFIG_IF_TUN option and change vl.c
#ifdef CONFIG_IF_TUN
#include <linux/if_tun.h>
#endif
and
static int tun_open(char *ifname, int ifname_size)
{
#if CONFIG_IF_TUN
struct ifreq ifr;
int fd, ret;
fd = open("/dev/net/tun", O_RDWR);
if (fd < 0) {
fprintf(stderr, "warning: could not open /dev/net/tun: no virtual
network emulation\n");
return -1;
}
memset(&ifr, 0, sizeof(ifr));
ifr.ifr_flags = IFF_TAP | IFF_NO_PI;
pstrcpy(ifr.ifr_name, IFNAMSIZ, "tun%d");
ret = ioctl(fd, TUNSETIFF, (void *) &ifr);
if (ret != 0) {
close(fd);
#endif
fprintf(stderr, "warning: could not configure /dev/net/tun: no virtual
network emulation\n");
return -1;
#if CONFIG_IF_TUN
}
printf("Connected to host network interface: %s\n", ifr.ifr_name);
pstrcpy(ifname, ifname_size, ifr.ifr_name);
fcntl(fd, F_SETFL, O_NONBLOCK);
return fd;
#endif
}
Its works now.
--w
vodz
- [Qemu-devel] portable to old compiler and kernel,
Vladimir N. Oleynik <=