error("unsupported i386 relocation (%d)", type);
}
#elif defined(CONFIG_FORMAT_COFF)
+ {
+ char *temp_name;
+ int j;
+ EXE_SYM *sym;
+ temp_name = get_sym_name(symtab + *(uint32_t *)(rel->r_reloc->r_symndx));
+ if (!strcmp(temp_name, ".data")) {
+ for (j = 0, sym = symtab; j < nb_syms; j++, sym++) {
+ if (strstart(sym->st_name, sym_name, NULL)) {
+ addend -= sym->st_value;
+ }
+ }
+ }
+ }
type = rel->r_type;
switch(type) {
case DIR32:
int load_image(const char *filename, uint8_t *addr)
{
int fd, size;
- fd = open(filename, O_RDONLY);
+ fd = open(filename, O_RDONLY | O_BINARY);
if (fd < 0)
return -1;
size = lseek(fd, 0, SEEK_END);
QEMUClock *vm_clock;
static QEMUTimer *active_timers[2];
-#ifndef _WIN32
+#ifdef _WIN32
+static MMRESULT timerID;
+#else
/* frequency of the times() clock tick */
static int timer_freq;
#endif
#ifdef _WIN32
{
int count=0;
- MMRESULT timerID = timeSetEvent(10, // interval (ms)
- 0, // resolution
- host_alarm_handler, // function
- (DWORD)&count, // user parameter
- TIME_PERIODIC | TIME_CALLBACK_FUNCTION);
+ timerID = timeSetEvent(10, // interval (ms)
+ 0, // resolution
+ host_alarm_handler, // function
+ (DWORD)&count, // user parameter
+ TIME_PERIODIC | TIME_CALLBACK_FUNCTION);
if( !timerID ) {
perror("failed timer alarm");
exit(1);
#endif
}
+void quit_timers(void)
+{
+#ifdef _WIN32
+ timeKillEvent(timerID);
+#endif
+}
+
/***********************************************************/
/* serial device */
}
term_init();
main_loop();
+ quit_timers();
return 0;
}
#ifndef O_LARGEFILE
#define O_LARGEFILE 0
#endif
+#ifndef O_BINARY
+#define O_BINARY 0
+#endif
#ifdef _WIN32
#define lseek64 lseek
/* monitor.c */
void monitor_init(void);
-void term_printf(const char *fmt, ...);
+void term_printf(const char *fmt, ...) __attribute__ ((__format__ (__printf__, 1, 2)));
void term_flush(void);
void term_print_help(void);