Makefile.mingw corrections and made the code pass much stricter checks (now mandated by Makefile.mignw) to ensure GCC 14 readiness.

This commit is contained in:
OBattler
2022-11-17 22:44:06 +01:00
parent 74eb753d59
commit 27ebb27db7
108 changed files with 682 additions and 680 deletions

View File

@@ -9,12 +9,12 @@
#include "x86_ops.h"
#include "codegen.h"
void (*codegen_timing_start)();
void (*codegen_timing_start)(void);
void (*codegen_timing_prefix)(uint8_t prefix, uint32_t fetchdat);
void (*codegen_timing_opcode)(uint8_t opcode, uint32_t fetchdat, int op_32, uint32_t op_pc);
void (*codegen_timing_block_start)();
void (*codegen_timing_block_end)();
int (*codegen_timing_jump_cycles)();
void (*codegen_timing_block_start)(void);
void (*codegen_timing_block_end)(void);
int (*codegen_timing_jump_cycles)(void);
void codegen_timing_set(codegen_timing_t *timing)
{

View File

@@ -292,39 +292,39 @@ extern codeblock_t *codeblock;
extern codeblock_t **codeblock_hash;
void codegen_init();
void codegen_reset();
void codegen_block_init(uint32_t phys_addr);
void codegen_block_remove();
void codegen_block_start_recompile(codeblock_t *block);
void codegen_block_end_recompile(codeblock_t *block);
void codegen_block_end();
void codegen_generate_call(uint8_t opcode, OpFn op, uint32_t fetchdat, uint32_t new_pc, uint32_t old_pc);
void codegen_generate_seg_restore();
void codegen_set_op32();
void codegen_flush();
void codegen_check_flush(page_t *page, uint64_t mask, uint32_t phys_addr);
extern void codegen_init(void);
extern void codegen_reset(void);
extern void codegen_block_init(uint32_t phys_addr);
extern void codegen_block_remove(void);
extern void codegen_block_start_recompile(codeblock_t *block);
extern void codegen_block_end_recompile(codeblock_t *block);
extern void codegen_block_end(void);
extern void codegen_generate_call(uint8_t opcode, OpFn op, uint32_t fetchdat, uint32_t new_pc, uint32_t old_pc);
extern void codegen_generate_seg_restore(void);
extern void codegen_set_op32(void);
extern void codegen_flush(void);
extern void codegen_check_flush(page_t *page, uint64_t mask, uint32_t phys_addr);
extern int cpu_block_end;
extern uint32_t codegen_endpc;
extern int codegen_block_cycles;
extern void (*codegen_timing_start)();
extern void (*codegen_timing_start)(void);
extern void (*codegen_timing_prefix)(uint8_t prefix, uint32_t fetchdat);
extern void (*codegen_timing_opcode)(uint8_t opcode, uint32_t fetchdat, int op_32, uint32_t op_pc);
extern void (*codegen_timing_block_start)();
extern void (*codegen_timing_block_end)();
extern int (*codegen_timing_jump_cycles)();
extern void (*codegen_timing_block_start)(void);
extern void (*codegen_timing_block_end)(void);
extern int (*codegen_timing_jump_cycles)(void);
typedef struct codegen_timing_t
{
void (*start)();
void (*start)(void);
void (*prefix)(uint8_t prefix, uint32_t fetchdat);
void (*opcode)(uint8_t opcode, uint32_t fetchdat, int op_32, uint32_t op_pc);
void (*block_start)();
void (*block_end)();
int (*jump_cycles)();
void (*block_start)(void);
void (*block_end)(void);
int (*jump_cycles)(void);
} codegen_timing_t;
extern codegen_timing_t codegen_timing_pentium;

View File

@@ -9,4 +9,4 @@ struct ir_data_t;
void codegen_accumulate(int acc_reg, int delta);
void codegen_accumulate_flush(void);
void codegen_accumulate_reset();
void codegen_accumulate_reset(void);

View File

@@ -61,7 +61,7 @@ void codegen_accumulate_flush(void)
acc_regs[0].count = 0;
}
void codegen_accumulate_reset()
void codegen_accumulate_reset(void)
{
acc_regs[0].count = 0;
}

