mirror of
https://gitlab.com/freepascal.org/fpc/source.git
synced 2025-09-26 15:10:12 +02:00
* fixed x86 unit for x86-64
* enabled ports again for x86_64-linux git-svn-id: trunk@11360 -
This commit is contained in:
parent
85c46e72cc
commit
5ff2312993
@ -280,7 +280,7 @@ CPU_UNITS=x86 ports cpu mmx
|
|||||||
SYSINIT_UNITS=si_prc si_c21g si_c21 si_c si_dll si_uc
|
SYSINIT_UNITS=si_prc si_c21g si_c21 si_c si_dll si_uc
|
||||||
endif
|
endif
|
||||||
ifeq ($(ARCH),x86_64)
|
ifeq ($(ARCH),x86_64)
|
||||||
CPU_UNITS=
|
CPU_UNITS=x86 ports
|
||||||
SYSINIT_UNITS= # si_prc si_c si_dll
|
SYSINIT_UNITS= # si_prc si_c si_dll
|
||||||
endif
|
endif
|
||||||
ifeq ($(ARCH),arm)
|
ifeq ($(ARCH),arm)
|
||||||
|
@ -72,7 +72,7 @@ SYSINIT_UNITS=si_prc si_c21g si_c21 si_c si_dll si_uc
|
|||||||
endif
|
endif
|
||||||
|
|
||||||
ifeq ($(ARCH),x86_64)
|
ifeq ($(ARCH),x86_64)
|
||||||
CPU_UNITS=
|
CPU_UNITS=x86 ports
|
||||||
SYSINIT_UNITS= # si_prc si_c si_dll
|
SYSINIT_UNITS= # si_prc si_c si_dll
|
||||||
endif
|
endif
|
||||||
|
|
||||||
|
184
rtl/unix/x86.pp
184
rtl/unix/x86.pp
@ -52,10 +52,17 @@ Procedure WritePort (Port : Longint; Value : Byte);
|
|||||||
}
|
}
|
||||||
begin
|
begin
|
||||||
asm
|
asm
|
||||||
|
{$ifdef CPU386}
|
||||||
movl port,%edx
|
movl port,%edx
|
||||||
movb value,%al
|
movb value,%al
|
||||||
outb %al,%dx
|
outb %al,%dx
|
||||||
end ['EAX','EDX'];
|
{$endif CPU386}
|
||||||
|
{$ifdef CPUX86_64}
|
||||||
|
movl port,%edx
|
||||||
|
movb value,%al
|
||||||
|
outb %al,%dx
|
||||||
|
{$endif CPUX86_64}
|
||||||
|
end;
|
||||||
end;
|
end;
|
||||||
|
|
||||||
Procedure WritePort (Port : Longint; Value : Word);
|
Procedure WritePort (Port : Longint; Value : Word);
|
||||||
@ -65,10 +72,17 @@ Procedure WritePort (Port : Longint; Value : Word);
|
|||||||
|
|
||||||
begin
|
begin
|
||||||
asm
|
asm
|
||||||
|
{$ifdef CPU386}
|
||||||
movl port,%edx
|
movl port,%edx
|
||||||
movw value,%ax
|
movw value,%ax
|
||||||
outw %ax,%dx
|
outw %ax,%dx
|
||||||
end ['EAX','EDX'];
|
{$endif CPU386}
|
||||||
|
{$ifdef CPUX86_64}
|
||||||
|
movl port,%edx
|
||||||
|
movw value,%ax
|
||||||
|
outw %ax,%dx
|
||||||
|
{$endif CPUX86_64}
|
||||||
|
end;
|
||||||
end;
|
end;
|
||||||
|
|
||||||
|
|
||||||
@ -77,13 +91,19 @@ Procedure WritePort (Port : Longint; Value : Longint);
|
|||||||
{
|
{
|
||||||
Writes 'Value' to port 'Port'
|
Writes 'Value' to port 'Port'
|
||||||
}
|
}
|
||||||
|
|
||||||
begin
|
begin
|
||||||
asm
|
asm
|
||||||
|
{$ifdef CPU386}
|
||||||
movl port,%edx
|
movl port,%edx
|
||||||
movl value,%eax
|
movl value,%eax
|
||||||
outl %eax,%dx
|
outl %eax,%dx
|
||||||
end ['EAX','EDX'];
|
{$endif CPU386}
|
||||||
|
{$ifdef CPUX86_64}
|
||||||
|
movl port,%edx
|
||||||
|
movl value,%eax
|
||||||
|
outl %eax,%dx
|
||||||
|
{$endif CPUX86_64}
|
||||||
|
end;
|
||||||
end;
|
end;
|
||||||
|
|
||||||
|
|
||||||
@ -93,10 +113,17 @@ Procedure WritePortB (Port : Longint; Value : Byte);
|
|||||||
}
|
}
|
||||||
begin
|
begin
|
||||||
asm
|
asm
|
||||||
|
{$ifdef CPU386}
|
||||||
movl port,%edx
|
movl port,%edx
|
||||||
movb value,%al
|
movb value,%al
|
||||||
outb %al,%dx
|
outb %al,%dx
|
||||||
end ['EAX','EDX'];
|
{$endif CPU386}
|
||||||
|
{$ifdef CPUX86_64}
|
||||||
|
movl port,%edx
|
||||||
|
movb value,%al
|
||||||
|
outb %al,%dx
|
||||||
|
{$endif CPUX86_64}
|
||||||
|
end;
|
||||||
end;
|
end;
|
||||||
|
|
||||||
Procedure WritePortW (Port : Longint; Value : Word);
|
Procedure WritePortW (Port : Longint; Value : Word);
|
||||||
@ -106,10 +133,17 @@ Procedure WritePortW (Port : Longint; Value : Word);
|
|||||||
|
|
||||||
begin
|
begin
|
||||||
asm
|
asm
|
||||||
|
{$ifdef CPU386}
|
||||||
movl port,%edx
|
movl port,%edx
|
||||||
movw value,%ax
|
movw value,%ax
|
||||||
outw %ax,%dx
|
outw %ax,%dx
|
||||||
end ['EAX','EDX'];
|
{$endif CPU386}
|
||||||
|
{$ifdef CPUX86_64}
|
||||||
|
movl port,%edx
|
||||||
|
movw value,%ax
|
||||||
|
outw %ax,%dx
|
||||||
|
{$endif CPUX86_64}
|
||||||
|
end;
|
||||||
end;
|
end;
|
||||||
|
|
||||||
|
|
||||||
@ -121,10 +155,17 @@ Procedure WritePortL (Port : Longint; Value : Longint);
|
|||||||
|
|
||||||
begin
|
begin
|
||||||
asm
|
asm
|
||||||
|
{$ifdef CPU386}
|
||||||
movl port,%edx
|
movl port,%edx
|
||||||
movl value,%eax
|
movl value,%eax
|
||||||
outl %eax,%dx
|
outl %eax,%dx
|
||||||
end ['EAX','EDX'];
|
{$endif CPU386}
|
||||||
|
{$ifdef CPUX86_64}
|
||||||
|
movl port,%edx
|
||||||
|
movl value,%eax
|
||||||
|
outl %eax,%dx
|
||||||
|
{$endif CPUX86_64}
|
||||||
|
end;
|
||||||
end;
|
end;
|
||||||
|
|
||||||
|
|
||||||
@ -135,13 +176,23 @@ Procedure WritePortl (Port : Longint; Var Buf; Count: longint);
|
|||||||
}
|
}
|
||||||
begin
|
begin
|
||||||
asm
|
asm
|
||||||
|
{$ifdef CPU386}
|
||||||
movl count,%ecx
|
movl count,%ecx
|
||||||
movl buf,%esi
|
movl buf,%esi
|
||||||
movl port,%edx
|
movl port,%edx
|
||||||
cld
|
cld
|
||||||
rep
|
rep
|
||||||
outsl
|
outsl
|
||||||
end ['ECX','ESI','EDX'];
|
{$endif CPU386}
|
||||||
|
{$ifdef CPUX86_64}
|
||||||
|
movl count,%ecx
|
||||||
|
movq buf,%rsi
|
||||||
|
movl port,%edx
|
||||||
|
cld
|
||||||
|
rep
|
||||||
|
outsl
|
||||||
|
{$endif CPUX86_64}
|
||||||
|
end;
|
||||||
end;
|
end;
|
||||||
|
|
||||||
|
|
||||||
@ -152,13 +203,23 @@ Procedure WritePortW (Port : Longint; Var Buf; Count: longint);
|
|||||||
}
|
}
|
||||||
begin
|
begin
|
||||||
asm
|
asm
|
||||||
|
{$ifdef CPU386}
|
||||||
movl count,%ecx
|
movl count,%ecx
|
||||||
movl buf,%esi
|
movl buf,%esi
|
||||||
movl port,%edx
|
movl port,%edx
|
||||||
cld
|
cld
|
||||||
rep
|
rep
|
||||||
outsw
|
outsw
|
||||||
end ['ECX','ESI','EDX'];
|
{$endif CPU386}
|
||||||
|
{$ifdef CPUX86_64}
|
||||||
|
movl count,%ecx
|
||||||
|
movq buf,%rsi
|
||||||
|
movl port,%edx
|
||||||
|
cld
|
||||||
|
rep
|
||||||
|
outsw
|
||||||
|
{$endif CPUX86_64}
|
||||||
|
end;
|
||||||
end;
|
end;
|
||||||
|
|
||||||
|
|
||||||
@ -169,13 +230,23 @@ Procedure WritePortB (Port : Longint; Var Buf; Count: longint);
|
|||||||
}
|
}
|
||||||
begin
|
begin
|
||||||
asm
|
asm
|
||||||
|
{$ifdef CPU386}
|
||||||
movl count,%ecx
|
movl count,%ecx
|
||||||
movl buf,%esi
|
movl buf,%esi
|
||||||
movl port,%edx
|
movl port,%edx
|
||||||
cld
|
cld
|
||||||
rep
|
rep
|
||||||
outsb
|
outsb
|
||||||
end ['ECX','ESI','EDX'];
|
{$endif CPU386}
|
||||||
|
{$ifdef CPUX86_64}
|
||||||
|
movl count,%ecx
|
||||||
|
movq buf,%rsi
|
||||||
|
movl port,%edx
|
||||||
|
cld
|
||||||
|
rep
|
||||||
|
outsb
|
||||||
|
{$endif CPUX86_64}
|
||||||
|
end;
|
||||||
end;
|
end;
|
||||||
|
|
||||||
|
|
||||||
@ -186,11 +257,19 @@ Procedure ReadPort (Port : Longint; Var Value : Byte);
|
|||||||
}
|
}
|
||||||
begin
|
begin
|
||||||
asm
|
asm
|
||||||
|
{$ifdef CPU386}
|
||||||
movl port,%edx
|
movl port,%edx
|
||||||
inb %dx,%al
|
inb %dx,%al
|
||||||
movl value,%edx
|
movl value,%edx
|
||||||
movb %al,(%edx)
|
movb %al,(%edx)
|
||||||
end ['EAX','EDX'];
|
{$endif CPU386}
|
||||||
|
{$ifdef CPUX86_64}
|
||||||
|
movl port,%edx
|
||||||
|
inb %dx,%al
|
||||||
|
movq value,%rdx
|
||||||
|
movb %al,(%rdx)
|
||||||
|
{$endif CPUX86_64}
|
||||||
|
end;
|
||||||
end;
|
end;
|
||||||
|
|
||||||
|
|
||||||
@ -201,11 +280,19 @@ Procedure ReadPort (Port : Longint; Var Value : Word);
|
|||||||
}
|
}
|
||||||
begin
|
begin
|
||||||
asm
|
asm
|
||||||
|
{$ifdef CPU386}
|
||||||
movl port,%edx
|
movl port,%edx
|
||||||
inw %dx,%ax
|
inw %dx,%ax
|
||||||
movl value,%edx
|
movl value,%edx
|
||||||
movw %ax,(%edx)
|
movw %ax,(%edx)
|
||||||
end ['EAX','EDX'];
|
{$endif CPU386}
|
||||||
|
{$ifdef CPUX86_64}
|
||||||
|
movl port,%edx
|
||||||
|
inw %dx,%ax
|
||||||
|
movq value,%rdx
|
||||||
|
movw %ax,(%rdx)
|
||||||
|
{$endif CPUX86_64}
|
||||||
|
end;
|
||||||
end;
|
end;
|
||||||
|
|
||||||
|
|
||||||
@ -216,11 +303,19 @@ Procedure ReadPort (Port : Longint; Var Value : Longint);
|
|||||||
}
|
}
|
||||||
begin
|
begin
|
||||||
asm
|
asm
|
||||||
|
{$ifdef CPU386}
|
||||||
movl port,%edx
|
movl port,%edx
|
||||||
inl %dx,%eax
|
inl %dx,%eax
|
||||||
movl value,%edx
|
movl value,%edx
|
||||||
movl %eax,(%edx)
|
movl %eax,(%edx)
|
||||||
end ['EAX','EDX'];
|
{$endif CPU386}
|
||||||
|
{$ifdef CPUX86_64}
|
||||||
|
movl port,%edx
|
||||||
|
inl %dx,%eax
|
||||||
|
movq value,%rdx
|
||||||
|
movl %eax,(%rdx)
|
||||||
|
{$endif CPUX86_64}
|
||||||
|
end;
|
||||||
end;
|
end;
|
||||||
|
|
||||||
|
|
||||||
@ -229,31 +324,50 @@ function ReadPortB (Port : Longint): Byte; assembler;
|
|||||||
{
|
{
|
||||||
Reads a byte from port 'Port'
|
Reads a byte from port 'Port'
|
||||||
}
|
}
|
||||||
|
|
||||||
asm
|
asm
|
||||||
|
{$ifdef CPU386}
|
||||||
movl port,%edx
|
movl port,%edx
|
||||||
xorl %eax,%eax
|
xorl %eax,%eax
|
||||||
inb %dx,%al
|
inb %dx,%al
|
||||||
end ['EAX','EDX'];
|
{$endif CPU386}
|
||||||
|
{$ifdef CPUX86_64}
|
||||||
|
movl port,%edx
|
||||||
|
xorl %eax,%eax
|
||||||
|
inb %dx,%al
|
||||||
|
{$endif CPUX86_64}
|
||||||
|
end;
|
||||||
|
|
||||||
function ReadPortW (Port : Longint): Word; assembler;
|
function ReadPortW (Port : Longint): Word; assembler;
|
||||||
{
|
{
|
||||||
Reads a word from port 'Port'
|
Reads a word from port 'Port'
|
||||||
}
|
}
|
||||||
asm
|
asm
|
||||||
|
{$ifdef CPU386}
|
||||||
movl port,%edx
|
movl port,%edx
|
||||||
xorl %eax,%eax
|
xorl %eax,%eax
|
||||||
inw %dx,%ax
|
inw %dx,%ax
|
||||||
end ['EAX','EDX'];
|
{$endif CPU386}
|
||||||
|
{$ifdef CPUX86_64}
|
||||||
|
movl port,%edx
|
||||||
|
xorl %eax,%eax
|
||||||
|
inw %dx,%ax
|
||||||
|
{$endif CPUX86_64}
|
||||||
|
end;
|
||||||
|
|
||||||
function ReadPortL (Port : Longint): LongInt; assembler;
|
function ReadPortL (Port : Longint): LongInt; assembler;
|
||||||
{
|
{
|
||||||
Reads a LongInt from port 'Port'
|
Reads a LongInt from port 'Port'
|
||||||
}
|
}
|
||||||
asm
|
asm
|
||||||
|
{$ifdef CPU386}
|
||||||
movl port,%edx
|
movl port,%edx
|
||||||
inl %dx,%eax
|
inl %dx,%eax
|
||||||
end ['EAX','EDX'];
|
{$endif CPU386}
|
||||||
|
{$ifdef CPUX86_64}
|
||||||
|
movl port,%edx
|
||||||
|
inl %dx,%eax
|
||||||
|
{$endif CPUX86_64}
|
||||||
|
end;
|
||||||
|
|
||||||
Procedure ReadPortL (Port : Longint; Var Buf; Count: longint);
|
Procedure ReadPortL (Port : Longint; Var Buf; Count: longint);
|
||||||
{
|
{
|
||||||
@ -261,13 +375,23 @@ Procedure ReadPortL (Port : Longint; Var Buf; Count: longint);
|
|||||||
}
|
}
|
||||||
begin
|
begin
|
||||||
asm
|
asm
|
||||||
|
{$ifdef CPU386}
|
||||||
movl count,%ecx
|
movl count,%ecx
|
||||||
movl buf,%edi
|
movl buf,%edi
|
||||||
movl port,%edx
|
movl port,%edx
|
||||||
cld
|
cld
|
||||||
rep
|
rep
|
||||||
insl
|
insl
|
||||||
end ['ECX','EDI','EDX'];
|
{$endif CPU386}
|
||||||
|
{$ifdef CPUX86_64}
|
||||||
|
movl count,%ecx
|
||||||
|
movq buf,%rdi
|
||||||
|
movl port,%edx
|
||||||
|
cld
|
||||||
|
rep
|
||||||
|
insl
|
||||||
|
{$endif CPUX86_64}
|
||||||
|
end;
|
||||||
end;
|
end;
|
||||||
|
|
||||||
|
|
||||||
@ -278,13 +402,23 @@ Procedure ReadPortW (Port : Longint; Var Buf; Count: longint);
|
|||||||
}
|
}
|
||||||
begin
|
begin
|
||||||
asm
|
asm
|
||||||
|
{$ifdef CPU386}
|
||||||
movl count,%ecx
|
movl count,%ecx
|
||||||
movl buf,%edi
|
movl buf,%edi
|
||||||
movl port,%edx
|
movl port,%edx
|
||||||
cld
|
cld
|
||||||
rep
|
rep
|
||||||
insw
|
insw
|
||||||
end ['ECX','EDI','EDX'];
|
{$endif CPU386}
|
||||||
|
{$ifdef CPUX86_64}
|
||||||
|
movl count,%ecx
|
||||||
|
movq buf,%rdi
|
||||||
|
movl port,%edx
|
||||||
|
cld
|
||||||
|
rep
|
||||||
|
insw
|
||||||
|
{$endif CPUX86_64}
|
||||||
|
end;
|
||||||
end;
|
end;
|
||||||
|
|
||||||
Procedure ReadPortB (Port : Longint; Var Buf; Count: longint);
|
Procedure ReadPortB (Port : Longint; Var Buf; Count: longint);
|
||||||
@ -293,13 +427,23 @@ Procedure ReadPortB (Port : Longint; Var Buf; Count: longint);
|
|||||||
}
|
}
|
||||||
begin
|
begin
|
||||||
asm
|
asm
|
||||||
|
{$ifdef CPU386}
|
||||||
movl count,%ecx
|
movl count,%ecx
|
||||||
movl buf,%edi
|
movl buf,%edi
|
||||||
movl port,%edx
|
movl port,%edx
|
||||||
cld
|
cld
|
||||||
rep
|
rep
|
||||||
insb
|
insb
|
||||||
end ['ECX','EDI','EDX'];
|
{$endif CPU386}
|
||||||
|
{$ifdef CPUX86_64}
|
||||||
|
movl count,%ecx
|
||||||
|
movq buf,%rdi
|
||||||
|
movl port,%edx
|
||||||
|
cld
|
||||||
|
rep
|
||||||
|
insb
|
||||||
|
{$endif CPUX86_64}
|
||||||
|
end;
|
||||||
end;
|
end;
|
||||||
|
|
||||||
{$ifdef linux}
|
{$ifdef linux}
|
||||||
|
Loading…
Reference in New Issue
Block a user