mirror of
https://gitlab.com/freepascal.org/fpc/source.git
synced 2025-08-18 18:29:18 +02:00
m68k-palmos: skeleton for a recent system unit
git-svn-id: trunk@36862 -
This commit is contained in:
parent
4c7b73d48d
commit
5f2dce07d3
8
.gitattributes
vendored
8
.gitattributes
vendored
@ -9908,11 +9908,15 @@ rtl/palmos/m68k/crt0.o -text
|
|||||||
rtl/palmos/m68k/gdbstub.o -text
|
rtl/palmos/m68k/gdbstub.o -text
|
||||||
rtl/palmos/m68k/libcrt.a -text
|
rtl/palmos/m68k/libcrt.a -text
|
||||||
rtl/palmos/m68k/prt0.as svneol=native#text/plain
|
rtl/palmos/m68k/prt0.as svneol=native#text/plain
|
||||||
rtl/palmos/os.inc svneol=native#text/plain
|
|
||||||
rtl/palmos/pilot.pp svneol=native#text/plain
|
rtl/palmos/pilot.pp svneol=native#text/plain
|
||||||
rtl/palmos/readme -text
|
rtl/palmos/readme -text
|
||||||
rtl/palmos/rtldefs.inc svneol=native#text/plain
|
rtl/palmos/rtldefs.inc svneol=native#text/plain
|
||||||
rtl/palmos/syspalm.pp svneol=native#text/plain
|
rtl/palmos/sysdir.inc svneol=native#text/plain
|
||||||
|
rtl/palmos/sysfile.inc svneol=native#text/plain
|
||||||
|
rtl/palmos/sysheap.inc svneol=native#text/plain
|
||||||
|
rtl/palmos/sysos.inc svneol=native#text/plain
|
||||||
|
rtl/palmos/sysosh.inc svneol=native#text/plain
|
||||||
|
rtl/palmos/syspara.inc svneol=native#text/plain
|
||||||
rtl/palmos/system.pp svneol=native#text/plain
|
rtl/palmos/system.pp svneol=native#text/plain
|
||||||
rtl/palmos/systraps.pp svneol=native#text/plain
|
rtl/palmos/systraps.pp svneol=native#text/plain
|
||||||
rtl/powerpc/int64p.inc svneol=native#text/plain
|
rtl/powerpc/int64p.inc svneol=native#text/plain
|
||||||
|
@ -1,81 +1,16 @@
|
|||||||
This file isn't ready yet, we use the C startup code in crt0.o instead.
|
#
|
||||||
|
# This file is part of the Free Pascal run time library.
|
||||||
|
# Copyright (c) 2017 by Karoly Balogh
|
||||||
|
# member of the Free Pascal development team.
|
||||||
|
#
|
||||||
|
# See the file COPYING.FPC, included in this distribution,
|
||||||
|
# for details about the copyright.
|
||||||
|
#
|
||||||
|
# This program is distributed in the hope that it will be useful,
|
||||||
|
# but WITHOUT ANY WARRANTY;without even the implied warranty of
|
||||||
|
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
|
||||||
|
#
|
||||||
|
#**********************************************************************}
|
||||||
|
#
|
||||||
|
|
||||||
c:\FPC\FIXES\RTL\PALMOS\CRT0.O(.text+0x46):crt0.c: undefined reference to `_GccR
|
# FIX ME: dummy file, required for the build to pass, implement! (KB)
|
||||||
elocateData'
|
|
||||||
c:\FPC\FIXES\RTL\PALMOS\CRT0.O(.text+0x46):crt0.c: relocation truncated to fit:
|
|
||||||
DISP16 _GccRelocateData
|
|
||||||
c:\FPC\FIXES\RTL\PALMOS\CRT0.O(.text+0x50):crt0.c: undefined reference to `__do_
|
|
||||||
bhook'
|
|
||||||
c:\FPC\FIXES\RTL\PALMOS\CRT0.O(.text+0x50):crt0.c: relocation truncated to fit:
|
|
||||||
DISP16 __do_bhook
|
|
||||||
c:\FPC\FIXES\RTL\PALMOS\CRT0.O(.text+0x5a):crt0.c: undefined reference to `__do_
|
|
||||||
ctors'
|
|
||||||
c:\FPC\FIXES\RTL\PALMOS\CRT0.O(.text+0x5a):crt0.c: relocation truncated to fit:
|
|
||||||
DISP16 __do_ctors
|
|
||||||
c:\FPC\FIXES\RTL\PALMOS\CRT0.O(.text+0x70):crt0.c: undefined reference to `__do_
|
|
||||||
dtors'
|
|
||||||
c:\FPC\FIXES\RTL\PALMOS\CRT0.O(.text+0x70):crt0.c: relocation truncated to fit:
|
|
||||||
DISP16 __do_dtors
|
|
||||||
c:\FPC\FIXES\RTL\PALMOS\CRT0.O(.text+0x7a):crt0.c: undefined reference to `__do_
|
|
||||||
ehook'
|
|
||||||
c:\FPC\FIXES\RTL\PALMOS\CRT0.O(.text+0x7a):crt0.c: relocation truncated to fit:
|
|
||||||
DISP16 __do_ehook
|
|
||||||
TEST.O(.text+0x6):test.pas: undefined reference to `FPC_INITIALIZEUNITS'
|
|
||||||
TEST.O(.text+0x10):test.pas: undefined reference to `FPC_DO_EXIT'
|
|
||||||
|
|
||||||
Disassembly of section .text:
|
|
||||||
|
|
||||||
00000000 <start>:
|
|
||||||
0: 4e56 fff4 linkw %fp,#-12
|
|
||||||
4: 48e7 1f00 moveml %d3-%d7,%sp@-
|
|
||||||
8: 486e fffc pea %fp@(-4)
|
|
||||||
c: 486e fff8 pea %fp@(-8)
|
|
||||||
10: 486e fff4 pea %fp@(-12)
|
|
||||||
14: 4e4f trap #15
|
|
||||||
16: a08f 0120217
|
|
||||||
18: 4fef 000c lea %sp@(12),%sp
|
|
||||||
1c: 4a40 tstw %d0
|
|
||||||
1e: 670e beqs 2e <start+0x2e>
|
|
||||||
20: 1f3c 0003 moveb #3,%sp@-
|
|
||||||
24: 4e4f trap #15
|
|
||||||
26: a234 0121064
|
|
||||||
28: 70ff moveq #-1,%d0
|
|
||||||
2a: 6000 0062 braw 8e <start+0x8e>
|
|
||||||
2e: 206e fff4 moveal %fp@(-12),%a0
|
|
||||||
32: 3c10 movew %a0@,%d6
|
|
||||||
34: 2a28 0002 movel %a0@(2),%d5
|
|
||||||
38: 3828 0006 movew %a0@(6),%d4
|
|
||||||
3c: 3604 movew %d4,%d3
|
|
||||||
3e: 0243 0004 andiw #4,%d3
|
|
||||||
42: 6704 beqs 48 <start+0x48>
|
|
||||||
44: 6100 ffba bsrw 0 <start>
|
|
||||||
48: 3f04 movew %d4,%sp@-
|
|
||||||
4a: 2f05 movel %d5,%sp@-
|
|
||||||
4c: 3f06 movew %d6,%sp@-
|
|
||||||
4e: 6100 ffb0 bsrw 0 <start>
|
|
||||||
52: 508f addql #8,%sp
|
|
||||||
54: 4a43 tstw %d3
|
|
||||||
56: 6704 beqs 5c <start+0x5c>
|
|
||||||
58: 6100 ffa6 bsrw 0 <start>
|
|
||||||
5c: 3f04 movew %d4,%sp@-
|
|
||||||
5e: 2f05 movel %d5,%sp@-
|
|
||||||
60: 3f06 movew %d6,%sp@-
|
|
||||||
62: 6100 ff9c bsrw 0 <start>
|
|
||||||
66: 2e00 movel %d0,%d7
|
|
||||||
68: 508f addql #8,%sp
|
|
||||||
6a: 4a43 tstw %d3
|
|
||||||
6c: 6704 beqs 72 <start+0x72>
|
|
||||||
6e: 6100 ff90 bsrw 0 <start>
|
|
||||||
72: 3f04 movew %d4,%sp@-
|
|
||||||
74: 2f05 movel %d5,%sp@-
|
|
||||||
76: 3f06 movew %d6,%sp@-
|
|
||||||
78: 6100 ff86 bsrw 0 <start>
|
|
||||||
7c: 2f2e fffc movel %fp@(-4),%sp@-
|
|
||||||
80: 2f2e fff8 movel %fp@(-8),%sp@-
|
|
||||||
84: 2f2e fff4 movel %fp@(-12),%sp@-
|
|
||||||
88: 4e4f trap #15
|
|
||||||
8a: a090 0120220
|
|
||||||
8c: 2007 movel %d7,%d0
|
|
||||||
8e: 4cee 00f8 ffe0 moveml %fp@(-32),%d3-%d7
|
|
||||||
94: 4e5e unlk %fp
|
|
||||||
96: 4e75 rts
|
|
||||||
|
62
rtl/palmos/sysdir.inc
Normal file
62
rtl/palmos/sysdir.inc
Normal file
@ -0,0 +1,62 @@
|
|||||||
|
{
|
||||||
|
This file is part of the Free Pascal run time library.
|
||||||
|
Copyright (c) 2017 by Free Pascal development team
|
||||||
|
|
||||||
|
Low level directory functions
|
||||||
|
|
||||||
|
See the file COPYING.FPC, included in this distribution,
|
||||||
|
for details about the copyright.
|
||||||
|
|
||||||
|
This program is distributed in the hope that it will be useful,
|
||||||
|
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||||
|
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
|
||||||
|
|
||||||
|
**********************************************************************}
|
||||||
|
|
||||||
|
|
||||||
|
{*****************************************************************************
|
||||||
|
Directory Handling
|
||||||
|
*****************************************************************************}
|
||||||
|
{$if defined(FPC_HAS_FEATURE_ANSISTRINGS)}
|
||||||
|
procedure do_mkdir(const s: rawbytestring);
|
||||||
|
begin
|
||||||
|
InOutRes:=3;
|
||||||
|
end;
|
||||||
|
|
||||||
|
procedure do_rmdir(const s: rawbytestring);
|
||||||
|
begin
|
||||||
|
InOutRes:=3;
|
||||||
|
end;
|
||||||
|
|
||||||
|
procedure do_chdir(const s: rawbytestring);
|
||||||
|
begin
|
||||||
|
InOutRes:=3;
|
||||||
|
end;
|
||||||
|
|
||||||
|
procedure do_GetDir (DriveNr: byte; var Dir: RawByteString);
|
||||||
|
begin
|
||||||
|
InOutRes:=3;
|
||||||
|
end;
|
||||||
|
|
||||||
|
{$else FPC_HAS_FEATURE_ANSISTRINGS}
|
||||||
|
|
||||||
|
procedure mkdir(const s: shortstring);
|
||||||
|
begin
|
||||||
|
InOutRes:=3;
|
||||||
|
end;
|
||||||
|
|
||||||
|
procedure rmdir(const s: shortstring);
|
||||||
|
begin
|
||||||
|
InOutRes:=3;
|
||||||
|
end;
|
||||||
|
|
||||||
|
procedure chdir(const s: shortstring);
|
||||||
|
begin
|
||||||
|
InOutRes:=3;
|
||||||
|
end;
|
||||||
|
|
||||||
|
procedure GetDir (DriveNr: byte; var Dir: ShortString);
|
||||||
|
begin
|
||||||
|
InOutRes:=3;
|
||||||
|
end;
|
||||||
|
{$endif FPC_HAS_FEATURE_ANSISTRINGS}
|
86
rtl/palmos/sysfile.inc
Normal file
86
rtl/palmos/sysfile.inc
Normal file
@ -0,0 +1,86 @@
|
|||||||
|
{
|
||||||
|
This file is part of the Free Pascal run time library.
|
||||||
|
Copyright (c) 2017 by Free Pascal development team
|
||||||
|
|
||||||
|
Low level file functions
|
||||||
|
|
||||||
|
See the file COPYING.FPC, included in this distribution,
|
||||||
|
for details about the copyright.
|
||||||
|
|
||||||
|
This program is distributed in the hope that it will be useful,
|
||||||
|
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||||
|
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
|
||||||
|
|
||||||
|
**********************************************************************}
|
||||||
|
|
||||||
|
|
||||||
|
{****************************************************************************
|
||||||
|
Low level File Routines
|
||||||
|
All these functions can set InOutRes on errors
|
||||||
|
****************************************************************************}
|
||||||
|
|
||||||
|
{ close a file from the handle value }
|
||||||
|
procedure do_close(handle : longint);
|
||||||
|
begin
|
||||||
|
end;
|
||||||
|
|
||||||
|
|
||||||
|
procedure do_erase(p : pchar; pchangeable: boolean);
|
||||||
|
begin
|
||||||
|
end;
|
||||||
|
|
||||||
|
|
||||||
|
procedure do_rename(p1,p2 : pchar; p1changeable, p2changeable: boolean);
|
||||||
|
begin
|
||||||
|
end;
|
||||||
|
|
||||||
|
|
||||||
|
function do_write(h: longint; addr: pointer; len: longint) : longint;
|
||||||
|
begin
|
||||||
|
result := -1;
|
||||||
|
end;
|
||||||
|
|
||||||
|
|
||||||
|
function do_read(h: longint; addr: pointer; len: longint) : longint;
|
||||||
|
begin
|
||||||
|
result := -1;
|
||||||
|
end;
|
||||||
|
|
||||||
|
|
||||||
|
function do_filepos(handle: longint) : longint;
|
||||||
|
begin
|
||||||
|
result := -1;
|
||||||
|
end;
|
||||||
|
|
||||||
|
|
||||||
|
procedure do_seek(handle, pos: longint);
|
||||||
|
begin
|
||||||
|
end;
|
||||||
|
|
||||||
|
|
||||||
|
function do_seekend(handle: longint):longint;
|
||||||
|
begin
|
||||||
|
result := -1;
|
||||||
|
end;
|
||||||
|
|
||||||
|
|
||||||
|
function do_filesize(handle : longint) : longint;
|
||||||
|
begin
|
||||||
|
result := -1;
|
||||||
|
end;
|
||||||
|
|
||||||
|
|
||||||
|
procedure do_truncate(handle, pos: longint);
|
||||||
|
begin
|
||||||
|
end;
|
||||||
|
|
||||||
|
|
||||||
|
procedure do_open(var f;p:PFileTextRecChar;flags:longint; pchangeable: boolean);
|
||||||
|
begin
|
||||||
|
end;
|
||||||
|
|
||||||
|
|
||||||
|
function do_isdevice(handle: longint): boolean;
|
||||||
|
begin
|
||||||
|
result := false;
|
||||||
|
end;
|
29
rtl/palmos/sysheap.inc
Normal file
29
rtl/palmos/sysheap.inc
Normal file
@ -0,0 +1,29 @@
|
|||||||
|
{
|
||||||
|
This file is part of the Free Pascal run time library.
|
||||||
|
Copyright (c) 2017 by Free Pascal development team
|
||||||
|
|
||||||
|
Low level memory functions
|
||||||
|
|
||||||
|
See the file COPYING.FPC, included in this distribution,
|
||||||
|
for details about the copyright.
|
||||||
|
|
||||||
|
This program is distributed in the hope that it will be useful,
|
||||||
|
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||||
|
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
|
||||||
|
|
||||||
|
**********************************************************************}
|
||||||
|
|
||||||
|
{*****************************************************************************
|
||||||
|
OS Memory allocation / deallocation
|
||||||
|
****************************************************************************}
|
||||||
|
|
||||||
|
|
||||||
|
function SysOSAlloc(size: ptruint): pointer;
|
||||||
|
begin
|
||||||
|
end;
|
||||||
|
|
||||||
|
{$define HAS_SYSOSFREE}
|
||||||
|
|
||||||
|
procedure SysOSFree(p: pointer; size: ptruint);
|
||||||
|
begin
|
||||||
|
end;
|
@ -1,6 +1,8 @@
|
|||||||
{
|
{
|
||||||
This file is part of the Free Pascal run time library.
|
This file is part of the Free Pascal run time library.
|
||||||
Copyright (c) 1999-2000 by the Free Pascal development team.
|
Copyright (c) 2017 by Free Pascal development team
|
||||||
|
|
||||||
|
OS specific code
|
||||||
|
|
||||||
See the file COPYING.FPC, included in this distribution,
|
See the file COPYING.FPC, included in this distribution,
|
||||||
for details about the copyright.
|
for details about the copyright.
|
||||||
@ -10,12 +12,4 @@
|
|||||||
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
|
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
|
||||||
|
|
||||||
**********************************************************************}
|
**********************************************************************}
|
||||||
{$define palmos}
|
|
||||||
{$undef atari}
|
|
||||||
{$undef go32v2}
|
|
||||||
{$undef os2}
|
|
||||||
{$undef linux}
|
|
||||||
{$undef win32}
|
|
||||||
{$undef amiga}
|
|
||||||
{$undef macos}
|
|
||||||
|
|
28
rtl/palmos/sysosh.inc
Normal file
28
rtl/palmos/sysosh.inc
Normal file
@ -0,0 +1,28 @@
|
|||||||
|
{
|
||||||
|
This file is part of the Free Pascal run time library.
|
||||||
|
Copyright (c) 2017 by Free Pascal development team
|
||||||
|
|
||||||
|
OS specific headers
|
||||||
|
|
||||||
|
See the file COPYING.FPC, included in this distribution,
|
||||||
|
for details about the copyright.
|
||||||
|
|
||||||
|
This program is distributed in the hope that it will be useful,
|
||||||
|
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||||
|
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
|
||||||
|
|
||||||
|
**********************************************************************}
|
||||||
|
|
||||||
|
{Platform specific information}
|
||||||
|
type
|
||||||
|
{$ifdef CPU64}
|
||||||
|
THandle = Int64;
|
||||||
|
{$else CPU64}
|
||||||
|
THandle = Longint;
|
||||||
|
{$endif CPU64}
|
||||||
|
TThreadID = THandle;
|
||||||
|
|
||||||
|
PRTLCriticalSection = ^TRTLCriticalSection;
|
||||||
|
TRTLCriticalSection = record
|
||||||
|
Locked: boolean
|
||||||
|
end;
|
@ -1 +0,0 @@
|
|||||||
{$i system.pp}
|
|
42
rtl/palmos/syspara.inc
Normal file
42
rtl/palmos/syspara.inc
Normal file
@ -0,0 +1,42 @@
|
|||||||
|
{
|
||||||
|
This file is part of the Free Pascal run time library.
|
||||||
|
Copyright (c) 2017 by Karoly Balogh
|
||||||
|
members of the Free Pascal development team.
|
||||||
|
|
||||||
|
Command line parameter handling
|
||||||
|
|
||||||
|
See the file COPYING.FPC, included in this distribution,
|
||||||
|
for details about the copyright.
|
||||||
|
|
||||||
|
This program is distributed in the hope that it will be useful,
|
||||||
|
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||||
|
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
|
||||||
|
|
||||||
|
**********************************************************************}
|
||||||
|
|
||||||
|
|
||||||
|
{ Generates correct argument array on startup }
|
||||||
|
procedure GenerateArgs;
|
||||||
|
begin
|
||||||
|
end;
|
||||||
|
|
||||||
|
|
||||||
|
{*****************************************************************************
|
||||||
|
ParamStr
|
||||||
|
*****************************************************************************}
|
||||||
|
|
||||||
|
{ number of args }
|
||||||
|
function ParamCount: LongInt;
|
||||||
|
begin
|
||||||
|
ParamCount := argc - 1;
|
||||||
|
end;
|
||||||
|
|
||||||
|
{ argument number l }
|
||||||
|
function ParamStr(l: LongInt): string;
|
||||||
|
var
|
||||||
|
s1: string;
|
||||||
|
begin
|
||||||
|
ParamStr := '';
|
||||||
|
if (l > 0) and (l + 1 <= argc) then
|
||||||
|
ParamStr := StrPas(argv[l]);
|
||||||
|
end;
|
@ -1,5 +1,4 @@
|
|||||||
{
|
{
|
||||||
|
|
||||||
This file is part of the Free Pascal run time library.
|
This file is part of the Free Pascal run time library.
|
||||||
Copyright (c) 1999-2000 by Florian Klaempfl
|
Copyright (c) 1999-2000 by Florian Klaempfl
|
||||||
member of the Free Pascal development team
|
member of the Free Pascal development team
|
||||||
@ -13,90 +12,115 @@
|
|||||||
|
|
||||||
**********************************************************************}
|
**********************************************************************}
|
||||||
|
|
||||||
{$define PALMOS}
|
|
||||||
{$ASMMODE DIRECT}
|
|
||||||
unit System;
|
unit System;
|
||||||
|
|
||||||
{$I os.inc}
|
interface
|
||||||
|
|
||||||
Interface
|
{$DEFINE FPC_ANSI_TEXTFILEREC}
|
||||||
|
|
||||||
|
{$i systemh.inc}
|
||||||
|
|
||||||
{Platform specific information}
|
{Platform specific information}
|
||||||
const
|
const
|
||||||
LineEnding = #10;
|
LineEnding = #10;
|
||||||
LFNSupport = false;
|
LFNSupport = false;
|
||||||
DirectorySeparator = '/';
|
DirectorySeparator = '/';
|
||||||
DriveSeparator = ':';
|
DriveSeparator = ':';
|
||||||
ExtensionSeparator = '.';
|
ExtensionSeparator = '.';
|
||||||
PathSeparator = ';';
|
PathSeparator = ';';
|
||||||
AllowDirectorySeparators : set of char = ['\','/'];
|
AllowDirectorySeparators : set of char = ['\','/'];
|
||||||
AllowDriveSeparators : set of char = [':'];
|
AllowDriveSeparators : set of char = [':'];
|
||||||
FileNameCaseSensitive = false;
|
FileNameCaseSensitive = false;
|
||||||
FileNameCasePreserving = true;
|
FileNameCasePreserving = true;
|
||||||
CtrlZMarksEOF: boolean = false; (* #26 not considered as end of file *)
|
CtrlZMarksEOF: boolean = false; (* #26 not considered as end of file *)
|
||||||
maxExitCode = 255; {$ERROR TODO: CONFIRM THIS}
|
maxExitCode = 255; {.$ERROR TODO: CONFIRM THIS}
|
||||||
MaxPathLen = 256;
|
MaxPathLen = 256;
|
||||||
AllFilesMask = '*';
|
AllFilesMask = '*';
|
||||||
|
|
||||||
Type
|
sLineBreak = LineEnding;
|
||||||
{ type and constant declartions doesn't hurt }
|
DefaultTextLineBreakStyle : TTextLineBreakStyle = tlbsLF;
|
||||||
LongInt = $80000000..$7fffffff;
|
|
||||||
Integer = -32768..32767;
|
|
||||||
ShortInt = -128..127;
|
|
||||||
Byte = 0..255;
|
|
||||||
Word = 0..65535;
|
|
||||||
|
|
||||||
{ !!!!
|
const
|
||||||
DWord = Cardinal;
|
UnusedHandle = $ffff;
|
||||||
LongWord = Cardinal;
|
StdInputHandle = 0;
|
||||||
}
|
StdOutputHandle = 1;
|
||||||
|
StdErrorHandle = $ffff;
|
||||||
|
|
||||||
{ The Cardinal data type isn't currently implemented for the m68k }
|
var
|
||||||
DWord = LongInt;
|
args: PChar;
|
||||||
LongWord = LongInt;
|
argc: LongInt;
|
||||||
|
argv: PPChar;
|
||||||
|
envp: PPChar;
|
||||||
|
|
||||||
{ Zero - terminated strings }
|
|
||||||
PChar = ^Char;
|
|
||||||
PPChar = ^PChar;
|
|
||||||
|
|
||||||
{ procedure type }
|
{$if defined(FPUSOFT)}
|
||||||
TProcedure = Procedure;
|
|
||||||
|
|
||||||
const
|
{$define fpc_softfpu_interface}
|
||||||
{ max. values for longint and int }
|
{$i softfpu.pp}
|
||||||
MaxLongint = High(LongInt);
|
{$undef fpc_softfpu_interface}
|
||||||
MaxInt = High(Integer);
|
|
||||||
|
|
||||||
{ Must be determined at startup for both }
|
{$endif defined(FPUSOFT)}
|
||||||
Test68000 : byte = 0;
|
|
||||||
Test68881 : byte = 0;
|
|
||||||
|
|
||||||
{ Palm specific data types }
|
|
||||||
type
|
|
||||||
Ptr = ^Char;
|
|
||||||
|
|
||||||
var
|
var
|
||||||
ExitCode : DWord;
|
|
||||||
{ this variables are passed to PilotMain by the PalmOS }
|
{ this variables are passed to PilotMain by the PalmOS }
|
||||||
cmd : Word;
|
cmd : Word;
|
||||||
cmdPBP : Ptr;
|
cmdPBP : PChar; // Ptr;
|
||||||
launchFlags : Word;
|
launchFlags : Word;
|
||||||
|
|
||||||
implementation
|
implementation
|
||||||
|
|
||||||
|
{$if defined(FPUSOFT)}
|
||||||
|
|
||||||
|
{$define fpc_softfpu_implementation}
|
||||||
|
{$define softfpu_compiler_mul32to64}
|
||||||
|
{$define softfpu_inline}
|
||||||
|
{$i softfpu.pp}
|
||||||
|
{$undef fpc_softfpu_implementation}
|
||||||
|
|
||||||
|
{ we get these functions and types from the softfpu code }
|
||||||
|
{$define FPC_SYSTEM_HAS_float64}
|
||||||
|
{$define FPC_SYSTEM_HAS_float32}
|
||||||
|
{$define FPC_SYSTEM_HAS_flag}
|
||||||
|
{$define FPC_SYSTEM_HAS_extractFloat64Frac0}
|
||||||
|
{$define FPC_SYSTEM_HAS_extractFloat64Frac1}
|
||||||
|
{$define FPC_SYSTEM_HAS_extractFloat64Exp}
|
||||||
|
{$define FPC_SYSTEM_HAS_extractFloat64Sign}
|
||||||
|
{$define FPC_SYSTEM_HAS_ExtractFloat32Frac}
|
||||||
|
{$define FPC_SYSTEM_HAS_extractFloat32Exp}
|
||||||
|
{$define FPC_SYSTEM_HAS_extractFloat32Sign}
|
||||||
|
|
||||||
|
{$endif defined(FPUSOFT)}
|
||||||
|
|
||||||
|
{$i system.inc}
|
||||||
|
{$i syspara.inc}
|
||||||
|
|
||||||
{ mimic the C start code }
|
{ mimic the C start code }
|
||||||
function PilotMain(_cmd : Word;_cmdPBP : Ptr;_launchFlags : Word) : DWord;cdecl;public;
|
function PilotMain(_cmd : Word;_cmdPBP : PChar;{Ptr;}_launchFlags : Word) : DWord;cdecl;public;
|
||||||
|
|
||||||
begin
|
begin
|
||||||
cmd:=_cmd;
|
cmd:=_cmd;
|
||||||
cmdPBP:=_cmdPBP;
|
cmdPBP:=_cmdPBP;
|
||||||
launchFlags:=_launchFlags;
|
launchFlags:=_launchFlags;
|
||||||
asm
|
// asm
|
||||||
bsr PASCALMAIN
|
// bsr PASCALMAIN
|
||||||
end;
|
// end;
|
||||||
PilotMain:=ExitCode;
|
PilotMain:=ExitCode;
|
||||||
end;
|
end;
|
||||||
|
|
||||||
|
procedure SysInitParamsAndEnv;
|
||||||
|
begin
|
||||||
|
{$WARNING: make sure argv/argc will be correct here}
|
||||||
|
GenerateArgs;
|
||||||
|
end;
|
||||||
|
|
||||||
|
procedure randomize;
|
||||||
|
begin
|
||||||
|
{$WARNING: randseed initial value is zero!}
|
||||||
|
randseed:=0;
|
||||||
|
end;
|
||||||
|
|
||||||
|
|
||||||
{*****************************************************************************
|
{*****************************************************************************
|
||||||
System Dependent Exit code
|
System Dependent Exit code
|
||||||
*****************************************************************************}
|
*****************************************************************************}
|
||||||
@ -106,7 +130,21 @@ end;
|
|||||||
|
|
||||||
function GetProcessID: SizeUInt;
|
function GetProcessID: SizeUInt;
|
||||||
begin
|
begin
|
||||||
GetProcessID := 1;
|
GetProcessID := 1;
|
||||||
|
end;
|
||||||
|
|
||||||
|
{*****************************************************************************
|
||||||
|
SystemUnit Initialization
|
||||||
|
*****************************************************************************}
|
||||||
|
|
||||||
|
procedure SysInitStdIO;
|
||||||
|
begin
|
||||||
|
OpenStdIO(Input,fmInput,StdInputHandle);
|
||||||
|
OpenStdIO(Output,fmOutput,StdOutputHandle);
|
||||||
|
OpenStdIO(StdOut,fmOutput,StdOutputHandle);
|
||||||
|
|
||||||
|
OpenStdIO(StdErr,fmOutput,StdErrorHandle);
|
||||||
|
OpenStdIO(ErrOutput,fmOutput,StdErrorHandle);
|
||||||
end;
|
end;
|
||||||
|
|
||||||
function CheckInitialStkLen(stklen : SizeUInt) : SizeUInt;
|
function CheckInitialStkLen(stklen : SizeUInt) : SizeUInt;
|
||||||
@ -115,6 +153,17 @@ begin
|
|||||||
end;
|
end;
|
||||||
|
|
||||||
begin
|
begin
|
||||||
StackLength := CheckInitialStkLen (InitialStkLen);
|
StackLength := CheckInitialStkLen (InitialStkLen);
|
||||||
ExitCode:=0;
|
{ Initialize ExitProc }
|
||||||
|
ExitProc:=Nil;
|
||||||
|
{ Setup heap }
|
||||||
|
InitHeap;
|
||||||
|
SysInitExceptions;
|
||||||
|
InitUnicodeStringManager;
|
||||||
|
{ Setup stdin, stdout and stderr }
|
||||||
|
SysInitStdIO;
|
||||||
|
{ Reset IO Error }
|
||||||
|
InOutRes:=0;
|
||||||
|
{ Setup command line arguments }
|
||||||
|
SysInitParamsAndEnv;
|
||||||
end.
|
end.
|
||||||
|
@ -1,3 +1,4 @@
|
|||||||
|
{
|
||||||
adapted for use with Free Pascal by Florian Klaempfl
|
adapted for use with Free Pascal by Florian Klaempfl
|
||||||
}
|
}
|
||||||
{ -------------------------------------------------- }
|
{ -------------------------------------------------- }
|
||||||
|
Loading…
Reference in New Issue
Block a user