diff --git a/.gitattributes b/.gitattributes index 97d0003606..a4c05b3964 100644 --- a/.gitattributes +++ b/.gitattributes @@ -7033,7 +7033,9 @@ rtl/embedded/avr/start.inc svneol=native#text/plain rtl/embedded/buildrtl.lpi svneol=native#text/plain rtl/embedded/buildrtl.pp svneol=native#text/plain rtl/embedded/check.inc svneol=native#text/plain +rtl/embedded/consoleio.pp svneol=native#text/pascal rtl/embedded/empty.cfg svneol=native#text/plain +rtl/embedded/heapmgr.pp svneol=native#text/pascal rtl/embedded/rtl.cfg svneol=native#text/plain rtl/embedded/sysdir.inc svneol=native#text/plain rtl/embedded/sysfile.inc svneol=native#text/plain diff --git a/rtl/embedded/Makefile b/rtl/embedded/Makefile index 32ffc3c749..29a9896a00 100644 --- a/rtl/embedded/Makefile +++ b/rtl/embedded/Makefile @@ -1,5 +1,5 @@ # -# Don't edit, this file is generated by FPCMake Version 2.0.0 [2011/08/28] +# Don't edit, this file is generated by FPCMake Version 2.0.0 [2011/09/05] # default: all MAKEFILETARGETS=i386-linux i386-go32v2 i386-win32 i386-os2 i386-freebsd i386-beos i386-haiku i386-netbsd i386-solaris i386-qnx i386-netware i386-openbsd i386-wdosx i386-darwin i386-emx i386-watcom i386-netwlibc i386-wince i386-embedded i386-symbian i386-nativent i386-iphonesim m68k-linux m68k-freebsd m68k-netbsd m68k-amiga m68k-atari m68k-openbsd m68k-palmos m68k-embedded powerpc-linux powerpc-netbsd powerpc-amiga powerpc-macos powerpc-darwin powerpc-morphos powerpc-embedded powerpc-wii sparc-linux sparc-netbsd sparc-solaris sparc-embedded x86_64-linux x86_64-freebsd x86_64-solaris x86_64-darwin x86_64-win64 x86_64-embedded arm-linux arm-palmos arm-darwin arm-wince arm-gba arm-nds arm-embedded arm-symbian powerpc64-linux powerpc64-darwin powerpc64-embedded avr-embedded armeb-linux armeb-embedded mipsel-linux @@ -315,7 +315,7 @@ CPU_UNITS= SYSINIT_UNITS= ifeq ($(ARCH),arm) ifeq ($(SUBARCH),armv7m) -CPU_UNITS=lm3fury lm3tempest stm32f103 lpc1768 # thumb2_bare +CPU_UNITS=lm3fury lm3tempest stm32f103 lpc1768 # thumb2_bare endif ifeq ($(SUBARCH),armv4t) CPU_UNITS=lpc21x4 at91sam7x256 @@ -333,193 +333,193 @@ endif OBJPASDIR=$(RTL)/objpas GRAPHDIR=$(INC)/graph ifeq ($(FULL_TARGET),i386-linux) -override TARGET_UNITS+=$(SYSTEMUNIT) $(CPU_UNITS) objpas # macpas iso7185 strings +override TARGET_UNITS+=$(SYSTEMUNIT) $(CPU_UNITS) objpas heapmgr consoleio # macpas iso7185 strings endif ifeq ($(FULL_TARGET),i386-go32v2) -override TARGET_UNITS+=$(SYSTEMUNIT) $(CPU_UNITS) objpas # macpas iso7185 strings +override TARGET_UNITS+=$(SYSTEMUNIT) $(CPU_UNITS) objpas heapmgr consoleio # macpas iso7185 strings endif ifeq ($(FULL_TARGET),i386-win32) -override TARGET_UNITS+=$(SYSTEMUNIT) $(CPU_UNITS) objpas # macpas iso7185 strings +override TARGET_UNITS+=$(SYSTEMUNIT) $(CPU_UNITS) objpas heapmgr consoleio # macpas iso7185 strings endif ifeq ($(FULL_TARGET),i386-os2) -override TARGET_UNITS+=$(SYSTEMUNIT) $(CPU_UNITS) objpas # macpas iso7185 strings +override TARGET_UNITS+=$(SYSTEMUNIT) $(CPU_UNITS) objpas heapmgr consoleio # macpas iso7185 strings endif ifeq ($(FULL_TARGET),i386-freebsd) -override TARGET_UNITS+=$(SYSTEMUNIT) $(CPU_UNITS) objpas # macpas iso7185 strings +override TARGET_UNITS+=$(SYSTEMUNIT) $(CPU_UNITS) objpas heapmgr consoleio # macpas iso7185 strings endif ifeq ($(FULL_TARGET),i386-beos) -override TARGET_UNITS+=$(SYSTEMUNIT) $(CPU_UNITS) objpas # macpas iso7185 strings +override TARGET_UNITS+=$(SYSTEMUNIT) $(CPU_UNITS) objpas heapmgr consoleio # macpas iso7185 strings endif ifeq ($(FULL_TARGET),i386-haiku) -override TARGET_UNITS+=$(SYSTEMUNIT) $(CPU_UNITS) objpas # macpas iso7185 strings +override TARGET_UNITS+=$(SYSTEMUNIT) $(CPU_UNITS) objpas heapmgr consoleio # macpas iso7185 strings endif ifeq ($(FULL_TARGET),i386-netbsd) -override TARGET_UNITS+=$(SYSTEMUNIT) $(CPU_UNITS) objpas # macpas iso7185 strings +override TARGET_UNITS+=$(SYSTEMUNIT) $(CPU_UNITS) objpas heapmgr consoleio # macpas iso7185 strings endif ifeq ($(FULL_TARGET),i386-solaris) -override TARGET_UNITS+=$(SYSTEMUNIT) $(CPU_UNITS) objpas # macpas iso7185 strings +override TARGET_UNITS+=$(SYSTEMUNIT) $(CPU_UNITS) objpas heapmgr consoleio # macpas iso7185 strings endif ifeq ($(FULL_TARGET),i386-qnx) -override TARGET_UNITS+=$(SYSTEMUNIT) $(CPU_UNITS) objpas # macpas iso7185 strings +override TARGET_UNITS+=$(SYSTEMUNIT) $(CPU_UNITS) objpas heapmgr consoleio # macpas iso7185 strings endif ifeq ($(FULL_TARGET),i386-netware) -override TARGET_UNITS+=$(SYSTEMUNIT) $(CPU_UNITS) objpas # macpas iso7185 strings +override TARGET_UNITS+=$(SYSTEMUNIT) $(CPU_UNITS) objpas heapmgr consoleio # macpas iso7185 strings endif ifeq ($(FULL_TARGET),i386-openbsd) -override TARGET_UNITS+=$(SYSTEMUNIT) $(CPU_UNITS) objpas # macpas iso7185 strings +override TARGET_UNITS+=$(SYSTEMUNIT) $(CPU_UNITS) objpas heapmgr consoleio # macpas iso7185 strings endif ifeq ($(FULL_TARGET),i386-wdosx) -override TARGET_UNITS+=$(SYSTEMUNIT) $(CPU_UNITS) objpas # macpas iso7185 strings +override TARGET_UNITS+=$(SYSTEMUNIT) $(CPU_UNITS) objpas heapmgr consoleio # macpas iso7185 strings endif ifeq ($(FULL_TARGET),i386-darwin) -override TARGET_UNITS+=$(SYSTEMUNIT) $(CPU_UNITS) objpas # macpas iso7185 strings +override TARGET_UNITS+=$(SYSTEMUNIT) $(CPU_UNITS) objpas heapmgr consoleio # macpas iso7185 strings endif ifeq ($(FULL_TARGET),i386-emx) -override TARGET_UNITS+=$(SYSTEMUNIT) $(CPU_UNITS) objpas # macpas iso7185 strings +override TARGET_UNITS+=$(SYSTEMUNIT) $(CPU_UNITS) objpas heapmgr consoleio # macpas iso7185 strings endif ifeq ($(FULL_TARGET),i386-watcom) -override TARGET_UNITS+=$(SYSTEMUNIT) $(CPU_UNITS) objpas # macpas iso7185 strings +override TARGET_UNITS+=$(SYSTEMUNIT) $(CPU_UNITS) objpas heapmgr consoleio # macpas iso7185 strings endif ifeq ($(FULL_TARGET),i386-netwlibc) -override TARGET_UNITS+=$(SYSTEMUNIT) $(CPU_UNITS) objpas # macpas iso7185 strings +override TARGET_UNITS+=$(SYSTEMUNIT) $(CPU_UNITS) objpas heapmgr consoleio # macpas iso7185 strings endif ifeq ($(FULL_TARGET),i386-wince) -override TARGET_UNITS+=$(SYSTEMUNIT) $(CPU_UNITS) objpas # macpas iso7185 strings +override TARGET_UNITS+=$(SYSTEMUNIT) $(CPU_UNITS) objpas heapmgr consoleio # macpas iso7185 strings endif ifeq ($(FULL_TARGET),i386-embedded) -override TARGET_UNITS+=$(SYSTEMUNIT) $(CPU_UNITS) objpas # macpas iso7185 strings +override TARGET_UNITS+=$(SYSTEMUNIT) $(CPU_UNITS) objpas heapmgr consoleio # macpas iso7185 strings endif ifeq ($(FULL_TARGET),i386-symbian) -override TARGET_UNITS+=$(SYSTEMUNIT) $(CPU_UNITS) objpas # macpas iso7185 strings +override TARGET_UNITS+=$(SYSTEMUNIT) $(CPU_UNITS) objpas heapmgr consoleio # macpas iso7185 strings endif ifeq ($(FULL_TARGET),i386-nativent) -override TARGET_UNITS+=$(SYSTEMUNIT) $(CPU_UNITS) objpas # macpas iso7185 strings +override TARGET_UNITS+=$(SYSTEMUNIT) $(CPU_UNITS) objpas heapmgr consoleio # macpas iso7185 strings endif ifeq ($(FULL_TARGET),i386-iphonesim) -override TARGET_UNITS+=$(SYSTEMUNIT) $(CPU_UNITS) objpas # macpas iso7185 strings +override TARGET_UNITS+=$(SYSTEMUNIT) $(CPU_UNITS) objpas heapmgr consoleio # macpas iso7185 strings endif ifeq ($(FULL_TARGET),m68k-linux) -override TARGET_UNITS+=$(SYSTEMUNIT) $(CPU_UNITS) objpas # macpas iso7185 strings +override TARGET_UNITS+=$(SYSTEMUNIT) $(CPU_UNITS) objpas heapmgr consoleio # macpas iso7185 strings endif ifeq ($(FULL_TARGET),m68k-freebsd) -override TARGET_UNITS+=$(SYSTEMUNIT) $(CPU_UNITS) objpas # macpas iso7185 strings +override TARGET_UNITS+=$(SYSTEMUNIT) $(CPU_UNITS) objpas heapmgr consoleio # macpas iso7185 strings endif ifeq ($(FULL_TARGET),m68k-netbsd) -override TARGET_UNITS+=$(SYSTEMUNIT) $(CPU_UNITS) objpas # macpas iso7185 strings +override TARGET_UNITS+=$(SYSTEMUNIT) $(CPU_UNITS) objpas heapmgr consoleio # macpas iso7185 strings endif ifeq ($(FULL_TARGET),m68k-amiga) -override TARGET_UNITS+=$(SYSTEMUNIT) $(CPU_UNITS) objpas # macpas iso7185 strings +override TARGET_UNITS+=$(SYSTEMUNIT) $(CPU_UNITS) objpas heapmgr consoleio # macpas iso7185 strings endif ifeq ($(FULL_TARGET),m68k-atari) -override TARGET_UNITS+=$(SYSTEMUNIT) $(CPU_UNITS) objpas # macpas iso7185 strings +override TARGET_UNITS+=$(SYSTEMUNIT) $(CPU_UNITS) objpas heapmgr consoleio # macpas iso7185 strings endif ifeq ($(FULL_TARGET),m68k-openbsd) -override TARGET_UNITS+=$(SYSTEMUNIT) $(CPU_UNITS) objpas # macpas iso7185 strings +override TARGET_UNITS+=$(SYSTEMUNIT) $(CPU_UNITS) objpas heapmgr consoleio # macpas iso7185 strings endif ifeq ($(FULL_TARGET),m68k-palmos) -override TARGET_UNITS+=$(SYSTEMUNIT) $(CPU_UNITS) objpas # macpas iso7185 strings +override TARGET_UNITS+=$(SYSTEMUNIT) $(CPU_UNITS) objpas heapmgr consoleio # macpas iso7185 strings endif ifeq ($(FULL_TARGET),m68k-embedded) -override TARGET_UNITS+=$(SYSTEMUNIT) $(CPU_UNITS) objpas # macpas iso7185 strings +override TARGET_UNITS+=$(SYSTEMUNIT) $(CPU_UNITS) objpas heapmgr consoleio # macpas iso7185 strings endif ifeq ($(FULL_TARGET),powerpc-linux) -override TARGET_UNITS+=$(SYSTEMUNIT) $(CPU_UNITS) objpas # macpas iso7185 strings +override TARGET_UNITS+=$(SYSTEMUNIT) $(CPU_UNITS) objpas heapmgr consoleio # macpas iso7185 strings endif ifeq ($(FULL_TARGET),powerpc-netbsd) -override TARGET_UNITS+=$(SYSTEMUNIT) $(CPU_UNITS) objpas # macpas iso7185 strings +override TARGET_UNITS+=$(SYSTEMUNIT) $(CPU_UNITS) objpas heapmgr consoleio # macpas iso7185 strings endif ifeq ($(FULL_TARGET),powerpc-amiga) -override TARGET_UNITS+=$(SYSTEMUNIT) $(CPU_UNITS) objpas # macpas iso7185 strings +override TARGET_UNITS+=$(SYSTEMUNIT) $(CPU_UNITS) objpas heapmgr consoleio # macpas iso7185 strings endif ifeq ($(FULL_TARGET),powerpc-macos) -override TARGET_UNITS+=$(SYSTEMUNIT) $(CPU_UNITS) objpas # macpas iso7185 strings +override TARGET_UNITS+=$(SYSTEMUNIT) $(CPU_UNITS) objpas heapmgr consoleio # macpas iso7185 strings endif ifeq ($(FULL_TARGET),powerpc-darwin) -override TARGET_UNITS+=$(SYSTEMUNIT) $(CPU_UNITS) objpas # macpas iso7185 strings +override TARGET_UNITS+=$(SYSTEMUNIT) $(CPU_UNITS) objpas heapmgr consoleio # macpas iso7185 strings endif ifeq ($(FULL_TARGET),powerpc-morphos) -override TARGET_UNITS+=$(SYSTEMUNIT) $(CPU_UNITS) objpas # macpas iso7185 strings +override TARGET_UNITS+=$(SYSTEMUNIT) $(CPU_UNITS) objpas heapmgr consoleio # macpas iso7185 strings endif ifeq ($(FULL_TARGET),powerpc-embedded) -override TARGET_UNITS+=$(SYSTEMUNIT) $(CPU_UNITS) objpas # macpas iso7185 strings +override TARGET_UNITS+=$(SYSTEMUNIT) $(CPU_UNITS) objpas heapmgr consoleio # macpas iso7185 strings endif ifeq ($(FULL_TARGET),powerpc-wii) -override TARGET_UNITS+=$(SYSTEMUNIT) $(CPU_UNITS) objpas # macpas iso7185 strings +override TARGET_UNITS+=$(SYSTEMUNIT) $(CPU_UNITS) objpas heapmgr consoleio # macpas iso7185 strings endif ifeq ($(FULL_TARGET),sparc-linux) -override TARGET_UNITS+=$(SYSTEMUNIT) $(CPU_UNITS) objpas # macpas iso7185 strings +override TARGET_UNITS+=$(SYSTEMUNIT) $(CPU_UNITS) objpas heapmgr consoleio # macpas iso7185 strings endif ifeq ($(FULL_TARGET),sparc-netbsd) -override TARGET_UNITS+=$(SYSTEMUNIT) $(CPU_UNITS) objpas # macpas iso7185 strings +override TARGET_UNITS+=$(SYSTEMUNIT) $(CPU_UNITS) objpas heapmgr consoleio # macpas iso7185 strings endif ifeq ($(FULL_TARGET),sparc-solaris) -override TARGET_UNITS+=$(SYSTEMUNIT) $(CPU_UNITS) objpas # macpas iso7185 strings +override TARGET_UNITS+=$(SYSTEMUNIT) $(CPU_UNITS) objpas heapmgr consoleio # macpas iso7185 strings endif ifeq ($(FULL_TARGET),sparc-embedded) -override TARGET_UNITS+=$(SYSTEMUNIT) $(CPU_UNITS) objpas # macpas iso7185 strings +override TARGET_UNITS+=$(SYSTEMUNIT) $(CPU_UNITS) objpas heapmgr consoleio # macpas iso7185 strings endif ifeq ($(FULL_TARGET),x86_64-linux) -override TARGET_UNITS+=$(SYSTEMUNIT) $(CPU_UNITS) objpas # macpas iso7185 strings +override TARGET_UNITS+=$(SYSTEMUNIT) $(CPU_UNITS) objpas heapmgr consoleio # macpas iso7185 strings endif ifeq ($(FULL_TARGET),x86_64-freebsd) -override TARGET_UNITS+=$(SYSTEMUNIT) $(CPU_UNITS) objpas # macpas iso7185 strings +override TARGET_UNITS+=$(SYSTEMUNIT) $(CPU_UNITS) objpas heapmgr consoleio # macpas iso7185 strings endif ifeq ($(FULL_TARGET),x86_64-solaris) -override TARGET_UNITS+=$(SYSTEMUNIT) $(CPU_UNITS) objpas # macpas iso7185 strings +override TARGET_UNITS+=$(SYSTEMUNIT) $(CPU_UNITS) objpas heapmgr consoleio # macpas iso7185 strings endif ifeq ($(FULL_TARGET),x86_64-darwin) -override TARGET_UNITS+=$(SYSTEMUNIT) $(CPU_UNITS) objpas # macpas iso7185 strings +override TARGET_UNITS+=$(SYSTEMUNIT) $(CPU_UNITS) objpas heapmgr consoleio # macpas iso7185 strings endif ifeq ($(FULL_TARGET),x86_64-win64) -override TARGET_UNITS+=$(SYSTEMUNIT) $(CPU_UNITS) objpas # macpas iso7185 strings +override TARGET_UNITS+=$(SYSTEMUNIT) $(CPU_UNITS) objpas heapmgr consoleio # macpas iso7185 strings endif ifeq ($(FULL_TARGET),x86_64-embedded) -override TARGET_UNITS+=$(SYSTEMUNIT) $(CPU_UNITS) objpas # macpas iso7185 strings +override TARGET_UNITS+=$(SYSTEMUNIT) $(CPU_UNITS) objpas heapmgr consoleio # macpas iso7185 strings endif ifeq ($(FULL_TARGET),arm-linux) -override TARGET_UNITS+=$(SYSTEMUNIT) $(CPU_UNITS) objpas # macpas iso7185 strings +override TARGET_UNITS+=$(SYSTEMUNIT) $(CPU_UNITS) objpas heapmgr consoleio # macpas iso7185 strings endif ifeq ($(FULL_TARGET),arm-palmos) -override TARGET_UNITS+=$(SYSTEMUNIT) $(CPU_UNITS) objpas # macpas iso7185 strings +override TARGET_UNITS+=$(SYSTEMUNIT) $(CPU_UNITS) objpas heapmgr consoleio # macpas iso7185 strings endif ifeq ($(FULL_TARGET),arm-darwin) -override TARGET_UNITS+=$(SYSTEMUNIT) $(CPU_UNITS) objpas # macpas iso7185 strings +override TARGET_UNITS+=$(SYSTEMUNIT) $(CPU_UNITS) objpas heapmgr consoleio # macpas iso7185 strings endif ifeq ($(FULL_TARGET),arm-wince) -override TARGET_UNITS+=$(SYSTEMUNIT) $(CPU_UNITS) objpas # macpas iso7185 strings +override TARGET_UNITS+=$(SYSTEMUNIT) $(CPU_UNITS) objpas heapmgr consoleio # macpas iso7185 strings endif ifeq ($(FULL_TARGET),arm-gba) -override TARGET_UNITS+=$(SYSTEMUNIT) $(CPU_UNITS) objpas # macpas iso7185 strings +override TARGET_UNITS+=$(SYSTEMUNIT) $(CPU_UNITS) objpas heapmgr consoleio # macpas iso7185 strings endif ifeq ($(FULL_TARGET),arm-nds) -override TARGET_UNITS+=$(SYSTEMUNIT) $(CPU_UNITS) objpas # macpas iso7185 strings +override TARGET_UNITS+=$(SYSTEMUNIT) $(CPU_UNITS) objpas heapmgr consoleio # macpas iso7185 strings endif ifeq ($(FULL_TARGET),arm-embedded) -override TARGET_UNITS+=$(SYSTEMUNIT) $(CPU_UNITS) objpas # macpas iso7185 strings +override TARGET_UNITS+=$(SYSTEMUNIT) $(CPU_UNITS) objpas heapmgr consoleio # macpas iso7185 strings endif ifeq ($(FULL_TARGET),arm-symbian) -override TARGET_UNITS+=$(SYSTEMUNIT) $(CPU_UNITS) objpas # macpas iso7185 strings +override TARGET_UNITS+=$(SYSTEMUNIT) $(CPU_UNITS) objpas heapmgr consoleio # macpas iso7185 strings endif ifeq ($(FULL_TARGET),powerpc64-linux) -override TARGET_UNITS+=$(SYSTEMUNIT) $(CPU_UNITS) objpas # macpas iso7185 strings +override TARGET_UNITS+=$(SYSTEMUNIT) $(CPU_UNITS) objpas heapmgr consoleio # macpas iso7185 strings endif ifeq ($(FULL_TARGET),powerpc64-darwin) -override TARGET_UNITS+=$(SYSTEMUNIT) $(CPU_UNITS) objpas # macpas iso7185 strings +override TARGET_UNITS+=$(SYSTEMUNIT) $(CPU_UNITS) objpas heapmgr consoleio # macpas iso7185 strings endif ifeq ($(FULL_TARGET),powerpc64-embedded) -override TARGET_UNITS+=$(SYSTEMUNIT) $(CPU_UNITS) objpas # macpas iso7185 strings +override TARGET_UNITS+=$(SYSTEMUNIT) $(CPU_UNITS) objpas heapmgr consoleio # macpas iso7185 strings endif ifeq ($(FULL_TARGET),avr-embedded) -override TARGET_UNITS+=$(SYSTEMUNIT) $(CPU_UNITS) objpas # macpas iso7185 strings +override TARGET_UNITS+=$(SYSTEMUNIT) $(CPU_UNITS) objpas heapmgr consoleio # macpas iso7185 strings endif ifeq ($(FULL_TARGET),armeb-linux) -override TARGET_UNITS+=$(SYSTEMUNIT) $(CPU_UNITS) objpas # macpas iso7185 strings +override TARGET_UNITS+=$(SYSTEMUNIT) $(CPU_UNITS) objpas heapmgr consoleio # macpas iso7185 strings endif ifeq ($(FULL_TARGET),armeb-embedded) -override TARGET_UNITS+=$(SYSTEMUNIT) $(CPU_UNITS) objpas # macpas iso7185 strings +override TARGET_UNITS+=$(SYSTEMUNIT) $(CPU_UNITS) objpas heapmgr consoleio # macpas iso7185 strings endif ifeq ($(FULL_TARGET),mipsel-linux) -override TARGET_UNITS+=$(SYSTEMUNIT) $(CPU_UNITS) objpas # macpas iso7185 strings +override TARGET_UNITS+=$(SYSTEMUNIT) $(CPU_UNITS) objpas heapmgr consoleio # macpas iso7185 strings endif override INSTALL_FPCPACKAGE=y ifeq ($(FULL_TARGET),i386-linux) diff --git a/rtl/embedded/Makefile.fpc b/rtl/embedded/Makefile.fpc index d152fc2394..88bdbb9639 100644 --- a/rtl/embedded/Makefile.fpc +++ b/rtl/embedded/Makefile.fpc @@ -7,7 +7,7 @@ main=rtl [target] loaders= -units=$(SYSTEMUNIT) $(CPU_UNITS) objpas # macpas iso7185 strings \ +units=$(SYSTEMUNIT) $(CPU_UNITS) objpas heapmgr consoleio # macpas iso7185 strings \ # dos \ # sysutils \ # classes math typinfo varutils fmtbcd \ @@ -49,7 +49,7 @@ SYSINIT_UNITS= ifeq ($(ARCH),arm) ifeq ($(SUBARCH),armv7m) -CPU_UNITS=lm3fury lm3tempest stm32f103 lpc1768 # thumb2_bare +CPU_UNITS=lm3fury lm3tempest stm32f103 lpc1768 # thumb2_bare endif ifeq ($(SUBARCH),armv4t) CPU_UNITS=lpc21x4 at91sam7x256 diff --git a/rtl/embedded/consoleio.pp b/rtl/embedded/consoleio.pp new file mode 100644 index 0000000000..6a4db02f45 --- /dev/null +++ b/rtl/embedded/consoleio.pp @@ -0,0 +1,67 @@ +{ + This file is part of the Free Pascal run time library. + Copyright (c) 2011 by the Free Pascal development team. + + Console i/o for the FPC embedded target + + 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. + + **********************************************************************} +{$mode objfpc} +Unit consoleio; + + interface + + implementation + + procedure SysInitStdIO; + begin + // OpenStdIO(Input,fmInput,0); + // OpenStdIO(Output,fmOutput,0); + // OpenStdIO(ErrOutput,fmOutput,0); + // OpenStdIO(StdOut,fmOutput,0); + // OpenStdIO(StdErr,fmOutput,0); + end; + + procedure SysFlushStdIO; + begin + { Make sure that all output is written to the redirected file } +{!!!!!!!! if Textrec(Output).Mode=fmOutput then + Flush(Output); + if Textrec(ErrOutput).Mode=fmOutput then + Flush(ErrOutput); + if Textrec(stdout).Mode=fmOutput then + Flush(stdout); + if Textrec(StdErr).Mode=fmOutput then + Flush(StdErr); } + end; + +var + ErrorBase : Pointer;external name 'FPC_ERRORBASE'; + +var + pstdout : ^Text; + +initialization + { Setup stdin, stdout and stderr } + SysInitStdIO; +finalization + { Show runtime error and exit } + pstdout:=@stdout; + If erroraddr<>nil Then + Begin + Writeln(pstdout^,'Runtime error ',Errorcode,' at $',hexstr(erroraddr)); + { to get a nice symify } + Writeln(pstdout^,BackTraceStrFunc(Erroraddr)); + dump_stack(pstdout^,ErrorBase); + Writeln(pstdout^,''); + End; + SysFlushStdIO; +end. + + diff --git a/rtl/embedded/heapmgr.pp b/rtl/embedded/heapmgr.pp new file mode 100644 index 0000000000..16359fc2de --- /dev/null +++ b/rtl/embedded/heapmgr.pp @@ -0,0 +1,66 @@ +{ + This file is part of the Free Pascal run time library. + Copyright (c) 2011 by the Free Pascal development team. + + Heap manager for the FPC embedded target + + 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. + + **********************************************************************} +{$mode objfpc} +Unit heapmgr; + +interface + +implementation + + var + Memorymanager: TMemoryManager;external name 'FPC_SYSTEM_MEMORYMANAGER'; + + Procedure HandleError (Errno : longint);external name 'FPC_HANDLEERROR'; + + {***************************************************************************** + OS Memory allocation / deallocation + ****************************************************************************} + function SysOSAlloc(size: ptruint): pointer; + begin + result:=nil; // pointer($02000000); + end; + + + procedure SysOSFree(p: pointer; size: ptruint); + begin + end; + + {$define FPC_IN_HEAPMGR} + {$i heap.inc} + + const + MyMemoryManager: TMemoryManager = ( + NeedLock: false; // Obsolete + GetMem: @SysGetMem; + FreeMem: @SysFreeMem; + FreeMemSize: @SysFreeMemSize; + AllocMem: @SysAllocMem; + ReAllocMem: @SysReAllocMem; + MemSize: @SysMemSize; + InitThread: nil; + DoneThread: nil; + RelocateHeap: nil; + GetHeapStatus: @SysGetHeapStatus; + GetFPCHeapStatus: @SysGetFPCHeapStatus; + ); + + +initialization + SetMemoryManager(MyMemoryManager); + InitHeap; +finalization + FinalizeHeap; +end. + diff --git a/rtl/embedded/sysheap.inc b/rtl/embedded/sysheap.inc index 89cccb4055..d2d7059a0f 100644 --- a/rtl/embedded/sysheap.inc +++ b/rtl/embedded/sysheap.inc @@ -13,18 +13,3 @@ **********************************************************************} -{***************************************************************************** - OS Memory allocation / deallocation - ****************************************************************************} - - -function SysOSAlloc(size: ptruint): pointer; -begin - result:=nil; // pointer($02000000); -end; - -{ $define HAS_SYSOSFREE} - -procedure SysOSFree(p: pointer; size: ptruint); -begin -end; diff --git a/rtl/embedded/system.pp b/rtl/embedded/system.pp index c0ab330e80..7233bd0fa1 100644 --- a/rtl/embedded/system.pp +++ b/rtl/embedded/system.pp @@ -24,6 +24,9 @@ Unit System; {$define HAS_CMDLINE} {$define USE_NOTHREADMANAGER} +{ Do not use standard memory manager } +{$define HAS_MEMORYMANAGER} + {$I check.inc} {$I systemh.inc} @@ -66,17 +69,12 @@ const DefaultTextLineBreakStyle : TTextLineBreakStyle = tlbsLF; {$endif FPC_HAS_FEATURE_TEXTIO} -{ -var - argc:longint;external name 'operatingsystem_parameter_argc'; - argv:PPchar;external name 'operatingsystem_parameter_argv'; - envp:PPchar;external name 'operatingsystem_parameter_envp'; -} - - {$ifdef FPC_HAS_FEATURE_COMMANDARGS} -function get_cmdline:Pchar; -property cmdline:Pchar read get_cmdline; +var + argc: LongInt = 0; + argv: PPChar = nil; + envp: PPChar = nil; + cmdline: PChar = nil; {$endif FPC_HAS_FEATURE_COMMANDARGS} {$ifndef FPUNONE} @@ -138,11 +136,19 @@ begin End; +{$ifdef FPC_HAS_FEATURE_PROCESSES} +function GetProcessID: SizeUInt; +begin + GetProcessID := 0; +end; +{$endif} + + {$ifdef FPC_HAS_FEATURE_RANDOM} Procedure Randomize; Begin - randseed:=longint(Fptime(nil)); + RandSeed := 63458; End; {$endif FPC_HAS_FEATURE_RANDOM} @@ -156,95 +162,16 @@ Begin End; - { variable where full path and filename and executable is stored } - { is setup by the startup of the system unit. } -var - execpathstr : shortstring; - function paramstr(l: longint) : string; begin - { stricly conforming POSIX applications } - { have the executing filename as argv[0] } if l=0 then begin - paramstr := execpathstr; + paramstr := ''; end else paramstr:=strpas(argv[l]); end; -{***************************************************************************** - cmdline -*****************************************************************************} - -procedure SetupCmdLine; -var - bufsize, - len,j, - size,i : longint; - found : boolean; - buf : pchar; - - procedure AddBuf; - begin - reallocmem(calculated_cmdline,size+bufsize); - move(buf^,calculated_cmdline[size],bufsize); - inc(size,bufsize); - bufsize:=0; - end; - -begin - if argc<=0 then - exit; - GetMem(buf,ARG_MAX); - size:=0; - bufsize:=0; - i:=0; - while (iARG_MAX-2 then - len:=ARG_MAX-2; - found:=false; - for j:=1 to len do - if argv[i][j]=' ' then - begin - found:=true; - break; - end; - if bufsize+len>=ARG_MAX-2 then - AddBuf; - if found then - begin - buf[bufsize]:='"'; - inc(bufsize); - end; - move(argv[i]^,buf[bufsize],len); - inc(bufsize,len); - if found then - begin - buf[bufsize]:='"'; - inc(bufsize); - end; - if i@SysGetMem) or (MemoryManager.FreeMem<>@SysFreeMem); +{$endif HAS_MEMORYMANAGER} end; procedure GetMem(Out p:pointer;Size:ptruint); @@ -333,6 +357,7 @@ procedure fpc_freemem(p:pointer);compilerproc;[public,alias:'FPC_FREEMEM']; begin MemoryManager.FreeMem(p); end; +{$endif FPC_IN_HEAPMGR} {$ifndef HAS_MEMORYMANAGER} {***************************************************************************** diff --git a/rtl/inc/heaph.inc b/rtl/inc/heaph.inc index 304d9e80c4..c534b231db 100644 --- a/rtl/inc/heaph.inc +++ b/rtl/inc/heaph.inc @@ -65,6 +65,7 @@ const var ReturnNilIfGrowHeapFails : boolean; +{$ifndef HAS_MEMORYMANAGER} { Default MemoryManager functions } Function SysGetmem(Size:ptruint):Pointer; Function SysFreemem(p:pointer):ptruint; @@ -75,6 +76,7 @@ function SysTryResizeMem(var p:pointer;size:ptruint):boolean; Function SysReAllocMem(var p:pointer;size:ptruint):Pointer; function SysGetHeapStatus:THeapStatus; function SysGetFPCHeapStatus:TFPCHeapStatus; +{$endif HAS_MEMORYMANAGER} { Tp7 functions } Procedure Getmem(Out p:pointer;Size:ptruint); diff --git a/rtl/inc/system.inc b/rtl/inc/system.inc index 45181973b4..e50222935e 100644 --- a/rtl/inc/system.inc +++ b/rtl/inc/system.inc @@ -93,7 +93,7 @@ const OldRandSeed : Cardinal = 0; { For Error Handling.} - ErrorBase : Pointer = nil; + ErrorBase : Pointer = nil;public name 'FPC_ERRORBASE'; { Used by the ansi/widestrings and maybe also other things in the future } var @@ -888,6 +888,10 @@ Begin FinalizeUnits; {$ifdef FPC_HAS_FEATURE_CONSOLEIO} + { the embedded system unit itself contains no routines for console i/o + console i/o is done by the Consoleio unit which can do things like + redirection to seriell i/o } +{$ifndef EMBEDDED} { Show runtime error and exit } pstdout:=@stdout; If erroraddr<>nil Then @@ -899,6 +903,7 @@ Begin Writeln(pstdout^,''); End; SysFlushStdIO; +{$endif EMBEDDED} {$endif FPC_HAS_FEATURE_CONSOLEIO} {$if defined(MSWINDOWS) or defined(OS2)} diff --git a/rtl/inc/systemh.inc b/rtl/inc/systemh.inc index 922462d7bc..5325f50701 100644 --- a/rtl/inc/systemh.inc +++ b/rtl/inc/systemh.inc @@ -1125,8 +1125,10 @@ Procedure halt;{$ifdef SYSTEMINLINE}inline;{$endif} Procedure SysInitExceptions; {$endif FPC_HAS_FEATURE_EXCEPTIONS} {$ifdef FPC_HAS_FEATURE_CONSOLEIO} +{$ifndef EMBEDDED} procedure SysInitStdIO; procedure SysFlushStdIO; +{$endif EMBEDDED} {$endif FPC_HAS_FEATURE_CONSOLEIO} {$ifndef FPUNONE} Procedure SysResetFPU;