comparison gen.h @ 894:a7774fc2de4b

Partially working change to do proper stack alignment rather than doing a lame alignment check when calling a C compile dfunction. 68K core seems okay, but Z80 is busted.
author Michael Pavone <pavone@retrodev.com>
date Wed, 25 Nov 2015 08:40:45 -0800
parents d0943769353b
children 2ec5e6eaf81d
comparison
equal deleted inserted replaced
893:4f46b4cd5035 894:a7774fc2de4b
13 #define CODE_ALLOC_SIZE (1024*1024) 13 #define CODE_ALLOC_SIZE (1024*1024)
14 14
15 typedef struct { 15 typedef struct {
16 code_ptr cur; 16 code_ptr cur;
17 code_ptr last; 17 code_ptr last;
18 uint32_t stack_off;
18 } code_info; 19 } code_info;
19 20
20 void check_alloc_code(code_info *code, uint32_t inst_size); 21 void check_alloc_code(code_info *code, uint32_t inst_size);
21 22
22 void init_code_info(code_info *code); 23 void init_code_info(code_info *code);
24 void jmp(code_info *code, code_ptr dest); 25 void jmp(code_info *code, code_ptr dest);
25 void jmp_r(code_info *code, uint8_t dst); 26 void jmp_r(code_info *code, uint8_t dst);
26 //call a function and put the arguments in the appropriate place according to the host ABI 27 //call a function and put the arguments in the appropriate place according to the host ABI
27 void call_args(code_info *code, code_ptr fun, uint32_t num_args, ...); 28 void call_args(code_info *code, code_ptr fun, uint32_t num_args, ...);
28 //like the above, but follows other aspects of the ABI like stack alignment 29 //like the above, but follows other aspects of the ABI like stack alignment
29 void call_args_abi(code_info *code, code_ptr fun, uint32_t num_args, ...); 30 //void call_args_abi(code_info *code, code_ptr fun, uint32_t num_args, ...);
31 #define call_args_abi call_args
30 void save_callee_save_regs(code_info *code); 32 void save_callee_save_regs(code_info *code);
31 void restore_callee_save_regs(code_info *code); 33 void restore_callee_save_regs(code_info *code);
32 34
33 #endif //GEN_H_ 35 #endif //GEN_H_