View File

@@ -58,7 +58,7 @@ void codegen_accumulate_flush(void)
acc_regs[0].count = 0;
}
void codegen_accumulate_reset()
void codegen_accumulate_reset(void)
{
acc_regs[0].count = 0;
}

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

View File

@@ -60,7 +60,7 @@ static uint32_t last_op32;
static x86seg *last_ea_seg;
static int last_ssegs;
void codegen_init()
void codegen_init(void)
{
int c;
@@ -80,7 +80,7 @@ void codegen_init()
codeblock[c].valid = 0;
}
void codegen_reset()
void codegen_reset(void)
{
int c;
@@ -92,7 +92,7 @@ void codegen_reset()
codeblock[c].valid = 0;
}
void dump_block()
void dump_block(void)
{
}
@@ -381,7 +381,7 @@ void codegen_block_start_recompile(codeblock_t *block)
codegen_flat_ss = !(cpu_cur_status & CPU_STATUS_NOTFLATSS);
}
void codegen_block_remove()
void codegen_block_remove(void)
{
codeblock_t *block = &codeblock[block_current];
@@ -390,7 +390,7 @@ void codegen_block_remove()
recomp_page = -1;
}
void codegen_block_generate_end_mask()
void codegen_block_generate_end_mask(void)
{
codeblock_t *block = &codeblock[block_current];
uint32_t start_pc;
@@ -448,7 +448,7 @@ void codegen_block_generate_end_mask()
recomp_page = -1;
}
void codegen_block_end()
void codegen_block_end(void)
{
codeblock_t *block = &codeblock[block_current];
@@ -491,7 +491,7 @@ void codegen_block_end_recompile(codeblock_t *block)
add_to_block_list(block);
}
void codegen_flush()
void codegen_flush(void)
{
return;
}
@@ -541,7 +541,7 @@ int opcode_0f_modrm[256] =
0, 1, 1, 1, 0, 1, 0, 0, 1, 1, 1, 0, 1, 1, 1, 0 /*f0*/
};
void codegen_debug()
void codegen_debug(void)
{
}

View File

