From: <jt...@us...> - 2007-04-29 21:55:40
|
Revision: 255 http://ro-oslib.svn.sourceforge.net/ro-oslib/?rev=255&view=rev Author: jtytgat Date: 2007-04-29 14:55:38 -0700 (Sun, 29 Apr 2007) Log Message: ----------- Build changes to get clean AOF vs ELF builds done. Modified Paths: -------------- branches/simplified-build/!OsLib/Source/Computer/oslib/Modules branches/simplified-build/!OsLib/Source/Core/oslib/Modules branches/simplified-build/!OsLib/Source/Macros/oslib/Modules branches/simplified-build/!OsLib/Source/Makefile branches/simplified-build/!OsLib/Source/Makefile.inc branches/simplified-build/!OsLib/Source/Makefile.setup.CROSSGCC_AOF branches/simplified-build/!OsLib/Source/Makefile.setup.CROSSGCC_ELF branches/simplified-build/!OsLib/Source/Toolbox/oslib/Modules branches/simplified-build/!OsLib/Source/Types/oslib/Modules branches/simplified-build/!OsLib/Source/User/oslib/Modules Added Paths: ----------- branches/simplified-build/!OsLib/Source/Core/oslib/OSChangeDynamicAreaNoFail.gas branches/simplified-build/!OsLib/Source/Core/oslib/OSHeapResizeNoFail.gas branches/simplified-build/!OsLib/Source/Core/oslib/OSReadVarValSize.gas branches/simplified-build/!OsLib/Source/Core/oslib/XOSChangeDynamicAreaNoFail.gas branches/simplified-build/!OsLib/Source/Core/oslib/XOSHeapResizeNoFail.gas branches/simplified-build/!OsLib/Source/Core/oslib/XOSReadVarValSize.gas branches/simplified-build/!OsLib/Source/Macros/oslib/Macros.AOFHdr branches/simplified-build/!OsLib/Source/Macros/oslib/Macros.ELFHdr branches/simplified-build/!OsLib/Source/Types/oslib/ColTrans32.AOFHdr branches/simplified-build/!OsLib/Source/Types/oslib/ColTrans32.ELFHdr branches/simplified-build/!OsLib/Source/Types/oslib/DOSFS32.AOFHdr branches/simplified-build/!OsLib/Source/Types/oslib/DOSFS32.ELFHdr branches/simplified-build/!OsLib/Source/Types/oslib/DeviceFS32.AOFHdr branches/simplified-build/!OsLib/Source/Types/oslib/DeviceFS32.ELFHdr branches/simplified-build/!OsLib/Source/Types/oslib/FileCore32.AOFHdr branches/simplified-build/!OsLib/Source/Types/oslib/FileCore32.ELFHdr branches/simplified-build/!OsLib/Source/Types/oslib/FileSwch32.AOFHdr branches/simplified-build/!OsLib/Source/Types/oslib/FileSwch32.ELFHdr branches/simplified-build/!OsLib/Source/Types/oslib/OSArgs32.AOFHdr branches/simplified-build/!OsLib/Source/Types/oslib/OSArgs32.ELFHdr branches/simplified-build/!OsLib/Source/Types/oslib/OSCore32.AOFHdr branches/simplified-build/!OsLib/Source/Types/oslib/OSCore32.ELFHdr branches/simplified-build/!OsLib/Source/Types/oslib/OSF32.AOFHdr branches/simplified-build/!OsLib/Source/Types/oslib/OSF32.ELFHdr branches/simplified-build/!OsLib/Source/Types/oslib/OSFSCtrl32.AOFHdr branches/simplified-build/!OsLib/Source/Types/oslib/OSFSCtrl32.ELFHdr branches/simplified-build/!OsLib/Source/Types/oslib/OSFind32.AOFHdr branches/simplified-build/!OsLib/Source/Types/oslib/OSFind32.ELFHdr branches/simplified-build/!OsLib/Source/Types/oslib/OSGBPB32.AOFHdr branches/simplified-build/!OsLib/Source/Types/oslib/OSGBPB32.ELFHdr branches/simplified-build/!OsLib/Source/Types/oslib/PDriver32.AOFHdr branches/simplified-build/!OsLib/Source/Types/oslib/PDriver32.ELFHdr branches/simplified-build/!OsLib/Source/Types/oslib/Types.AOFHdr branches/simplified-build/!OsLib/Source/Types/oslib/Types.ELFHdr branches/simplified-build/!OsLib/Source/Types/oslib/Wimp32.AOFHdr branches/simplified-build/!OsLib/Source/Types/oslib/Wimp32.ELFHdr Removed Paths: ------------- branches/simplified-build/!OsLib/Source/Macros/oslib/Macros.Hdr branches/simplified-build/!OsLib/Source/Types/oslib/ColTrans32.Hdr branches/simplified-build/!OsLib/Source/Types/oslib/ColTrans32.help branches/simplified-build/!OsLib/Source/Types/oslib/DOSFS32.Hdr branches/simplified-build/!OsLib/Source/Types/oslib/DOSFS32.help branches/simplified-build/!OsLib/Source/Types/oslib/DeviceFS32.Hdr branches/simplified-build/!OsLib/Source/Types/oslib/DeviceFS32.help branches/simplified-build/!OsLib/Source/Types/oslib/FileCore32.Hdr branches/simplified-build/!OsLib/Source/Types/oslib/FileCore32.help branches/simplified-build/!OsLib/Source/Types/oslib/FileSwch32.Hdr branches/simplified-build/!OsLib/Source/Types/oslib/FileSwch32.help branches/simplified-build/!OsLib/Source/Types/oslib/OSArgs32.Hdr branches/simplified-build/!OsLib/Source/Types/oslib/OSArgs32.help branches/simplified-build/!OsLib/Source/Types/oslib/OSCore32.Hdr branches/simplified-build/!OsLib/Source/Types/oslib/OSCore32.help branches/simplified-build/!OsLib/Source/Types/oslib/OSF32.Hdr branches/simplified-build/!OsLib/Source/Types/oslib/OSF32.help branches/simplified-build/!OsLib/Source/Types/oslib/OSFSCtrl32.Hdr branches/simplified-build/!OsLib/Source/Types/oslib/OSFSCtrl32.help branches/simplified-build/!OsLib/Source/Types/oslib/OSFind32.Hdr branches/simplified-build/!OsLib/Source/Types/oslib/OSFind32.help branches/simplified-build/!OsLib/Source/Types/oslib/OSGBPB32.Hdr branches/simplified-build/!OsLib/Source/Types/oslib/OSGBPB32.help branches/simplified-build/!OsLib/Source/Types/oslib/PDriver32.Hdr branches/simplified-build/!OsLib/Source/Types/oslib/PDriver32.help branches/simplified-build/!OsLib/Source/Types/oslib/Types.Hdr branches/simplified-build/!OsLib/Source/Types/oslib/Types.help branches/simplified-build/!OsLib/Source/Types/oslib/Wimp32.Hdr branches/simplified-build/!OsLib/Source/Types/oslib/Wimp32.help Modified: branches/simplified-build/!OsLib/Source/Computer/oslib/Modules =================================================================== --- branches/simplified-build/!OsLib/Source/Computer/oslib/Modules 2007-04-28 13:28:42 UTC (rev 254) +++ branches/simplified-build/!OsLib/Source/Computer/oslib/Modules 2007-04-29 21:55:38 UTC (rev 255) @@ -2,8 +2,8 @@ # List of modules comprising Computer # for inclusion in Make files independant of platform -# modules containing SWIs -SWIMODULES += \ +# Modules containing SWIs +SWIMODULES = \ ADFS \ CD \ CDFS \ @@ -36,12 +36,12 @@ SCSIFS \ ShareFS \ Socket \ -SysLog +SysLog -# modules with no SWIs -MODULES += \ +# Modules with no SWIs +MODULES = \ CDFSFiler \ -NetFiler +NetFiler -# modules defined other than by SWI definition -CMODULES += +# Modules defined other than by SWI definition +ASMMODULES = Modified: branches/simplified-build/!OsLib/Source/Core/oslib/Modules =================================================================== --- branches/simplified-build/!OsLib/Source/Core/oslib/Modules 2007-04-28 13:28:42 UTC (rev 254) +++ branches/simplified-build/!OsLib/Source/Core/oslib/Modules 2007-04-29 21:55:38 UTC (rev 255) @@ -1,8 +1,8 @@ #Source/Core/oslib/Modules # -# modules containing SWIs -SWIMODULES += \ +# Modules containing SWIs +SWIMODULES = \ BlendTable \ Buffer \ Cache \ @@ -31,18 +31,17 @@ SharedCLibrary \ Sound \ Squash \ -Territory +Territory -# modules with no SWIs -MODULES += \ +# Modules with no SWIs +MODULES = \ Shell -# modules defined other than by SWI definition -CMODULES += \ +# Modules defined other than by SWI definition +ASMMODULES = \ OSChangeDynamicAreaNoFail \ OSHeapResizeNoFail \ OSReadVarValSize \ XOSChangeDynamicAreaNoFail \ XOSHeapResizeNoFail \ -XOSReadVarValSize - +XOSReadVarValSize Copied: branches/simplified-build/!OsLib/Source/Core/oslib/OSChangeDynamicAreaNoFail.gas (from rev 246, branches/simplified-build/!OsLib/Source/Core/oslib/OSChangeDynamicAreaNoFail.asm) =================================================================== --- branches/simplified-build/!OsLib/Source/Core/oslib/OSChangeDynamicAreaNoFail.gas (rev 0) +++ branches/simplified-build/!OsLib/Source/Core/oslib/OSChangeDynamicAreaNoFail.gas 2007-04-29 21:55:38 UTC (rev 255) @@ -0,0 +1,72 @@ +@Index: OSLib/!OsLib/Source/Core/oslib/OSChangeDynamicAreaNoFail.asm 20031228 +@ os_change_dynamic_area_no_fail - Extend or shrink dynamic area without throwing error if +@ the change was only partially performed + +@ Initial Release 08-Nov-01 Tony van der Hoff +@ Bug fix 21-Dec-01 TV + +@OSLib---efficient, type-safe, transparent, extensible, +@ register-safe A P I coverage of RISC O S +@ +@ OSLib is free software; you can redistribute it and/or modify +@it under the terms of the GNU General Public Licence as published by +@the Free Software Foundation; either version 1, or (at your option) +@any later version. +@ +@ OSLib 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. See the +@GNU General Public License for more details. +@ +@ You should have received a copy of the GNU General Public Licence +@along with this programme; if not, write to the Free Software +@Foundation, Inc, 675 Mass Ave, Cambridge, MA 02139, U S A. + +@#include "oslib/OS.Hdr" + +R .req r0 + + .global os_change_dynamic_area_no_fail + .type os_change_dynamic_area_no_fail, %function + + .text + +@ os_change_dynamic_area_no_fail +@ APCS Compliant +@Entry A1 = area type +@ A2 = required size change in bytes (signed integer) +@Exit R = actual size change in bytes (unsigned integer) +@ +@ C Prototype: +@extern int os_change_dynamic_area_no_fail( os_dynamic_area_no area, +@ os_dynamic_area_no size_increase +@ ); +@ +@ This code works around the problem that OS_ChangeDynamicArea throws an error if the move is only +@ partially performed. OSLib is then unable to return the amount by which the area has changed. +@ +@ The object code is patched into the library at build time by the MakeFile. + + +os_change_dynamic_area_no_fail: + SWI 0x2002a @ XOS_ChangeDynamicArea (PRM 1-377) + BVC 99f @ no error - normal return + + @Test for Error_ChDynamNotAllMoved - report any other error + LDR R3, =0x1c1 @ Error_ChDynamNotAllMoved + LDR R2, [R0] @ get error number in R2 [TV 011221] + CMP R2, R3 + SWINE 0x2B @ OS_GenerateError - no return + + @ ignore Error_ChDynamNotAllMoved + + @ exit +99: MOV R, R1 @ APCS return value + +#ifdef __APCS_32__ + MOV PC, LR +#else + MOVS PC, LR +#endif + + .end Copied: branches/simplified-build/!OsLib/Source/Core/oslib/OSHeapResizeNoFail.gas (from rev 246, branches/simplified-build/!OsLib/Source/Core/oslib/OSHeapResizeNoFail.asm) =================================================================== --- branches/simplified-build/!OsLib/Source/Core/oslib/OSHeapResizeNoFail.gas (rev 0) +++ branches/simplified-build/!OsLib/Source/Core/oslib/OSHeapResizeNoFail.gas 2007-04-29 21:55:38 UTC (rev 255) @@ -0,0 +1,73 @@ +@Index: OSLib/!OsLib/Source/Core/oslib/OSHeapResizeNoFail.asm 20031228 +@ osheap_resize_no_fail - Extend or shrink heap without throwing error if shrink fails +@ Initial Release 08-Nov-01 Tony van der Hoff +@ Bug fix 21-Dec-01 TV + +@OSLib---efficient, type-safe, transparent, extensible, +@ register-safe A P I coverage of RISC O S +@ +@ OSLib is free software@ you can redistribute it and/or modify +@it under the terms of the GNU General Public Licence as published by +@the Free Software Foundation; either version 1, or (at your option) +@any later version. +@ +@ OSLib 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. See the +@GNU General Public License for more details. +@ +@ You should have received a copy of the GNU General Public Licence +@along with this programme; if not, write to the Free Software +@Foundation, Inc, 675 Mass Ave, Cambridge, MA 02139, U S A. + +@#include "oslib/OSHeap.Hdr" + +R .req r0 + + .global osheap_resize_no_fail + .type osheap_resize_no_fail, %function + + .text + +@ osheap_resize_no_fail +@ APCS Compliant +@Entry A1 = pointer to heap +@ A2 = required size change in bytes (signed integer) +@Exit R = actual size change in bytes +@ +@ C Prototype: +@extern int osheap_resize_no_fail( byte* heap, +@ int size_increase +@ ); +@ +@ This code works around the problem that OSHeap_Resize throws an error if shrink fails. +@ OSLib is then unable to return the amount by which the heap shrunk. +@ It also negates R3 if the error occurs, to give a consistent sign regardless of error condition. +@ The object code is patched into the library at build time by the MakeFile + +osheap_resize_no_fail: + MOV R3, A2 @ required change + MOV R1, A1 @ pointer to heap + MOV R0, #5 @ OSHeap_Resize - reason code + SWI 0x2001d @ XOS_Heap (PRM 1-375) + BVC 99f @ no error - normal return + + @Test for Error_HeapExcessiveShrink - report any other error + LDR R1, =0x187 @ Error_HeapExcessiveShrink + LDR R2, [R0] @ get error number in R2; [TV 011221] + CMP R2, R1 + SWINE 0x2B @ OS_GenerateError - no return + + @ ignore Error_HeapExcessiveShrink + RSB R3, R3, #0 @ complement R3 to give actual change + + @ exit +99: MOV R, R3 @ APCS return value + +#ifdef __APCS_32__ + MOV PC, LR +#else + MOVS PC, LR +#endif + + .end Copied: branches/simplified-build/!OsLib/Source/Core/oslib/OSReadVarValSize.gas (from rev 246, branches/simplified-build/!OsLib/Source/Core/oslib/OSReadVarValSize.asm) =================================================================== --- branches/simplified-build/!OsLib/Source/Core/oslib/OSReadVarValSize.gas (rev 0) +++ branches/simplified-build/!OsLib/Source/Core/oslib/OSReadVarValSize.gas 2007-04-29 21:55:38 UTC (rev 255) @@ -0,0 +1,94 @@ +@os_read_var_val_size - return length of a variable +@ Initial Release 23-Mar-99 Tony van der Hoff + +@OSLib---efficient, type-safe, transparent, extensible, +@ register-safe A P I coverage of RISC O S +@ +@ OSLib is free software; you can redistribute it and/or modify +@it under the terms of the GNU General Public Licence as published by +@the Free Software Foundation; either version 1, or (at your option) +@any later version. +@ +@ OSLib 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. See the +@GNU General Public License for more details. +@ +@ You should have received a copy of the GNU General Public Licence +@along with this programme; if not, write to the Free Software +@Foundation, Inc, 675 Mass Ave, Cambridge, MA 02139, U S A. + +@ This code works around the RO3 infelicity which causes OS_ReadVarVal to return an error +@ when R2 bit 31 is set to read the variable length. The object code is patched into the +@ library at build time by the MakeFile + +@#include "oslib/Types.Hdr" + +R .req r0 + + .global os_read_var_val_size + .type os_read_var_val_size, %function + + .text + +@ os_Read_var_val_size +@ APCS Compliant +@Entry R0 (a1) -> name of a variable (may be wildcarded) +@ R1 (a2) -> context pointer for wildcarded names +@ R2 (a3) = variable type (os_VARTYPE_EXPANDED or 0) +@ R3 (a4) -> integer to contain result = NOT length of variable value; 0 if not found +@ R4 (v1) -> integer to contain variable type +@Exit R = updated context pointer +@ +@ C Prototype: +@extern int os_read_var_val_size ( +@ char const *var, +@ int context, +@ os_var_type var_type, +@ int *used, +@ os_var_type *var_type_out); + +@ C prototype: int xos_read_var_val_size( char const *name, +@ int *context, +@ os_var_type var_type +@ ); +@ +@ + +os_read_var_val_size: + STMFD SP!, {A4, V1} + MOV R4, A3 @ variable type + MOV R3, A2 @ context in + MOV R2, #0x80000000 @ check variable + MOV R1, #0 @ unused + SWI 0x20023 @ XOS_ReadVarVal + BVC 90f @ no error + + @Ignore error if RO 3 or later + STMFD SP!, {R0, R2} @ keep results + MOV R0, #129 @ Get OS version + MOV R1, #0 + MOV R2, #0xFF + SWI 0x6 @ OS_Byte + LDMFD SP!, {R0, R2} @ restore state + CMP R1, #0xA3 @ test for RISC O S 3 + SWILO 0x2B @ RO2 - call OS_GenerateError + +90: LDR IP, [SP, #0] @ Result pointer + TEQ IP, #0 + STRNE R2, [IP] @ update result + LDR IP, [SP, #8] @ var-type out pointer + TEQ IP, #0 + STRNE R4, [IP] @ update var type + MOV R, R3 @ new context + +99: ADD SP, SP, #4 @ flatten stack + LDMFD SP!, {V1} @ restore state + +#ifdef __APCS_32__ + MOV PC, LR +#else + MOVS PC, LR @ exit +#endif + + .end Copied: branches/simplified-build/!OsLib/Source/Core/oslib/XOSChangeDynamicAreaNoFail.gas (from rev 246, branches/simplified-build/!OsLib/Source/Core/oslib/XOSChangeDynamicAreaNoFail.asm) =================================================================== --- branches/simplified-build/!OsLib/Source/Core/oslib/XOSChangeDynamicAreaNoFail.gas (rev 0) +++ branches/simplified-build/!OsLib/Source/Core/oslib/XOSChangeDynamicAreaNoFail.gas 2007-04-29 21:55:38 UTC (rev 255) @@ -0,0 +1,81 @@ +@Index: OSLib/!OsLib/Source/Core/oslib/XOSChangeDynamicAreaNoFail.asm 20031228 +@ os_change_dynamic_area_no_fail - Extend or shrink dynamic area without throwing error if +@ the change was only partially performed +@ +@ Initial Release 08-Nov-01 Tony van der Hoff +@ Bug fix 21-Dec-01 TV +@ Bug Fix 20-Feb-02 TV +@ +@OSLib---efficient, type-safe, transparent, extensible, +@ register-safe A P I coverage of RISC O S +@ +@ OSLib is free software; you can redistribute it and/or modify +@it under the terms of the GNU General Public Licence as published by +@the Free Software Foundation; either version 1, or (at your option) +@any later version. +@ +@ OSLib 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. See the +@GNU General Public License for more details. +@ +@ You should have received a copy of the GNU General Public Licence +@along with this programme; if not, write to the Free Software +@Foundation, Inc, 675 Mass Ave, Cambridge, MA 02139, U S A. + +@#include "oslib/OSHeap.Hdr" + +R .req r0 + + .global xos_change_dynamic_area_no_fail + .type xos_change_dynamic_area_no_fail, %function + + .text + +@ os_change_dynamic_area_no_fail +@ APCS Compliant +@Entry A1 = area type +@ A2 = required size change in bytes (signed integer) +@ A3 -> actual size change in bytes (unsigned integer) +@ +@ C Prototype: +@extern os_error* os_change_dynamic_area_no_fail( os_dynamic_area_no area, +@ int size_increase, +@ int* size_change +@ ); +@ +@ This code works around the problem that OS_ChangeDynamicArea throws an error if the move is only +@ partially performed. OSLib is then unable to return the amount by which the area has changed. +@ The object code is patched into the library at build time by the MakeFile. + +xos_change_dynamic_area_no_fail: + MOV IP, LR @ + + SWI 0x2002a @ XOS_ChangeDynamicArea (PRM 1-377) + BVC 90f @ no error - normal return + + @Test for Error_ChDynamNotAllMoved - return any other error + @ fixed bug causing R1 (result) and R2 (A3) to be overwritten with scratch data [TV 020220] + STMFD SP,{R2} @ save workspace + LDR R3, =0x1c1 @ Error_ChDynamNotAllMoved + LDR R2, [R0] @ get error number in R2 [TV 011221] + CMP R2, R3 + LDMFD SP,{R2} @ restore workspace + BNE 99f @ return error + + @ ignore Error_ChDynamNotAllMoved + + @ valid return +90: TEQ A3, #0 @ check null pointer + STRNE R1, [A3] @ output R1 [TV 020220] + MOV R, #0 @ clear error pointer + + @ exit +99: +#ifdef __APCS_32__ + MOV PC, IP +#else + MOVS PC, IP +#endif + + .end Copied: branches/simplified-build/!OsLib/Source/Core/oslib/XOSHeapResizeNoFail.gas (from rev 246, branches/simplified-build/!OsLib/Source/Core/oslib/XOSHeapResizeNoFail.asm) =================================================================== --- branches/simplified-build/!OsLib/Source/Core/oslib/XOSHeapResizeNoFail.gas (rev 0) +++ branches/simplified-build/!OsLib/Source/Core/oslib/XOSHeapResizeNoFail.gas 2007-04-29 21:55:38 UTC (rev 255) @@ -0,0 +1,84 @@ +@ Index: OSLib/!OsLib/Source/Core/oslib/XOSHeapResizeNoFail.asm 20031228 +@ osheap_resize_no_fail - Extend or shrink heap without throwing error if shrink fails +@ Initial Release 08-Nov-00 Tony van der Hoff +@ Bug fix 21-Dec-01 TV +@ Bug Fix 20-Feb-02 TV + +@OSLib---efficient, type-safe, transparent, extensible, +@ register-safe A P I coverage of RISC O S +@ +@ OSLib is free software; you can redistribute it and/or modify +@it under the terms of the GNU General Public Licence as published by +@the Free Software Foundation; either version 1, or (at your option) +@any later version. +@ +@ OSLib 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. See the +@GNU General Public License for more details. +@ +@ You should have received a copy of the GNU General Public Licence +@along with this programme; if not, write to the Free Software +@Foundation, Inc, 675 Mass Ave, Cambridge, MA 02139, U S A. + +@#include "oslib/OSHeap.Hdr" + +R .req r0 + + .global xosheap_resize_no_fail + .type xosheap_resize_no_fail, %function + + .text + +@ xosheap_resize_no_fail +@ APCS Compliant +@Entry A1 = pointer to heap +@ A2 = required size change in bytes (signed integer) +@ A3 -> actual size change in bytes (signed integer) +@Exit R = os_error code + +@ C Prototype: +@extern os_error *xosheap_resize_no_fail( byte* heap, +@ int size_increase, +@ int* size_change +@ ); +@ +@ This code works around the problem that OSHeap_Resize throws an error if shrink fails. +@ OSLib is then unable to return the amount by which the heap shrunk. +@ The object code is patched into the library at build time by the MakeFile + +xosheap_resize_no_fail: + MOV IP, LR @ + + MOV R3, A2 @ required change + MOV R1, A1 @ pointer to heap + MOV R0, #5 @ OSHeap_Resize - reason code + SWI 0x2001d @ XOS_Heap + BVC 90f @ no error - normal return + + @ Test for Error_HeapExcessiveShrink - report any other error + @ fixed bug causing R2 (A3) to be overwritten with scratch data [TV 020220] + STMFD SP,{R2} @ save workspace + LDR R1, =0x187 @Error_HeapExcessiveShrink + LDR R2, [R0] @ get error number in R2; [TV 011221] + CMP R2, R1 + LDMFD SP,{R2} @ restore workspace + BNE 99f @ return any other error + + @ ignore Error_HeapExcessiveShrink + RSB R3, R3, #0 @ complement R3 to give actual change + + @ valid return +90: TEQ A3, #0 @ check null pointer + STRNE R3, [A3] @ output R3 + MOV R, #0 @ clear error pointer + + @ exit +99: +#ifdef __APCS_32__ + MOV PC, IP +#else + MOVS PC, IP +#endif + + .end Copied: branches/simplified-build/!OsLib/Source/Core/oslib/XOSReadVarValSize.gas (from rev 246, branches/simplified-build/!OsLib/Source/Core/oslib/XOSReadVarValSize.asm) =================================================================== --- branches/simplified-build/!OsLib/Source/Core/oslib/XOSReadVarValSize.gas (rev 0) +++ branches/simplified-build/!OsLib/Source/Core/oslib/XOSReadVarValSize.gas 2007-04-29 21:55:38 UTC (rev 255) @@ -0,0 +1,96 @@ +@xos_read_var_val_size - return length of a variable +@ Initial Release 23-mar-99 Tony van der Hoff +@ History +@ 001230 TV Update for 32-bit compatibility + +@OSLib---efficient, type-safe, transparent, extensible, +@ register-safe A P I coverage of RISC O S +@ +@ OSLib is free software; you can redistribute it and/or modify +@it under the terms of the GNU General Public Licence as published by +@the Free Software Foundation; either version 1, or (at your option) +@any later version. +@ +@ OSLib 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. See the +@GNU General Public License for more details. +@ +@ You should have received a copy of the GNU General Public Licence +@along with this programme; if not, write to the Free Software +@Foundation, Inc, 675 Mass Ave, Cambridge, MA 02139, U S A. + +@ This code works around the RO3 infelicity which causes OS_ReadVarVal to return an error +@ when R2 bit 31 is set to read the variable length. The object code is patched into the +@ library at build time by the MakeFile + +@#include "oslib/Types.Hdr" + +R .req r0 + + .global xos_read_var_val_size + .type xos_read_var_val_size, %function + + .text + +@ xos_Read_var_val_size +@ APCS Compliant +@Entry R0 (a1) -> name of a variable (may be wildcarded) +@ R1 (a2) -> context pointer for wildcarded names +@ R2 (a3) = expand variable flag (os_VARTYPE_EXPANDED or 0) +@ R3 (a4) -> integer to contain result = NOT length of variable value; 0 if not found +@ R4 (v1) -> integer to contain variable type +@Exit R = 0, or pointer to error block +@ +@ C Prototype: +@extern os_error *xos_read_var_val_size ( +@ char const *var, +@ int context, +@ os_var_type var_type, +@ int *used, +@ int *context_out, +@ os_var_type *var_type_out ); + +xos_read_var_val_size: + MOV IP, LR + STMFD SP!, {A4, V1} + MOV R4, A3 @ expand variable flag + MOV R3, A2 @ context pointer + MOV R2, #0x80000000 @ check variable + MOV R1, #0 @ unused + SWI 0x20023 @ XOS_ReadVarVal + BVC 90f + + @Ignore error if RO 3 or later + STMFD SP!, {R0, R2} @ keep results + MOV R0, #129 @ Get OS version + MOV R1, #0 + MOV R2, #0xFF + SWI 0x20006 @ XOS_Byte + ADDVS SP, SP, #8 @ flatten stack + BVS 99f @ error exit + LDMFD SP!, {R, R2} @ restore state + CMP R1, #0xA3 @ test for RISC O S 3 + BLO 99f @ RO2 - Can't ignore error + + @ no real error +90: LDR LR, [SP, #0] @ a4 = pointer to result + TEQ LR, #0 + STRNE R2, [LR] @ save result + LDR LR, [SP, #8] @ v1 = pointer to context out + TEQ LR, #0 + STRNE R3, [LR] @ update context + LDR LR, [SP, #12] @ a3 = pointer to var type + TEQ LR, #0 + STRNE R4, [LR] @ variable type out + MOV R, #0 @ clear error pointer + +99: ADD SP, SP, #4 @ flatten stack + LDMFD SP!, {V1} @ restore arguments +#ifdef __APCS_32__ + MOV PC, IP +#else + MOVS PC, IP @ exit +#endif + + .end Copied: branches/simplified-build/!OsLib/Source/Macros/oslib/Macros.AOFHdr (from rev 246, branches/simplified-build/!OsLib/Source/Macros/oslib/Macros.Hdr) =================================================================== --- branches/simplified-build/!OsLib/Source/Macros/oslib/Macros.AOFHdr (rev 0) +++ branches/simplified-build/!OsLib/Source/Macros/oslib/Macros.AOFHdr 2007-04-29 21:55:38 UTC (rev 255) @@ -0,0 +1,227 @@ + [ :LNOT: :DEF: Macros_Hdr + GBLL Macros_Hdr + +;OSLib---efficient, type-safe, transparent, extensible, +; register-safe A P I coverage of RISC O S +;Copyright \xA9 1994 Jonathan Coxhead + +; OSLib is free software; you can redistribute it and/or modify +;it under the terms of the GNU General Public License as published by +;the Free Software Foundation; either version 1, or (at your option) +;any later version. +; +; OSLib 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. See the +;GNU General Public License for more details. +; +; You should have received a copy of the GNU General Public License +;along with this programme; if not, write to the Free Software +;Foundation, Inc, 675 Mass Ave, Cambridge, MA 02139, U S A. + + MACRO +$label Inc $c, $r1 +$label ADD$c $r1, $r1, #1 + MEND + + MACRO +$label IncS $c, $r1 +$label ADD$c.S $r1, $r1, #1 + MEND + + MACRO +$label Dec $c, $r1 +$label SUB$c $r1, $r1, #1 + MEND + + MACRO +$label DecS $c, $r1 +$label SUB$c.S $r1, $r1, #1 + MEND + + MACRO +$label Max $r1, $r2, $r3 + ;r1 = MAX (r2, r3) +$label CMP $r2, $r3 + MOVGT $r1, $r2 + MOVLE $r1, $r3 + MEND + + MACRO +$label Min $r1, $r2, $r3 + ;r1 = MIN (r2, r3) +$label CMP $r2, $r3 + MOVLT $r1, $r2 + MOVGE $r1, $r3 + MEND + + MACRO +$label MaxAB $r1, $r2 + ;r1 = MAX (r1, r2) +$label CMP $r1, $r2 + MOVLT $r1, $r2 + MEND + + MACRO +$label MinAB $r1, $r2 + ;r1 = MIN (r1, r2) +$label CMP $r1, $r2 + MOVGT $r1, $r2 + MEND + + MACRO +$label Abs $r1, $r2 + ;r1 = ABS (r2) +$label CMP $r2, #0 + MOVGE $r1, $r2 + RSBLT $r1, $r2, #0 + MEND + + MACRO +$label Sgn $r1, $r2 + ;r1 = SGN (r2) +$label CMP $r2, #0 + MOVGT $r1, #1 + MOVEQ $r1, #0 + MVNLT $r1, #0 + MEND + + MACRO +$label Dim $r1, $r2, $r3 + ;r1 = DIM (r2, r3) +$label CMP $r2, $r3 + SUBGT $r1, $r2, $r3 + MOVLE $r1, #0 + MEND + + MACRO +$label Sqr $c, $r1, $r2 + ;r1 = SQR (r2) +$label MUL$c $r1, $r2, $r2 + MEND + + MACRO +$label Bool $r1, $r2 + ;r1 = BOOL (r2) +$label TEQ $r2, #0 + MOVNE $r2, #True + MOVEQ $r2, #False + MEND + + MACRO +$label Int $r1, $r2 + ;r1 = INT (r2) +$label SUB $r1, $r2, #"0" + CMP $r1, #9 + SUBHI $r1, $r2, #"a" + CMPHI $r1, #5 + SUBHI $r1, $r2, #"A" + CMPHI $r1, #5 + ADDHI $r1, $r1, #10 + MEND + + MACRO +$label UChar $r1, $r2 + ;r1 = UCHAR (r2) +$label CMP $r2, #10 + ADDLT $r1, $r2, #"0" + ADDGE $r1, $r2, #"A"-10 + MEND + + MACRO +$label LChar $r1, $r2 + ;r1 = LCHAR (r2) +$label CMP $r2, #10 + ADDLT $r1, $r2, #"0" + ADDGE $r1, $r2, #"a"-10 + MEND + + MACRO +$label BinExp $c, $r1, $r2 + ;r1 = BINEXP (r2) +$label MOV$c $r1, #1 + MOV$c $r1, $r1, LSL $r2 + MEND + + MACRO +$label Align $c, $r1, $r2 + ;r1 = ALIGN (r2) +$label ADD$c $r1, $r2, #3 + BIC$c $r1, $r1, #3 + MEND + + MACRO +$label SetC + ;C=1 V=0 Z=0 N=0 +$label CMP PC, #0 + MEND + + MACRO +$label ClearFlags + ;C=0 V=0 Z=0 N=0 +$label CMN PC, #0 + MEND + + MACRO +$label ClrV +$label ClearFlags + MEND + + MACRO +$label ClrC +$label ClearFlags + MEND + + MACRO +$label ClrN +$label ClearFlags + MEND + + MACRO +$label SetV + ;C=0 V=1 Z=0 N=1 +$label CMP PC, #&80000000 + MEND + + MACRO +$label SetN + ;C=0 V=0 Z=0 N=1 +$label CMN PC, #&80000000 + MEND + + MACRO +$label SetZ + ;C=* V=* Z=1 N=0 +$label TST PC, #0 + MEND + + MACRO +$label ClrZ + ;C=* V=* Z=0 N=0 +$label TEQ PC, #0 + MEND + + MACRO +$label NOP +$label & 0 + MEND + + MACRO +$label DivRem $rc, $ra, $rb, $rtemp + ;rc := ra DIV rb; ra := ra REM rb; rb preserved, rtemp corrupt +$label MOV $rtemp, $rb + CMP $rtemp, $ra, LSR #1 +01 MOVLS $rtemp, $rtemp, LSL #1 + CMPLS $rtemp, $ra, LSR #1 + BLS %BT01 + MOV $rc, #0 +02 CMP $ra, $rtemp + SUBCS $ra, $ra, $rtemp + ADC $rc, $rc, $rc + MOV $rtemp, $rtemp, LSR #1 + CMP $rtemp, $rb + BCS %BT02 + MEND + + ] + END Copied: branches/simplified-build/!OsLib/Source/Macros/oslib/Macros.ELFHdr (from rev 246, branches/simplified-build/!OsLib/Source/Macros/oslib/Macros.Hdr) =================================================================== --- branches/simplified-build/!OsLib/Source/Macros/oslib/Macros.ELFHdr (rev 0) +++ branches/simplified-build/!OsLib/Source/Macros/oslib/Macros.ELFHdr 2007-04-29 21:55:38 UTC (rev 255) @@ -0,0 +1,202 @@ +#ifndef Macros_Hdr +# define Macros_Hdr + +# ifndef Get_Types +# define Get_Types +# include "oslib/Types.Hdr" +# endif + +@OSLib---efficient, type-safe, transparent, extensible, +@ register-safe A P I coverage of RISC O S +@Copyright � 1994 Jonathan Coxhead + +@ OSLib is free software; you can redistribute it and/or modify +@it under the terms of the GNU General Public License as published by +@the Free Software Foundation; either version 1, or (at your option) +@any later version. +@ +@ OSLib 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. See the +@GNU General Public License for more details. +@ +@ You should have received a copy of the GNU General Public License +@along with this programme; if not, write to the Free Software +@Foundation, Inc, 675 Mass Ave, Cambridge, MA 02139, U S A. + + .macro Inc c, r1 + ADD\c \r1, \r1, #1 + .endm + + .macro IncS c, r1 + ADD\cS \r1, \r1, #1 + .endm + + .macro Dec c, r1 + SUB\c \r1, \r1, #1 + .endm + + .macro DecS c, r1 + SUB\cS \r1, \r1, #1 + .endm + + @ r1 = MAX (r2, r3) + .macro Max r1, r2, r3 + CMP \r2, \r3 + MOVGT \r1, \r2 + MOVLE \r1, \r3 + .endm + + @ r1 = MIN (r2, r3) + .macro Min r1, r2, r3 + CMP \r2, \r3 + MOVLT \r1, \r2 + MOVGE \r1, \r3 + .endm + + @ r1 = MAX (r1, r2) + .macro MaxAB r1, r2 + CMP \r1, \r2 + MOVLT \r1, \r2 + .endm + + @ r1 = MIN (r1, r2) + .macro MinAB r1, r2 + CMP \r1, \r2 + MOVGT \r1, \r2 + .endm + + @ r1 = ABS (r2) + .macro Abs r1, r2 + CMP \r2, #0 + MOVGE \r1, \r2 + RSBLT \r1, \r2, #0 + .endm + + @ r1 = SGN (r2) + .macro Sgn r1, r2 + CMP \r2, #0 + MOVGT \r1, #1 + MOVEQ \r1, #0 + MVNLT \r1, #0 + .endm + + @ r1 = DIM (r2, r3) + .macro Dim r1, r2, r3 + CMP \r2, \r3 + SUBGT \r1, \r2, \r3 + MOVLE \r1, #0 + .endm + + @ r1 = SQR (r2) + .macro Sqr c, r1, r2 + MUL\c \r1, \r2, \r2 + .endm + + @ r1 = BOOL (r2) + .macro Bool r1, r2 + TEQ \r2, #0 + MOVNE \r2, #True + MOVEQ \r2, #False + .endm + + @ r1 = INT (r2) + .macro Int r1, r2 + SUB \r1, \r2, #"0" + CMP \r1, #9 + SUBHI \r1, \r2, #"a" + CMPHI \r1, #5 + SUBHI \r1, \r2, #"A" + CMPHI \r1, #5 + ADDHI \r1, \r1, #10 + .endm + + @ r1 = UCHAR (r2) + .macro UChar r1, r2 + CMP \r2, #10 + ADDLT \r1, \r2, #"0" + ADDGE \r1, \r2, #"A"-10 + .endm + + @ r1 = LCHAR (r2) + .macro LChar r1, r2 + CMP \r2, #10 + ADDLT \r1, \r2, #"0" + ADDGE \r1, \r2, #"a"-10 + .endm + + @ r1 = BINEXP (r2) + .macro BinExp c, r1, r2 + MOV\c \r1, #1 + MOV\c \r1, \r1, LSL \r2 + .endm + + @ r1 = ALIGN (r2) + .macro Align c, r1, r2 + ADD\c \r1, \r2, #3 + BIC\c \r1, \r1, #3 + .endm + + @ C=1 V=0 Z=0 N=0 + .macro SetC + CMP PC, #0 + .endm + + @ C=0 V=0 Z=0 N=0 + .macro ClearFlags + CMN PC, #0 + .endm + + .macro ClrV + ClearFlags + .endm + + .macro ClrC + ClearFlags + .endm + + .macro ClrN + ClearFlags + .endm + + @ C=0 V=1 Z=0 N=1 + .macro SetV + CMP PC, #&80000000 + .endm + + @ C=0 V=0 Z=0 N=1 + .macro SetN + CMN PC, #&80000000 + .endm + + @ C=* V=* Z=1 N=0 + .macro SetZ + TST PC, #0 + .endm + + @ C=* V=* Z=0 N=0 + .macro ClrZ + TEQ PC, #0 + .endm + + .macro NOP + & 0 + .endm + + @ rc := ra DIV rb; ra := ra REM rb; rb preserved, rtemp corrupt + .macro DivRem rc, ra, rb, rtemp + MOV \rtemp, \rb + CMP \rtemp, \ra, LSR #1 +1: MOVLS \rtemp, \rtemp, LSL #1 + CMPLS \rtemp, \ra, LSR #1 + BLS 1b + MOV \rc, #0 +2: CMP \ra, \rtemp + SUBCS \ra, \ra, \rtemp + ADC \rc, \rc, \rc + MOV \rtemp, \rtemp, LSR #1 + CMP \rtemp, \rb + BCS 2b + .endm + +#endif Deleted: branches/simplified-build/!OsLib/Source/Macros/oslib/Macros.Hdr =================================================================== --- branches/simplified-build/!OsLib/Source/Macros/oslib/Macros.Hdr 2007-04-28 13:28:42 UTC (rev 254) +++ branches/simplified-build/!OsLib/Source/Macros/oslib/Macros.Hdr 2007-04-29 21:55:38 UTC (rev 255) @@ -1,227 +0,0 @@ - [ :LNOT: :DEF: Macros_Hdr - GBLL Macros_Hdr - -;OSLib---efficient, type-safe, transparent, extensible, -; register-safe A P I coverage of RISC O S -;Copyright \xA9 1994 Jonathan Coxhead - -; OSLib is free software; you can redistribute it and/or modify -;it under the terms of the GNU General Public License as published by -;the Free Software Foundation; either version 1, or (at your option) -;any later version. -; -; OSLib 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. See the -;GNU General Public License for more details. -; -; You should have received a copy of the GNU General Public License -;along with this programme; if not, write to the Free Software -;Foundation, Inc, 675 Mass Ave, Cambridge, MA 02139, U S A. - - MACRO -$label Inc $c, $r1 -$label ADD$c $r1, $r1, #1 - MEND - - MACRO -$label IncS $c, $r1 -$label ADD$c.S $r1, $r1, #1 - MEND - - MACRO -$label Dec $c, $r1 -$label SUB$c $r1, $r1, #1 - MEND - - MACRO -$label DecS $c, $r1 -$label SUB$c.S $r1, $r1, #1 - MEND - - MACRO -$label Max $r1, $r2, $r3 - ;r1 = MAX (r2, r3) -$label CMP $r2, $r3 - MOVGT $r1, $r2 - MOVLE $r1, $r3 - MEND - - MACRO -$label Min $r1, $r2, $r3 - ;r1 = MIN (r2, r3) -$label CMP $r2, $r3 - MOVLT $r1, $r2 - MOVGE $r1, $r3 - MEND - - MACRO -$label MaxAB $r1, $r2 - ;r1 = MAX (r1, r2) -$label CMP $r1, $r2 - MOVLT $r1, $r2 - MEND - - MACRO -$label MinAB $r1, $r2 - ;r1 = MIN (r1, r2) -$label CMP $r1, $r2 - MOVGT $r1, $r2 - MEND - - MACRO -$label Abs $r1, $r2 - ;r1 = ABS (r2) -$label CMP $r2, #0 - MOVGE $r1, $r2 - RSBLT $r1, $r2, #0 - MEND - - MACRO -$label Sgn $r1, $r2 - ;r1 = SGN (r2) -$label CMP $r2, #0 - MOVGT $r1, #1 - MOVEQ $r1, #0 - MVNLT $r1, #0 - MEND - - MACRO -$label Dim $r1, $r2, $r3 - ;r1 = DIM (r2, r3) -$label CMP $r2, $r3 - SUBGT $r1, $r2, $r3 - MOVLE $r1, #0 - MEND - - MACRO -$label Sqr $c, $r1, $r2 - ;r1 = SQR (r2) -$label MUL$c $r1, $r2, $r2 - MEND - - MACRO -$label Bool $r1, $r2 - ;r1 = BOOL (r2) -$label TEQ $r2, #0 - MOVNE $r2, #True - MOVEQ $r2, #False - MEND - - MACRO -$label Int $r1, $r2 - ;r1 = INT (r2) -$label SUB $r1, $r2, #"0" - CMP $r1, #9 - SUBHI $r1, $r2, #"a" - CMPHI $r1, #5 - SUBHI $r1, $r2, #"A" - CMPHI $r1, #5 - ADDHI $r1, $r1, #10 - MEND - - MACRO -$label UChar $r1, $r2 - ;r1 = UCHAR (r2) -$label CMP $r2, #10 - ADDLT $r1, $r2, #"0" - ADDGE $r1, $r2, #"A"-10 - MEND - - MACRO -$label LChar $r1, $r2 - ;r1 = LCHAR (r2) -$label CMP $r2, #10 - ADDLT $r1, $r2, #"0" - ADDGE $r1, $r2, #"a"-10 - MEND - - MACRO -$label BinExp $c, $r1, $r2 - ;r1 = BINEXP (r2) -$label MOV$c $r1, #1 - MOV$c $r1, $r1, LSL $r2 - MEND - - MACRO -$label Align $c, $r1, $r2 - ;r1 = ALIGN (r2) -$label ADD$c $r1, $r2, #3 - BIC$c $r1, $r1, #3 - MEND - - MACRO -$label SetC - ;C=1 V=0 Z=0 N=0 -$label CMP PC, #0 - MEND - - MACRO -$label ClearFlags - ;C=0 V=0 Z=0 N=0 -$label CMN PC, #0 - MEND - - MACRO -$label ClrV -$label ClearFlags - MEND - - MACRO -$label ClrC -$label ClearFlags - MEND - - MACRO -$label ClrN -$label ClearFlags - MEND - - MACRO -$label SetV - ;C=0 V=1 Z=0 N=1 -$label CMP PC, #&80000000 - MEND - - MACRO -$label SetN - ;C=0 V=0 Z=0 N=1 -$label CMN PC, #&80000000 - MEND - - MACRO -$label SetZ - ;C=* V=* Z=1 N=0 -$label TST PC, #0 - MEND - - MACRO -$label ClrZ - ;C=* V=* Z=0 N=0 -$label TEQ PC, #0 - MEND - - MACRO -$label NOP -$label & 0 - MEND - - MACRO -$label DivRem $rc, $ra, $rb, $rtemp - ;rc := ra DIV rb; ra := ra REM rb; rb preserved, rtemp corrupt -$label MOV $rtemp, $rb - CMP $rtemp, $ra, LSR #1 -01 MOVLS $rtemp, $rtemp, LSL #1 - CMPLS $rtemp, $ra, LSR #1 - BLS %BT01 - MOV $rc, #0 -02 CMP $ra, $rtemp - SUBCS $ra, $ra, $rtemp - ADC $rc, $rc, $rc - MOV $rtemp, $rtemp, LSR #1 - CMP $rtemp, $rb - BCS %BT02 - MEND - - ] - END Modified: branches/simplified-build/!OsLib/Source/Macros/oslib/Modules =================================================================== --- branches/simplified-build/!OsLib/Source/Macros/oslib/Modules 2007-04-28 13:28:42 UTC (rev 254) +++ branches/simplified-build/!OsLib/Source/Macros/oslib/Modules 2007-04-29 21:55:38 UTC (rev 255) @@ -2,7 +2,6 @@ # List of modules comprising Macros # for inclusion in Make files independant of platform -# modules with no SWIs -MODULES += \ -Macros \ - +# Modules defined by handwritten .h, .AOFHdr and .ELFHdr files. +HDRMODULES = \ +Macros Modified: branches/simplified-build/!OsLib/Source/Makefile =================================================================== --- branches/simplified-build/!OsLib/Source/Makefile 2007-04-28 13:28:42 UTC (rev 254) +++ branches/simplified-build/!OsLib/Source/Makefile 2007-04-29 21:55:38 UTC (rev 255) @@ -3,6 +3,11 @@ # Build type: CROSSGCC_AOF (default), CROSSGCC_ELF [NORCROFT_AOF: not supported yet] BUILDTYPE ?= CROSSGCC_AOF +ifeq ($(BUILDTYPE),CROSSGCC_ELF) +else ifeq ($(BUILDTYPE),CROSSGCC_AOF) +else +$(error Unknown BUILDTYPE value) +endif include Makefile.setup.$(BUILDTYPE) .PHONY: all install release-oslib release-cstrong clean oslib cstrong BuildRequirements @@ -31,31 +36,31 @@ cd $(BUILDDIR) && $(GCCSDK_INSTALL_CROSSBIN)/zip -, -9r $(RELEASEDIR)/$(BUILDTYPE)/OSLibStrongHelp $(OSLIBCSTRONG) clean: + $(MAKE) -C Types/oslib $@ $(MAKE) -C Computer/oslib $@ $(MAKE) -C Core/oslib $@ $(MAKE) -C Macros/oslib $@ $(MAKE) -C Toolbox/oslib $@ - $(MAKE) -C Types/oslib $@ $(MAKE) -C User/oslib $@ -$(RM) $(BUILDDIR) oslib: $(OSLIBLIB) $(OSLIBLIB): BuildRequirements + $(MAKE) -C Types/oslib oslib $(MAKE) -C Computer/oslib oslib $(MAKE) -C Core/oslib oslib $(MAKE) -C Macros/oslib oslib $(MAKE) -C Toolbox/oslib oslib - $(MAKE) -C Types/oslib oslib $(MAKE) -C User/oslib oslib cd $(OBJDIR) && $(LIBFILE) $@ */*.o cstrong: $(OSLIBCSTRONG) $(OSLIBCSTRONG): BuildRequirements + $(MAKE) -C Types/oslib cstrong $(MAKE) -C Computer/oslib cstrong $(MAKE) -C Core/oslib cstrong $(MAKE) -C Macros/oslib cstrong $(MAKE) -C Toolbox/oslib cstrong - $(MAKE) -C Types/oslib cstrong $(MAKE) -C User/oslib cstrong cd $(BUILDDIR) && $(BINDHELP) $(CSTRONGDIR) $@ Modified: branches/simplified-build/!OsLib/Source/Makefile.inc =================================================================== --- branches/simplified-build/!OsLib/Source/Makefile.inc 2007-04-28 13:28:42 UTC (rev 254) +++ branches/simplified-build/!OsLib/Source/Makefile.inc 2007-04-29 21:55:38 UTC (rev 255) @@ -1,19 +1,25 @@ # ... -ASMHEADERS = $(patsubst %,%.Hdr,$(SWIMODULES) $(MODULES)) -CHEADERS = $(patsubst %,%.h,$(SWIMODULES) $(MODULES)) +# SWIMODULES and MODULES all have their .swi file. The former have one or +# more SWI's defined, the latter no SWI's at all. +# HDRMODULES only have handwritten .h, .AOFHdr and .ELFHdr files. +# ASMMODULES only have handwritten .asm (AOF) and .gas (ELF) assembler files. + +ASMHEADERS = $(patsubst %,%.Hdr,$(SWIMODULES) $(MODULES) $(HDRMODULES)) +CHEADERS = $(patsubst %,%.h,$(SWIMODULES) $(MODULES) $(HDRMODULES)) CSTRONG = $(patsubst %,%.help,$(SWIMODULES) $(MODULES)) SWIOBJS = $(patsubst %,%.o,$(SWIMODULES)) -ASMOBJS = $(patsubst %,%.o,$(CMODULES)) +ASMOBJS = $(patsubst %,%.o,$(ASMMODULES)) -# To be generated from .swi files (only used for removing those files) -GENASMHEADERS = $(patsubst %,%.Hdr,$(SWIMODULES)) -GENCHEADERS = $(patsubst %,%.h,$(SWIMODULES)) -GENCSTRONG = $(patsubst %,%.help,$(SWIMODULES)) +# Generated files from .swi files (only used for removing those files in clean +# rule) +GENASMHEADERS = $(patsubst %,%.Hdr,$(SWIMODULES) $(MODULES) $(HDRMODULES)) +GENCHEADERS = $(patsubst %,%.h,$(SWIMODULES) $(MODULES)) +GENCSTRONG = $(patsubst %,%.help,$(SWIMODULES) $(MODULES)) .PHONY: oslib cstrong clean -# Building one subdirectory in Source can not happen in parallel because ViaFile -# creation. +# Building inside one subdirectory of Source can not happen in parallel +# because of ViaFile creation in defmod. .NOTPARALLEL: # Targets: @@ -29,18 +35,28 @@ -$(RM) l/* -$(RM) $(GENASMHEADERS) $(GENCHEADERS) $(GENCSTRONG) $(SWIOBJS) $(ASMOBJS) -# convert arg to lower case +# Convert arg to lower case tolower = $(shell echo $(1) | tr '[A-Z]' '[a-z]';) #------------------------------------------------------------------------ # general rules: .SUFFIXES: -.SUFFIXES: .o .h .swi .Hdr .help .asm +.SUFFIXES: .o .h .swi .Hdr .AOFHdr .ELFHdr .help .asm .gas +# Source files: .h .swi .AOFHdr .ELFHdr .asm .gas +# Derived files: .o .h .help + # Assmebler header generation: .swi.Hdr: $(DEFMOD) -hdr < $< > $@ +ifeq ($(BUILDTYPE),CROSSGCC_ELF) +.ELFHdr.Hdr: + if [ -s "$<" ]; then $(CP) $< $@; fi +else +.AOFHdr.Hdr: + if [ -s "$<" ]; then $(CP) $< $@; fi +endif # C header generation: .swi.h: @@ -58,6 +74,11 @@ $(DEFMOD) -cstrong -o $(CSTRONGDIR) < $< @touch $@ -# Object code generation (from .asm file): +# Object code generation (from .asm or .gas file): +ifeq ($(BUILDTYPE),CROSSGCC_ELF) +.gas.o: + $(AS) -o $@ $< +else .asm.o: - $(AS) -mapcs-32 -Wa,-apcs32 -o $@ $< + $(AS) -o $@ $< +endif Modified: branches/simplified-build/!OsLib/Source/Makefile.setup.CROSSGCC_AOF =================================================================== --- branches/simplified-build/!OsLib/Source/Makefile.setup.CROSSGCC_AOF 2007-04-28 13:28:42 UTC (rev 254) +++ branches/simplified-build/!OsLib/Source/Makefile.setup.CROSSGCC_AOF 2007-04-29 21:55:38 UTC (rev 255) @@ -25,12 +25,14 @@ export PATH := $(GCCSDK_INSTALL_CROSSBIN):$(PATH) export CC := gcc -export AS := gcc -c -xassembler -I.. -I$(SOURCEDIR)/Types +export AS := gcc -c -xassembler -I.. -I$(SOURCEDIR)/Types -mapcs-32 -Wa,-apcs32 export LIBFILE := libfile -c export MKDIR := mkdir -p export RM := rm -rf export CP := cp -r export INSTALL := $(GCCSDK_INSTALL_ENV)/ro-install +ASMEXT = .asm + OSLIBLIB = $(BUILDDIR)/OSLib32.o OSLIBCSTRONG = $(BUILDDIR)/OSLib,3d6 Modified: branches/simplified-build/!OsLib/Source/Makefile.setup.CROSSGCC_ELF =================================================================== --- branches/simplified-build/!OsLib/Source/Makefile.setup.CROSSGCC_ELF 2007-04-28 13:28:42 UTC (rev 254) +++ branches/simplified-build/!OsLib/Source/Makefile.setup.CROSSGCC_ELF 2007-04-29 21:55:38 UTC (rev 255) @@ -19,18 +19,20 @@ export BYTEWIDE := $(SOURCEDIR)/ByteWide export DEFMOD := $(BINDIR)/defmod -asmtype gccelf -export REDUCEAOF := $(BINDIR)/reduceaof +export REDUCEAOF := @echo Not needed for ELF build: reduceaof export BINDHELP := $(BINDIR)/bindhelp export PATH := $(GCCSDK_INSTALL_CROSSBIN):$(PATH) export CC := arm-unknown-riscos-gcc -export AS := arm-unknown-riscos-gcc -c -xassembler -I.. -I$(SOURCEDIR)/Types -export LIBFILE := arm-unknown-riscos-ar -r +export AS := arm-unknown-riscos-gcc -c -xassembler -I.. -I$(SOURCEDIR)/Types -mapcs32 +export LIBFILE := arm-unknown-riscos-ar rs export MKDIR := mkdir -p export RM := rm -rf export CP := cp -r export INSTALL := $(GCCSDK_INSTALL_ENV)/ro-install +ASMEXT = .gas + OSLIBLIB = $(BUILDDIR)/OSLib32.o OSLIBCSTRONG = $(BUILDDIR)/OSLib,3d6 Modified: branches/simplified-build/!OsLib/Source/Toolbox/oslib/Modules =================================================================== --- branches/simplified-build/!OsLib/Source/Toolbox/oslib/Modules 2007-04-28 13:28:42 UTC (rev 254) +++ branches/simplified-build/!OsLib/Source/Toolbox/oslib/Modules 2007-04-29 21:55:38 UTC (rev 255) @@ -1,8 +1,8 @@ # OSLib/Source/Toolbox/oslib/Modules # Modules definition for Toolbox Make -# modules containing SWIs -SWIMODULES += \ +# Modules containing SWIs +SWIMODULES = \ ActionButton \ Button \ ColourDbox \ @@ -38,17 +38,16 @@ Toolbox \ Window \ WindowSupportExternal \ -WritableField +WritableField -# modules with no SWIs -MODULES += \ +# Modules with no SWIs +MODULES = \ Adjuster \ FileDbox \ KeyboardShortcut \ Label \ LabelledBox \ -ResEd +ResEd -# modules defined other than by SWI definition -CMODULES += - +# Modules defined other than by SWI definition +ASMMODULES = Copied: branches/simplified-build/!OsLib/Source/Types/oslib/ColTrans32.AOFHdr (from rev 246, branches/simplified-build/!OsLib/Source/Types/oslib/ColTrans32.Hdr) =================================================================== Copied: branches/simplified-build/!OsLib/Source/Types/oslib/ColTrans32.ELFHdr (from rev 246, branches/simplified-build/!OsLib/Source/Types/oslib/ColTrans32.Hdr) =================================================================== Deleted: branches/simplified-build/!OsLib/Source/Types/oslib/ColTrans32.Hdr =================================================================== Deleted: branches/simplified-build/!OsLib/Source/Types/oslib/ColTrans32.help =================================================================== Copied: branches/simplified-build/!OsLib/Source/Types/oslib/DOSFS32.AOFHdr (from rev 246, branches/simplified-build/!OsLib/Source/Types/oslib/DOSFS32.Hdr) =================================================================== Copied: branches/simplified-build/!OsLib/Source/Types/oslib/DOSFS32.ELFHdr (from rev 246, branches/simplified-build/!OsLib/Source/Types/oslib/DOSFS32.Hdr) =================================================================== Deleted: branches/simplified-build/!OsLib/Source/Types/oslib/DOSFS32.Hdr =================================================================== Deleted: branches/simplified-build/!OsLib/Source/Types/oslib/DOSFS32.help =================================================================== Copied: branches/simplified-build/!OsLib/Source/Types/oslib/DeviceFS32.AOFHdr (from rev 246, branches/simplified-build/!OsLib/Source/Types/oslib/DeviceFS32.Hdr) =================================================================== Copied: branches/simplified-build/!OsLib/Source/Types/oslib/DeviceFS32.ELFHdr (from rev 246, branches/simplified-build/!OsLib/Source/Types/oslib/DeviceFS32.Hdr) =================================================================== Deleted: branches/simplified-build/!OsLib/Source/Types/oslib/DeviceFS32.Hdr =================================================================== Deleted: branches/simplified-build/!OsLib/Source/Types/oslib/DeviceFS32.help =================================================================== Copied: branches/simplified-build/!OsLib/Source/Types/oslib/FileCore32.AOFHdr (from rev 246, branches/simplified-build/!OsLib/Source/Types/oslib/FileCore32.Hdr) =================================================================== Copied: branches/simplified-build/!OsLib/Source/Types/oslib/FileCore32.ELFHdr (from rev 246, branches/simplified-build/!OsLib/Source/Types/oslib/FileCore32.Hdr) =================================================================== Deleted: branches/simplified-build/!OsLib/Source/Types/oslib/FileCore32.Hdr =================================================================== Deleted: branches/simplified-build/!OsLib/Source/Types/oslib/FileCore32.help =================================================================== Copied: branches/simplified-build/!OsLib/Source/Types/oslib/FileSwch32.AOFHdr (from rev 246, branches/simplified-build/!OsLib/Source/Types/oslib/FileSwch32.Hdr) =================================================================== Copied: branches/simplified-build/!OsLib/Source/Types/oslib/FileSwch32.ELFHdr (from rev 246, branches/simplified-build/!OsLib/Source/Types/oslib/FileSwch32.Hdr) =================================================================== Deleted: branches/simplified-build/!OsLib/Source/Types/oslib/FileSwch32.Hdr =================================================================== Deleted: branches/simplified-build/!OsLib/Source/Types/oslib/FileSwch32.help =================================================================== Modified: branches/simplified-build/!OsLib/Source/Types/oslib/Modules =================================================================== --- branches/simplified-build/!OsLib/Source/Types/oslib/Modules 2007-04-28 13:28:42 UTC (rev 254) +++ branches/simplified-build/!OsLib/Source/Types/oslib/Modules 2007-04-29 21:55:38 UTC (rev 255) @@ -2,8 +2,8 @@ # List of modules comprising Macros # for inclusion in Make files independant of platform -# modules with no SWIs -MODULES += \ +# Modules defined by handwritten .h, .AOFHdr and .ELFHdr files. +HDRMODULES = \ ColTrans32 \ DeviceFS32 \ DOSFS32 \ @@ -18,4 +18,3 @@ PDriver32 \ Types \ Wimp32 - Copied: branches/simplified-build/!OsLib/Source/Types/oslib/OSArgs32.AOFHdr (from rev 246, branches/simplified-build/!OsLib/Source/Types/oslib/OSArgs32.Hdr) =================================================================== Copied: branches/simplified-build/!OsLib/Source/Types/oslib/OSArgs32.ELFHdr (from rev 246, branches/simplified-build/!OsLib/Source/Types/oslib/OSArgs32.Hdr) =================================================================== Deleted: branches/simplified-build/!OsLib/Source/Types/oslib/OSArgs32.Hdr =================================================================== Deleted: branches/simplified-build/!OsLib/Source/Types/oslib/OSArgs32.help =================================================================== Copied: branches/simplified-build/!OsLib/Source/Types/oslib/OSCore32.AOFHdr (from rev 246, branches/simplified-build/!OsLib/Source/Types/oslib/OSCore32.Hdr) =================================================================== --- branches/simplified-build/!OsLib/Source/Types/oslib/OSCore32.AOFHdr (rev 0) +++ branches/simplified-build/!OsLib/Source/Types/oslib/OSCore32.AOFHdr 2007-04-29 21:55:38 UTC (rev 255) @@ -0,0 +1,20 @@ +;/* OSCore32.Hdr +;** Used by OSCore.HDR to create the short synonyms for 32-bit file handles +;** +;** Tony van der Hoff 10-11-01 +;*/ + + [ :LNOT: :DEF: OSCore32_Hdr + GBLL OSCore32_Hdr + + [ :LNOT: :DEF: OSF32_Hdr + GET OSLIB:oslib.Hdr.OSF32 + ] + + [ :LNOT: :DEF: OSLIB_F8 + ] + + ] + + + END Copied: branches/simplified-build/!OsLib/Source/Types/oslib/OSCore32.ELFHdr (from rev 246, branches/simplified-build/!OsLib/Source/Types/oslib/OSCore32.Hdr) =================================================================== --- branches/simplified-build/!OsLib/Source/Types/oslib/OSCore32.ELFHdr (rev 0) +++ branches/simplified-build/!OsLib/Source/Types/oslib/OSCore32.ELFHdr 2007-04-29 21:55:38 UTC (rev 255) @@ -0,0 +1,6 @@ +@ OSCore32.Hdr +@ Used by OSCore.Hdr to create the short synonyms for 32-bit file handles +@ +@ Tony van der Hoff 10-11-01 + +#include "oslib/OSF32.Hdr" Deleted: branches/simplified-build/!OsLib/Source/Types/oslib/OSCore32.Hdr =================================================================== --- branches/simplified-build/!OsLib/Source/Types/oslib/OSCore32.Hdr 2007-04-28 13:28:42 UTC (rev 254) +++ branches/simplified-build/!OsLib/Source/Types/oslib/OSCore32.Hdr 2007-04-29 21:55:38 UTC (rev 255) @@ -1,20 +0,0 @@ -;/* OSCore32.Hdr -;** Used by OSCore.HDR to create the short synonyms for 32-bit file handles -;** -;** Tony van der Hoff 10-11-01 -;*/ - - [ :LNOT: :DEF: OSCore32_Hdr - GBLL OSCore32_Hdr - - [ :LNOT: :DEF: OSF32_Hdr - GET OSLIB:oslib.Hdr.OSF32 - ] - - [ :LNOT: :DEF: OSLIB_F8 - ] - - ] - - - END Deleted: branches/simplified-build/!OsLib/Source/Types/oslib/OSCore32.help =================================================================== Copied: branches/simplified-build/!OsLib/Source/Types/oslib/OSF32.AOFHdr (from rev 246, branches/simplified-build/!OsLib/Source/Types/oslib/OSF32.Hdr) =================================================================== --- branches/simplified-build/!OsLib/Source/Types/oslib/OSF32.AOFHdr (rev 0) +++ branches/simplified-build/!OsLib/Source/Types/oslib/OSF32.AOFHdr 2007-04-29 21:55:38 UTC (rev 255) @@ -0,0 +1,18 @@ +; OSF32.h +; creates a short-form synonym for OS_FW +; +; Tony van der Hoff 10-11-01 +; + + [ :LNOT: :DEF: OSF32_Hdr + GBLL OSF32_Hdr + + [ :LNOT: :DEF: OSLIB_F8 + GBLS $OS_F +;$OS_F SETS OS_FW ; TV 20021128 +OS_F SETS OS_FW + ] + + ] + + END Copied: branches/simplified-build/!OsLib/Source/Types/oslib/OSF32.ELFHdr (from rev 246, branches/simplified-build/!OsLib/Source/Types/oslib/OSF32.Hdr) =================================================================== --- branches/simplified-build/!OsLib/Source/Types/oslib/OSF32.ELFHdr (rev 0) +++ branches/simplified-build/!OsLib/Source/Types/oslib/OSF32.ELFHdr 2007-04-29 21:55:38 UTC (rev 255) @@ -0,0 +1,11 @@ +@ OSF32.h +@ creates a short-form synonym for OS_FW +@ +@ Tony van der Hoff 10-11-01 + +#ifndef OSF32_Hdr +# define OSF32_Hdr + +# define OS_F OS_FW + +#endif Deleted: branches/simplified-build/!OsLib/Source/Types/oslib/OSF32.Hdr =================================================================== --- branches/simplified-build/!OsLib/Source/Types/oslib/OSF32.Hdr 2007-04-28 13:28:42 UTC (rev 254) +++ branches/simplified-build/!OsLib/Source/Types/oslib/OSF32.Hdr 2007-04-29 21:55:38 UTC (rev 255) @@ -1,18 +0,0 @@ -; OSF32.h -; creates a short-form synonym for OS_FW -; -; Tony van der Hoff 10-11-01 -; - - [ :LNOT: :DEF: OSF32_Hdr - GBLL OSF32_Hdr - - [ :LNOT: :DEF: OSLIB_F8 - GBLS $OS_F -;$OS_F SETS OS_FW ; TV 20021128 -OS_F SETS OS_FW - ] - - ] - - END Deleted: branches/simplified-build/!OsLib/Source/Types/oslib/OSF32.help =================================================================== Copied: branches/simplified-build/!OsLib/Source/Types/oslib/OSFSCtrl32.AOFHdr (from rev 246, branches/simplified-build/!OsLib/Source/Types/oslib/OSFSCtrl32.Hdr) =================================================================== Copied: branches/simplified-build/!OsLib/Source/Types/oslib/OSFSCtrl32.ELFHdr (from rev 246, branches/simplified-build/!OsLib/Source/Types/oslib/OSFSCtrl32.Hdr) =================================================================== Deleted: branches/simplified-build/!OsLib/Source/Types/oslib/OSFSCtrl32.Hdr ============... [truncated message content] |