mirror of
https://gitlab.com/freepascal.org/fpc/source.git
synced 2025-08-14 13:29:14 +02:00
* Changed .elf extension to .nef (Not Executable File) for intermediate file builds in the NDS compiler (used on no$gba debugger for symbol table)
* Added nds target to ppudump.pp * Fixed rtl compilation for nds target * Changes in prt09.as git-svn-id: trunk@8002 -
This commit is contained in:
parent
e14906c484
commit
cdf4841517
@ -724,7 +724,7 @@ begin
|
|||||||
Replace(cmdstr,'$OPT',Info.ExtraOptions);
|
Replace(cmdstr,'$OPT',Info.ExtraOptions);
|
||||||
if not(cs_link_on_target in current_settings.globalswitches) then
|
if not(cs_link_on_target in current_settings.globalswitches) then
|
||||||
begin
|
begin
|
||||||
Replace(cmdstr,'$EXE',(maybequoted(ScriptFixFileName(ChangeFileExt(current_module.exefilename^,preName+'.elf')))));
|
Replace(cmdstr,'$EXE',(maybequoted(ScriptFixFileName(ChangeFileExt(current_module.exefilename^,preName+'.nef')))));
|
||||||
Replace(cmdstr,'$RES',(maybequoted(ScriptFixFileName(outputexedir+Info.ResName))));
|
Replace(cmdstr,'$RES',(maybequoted(ScriptFixFileName(outputexedir+Info.ResName))));
|
||||||
Replace(cmdstr,'$STATIC',StaticStr);
|
Replace(cmdstr,'$STATIC',StaticStr);
|
||||||
Replace(cmdstr,'$STRIP',StripStr);
|
Replace(cmdstr,'$STRIP',StripStr);
|
||||||
@ -733,7 +733,7 @@ begin
|
|||||||
end
|
end
|
||||||
else
|
else
|
||||||
begin
|
begin
|
||||||
Replace(cmdstr,'$EXE',maybequoted(ScriptFixFileName(ChangeFileExt(current_module.exefilename^,preName+'.elf'))));
|
Replace(cmdstr,'$EXE',maybequoted(ScriptFixFileName(ChangeFileExt(current_module.exefilename^,preName+'.nef'))));
|
||||||
Replace(cmdstr,'$RES',maybequoted(ScriptFixFileName(outputexedir+Info.ResName)));
|
Replace(cmdstr,'$RES',maybequoted(ScriptFixFileName(outputexedir+Info.ResName)));
|
||||||
Replace(cmdstr,'$STATIC',StaticStr);
|
Replace(cmdstr,'$STATIC',StaticStr);
|
||||||
Replace(cmdstr,'$STRIP',StripStr);
|
Replace(cmdstr,'$STRIP',StripStr);
|
||||||
@ -750,7 +750,7 @@ begin
|
|||||||
if success then
|
if success then
|
||||||
begin
|
begin
|
||||||
success:=DoExec(FindUtil(utilsprefix + 'objcopy'), '-O binary '+
|
success:=DoExec(FindUtil(utilsprefix + 'objcopy'), '-O binary '+
|
||||||
ChangeFileExt(current_module.exefilename^, preName+'.elf') + ' ' +
|
ChangeFileExt(current_module.exefilename^, preName+'.nef') + ' ' +
|
||||||
ChangeFileExt(current_module.exefilename^, preName+target_info.exeext),
|
ChangeFileExt(current_module.exefilename^, preName+target_info.exeext),
|
||||||
true,false);
|
true,false);
|
||||||
end;
|
end;
|
||||||
|
@ -150,7 +150,8 @@ type
|
|||||||
system_ia64_win64, { 39 }
|
system_ia64_win64, { 39 }
|
||||||
system_i386_wince, { 40 }
|
system_i386_wince, { 40 }
|
||||||
system_x86_6432_linux, { 41 }
|
system_x86_6432_linux, { 41 }
|
||||||
system_arm_gba { 42 }
|
system_arm_gba, { 42 }
|
||||||
|
system_arm_nds { 43 }
|
||||||
);
|
);
|
||||||
const
|
const
|
||||||
Targets : array[ttarget] of string[17]=(
|
Targets : array[ttarget] of string[17]=(
|
||||||
@ -196,7 +197,8 @@ const
|
|||||||
{ 39 } 'Win64-iA64',
|
{ 39 } 'Win64-iA64',
|
||||||
{ 40 } 'WinCE-i386',
|
{ 40 } 'WinCE-i386',
|
||||||
{ 41 } 'Linux-x64',
|
{ 41 } 'Linux-x64',
|
||||||
{ 42 } 'GBA-ARM'
|
{ 42 } 'GBA-arm',
|
||||||
|
{ 43 } 'NDS-arm'
|
||||||
);
|
);
|
||||||
begin
|
begin
|
||||||
if w<=ord(high(ttarget)) then
|
if w<=ord(high(ttarget)) then
|
||||||
|
@ -53,7 +53,7 @@ endif
|
|||||||
OBJPASDIR=$(RTL)/objpas
|
OBJPASDIR=$(RTL)/objpas
|
||||||
GRAPHDIR=$(INC)/graph
|
GRAPHDIR=$(INC)/graph
|
||||||
|
|
||||||
[rules]
|
[rules]
|
||||||
.NOTPARALLEL:
|
.NOTPARALLEL:
|
||||||
# Get the system independent include file names.
|
# Get the system independent include file names.
|
||||||
# This will set the following variables :
|
# This will set the following variables :
|
||||||
@ -91,7 +91,7 @@ cprt09$(OEXT) : cprt09.as
|
|||||||
# Base Units (System, strings, os-dependent-base-unit)
|
# Base Units (System, strings, os-dependent-base-unit)
|
||||||
#
|
#
|
||||||
|
|
||||||
$(SYSTEMUNIT)$(PPUEXT) : $(SYSTEMUNIT).pp $(SYSDEPS)
|
$(SYSTEMUNIT)$(PPUEXT) : $(SYSTEMUNIT).pp $(SYSDEPS) $(INC)/softfpu.pp
|
||||||
$(COMPILER) -Us -Sg $(SYSTEMUNIT).pp $(REDIR)
|
$(COMPILER) -Us -Sg $(SYSTEMUNIT).pp $(REDIR)
|
||||||
|
|
||||||
objpas$(PPUEXT): $(OBJPASDIR)/objpas.pp $(INC)/except.inc $(SYSTEMUNIT)$(PPUEXT)
|
objpas$(PPUEXT): $(OBJPASDIR)/objpas.pp $(INC)/except.inc $(SYSTEMUNIT)$(PPUEXT)
|
||||||
|
@ -101,8 +101,8 @@ _start:
|
|||||||
@-------------------------------------------------------------------------
|
@-------------------------------------------------------------------------
|
||||||
@ DCache & ICache enable
|
@ DCache & ICache enable
|
||||||
@-------------------------------------------------------------------------
|
@-------------------------------------------------------------------------
|
||||||
ldr r0,=0b01000110
|
ldr r0,=0b01000010
|
||||||
ldr r0,=0x42
|
|
||||||
mcr p15, 0, r0, c2, c0, 0
|
mcr p15, 0, r0, c2, c0, 0
|
||||||
mcr p15, 0, r0, c2, c0, 1
|
mcr p15, 0, r0, c2, c0, 1
|
||||||
|
|
||||||
@ -162,9 +162,6 @@ _start:
|
|||||||
ldr r0, =__eheap_end
|
ldr r0, =__eheap_end
|
||||||
str r0, [r1]
|
str r0, [r1]
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
mov r0, #0 @ int argc
|
mov r0, #0 @ int argc
|
||||||
mov r1, #0 @ char *argv[]
|
mov r1, #0 @ char *argv[]
|
||||||
ldr r3, =main
|
ldr r3, =main
|
||||||
|
@ -23,7 +23,7 @@
|
|||||||
|
|
||||||
function SysOSAlloc(size: ptruint): pointer;
|
function SysOSAlloc(size: ptruint): pointer;
|
||||||
begin
|
begin
|
||||||
result := nil;//pointer($02000000);
|
result := pointer($02000000);
|
||||||
end;
|
end;
|
||||||
|
|
||||||
{ $define HAS_SYSOSFREE}
|
{ $define HAS_SYSOSFREE}
|
||||||
|
@ -18,6 +18,9 @@ unit System;
|
|||||||
interface
|
interface
|
||||||
|
|
||||||
{$define FPC_IS_SYSTEM}
|
{$define FPC_IS_SYSTEM}
|
||||||
|
{ $define USE_NOTHREADMANAGER}
|
||||||
|
{ $define HAS_MEMORYMANAGER}
|
||||||
|
{ $undef FPC_HAS_FEATURE_TEXTIO}
|
||||||
|
|
||||||
{$i ndsbiosh.inc}
|
{$i ndsbiosh.inc}
|
||||||
|
|
||||||
@ -27,6 +30,7 @@ interface
|
|||||||
{$i softfpu.pp}
|
{$i softfpu.pp}
|
||||||
{$undef fpc_softfpu_interface}
|
{$undef fpc_softfpu_interface}
|
||||||
|
|
||||||
|
procedure InitHeapThread;
|
||||||
|
|
||||||
const
|
const
|
||||||
LineEnding = #10;
|
LineEnding = #10;
|
||||||
@ -55,8 +59,18 @@ var
|
|||||||
argv: PPChar;
|
argv: PPChar;
|
||||||
envp: PPChar;
|
envp: PPChar;
|
||||||
errno: integer;
|
errno: integer;
|
||||||
fake_heap_start: pchar; cvar;
|
// fake_heap_start: ^byte; cvar;
|
||||||
fake_heap_end: pchar; cvar;
|
fake_heap_end: ^byte; cvar;
|
||||||
|
// heap_start: longint; external name 'end';
|
||||||
|
// heap_end: longint; external name '__eheap_end';
|
||||||
|
heap_start: longint; external name 'end';
|
||||||
|
heap_end: longint; external name 'fake_heap_end';
|
||||||
|
// __eheap_start: longint; cvar; external;
|
||||||
|
// fake_heap_end: longint; cvar; external;
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
implementation
|
implementation
|
||||||
|
|
||||||
@ -133,41 +147,79 @@ begin
|
|||||||
end;
|
end;
|
||||||
|
|
||||||
|
|
||||||
|
(*
|
||||||
procedure InitHeap;
|
procedure InitHeap;
|
||||||
begin
|
begin
|
||||||
{
|
|
||||||
FillChar(freelists_fixed,sizeof(tfreelists),0);
|
FillChar(freelists_fixed,sizeof(tfreelists),0);
|
||||||
FillChar(freelists_free_chunk,sizeof(freelists_free_chunk),0);
|
FillChar(freelists_free_chunk,sizeof(freelists_free_chunk),0);
|
||||||
|
|
||||||
freelist_var:=nil;
|
freelist_var:=nil;
|
||||||
|
{The GBA has no operating system from which we ask memory, so we
|
||||||
|
initialize the heap with a single block of memory.}
|
||||||
freeoslistcount:=1;
|
freeoslistcount:=1;
|
||||||
freeoslist:=pointer($2040000);
|
//freeoslist:=pointer($023FF000);
|
||||||
|
freeoslist:=pointer(heap_start);
|
||||||
fillchar(freeoslist^,sizeof(freeoslist^),0);
|
fillchar(freeoslist^,sizeof(freeoslist^),0);
|
||||||
freeoslist^.size:=$40000;
|
//freeoslist^.size:=$00040000;//$003FF000;
|
||||||
|
freeoslist^.size:=heap_end-heap_start;
|
||||||
fillchar(internal_status,sizeof(internal_status),0);
|
fillchar(internal_status,sizeof(internal_status),0);
|
||||||
}
|
end;
|
||||||
|
*)
|
||||||
|
|
||||||
|
procedure InitHeap;
|
||||||
|
var
|
||||||
|
loc_freelists: pfreelists;
|
||||||
|
begin
|
||||||
|
{ we cannot initialize the locks here yet, thread support is
|
||||||
|
not loaded yet }
|
||||||
|
loc_freelists := @freelists;
|
||||||
|
|
||||||
|
// PROVA -->
|
||||||
|
loc_freelists^.varlist := nil;
|
||||||
|
loc_freelists^.oscount := 1;
|
||||||
|
loc_freelists := pointer(heap_start);
|
||||||
|
|
||||||
|
fillchar(loc_freelists^, sizeof(tfreelists), 0);
|
||||||
|
fillchar(orphaned_freelists, sizeof(orphaned_freelists), 0);
|
||||||
|
|
||||||
|
loc_freelists^.oslist^.size := heap_end - heap_start;
|
||||||
|
fillchar(loc_freelists^.internal_status, sizeof(TFPCHeapStatus), 0);
|
||||||
|
// <-- PROVA
|
||||||
|
|
||||||
end;
|
end;
|
||||||
|
|
||||||
|
|
||||||
|
procedure InitHeapThread;
|
||||||
|
var
|
||||||
|
loc_freelists: pfreelists;
|
||||||
|
begin
|
||||||
|
loc_freelists := @freelists;
|
||||||
|
fillchar(loc_freelists^,sizeof(tfreelists),0);
|
||||||
|
{$ifdef DUMP_MEM_USAGE}
|
||||||
|
fillchar(sizeusage,sizeof(sizeusage),0);
|
||||||
|
fillchar(maxsizeusage,sizeof(sizeusage),0);
|
||||||
|
{$endif}
|
||||||
|
end;
|
||||||
|
|
||||||
begin
|
begin
|
||||||
StackLength := CheckInitialStkLen(InitialStkLen);
|
StackLength := CheckInitialStkLen(InitialStkLen);
|
||||||
///StackBottom := Sptr - StackLength;
|
///StackBottom := Sptr - StackLength;
|
||||||
StackBottom := StackTop - StackLength;
|
StackBottom := StackTop - StackLength;
|
||||||
{ OS specific startup }
|
{ OS specific startup }
|
||||||
fake_heap_start := pchar(0);
|
// fake_heap_start := pchar(0);
|
||||||
fake_heap_end := pchar(0);
|
// fake_heap_end := pchar(0);
|
||||||
{ Set up signals handlers }
|
{ Set up signals handlers }
|
||||||
|
|
||||||
|
fpc_cpucodeinit;
|
||||||
{ Setup heap }
|
{ Setup heap }
|
||||||
InitHeap;
|
InitHeap;
|
||||||
//SysInitExceptions;
|
SysInitExceptions;
|
||||||
{ Setup stdin, stdout and stderr }
|
{ Setup stdin, stdout and stderr }
|
||||||
//SysInitStdIO;
|
SysInitStdIO;
|
||||||
{ Reset IO Error }
|
{ Reset IO Error }
|
||||||
InOutRes := 0;
|
InOutRes:=0;
|
||||||
{ Arguments }
|
{ Arguments }
|
||||||
|
|
||||||
//InitSystemThreads;
|
InitSystemThreads;
|
||||||
//initvariantmanager;
|
initvariantmanager;
|
||||||
//initwidestringmanager;
|
|
||||||
end.
|
end.
|
||||||
|
Loading…
Reference in New Issue
Block a user