@@ -120,7 +120,7 @@ uint32_t mem_check_write;
uint32_t mem_check_write_w;
uint32_t mem_check_write_l;
static uint32_t gen_MEM_LOAD_ADDR_EA_B()
static uint32_t gen_MEM_LOAD_ADDR_EA_B(void)
{
uint32_t addr = (uint32_t)&codeblock[block_current].data[block_pos];
@@ -171,7 +171,7 @@ static uint32_t gen_MEM_LOAD_ADDR_EA_B()
return addr;
}
static uint32_t gen_MEM_LOAD_ADDR_EA_W()
static uint32_t gen_MEM_LOAD_ADDR_EA_W(void)
{
uint32_t addr = (uint32_t)&codeblock[block_current].data[block_pos];
@@ -227,7 +227,7 @@ static uint32_t gen_MEM_LOAD_ADDR_EA_W()
return addr;
}
static uint32_t gen_MEM_LOAD_ADDR_EA_L()
static uint32_t gen_MEM_LOAD_ADDR_EA_L(void)
{
uint32_t addr = (uint32_t)&codeblock[block_current].data[block_pos];
@@ -279,7 +279,7 @@ static uint32_t gen_MEM_LOAD_ADDR_EA_L()
return addr;
}
static uint32_t gen_MEM_LOAD_ADDR_EA_Q()
static uint32_t gen_MEM_LOAD_ADDR_EA_Q(void)
{
uint32_t addr = (uint32_t)&codeblock[block_current].data[block_pos];
@@ -335,7 +335,7 @@ static uint32_t gen_MEM_LOAD_ADDR_EA_Q()
return addr;
}
static uint32_t gen_MEM_STORE_ADDR_EA_B()
static uint32_t gen_MEM_STORE_ADDR_EA_B(void)
{
uint32_t addr = (uint32_t)&codeblock[block_current].data[block_pos];
@@ -384,7 +384,7 @@ static uint32_t gen_MEM_STORE_ADDR_EA_B()
return addr;
}
static uint32_t gen_MEM_STORE_ADDR_EA_W()
static uint32_t gen_MEM_STORE_ADDR_EA_W(void)
{
uint32_t addr = (uint32_t)&codeblock[block_current].data[block_pos];
@@ -439,7 +439,7 @@ static uint32_t gen_MEM_STORE_ADDR_EA_W()
return addr;
}
static uint32_t gen_MEM_STORE_ADDR_EA_L()
static uint32_t gen_MEM_STORE_ADDR_EA_L(void)
{
uint32_t addr = (uint32_t)&codeblock[block_current].data[block_pos];
@@ -493,7 +493,7 @@ static uint32_t gen_MEM_STORE_ADDR_EA_L()
return addr;
}
static uint32_t gen_MEM_STORE_ADDR_EA_Q()
static uint32_t gen_MEM_STORE_ADDR_EA_Q(void)
{
uint32_t addr = (uint32_t)&codeblock[block_current].data[block_pos];
@@ -555,7 +555,7 @@ static uint32_t gen_MEM_STORE_ADDR_EA_Q()
#ifndef RELEASE_BUILD
static char gen_MEM_LOAD_ADDR_EA_B_NO_ABRT_err[] = "gen_MEM_LOAD_ADDR_EA_B_NO_ABRT aborted\n";
#endif
static uint32_t gen_MEM_LOAD_ADDR_EA_B_NO_ABRT()
static uint32_t gen_MEM_LOAD_ADDR_EA_B_NO_ABRT(void)
{
uint32_t addr = (uint32_t)&codeblock[block_current].data[block_pos];
@@ -620,7 +620,7 @@ static uint32_t gen_MEM_LOAD_ADDR_EA_B_NO_ABRT()
#ifndef RELEASE_BUILD
static char gen_MEM_LOAD_ADDR_EA_W_NO_ABRT_err[] = "gen_MEM_LOAD_ADDR_EA_W_NO_ABRT aborted\n";
#endif
static uint32_t gen_MEM_LOAD_ADDR_EA_W_NO_ABRT()
static uint32_t gen_MEM_LOAD_ADDR_EA_W_NO_ABRT(void)
{
uint32_t addr = (uint32_t)&codeblock[block_current].data[block_pos];
@@ -690,7 +690,7 @@ static uint32_t gen_MEM_LOAD_ADDR_EA_W_NO_ABRT()
#ifndef RELEASE_BUILD
static char gen_MEM_LOAD_ADDR_EA_L_NO_ABRT_err[] = "gen_MEM_LOAD_ADDR_EA_L_NO_ABRT aborted\n";
#endif
static uint32_t gen_MEM_LOAD_ADDR_EA_L_NO_ABRT()
static uint32_t gen_MEM_LOAD_ADDR_EA_L_NO_ABRT(void)
{
uint32_t addr = (uint32_t)&codeblock[block_current].data[block_pos];
@@ -759,7 +759,7 @@ static uint32_t gen_MEM_LOAD_ADDR_EA_L_NO_ABRT()
#ifndef RELEASE_BUILD
static char gen_MEM_STORE_ADDR_EA_B_NO_ABRT_err[] = "gen_MEM_STORE_ADDR_EA_B_NO_ABRT aborted\n";
#endif
static uint32_t gen_MEM_STORE_ADDR_EA_B_NO_ABRT()
static uint32_t gen_MEM_STORE_ADDR_EA_B_NO_ABRT(void)
{
uint32_t addr = (uint32_t)&codeblock[block_current].data[block_pos];
@@ -820,7 +820,7 @@ static uint32_t gen_MEM_STORE_ADDR_EA_B_NO_ABRT()
#ifndef RELEASE_BUILD
static char gen_MEM_STORE_ADDR_EA_W_NO_ABRT_err[] = "gen_MEM_STORE_ADDR_EA_W_NO_ABRT aborted\n";
#endif
static uint32_t gen_MEM_STORE_ADDR_EA_W_NO_ABRT()
static uint32_t gen_MEM_STORE_ADDR_EA_W_NO_ABRT(void)
{
uint32_t addr = (uint32_t)&codeblock[block_current].data[block_pos];
@@ -887,7 +887,7 @@ static uint32_t gen_MEM_STORE_ADDR_EA_W_NO_ABRT()
#ifndef RELEASE_BUILD
static char gen_MEM_STORE_ADDR_EA_L_NO_ABRT_err[] = "gen_MEM_STORE_ADDR_EA_L_NO_ABRT aborted\n";
#endif
static uint32_t gen_MEM_STORE_ADDR_EA_L_NO_ABRT()
static uint32_t gen_MEM_STORE_ADDR_EA_L_NO_ABRT(void)
{
uint32_t addr = (uint32_t)&codeblock[block_current].data[block_pos];
@@ -950,7 +950,7 @@ static uint32_t gen_MEM_STORE_ADDR_EA_L_NO_ABRT()
return addr;
}
static uint32_t gen_MEM_CHECK_WRITE()
static uint32_t gen_MEM_CHECK_WRITE(void)
{
uint32_t addr = (uint32_t)&codeblock[block_current].data[block_pos];
@@ -1007,7 +1007,7 @@ static uint32_t gen_MEM_CHECK_WRITE()
return addr;
}
static uint32_t gen_MEM_CHECK_WRITE_W()
static uint32_t gen_MEM_CHECK_WRITE_W(void)
{
uint32_t addr = (uint32_t)&codeblock[block_current].data[block_pos];
@@ -1089,7 +1089,7 @@ static uint32_t gen_MEM_CHECK_WRITE_W()
return addr;
}
static uint32_t gen_MEM_CHECK_WRITE_L()
static uint32_t gen_MEM_CHECK_WRITE_L(void)
{
uint32_t addr = (uint32_t)&codeblock[block_current].data[block_pos];
@@ -1171,7 +1171,7 @@ static uint32_t gen_MEM_CHECK_WRITE_L()
return addr;
}
void codegen_init()
void codegen_init(void)
{
#ifdef _WIN32
codeblock = VirtualAlloc(NULL, (BLOCK_SIZE+1) * sizeof(codeblock_t), MEM_COMMIT, PAGE_EXECUTE_READWRITE);
@@ -1244,14 +1244,14 @@ void codegen_init()
#endif
}
void codegen_reset()
void codegen_reset(void)
{
memset(codeblock, 0, BLOCK_SIZE * sizeof(codeblock_t));
memset(codeblock_hash, 0, HASH_SIZE * sizeof(codeblock_t *));
mem_reset_page_blocks();
}
void dump_block()
void dump_block(void)
{
}
@@ -1512,7 +1512,7 @@ void codegen_block_start_recompile(codeblock_t *block)
codegen_accumulate_reset();
}
void codegen_block_remove()
void codegen_block_remove(void)
{
codeblock_t *block = &codeblock[block_current];
@@ -1521,7 +1521,7 @@ void codegen_block_remove()
recomp_page = -1;
}
void codegen_block_generate_end_mask()
void codegen_block_generate_end_mask(void)
{
codeblock_t *block = &codeblock[block_current];
uint32_t start_pc;
@@ -1581,7 +1581,7 @@ void codegen_block_generate_end_mask()
recomp_page = -1;
}
void codegen_block_end()
void codegen_block_end(void)
{
codeblock_t *block = &codeblock[block_current];
@@ -1618,7 +1618,7 @@ void codegen_block_end_recompile(codeblock_t *block)
block->flags &= ~CODEBLOCK_STATIC_TOP;
}
void codegen_flush()
void codegen_flush(void)
{
return;
}
@@ -1668,7 +1668,7 @@ int opcode_0f_modrm[256] =
0, 1, 1, 1, 0, 1, 0, 0, 1, 1, 1, 0, 1, 1, 1, 0 /*f0*/
};
void codegen_debug()
void codegen_debug(void)
{
}