mirror of
https://gitlab.com/freepascal.org/fpc/source.git
synced 2025-08-12 12:26:02 +02:00
m68k-amiga: prepare the startup code and system unit for legacy support
git-svn-id: trunk@44563 -
This commit is contained in:
parent
433e40fe71
commit
632353a808
@ -30,6 +30,20 @@ var
|
|||||||
{$include execd.inc}
|
{$include execd.inc}
|
||||||
{$include execf.inc}
|
{$include execf.inc}
|
||||||
|
|
||||||
|
{$if defined(AMIGA_V1_0_ONLY) or defined(AMIGA_V1_2_ONLY)}
|
||||||
|
{$define AMIGA_LEGACY}
|
||||||
|
{$endif}
|
||||||
|
|
||||||
|
{$ifdef AMIGA_LEGACY}
|
||||||
|
var
|
||||||
|
args: pointer; public name '__fpc_args';
|
||||||
|
arglen: dword; public name '__fpc_arglen';
|
||||||
|
|
||||||
|
function AllocVec(byteSize : Cardinal; requirements: Cardinal): Pointer; external name '_fpc_amiga_allocvec';
|
||||||
|
procedure FreeVec(memoryBlock: Pointer); external name '_fpc_amiga_freevec';
|
||||||
|
procedure StackSwap(newStack: PStackSwapStruct); external name '_fpc_amiga_stackswap';
|
||||||
|
{$endif}
|
||||||
|
|
||||||
var
|
var
|
||||||
sst: TStackSwapStruct;
|
sst: TStackSwapStruct;
|
||||||
|
|
||||||
@ -42,6 +56,12 @@ var
|
|||||||
newStack: Pointer;
|
newStack: Pointer;
|
||||||
task: PTask;
|
task: PTask;
|
||||||
begin
|
begin
|
||||||
|
{$IFDEF AMIGA_LEGACY}
|
||||||
|
asm
|
||||||
|
move.l d0, arglen
|
||||||
|
move.l a0, args
|
||||||
|
end;
|
||||||
|
{$ENDIF}
|
||||||
AOS_ExecBase:=realExecBase;
|
AOS_ExecBase:=realExecBase;
|
||||||
newStack:=nil;
|
newStack:=nil;
|
||||||
|
|
||||||
|
@ -21,9 +21,15 @@ unit System;
|
|||||||
interface
|
interface
|
||||||
|
|
||||||
{$define FPC_IS_SYSTEM}
|
{$define FPC_IS_SYSTEM}
|
||||||
{$define FPC_HAS_ANSI_TEXTFILEREC}
|
{$define FPC_ANSI_TEXTFILEREC}
|
||||||
|
|
||||||
{.$define FPC_AMIGA_USE_TINYHEAP}
|
{$if defined(AMIGA_V1_0_ONLY) or defined(AMIGA_V1_2_ONLY)}
|
||||||
|
{$define AMIGA_LEGACY}
|
||||||
|
{$endif}
|
||||||
|
|
||||||
|
{$ifdef AMIGA_LEGACY}
|
||||||
|
{$.define FPC_AMIGA_USE_TINYHEAP}
|
||||||
|
{$endif}
|
||||||
|
|
||||||
{$ifdef FPC_AMIGA_USE_TINYHEAP}
|
{$ifdef FPC_AMIGA_USE_TINYHEAP}
|
||||||
{$define HAS_MEMORYMANAGER}
|
{$define HAS_MEMORYMANAGER}
|
||||||
@ -41,6 +47,17 @@ interface
|
|||||||
{$undef fpc_softfpu_interface}
|
{$undef fpc_softfpu_interface}
|
||||||
{$endif defined(cpum68k) and defined(fpusoft)}
|
{$endif defined(cpum68k) and defined(fpusoft)}
|
||||||
|
|
||||||
|
const
|
||||||
|
{$if defined(AMIGA_V1_0_ONLY)}
|
||||||
|
OS_MINVERSION = 0;
|
||||||
|
{$else}
|
||||||
|
{$if defined(AMIGA_V1_2_ONLY)}
|
||||||
|
OS_MINVERSION = 33;
|
||||||
|
{$else}
|
||||||
|
OS_MINVERSION = 37;
|
||||||
|
{$endif}
|
||||||
|
{$endif}
|
||||||
|
|
||||||
const
|
const
|
||||||
LineEnding = #10;
|
LineEnding = #10;
|
||||||
LFNSupport = True;
|
LFNSupport = True;
|
||||||
@ -250,11 +267,13 @@ begin
|
|||||||
AOS_wbMsg:=GetMsg(@self^.pr_MsgPort);
|
AOS_wbMsg:=GetMsg(@self^.pr_MsgPort);
|
||||||
end;
|
end;
|
||||||
|
|
||||||
AOS_DOSBase:=OpenLibrary('dos.library',37);
|
AOS_DOSBase:=OpenLibrary('dos.library',OS_MINVERSION);
|
||||||
if AOS_DOSBase=nil then Halt(1);
|
if AOS_DOSBase=nil then Halt(1);
|
||||||
AOS_UtilityBase:=OpenLibrary('utility.library',37);
|
{$ifndef AMIGA_LEGACY}
|
||||||
|
AOS_UtilityBase:=OpenLibrary('utility.library',OS_MINVERSION);
|
||||||
if AOS_UtilityBase=nil then Halt(1);
|
if AOS_UtilityBase=nil then Halt(1);
|
||||||
AOS_IntuitionBase:=OpenLibrary('intuition.library',37); { amunits support kludge }
|
{$endif}
|
||||||
|
AOS_IntuitionBase:=OpenLibrary('intuition.library',OS_MINVERSION); { amunits support kludge }
|
||||||
if AOS_IntuitionBase=nil then Halt(1);
|
if AOS_IntuitionBase=nil then Halt(1);
|
||||||
|
|
||||||
{$IFDEF AMIGAOS4}
|
{$IFDEF AMIGAOS4}
|
||||||
@ -295,10 +314,11 @@ procedure SysInitStdIO;
|
|||||||
begin
|
begin
|
||||||
OpenStdIO(Input,fmInput,StdInputHandle);
|
OpenStdIO(Input,fmInput,StdInputHandle);
|
||||||
OpenStdIO(Output,fmOutput,StdOutputHandle);
|
OpenStdIO(Output,fmOutput,StdOutputHandle);
|
||||||
OpenStdIO(StdOut,fmOutput,StdOutputHandle);
|
|
||||||
|
|
||||||
OpenStdIO(StdErr,fmOutput,StdErrorHandle);
|
|
||||||
OpenStdIO(ErrOutput,fmOutput,StdErrorHandle);
|
OpenStdIO(ErrOutput,fmOutput,StdErrorHandle);
|
||||||
|
{$ifndef FPC_STDOUT_TRUE_ALIAS}
|
||||||
|
OpenStdIO(StdOut,fmOutput,StdOutputHandle);
|
||||||
|
OpenStdIO(StdErr,fmOutput,StdErrorHandle);
|
||||||
|
{$endif FPC_STDOUT_TRUE_ALIAS}
|
||||||
end;
|
end;
|
||||||
|
|
||||||
function GetProcessID: SizeUInt;
|
function GetProcessID: SizeUInt;
|
||||||
|
Loading…
Reference in New Issue
Block a user