* use 16-bit offsets for threadvars on CPUs with 16-bit address space

git-svn-id: trunk@32013 -
This commit is contained in:
nickysn 2015-10-11 12:16:26 +00:00
parent 2116552b36
commit 12a9664181
4 changed files with 9 additions and 5 deletions

View File

@ -1236,7 +1236,11 @@ implementation
result:=crecorddef.create_global_internal(
name,sizeof(pint),sizeof(pint),
init_settings.alignment.maxCrecordalign);
{$ifdef cpu16bitaddr}
index_field:=result.add_field_by_def('',u16inttype);
{$else cpu16bitaddr}
index_field:=result.add_field_by_def('',u32inttype);
{$endif cpu16bitaddr}
non_mt_data_field:=result.add_field_by_def('',def);
{ no need to add alignment padding, we won't create arrays of these }
end;

View File

@ -437,13 +437,13 @@ begin
Result:=-1;
end;
procedure NoInitThreadvar(var offset : dword;size : dword);
procedure NoInitThreadvar(var offset : {$ifdef cpu16}word{$else}dword{$endif};size : dword);
begin
NoThreadError;
end;
function NoRelocateThreadvar(offset : dword) : pointer;
function NoRelocateThreadvar(offset : {$ifdef cpu16}word{$else}dword{$endif}) : pointer;
begin
NoThreadError;

View File

@ -47,8 +47,8 @@ type
TGetCurrentThreadIdHandler = Function : TThreadID;
TCriticalSectionHandler = Procedure (var cs);
TCriticalSectionHandlerTryEnter = function (var cs):longint;
TInitThreadVarHandler = Procedure(var offset : dword;size : dword);
TRelocateThreadVarHandler = Function(offset : dword) : pointer;
TInitThreadVarHandler = Procedure(var offset : {$ifdef cpu16}word{$else}dword{$endif};size : dword);
TRelocateThreadVarHandler = Function(offset : {$ifdef cpu16}word{$else}dword{$endif}) : pointer;
TAllocateThreadVarsHandler = Procedure;
TReleaseThreadVarsHandler = Procedure;
TBasicEventHandler = procedure(state:peventstate);

View File

@ -23,7 +23,7 @@
type
pltvInitEntry = ^ltvInitEntry;
ltvInitEntry = packed record
varaddr : pdword;
varaddr : {$ifdef cpu16}pword{$else}pdword{$endif};
size : longint;
end;