mirror of
https://gitlab.com/freepascal.org/fpc/source.git
synced 2025-06-03 16:18:32 +02:00
* moved pic helpers into system unit, resolves #8119
git-svn-id: trunk@17669 -
This commit is contained in:
parent
2f2c3ea545
commit
449c20ce63
@ -159,8 +159,6 @@ interface
|
||||
|
||||
function getprocalign : shortint;
|
||||
|
||||
procedure gen_pic_helpers(list : TAsmList);
|
||||
|
||||
procedure gen_fpc_dummy(list : TAsmList);
|
||||
|
||||
procedure InsertInterruptTable;
|
||||
@ -3105,36 +3103,6 @@ implementation
|
||||
end;
|
||||
|
||||
|
||||
procedure gen_pic_helpers(list : TAsmList);
|
||||
{$ifdef i386}
|
||||
var
|
||||
href : treference;
|
||||
{$endif i386}
|
||||
begin
|
||||
{ if other cpus require such helpers as well, it can be solved more cleanly }
|
||||
{$ifdef i386}
|
||||
if current_module.requires_ebx_pic_helper then
|
||||
begin
|
||||
new_section(list,sec_code,'fpc_geteipasebx',0);
|
||||
list.concat(tai_symbol.Createname('fpc_geteipasebx',AT_FUNCTION,getprocalign));
|
||||
reference_reset(href,sizeof(pint));
|
||||
href.base:=NR_ESP;
|
||||
list.concat(taicpu.op_ref_reg(A_MOV,S_L,href,NR_EBX));
|
||||
list.concat(taicpu.op_none(A_RET,S_NO));
|
||||
end;
|
||||
if current_module.requires_ecx_pic_helper then
|
||||
begin
|
||||
new_section(list,sec_code,'fpc_geteipasecx',0);
|
||||
list.concat(tai_symbol.Createname('fpc_geteipasecx',AT_FUNCTION,getprocalign));
|
||||
reference_reset(href,sizeof(pint));
|
||||
href.base:=NR_ESP;
|
||||
list.concat(taicpu.op_ref_reg(A_MOV,S_L,href,NR_ECX));
|
||||
list.concat(taicpu.op_none(A_RET,S_NO));
|
||||
end;
|
||||
{$endif i386}
|
||||
end;
|
||||
|
||||
|
||||
procedure gen_fpc_dummy(list : TAsmList);
|
||||
begin
|
||||
{$ifdef i386}
|
||||
|
@ -1357,9 +1357,6 @@ implementation
|
||||
gen_intf_wrappers(current_asmdata.asmlists[al_procedures],current_module.globalsymtable,false);
|
||||
gen_intf_wrappers(current_asmdata.asmlists[al_procedures],current_module.localsymtable,false);
|
||||
|
||||
{ generate pic helpers to load eip if necessary }
|
||||
gen_pic_helpers(current_asmdata.asmlists[al_procedures]);
|
||||
|
||||
{ generate rtti/init tables }
|
||||
write_persistent_type_info(current_module.globalsymtable);
|
||||
write_persistent_type_info(current_module.localsymtable);
|
||||
@ -2313,9 +2310,6 @@ implementation
|
||||
|
||||
InsertThreadvars;
|
||||
|
||||
{ generate pic helpers to load eip if necessary }
|
||||
gen_pic_helpers(current_asmdata.asmlists[al_procedures]);
|
||||
|
||||
{ generate rtti/init tables }
|
||||
write_persistent_type_info(current_module.localsymtable);
|
||||
|
||||
|
@ -116,6 +116,18 @@ procedure fpc_cpuinit;
|
||||
end;
|
||||
|
||||
|
||||
function fpc_geteipasebx : pointer; [public, alias: 'fpc_geteipasebx'];assembler; nostackframe;
|
||||
asm
|
||||
movl (%esp),%ebx
|
||||
end;
|
||||
|
||||
|
||||
function fpc_geteipasecx : pointer; [public, alias: 'fpc_geteipasecx'];assembler; nostackframe;
|
||||
asm
|
||||
movl (%esp),%ecx
|
||||
end;
|
||||
|
||||
|
||||
{$ifndef FPC_SYSTEM_HAS_MOVE}
|
||||
{$define FPC_SYSTEM_HAS_MOVE}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user