--- trunk/src/cpus/cpu_x86.c 2007/10/08 16:19:28 21 +++ trunk/src/cpus/cpu_x86.c 2007/10/08 16:19:37 22 @@ -25,7 +25,7 @@ * SUCH DAMAGE. * * - * $Id: cpu_x86.c,v 1.5 2005/11/13 00:14:07 debug Exp $ + * $Id: cpu_x86.c,v 1.7 2006/02/17 18:38:30 debug Exp $ * * x86 (and amd64) CPU emulation. * @@ -168,7 +168,7 @@ while (models[i].model_number != 0) { debug("%s", models[i].name); - for (j=0; j<10-strlen(models[i].name); j++) + for (j=0; j<10-(int)strlen(models[i].name); j++) debug(" "); i++; if ((i % 6) == 0 || models[i].name == NULL) @@ -508,14 +508,14 @@ } -static uint32_t read_imm(unsigned char **instrp, uint64_t *newpcp, +uint32_t read_imm(unsigned char **instrp, uint64_t *newpcp, int mode) { return read_imm_common(instrp, newpcp, mode, 0); } -static void print_csip(struct cpu *cpu) +void print_csip(struct cpu *cpu) { fatal("0x%04x:", cpu->cd.x86.s[X86_S_CS]); if (PROTECTED_MODE) @@ -713,7 +713,8 @@ int segment = 1, rpl, orig_selector = selector; unsigned char descr[8]; char *table_name = "GDT"; - uint64_t base, limit, table_base, table_limit; + uint64_t base, limit, table_base; + int64_t table_limit; if (segnr > 0x100) /* arbitrary, larger than N_X86_SEGS */ segment = 0; @@ -2428,7 +2429,7 @@ * * TODO: Level 1 and 2 info. */ -static void x86_cpuid(struct cpu *cpu) +void x86_cpuid(struct cpu *cpu) { switch (cpu->cd.x86.r[X86_R_AX]) { /* Normal CPU id: */ @@ -2596,7 +2597,7 @@ if (PROTECTED_MODE) { int i, int_type = 0; - if (nr * 8 > cpu->cd.x86.idtr_limit) { + if (nr * 8 > (int)cpu->cd.x86.idtr_limit) { fatal("TODO: protected mode int 0x%02x outside idtr" " limit (%i)?\n", nr, (int)cpu->cd.x86.idtr_limit); cpu->running = 0; @@ -2738,7 +2739,7 @@ /* * Real mode: */ - if (nr * 4 > cpu->cd.x86.idtr_limit) { + if (nr * 4 > (int)cpu->cd.x86.idtr_limit) { fatal("TODO: real mode int 0x%02x outside idtr limit (" "%i)?\n", nr, (int)cpu->cd.x86.idtr_limit); cpu->running = 0;