|
From: <jt...@us...> - 2007-06-19 00:03:14
|
Revision: 271
http://ro-oslib.svn.sourceforge.net/ro-oslib/?rev=271&view=rev
Author: jtytgat
Date: 2007-06-18 17:03:11 -0700 (Mon, 18 Jun 2007)
Log Message:
-----------
Improved testing AOF/ELF case
Modified Paths:
--------------
branches/simplified-build/!OsLib/Source/Test/Test/Makefile
branches/simplified-build/!OsLib/Source/Test/Test/test.asm
branches/simplified-build/!OsLib/Source/Test/Test1/Makefile
branches/simplified-build/!OsLib/Source/Test/Test1/test.asm
branches/simplified-build/!OsLib/Source/Test/Test1/test.c
Added Paths:
-----------
branches/simplified-build/!OsLib/Source/Test/Test/small_test.asm
branches/simplified-build/!OsLib/Source/Test/Test/small_test.gas
Removed Paths:
-------------
branches/simplified-build/!OsLib/Source/Test/Test/mkhdr.c
branches/simplified-build/!OsLib/Source/Test/Test/small_test.s
Modified: branches/simplified-build/!OsLib/Source/Test/Test/Makefile
===================================================================
--- branches/simplified-build/!OsLib/Source/Test/Test/Makefile 2007-05-31 16:14:13 UTC (rev 270)
+++ branches/simplified-build/!OsLib/Source/Test/Test/Makefile 2007-06-19 00:03:11 UTC (rev 271)
@@ -19,7 +19,7 @@
test_s: test$(ASMEXT) all_oslib.Hdr
$(AS) -o $@ -I$(TOPHEADERDIR) $<
-small_test.o: small_test.s all_oslib.Hdr
+small_test.o: small_test$(ASMEXT) all_oslib.Hdr
$(AS) -o $@ -I$(TOPHEADERDIR) $<
all_oslib.h: $(ALL_CHEADERS)
Deleted: branches/simplified-build/!OsLib/Source/Test/Test/mkhdr.c
===================================================================
--- branches/simplified-build/!OsLib/Source/Test/Test/mkhdr.c 2007-05-31 16:14:13 UTC (rev 270)
+++ branches/simplified-build/!OsLib/Source/Test/Test/mkhdr.c 2007-06-19 00:03:11 UTC (rev 271)
@@ -1,158 +0,0 @@
-/* mkhdr.c
-** Make a header file out of a list of modules
-** syntax: mkhdr [-c -s] <hdrfile> {<module> ...}
-*/
-
-#include <ctype.h>
-#include <stdio.h>
-#include <string.h>
-#include <time.h>
-
-//#define DEBUG
-
-typedef enum
- {
- mode_NONE,
- mode_C,
- mode_ASM,
- } mode_t;
-
-#define TMP_SIZ 64
-
-static int ToLower( char *dest, const char *src, int max )
-{
- int chars = 0;
-
- while ( (*src != '\0') && (chars < max) )
- {
- *dest++ = (char)tolower( *src++ );
- chars++;
- }
-
- *dest = '\0';
- return chars;
-}
-
-int main (int argc, const char **argv)
-{
- int status = 0;
- mode_t mode = mode_NONE;
- FILE *hdr = 0;
-
- fprintf( stderr, "mkhdr " __DATE__ " \xA9Tony van der Hoff\n\n" );
-
- if ( argc < 4 )
- {
- fprintf( stderr,
- "Usage:\tmkhdr [options] hdrfile module1 module2 ... moduleN\n\n"
- "Options:\t-c:\tgenerate c-style header file\n"
- "\t\t-s:\tgenerate objasm-style header file\n"
- );
- status = -1;
- }
-
- if ( status == 0 )
- {
-#ifdef DEBUG
- fprintf( stderr,
- "Option: %s\n"
- "Output: %s\n"
- , argv[1]
- , argv[2]
- );
- for ( int i = 3; i < argc; ++i )
- {
- fprintf( stderr, "%s ", argv[i] );
- }
- fputs( "\n",stderr );
-#endif
- if ( strcmp( argv[1], "-s" ) == 0 )
- mode = mode_ASM;
- else if ( strcmp( argv[1], "-c" ) == 0 )
- mode = mode_C;
-
- if ( mode == mode_NONE )
- {
- fprintf( stderr,
- "Error: invalid or no translation mode defined\n"
- );
- status = -1;
- }
- }
-
- if (status == 0)
- {
- hdr = fopen( argv[2], "w" );
- if ( hdr == 0 )
- {
- fprintf( stderr,
- "Error: File %s failed to open\n",
- argv[2]
- );
- status = -1;
- }
- else
- {
- }
- }
-
- if (status == 0)
- {
- time_t tim = time( 0 );
-
- switch ( mode )
- {
- case mode_C:
- fprintf( hdr,
- "/* %s - Generated by mkhdr [" __DATE__ "] on %s */\n",
- argv[2], ctime( &tim )
- );
- break;
-
- case mode_ASM:
- fprintf( hdr,
- ";%s - Generated by mkhdr [" __DATE__ "] on %s\n",
- argv[2], ctime( &tim )
- );
- break;
- }
-
- for ( int i = 3; i < argc; ++i )
- {
- char temp[ TMP_SIZ ];
-
- switch ( mode )
- {
- case mode_C:
- ToLower( temp, argv[i], TMP_SIZ );
- fprintf( hdr,
- "#include \"oslib/%s.h\"\n",
- temp
- );
- break;
-
- case mode_ASM:
- fprintf( hdr,
- //"\tGET\toslib.Hdr.%s\n",
- "\tGET\toslib/%s.Hdr\n",
- argv[i]
- );
- break;
- } /* end switch */
- } /* end for */
-
- switch ( mode )
- {
- case mode_ASM:
- fprintf( hdr,
- "\tEND\n"
- );
- break;
- }
- } /* status == 0 */
-
- if ( hdr )
- fclose( hdr );
-
- return status;
-}
Copied: branches/simplified-build/!OsLib/Source/Test/Test/small_test.asm (from rev 261, branches/simplified-build/!OsLib/Source/Test/Test/small_test.s)
===================================================================
--- branches/simplified-build/!OsLib/Source/Test/Test/small_test.asm (rev 0)
+++ branches/simplified-build/!OsLib/Source/Test/Test/small_test.asm 2007-06-19 00:03:11 UTC (rev 271)
@@ -0,0 +1,72 @@
+ GET oslib/OSGBPB.Hdr
+ GET oslib/Macros.Hdr
+
+ AREA code, CODE
+
+ ; void EnumCSD (void);
+ EXPORT |EnumCSD|
+|EnumCSD|
+ STMFD R13!, {R4-R11, R14}
+ MOV R4, #0
+|loop|
+ MOV R0, #OSGBPB_DirEntriesInfoStamped
+ LDR R1, =dirname
+ LDR R2, =buffer
+ MOV R3, #10
+ MOV R5, #endbuffer - buffer
+ LDR R6, =wildcard
+ SWI OS_GBPB
+ CMP R4, #-1
+ LDMEQFD R13!, {R4-R11, PC}
+
+ TEQ R3, #0
+|printloop|
+ BEQ loop
+
+ LDR R0, [R2, #OSGBPB_InfoStampedBase_size]
+ BL PrintHex
+
+ ADD R2, R2, #OSGBPB_InfoStampedBase
+ MOV R0, R2
+ SWI OS_Write0
+ SWI OS_NewLine
+ ; Skip object name:
+|skipname|
+ LDRB R14, [R2], #1
+ TEQ R14, #0
+ BNE skipname
+; Following OSLib macro doesn't seem to be appreciated by as.
+; Align , R2, R2
+ ADD R2, R2, #3
+ BIC R2, R2, #3
+
+ SUBS R3, R3, #1
+ B printloop
+
+|dirname|
+ = "@", 0
+|wildcard|
+ = "*", 0
+ ALIGN
+
+ ; R0 = hex address to be printed
+|PrintHex|
+ STMFD R13!, {R0-R7, R14}
+ ADR R1, PrintHexBuffer
+ MOV R2, #PrintHexBufferEnd - PrintHexBuffer
+ SWI OS_ConvertHex8
+ ADR R0, PrintHexBuffer
+ SWI OS_Write0
+ SWI OS_NewLine
+ LDMFD R13!, {R0-R7, PC}
+|PrintHexBuffer|
+ # 16
+|PrintHexBufferEnd|
+ ALIGN
+
+ AREA data, DATA, NOINIT
+|buffer|
+ # 256
+|endbuffer|
+
+ END
Copied: branches/simplified-build/!OsLib/Source/Test/Test/small_test.gas (from rev 261, branches/simplified-build/!OsLib/Source/Test/Test/small_test.s)
===================================================================
--- branches/simplified-build/!OsLib/Source/Test/Test/small_test.gas (rev 0)
+++ branches/simplified-build/!OsLib/Source/Test/Test/small_test.gas 2007-06-19 00:03:11 UTC (rev 271)
@@ -0,0 +1,69 @@
+#include "oslib/OSGBPB.Hdr"
+#include "oslib/Macros.Hdr"
+
+ .text
+
+ @ void EnumCSD (void);
+ .global EnumCSD
+EnumCSD:
+ STMFD R13!, {R4-R11, R14}
+ MOV R4, #0
+loop:
+ MOV R0, #OSGBPB_DirEntriesInfoStamped
+ LDR R1, =dirname
+ LDR R2, =buffer
+ MOV R3, #10
+ MOV R5, #endbuffer - buffer
+ LDR R6, =wildcard
+ SWI OS_GBPB
+ CMP R4, #-1
+ LDMEQFD R13!, {R4-R11, PC}
+
+ TEQ R3, #0
+printloop:
+ BEQ loop
+
+ LDR R0, [R2, #OSGBPB_InfoStampedBase_size]
+ BL PrintHex
+
+ ADD R2, R2, #OSGBPB_InfoStampedBase
+ MOV R0, R2
+ SWI OS_Write0
+ SWI OS_NewLine
+ @ Skip object name:
+skipname:
+ LDRB R14, [R2], #1
+ TEQ R14, #0
+ BNE skipname
+ Align , R2, R2
+
+ SUBS R3, R3, #1
+ B printloop
+
+dirname:
+ .asciz "@"
+wildcard:
+ .asciz "*"
+ .align
+
+ @ R0 = hex address to be printed
+PrintHex:
+ STMFD R13!, {R0-R7, R14}
+ ADR R1, PrintHexBuffer
+ MOV R2, #PrintHexBufferEnd - PrintHexBuffer
+ SWI OS_ConvertHex8
+ ADR R0, PrintHexBuffer
+ SWI OS_Write0
+ SWI OS_NewLine
+ LDMFD R13!, {R0-R7, PC}
+PrintHexBuffer:
+ .space 16
+PrintHexBufferEnd:
+ .align
+
+ .bss
+buffer:
+ .space 256
+endbuffer:
+
+ .end
Deleted: branches/simplified-build/!OsLib/Source/Test/Test/small_test.s
===================================================================
--- branches/simplified-build/!OsLib/Source/Test/Test/small_test.s 2007-05-31 16:14:13 UTC (rev 270)
+++ branches/simplified-build/!OsLib/Source/Test/Test/small_test.s 2007-06-19 00:03:11 UTC (rev 271)
@@ -1,69 +0,0 @@
-#include "oslib/OSGBPB.Hdr"
-#include "oslib/Macros.Hdr"
-
- .text
-
- @ void EnumCSD (void);
- .global EnumCSD
-EnumCSD:
- STMFD R13!, {R4-R11, R14}
- MOV R4, #0
-loop:
- MOV R0, #OSGBPB_DirEntriesInfoStamped
- LDR R1, =dirname
- LDR R2, =buffer
- MOV R3, #10
- MOV R5, #endbuffer - buffer
- LDR R6, =wildcard
- SWI OS_GBPB
- CMP R4, #-1
- LDMEQ R13!, {R4-R11, PC}
-
- TEQ R3, #0
-printloop:
- BEQ loop
-
- LDR R0, [R2, #OSGBPB_InfoStampedBase_size]
- BL PrintHex
-
- ADD R2, R2, #OSGBPB_InfoStampedBase
- MOV R0, R2
- SWI OS_Write0
- SWI OS_NewLine
- @ Skip object name:
-skipname:
- LDRB R14, [R2], #1
- TEQ R14, #0
- BNE skipname
- Align , R2, R2
-
- SUBS R3, R3, #1
- B printloop
-
-dirname:
- .asciz "@"
-wildcard:
- .asciz "*"
- .align
-
- @ R0 = hex address to be printed
-PrintHex:
- STMFD R13!, {R0-R7, R14}
- ADR R1, PrintHexBuffer
- MOV R2, #PrintHexBufferEnd - PrintHexBuffer
- SWI OS_ConvertHex8
- ADR R0, PrintHexBuffer
- SWI OS_Write0
- SWI OS_NewLine
- LDMFD R13!, {R0-R7, PC}
-PrintHexBuffer:
- .space 16
-PrintHexBufferEnd:
- .align
-
- .bss
-buffer:
- .space 256
-endbuffer:
-
- .end
Modified: branches/simplified-build/!OsLib/Source/Test/Test/test.asm
===================================================================
--- branches/simplified-build/!OsLib/Source/Test/Test/test.asm 2007-05-31 16:14:13 UTC (rev 270)
+++ branches/simplified-build/!OsLib/Source/Test/Test/test.asm 2007-06-19 00:03:11 UTC (rev 271)
@@ -1,7 +1,5 @@
-;test assembler headers
- ; faffing about with directory name to get ObjAsm to behave properly
- GET ../Test/OSLib.Hdr ; gets all OSLib headers
-; GET Hdr.OSLib ; alternative format for OBJASM
+; Test assembler headers
+ GET all_oslib.Hdr ; gets all OSLib headers
EXPORT |entry|
EXPORT |exit|
@@ -14,14 +12,14 @@
MOV sp, r1 ; set up a stack
- STMFD sp!, {lr} ; save the return address
+ STMFD sp!, {lr} ; save the return address
- ADR R0, message ; write the message std out
+ ADR R0, message ; write the message std out
SWI OS_Write0
SWI OS_NewLine
-|exit| ldmfd sp!, {pc} ; return
+|exit| ldmfd sp!, {pc} ; return
message = "Hello World from ObjAsm",0
Modified: branches/simplified-build/!OsLib/Source/Test/Test1/Makefile
===================================================================
--- branches/simplified-build/!OsLib/Source/Test/Test1/Makefile 2007-05-31 16:14:13 UTC (rev 270)
+++ branches/simplified-build/!OsLib/Source/Test/Test1/Makefile 2007-06-19 00:03:11 UTC (rev 271)
@@ -1,4 +1,6 @@
-# ...
+# This test will include all C headers and ASM headers one for one and see if
+# they either can be used stand-alone, either pull enough other headers files
+# in.
ALL_CHEADERS := $(wildcard $(HEADERDIR)/*.h)
ALL_ASMHEADERS := $(wildcard $(HEADERDIR)/*.Hdr)
@@ -24,14 +26,14 @@
ifeq ($(BUILDTYPE),CROSSGCC_ELF)
s_%.o: $(HEADERDIR)/%.Hdr
- @echo "Testing $(subst .o,.Hdr,$(subst s_,,$@))"
+ @echo "Testing $(subst .o,.Hdr,$(subst s_,,$@)) (ELF)"
@echo "#include \"oslib/$(subst .o,.Hdr,$(subst s_,,$@))\"" > include.Hdr
@$(AS) $(TEST_S) -I$(TOPHEADERDIR) -o /dev/null
@touch $@
else
s_%.o: $(HEADERDIR)/%.Hdr
- @echo "Testing $(subst .o,.Hdr,$(subst s_,,$@))"
- @echo " GET oslib/$(subst .o,.Hdr,$(subst s_,,$@))" > include.Hdr
+ @echo "Testing $(subst .o,.Hdr,$(subst s_,,$@)) (AOF)"
+ @echo "\tGET\toslib/$(subst .o,.Hdr,$(subst s_,,$@))" > include.Hdr
@$(AS) $(TEST_S) -I$(TOPHEADERDIR) -o /dev/null
@touch $@
endif
Modified: branches/simplified-build/!OsLib/Source/Test/Test1/test.asm
===================================================================
--- branches/simplified-build/!OsLib/Source/Test/Test1/test.asm 2007-05-31 16:14:13 UTC (rev 270)
+++ branches/simplified-build/!OsLib/Source/Test/Test1/test.asm 2007-06-19 00:03:11 UTC (rev 271)
@@ -1,13 +1,11 @@
-;test each assembler header
- ; faffing about with directory name to get ObjAsm to behave properly
- GET ../Test1/include.Hdr ; gets all OSLib headers
+; Test each assembler header individually
+ GET include.Hdr ; gets all OSLib headers
+
EXPORT |entry|
AREA code, CODE
- ENTRY
-|entry| MOV pc, lr ; exit on error
+|entry| MOV pc, lr
END
-
Modified: branches/simplified-build/!OsLib/Source/Test/Test1/test.c
===================================================================
--- branches/simplified-build/!OsLib/Source/Test/Test1/test.c 2007-05-31 16:14:13 UTC (rev 270)
+++ branches/simplified-build/!OsLib/Source/Test/Test1/test.c 2007-06-19 00:03:11 UTC (rev 271)
@@ -1,10 +1,8 @@
-/* test a new OSLib build by #includeing each headers
-*/
+/* test a new OSLib build by #include'ing each headers */
-//INCLUDE
#include "include.h"
int main (void)
{
- return 0;
+ return 0;
}
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|