diff --git a/newlib/ChangeLog b/newlib/ChangeLog index 0fa293739..d14722fc0 100644 --- a/newlib/ChangeLog +++ b/newlib/ChangeLog @@ -1,3 +1,11 @@ +2003-06-10 Richard Sandiford + + * libc/sys/h8300hms/setarch.h: New file. + * libc/sys/h8300hms/close.S, libc/sys/h8300hms/fstat.S, + libc/sys/h8300hms/lseek.S, libc/sys/h8300hms/open.S, + libc/sys/h8300hms/read.S, libc/sys/h8300hms/stat.S, + libc/sys/h8300hms/write.S, libc/sys/h8300hms/crt0.S: Use it. + 2003-06-06 Jeff Johnston * libc/argz/argz_add.c: Change to use _DEFUN macro for function diff --git a/newlib/libc/sys/h8300hms/close.S b/newlib/libc/sys/h8300hms/close.S index 54a1214d7..4df86cb55 100644 --- a/newlib/libc/sys/h8300hms/close.S +++ b/newlib/libc/sys/h8300hms/close.S @@ -1,12 +1,7 @@ ;int close(int fd); ;Integer arguments have to be zero extended. -#if defined(__H8300H__) - .h8300h -#endif -#if defined(__H8300S__) - .h8300s -#endif +#include "setarch.h" .section .text .align 2 diff --git a/newlib/libc/sys/h8300hms/crt0.S b/newlib/libc/sys/h8300hms/crt0.S index 257896449..aa6bed592 100644 --- a/newlib/libc/sys/h8300hms/crt0.S +++ b/newlib/libc/sys/h8300hms/crt0.S @@ -1,5 +1,7 @@ ; h8/300 and h8/300h start up file. +#include "setarch.h" + #ifdef __H8300__ .section .text @@ -36,11 +38,6 @@ _stack: .word 1 #ifdef __H8300H__ -#ifdef __NORMAL_MODE__ - .h8300hn -#else - .h8300h -#endif .section .text .global _start _start: @@ -74,11 +71,7 @@ _stack: .long 1 #endif #ifdef __H8300S__ -#ifdef __NORMAL_MODE__ - .h8300sn -#else - .h8300s -#endif + .section .text .global _start _start: diff --git a/newlib/libc/sys/h8300hms/fstat.S b/newlib/libc/sys/h8300hms/fstat.S index a6214e662..b89df0cbe 100644 --- a/newlib/libc/sys/h8300hms/fstat.S +++ b/newlib/libc/sys/h8300hms/fstat.S @@ -1,12 +1,7 @@ ;int fstat(int filedes, struct stat *buf); ;Integer arguments have to be zero extended. -#if defined(__H8300H__) - .h8300h -#endif -#if defined(__H8300S__) - .h8300s -#endif +#include "setarch.h" .section .text .align 2 diff --git a/newlib/libc/sys/h8300hms/lseek.S b/newlib/libc/sys/h8300hms/lseek.S index 1af533c14..b82f8412e 100644 --- a/newlib/libc/sys/h8300hms/lseek.S +++ b/newlib/libc/sys/h8300hms/lseek.S @@ -1,12 +1,7 @@ ;off_t lseek(int fildes, off_t offset, int whence); ;Integer arguments have to be zero extended. -#if defined(__H8300H__) - .h8300h -#endif -#if defined(__H8300S__) - .h8300s -#endif +#include "setarch.h" .section .text .align 2 diff --git a/newlib/libc/sys/h8300hms/open.S b/newlib/libc/sys/h8300hms/open.S index f025aac60..0feaab217 100644 --- a/newlib/libc/sys/h8300hms/open.S +++ b/newlib/libc/sys/h8300hms/open.S @@ -3,12 +3,7 @@ ;The second argument is taken from the stack, ;hence it is not zero extended here. -#if defined(__H8300H__) - .h8300h -#endif -#if defined(__H8300S__) - .h8300s -#endif +#include "setarch.h" .section .text .align 2 diff --git a/newlib/libc/sys/h8300hms/read.S b/newlib/libc/sys/h8300hms/read.S index 77a7f1c3a..1a2731e85 100644 --- a/newlib/libc/sys/h8300hms/read.S +++ b/newlib/libc/sys/h8300hms/read.S @@ -1,12 +1,7 @@ ;ssize_t read(int fd, void *buf, size_t count); ;Integer arguments have to be zero extended. -#if defined(__H8300H__) - .h8300h -#endif -#if defined(__H8300S__) - .h8300s -#endif +#include "setarch.h" .section .text .align 2 diff --git a/newlib/libc/sys/h8300hms/setarch.h b/newlib/libc/sys/h8300hms/setarch.h new file mode 100644 index 000000000..b670e1773 --- /dev/null +++ b/newlib/libc/sys/h8300hms/setarch.h @@ -0,0 +1,14 @@ +#ifdef __H8300H__ +#ifdef __NORMAL_MODE__ + .h8300hn +#else + .h8300h +#endif +#endif +#ifdef __H8300S__ +#ifdef __NORMAL_MODE__ + .h8300sn +#else + .h8300s +#endif +#endif diff --git a/newlib/libc/sys/h8300hms/stat.S b/newlib/libc/sys/h8300hms/stat.S index d4ce3ff37..dae23c470 100644 --- a/newlib/libc/sys/h8300hms/stat.S +++ b/newlib/libc/sys/h8300hms/stat.S @@ -1,11 +1,6 @@ ;int stat(const char *file_name, struct stat *buf); -#if defined(__H8300H__) - .h8300h -#endif -#if defined(__H8300S__) - .h8300s -#endif +#include "setarch.h" .section .text .align 2 diff --git a/newlib/libc/sys/h8300hms/write.S b/newlib/libc/sys/h8300hms/write.S index ccd06c5b7..fde5dc314 100644 --- a/newlib/libc/sys/h8300hms/write.S +++ b/newlib/libc/sys/h8300hms/write.S @@ -1,13 +1,7 @@ ;ssize_t write(int fd, const void *buf, size_t count); ;Integer arguments have to be zero extended. -#if defined(__H8300H__) - .h8300h -#endif - -#if defined(__H8300S__) - .h8300s -#endif +#include "setarch.h" .section .text .align 2