mirror of
https://gitlab.com/freepascal.org/fpc/source.git
synced 2025-04-17 11:59:30 +02:00
palmos: use tinyheap, also tweaks to startup code
git-svn-id: trunk@37217 -
This commit is contained in:
parent
587471a0bb
commit
893228deee
@ -13,3 +13,4 @@
|
||||
|
||||
**********************************************************************}
|
||||
|
||||
{$i palmos.inc}
|
||||
|
@ -16,9 +16,11 @@ unit System;
|
||||
|
||||
interface
|
||||
|
||||
{$DEFINE HAS_MEMORYMANAGER}
|
||||
{$DEFINE FPC_ANSI_TEXTFILEREC}
|
||||
|
||||
{$i systemh.inc}
|
||||
{$i tnyheaph.inc}
|
||||
|
||||
{Platform specific information}
|
||||
const
|
||||
@ -62,12 +64,6 @@ var
|
||||
{$endif defined(FPUSOFT)}
|
||||
|
||||
|
||||
var
|
||||
{ this variables are passed to PilotMain by the PalmOS }
|
||||
cmd : Word;
|
||||
cmdPBP : PChar; // Ptr;
|
||||
launchFlags : Word;
|
||||
|
||||
implementation
|
||||
|
||||
{$if defined(FPUSOFT)}
|
||||
@ -93,20 +89,11 @@ var
|
||||
{$endif defined(FPUSOFT)}
|
||||
|
||||
{$i system.inc}
|
||||
{$i tinyheap.inc}
|
||||
{$i syspara.inc}
|
||||
|
||||
{ mimic the C start code }
|
||||
function PilotMain(_cmd : Word;_cmdPBP : PChar;{Ptr;}_launchFlags : Word) : DWord;cdecl;public;
|
||||
|
||||
begin
|
||||
cmd:=_cmd;
|
||||
cmdPBP:=_cmdPBP;
|
||||
launchFlags:=_launchFlags;
|
||||
// asm
|
||||
// bsr PASCALMAIN
|
||||
// end;
|
||||
PilotMain:=ExitCode;
|
||||
end;
|
||||
var
|
||||
palmAppInfo: SysAppInfoPtr; external name '__appInfo';
|
||||
|
||||
procedure SysInitParamsAndEnv;
|
||||
begin
|
||||
@ -124,8 +111,11 @@ var
|
||||
{*****************************************************************************
|
||||
System Dependent Exit code
|
||||
*****************************************************************************}
|
||||
Procedure system_exit;
|
||||
procedure haltproc(e:longint);cdecl; external name 'haltproc';
|
||||
|
||||
procedure system_exit;
|
||||
begin
|
||||
haltproc(ExitCode);
|
||||
end;
|
||||
|
||||
function GetProcessID: SizeUInt;
|
||||
@ -153,11 +143,16 @@ begin
|
||||
end;
|
||||
|
||||
begin
|
||||
StackLength := CheckInitialStkLen (InitialStkLen);
|
||||
{ we don't support anything but normal startup now }
|
||||
{ FIXME: lets figure it out how various startup modes }
|
||||
{ can coexist with the system unit infrastructure (KB) }
|
||||
if not (palmAppInfo^.cmd = sysAppLaunchCmdNormalLaunch) then
|
||||
halt(0);
|
||||
|
||||
StackLength := CheckInitialStkLen(InitialStkLen);
|
||||
{ Initialize ExitProc }
|
||||
ExitProc:=Nil;
|
||||
{ Setup heap }
|
||||
InitHeap;
|
||||
|
||||
SysInitExceptions;
|
||||
InitUnicodeStringManager;
|
||||
{ Setup stdin, stdout and stderr }
|
||||
|
Loading…
Reference in New Issue
Block a user