[PATCH] libgloss: rename non-standard nosys to cio in msp430

Peter A. Bigot pab@pabigot.com
Mon Sep 22 12:16:00 GMT 2014


The msp430 port of newlib is nearly unique in discarding the libnosys
implementation provided by newlib in favor of its own implementation.
(Of the dozen+ supported newlib targets spu-* is the only other one that
does this).

Based on discussion on the mspgcc-users mailing list[1], this patch
changes msp430 to use the standard newlib libnosys, while preserving the
existing cio alternative as a distinctly named library.

libgloss/ChangeLog:
2014-09-22  Peter A. Bigot  <pab@pabigot.com>
	* configure.in: Remove config_libnosys=false
	* configure: Regenerated.
	* msp430/nosyscalls.S: Rename to ciosyscalls.S
	* msp430/Makefile.in: Change LIBNOSYS to LIB_CIO.

[1] http://www.mail-archive.com/mspgcc-users@lists.sourceforge.net/msg12104.html

Cc: dj@redhat.com
Cc: nickc@redhat.com
Signed-off-by: Peter A. Bigot <pab@pabigot.com>
---
 libgloss/configure            |  1 -
 libgloss/configure.in         |  1 -
 libgloss/msp430/Makefile.in   | 12 ++++----
 libgloss/msp430/ciosyscalls.S | 69 +++++++++++++++++++++++++++++++++++++++++++
 libgloss/msp430/nosyscalls.S  | 69 -------------------------------------------
 5 files changed, 75 insertions(+), 77 deletions(-)
 create mode 100644 libgloss/msp430/ciosyscalls.S
 delete mode 100644 libgloss/msp430/nosyscalls.S

diff --git a/libgloss/configure b/libgloss/configure
index 41d91d6..aaef579 100755
--- a/libgloss/configure
+++ b/libgloss/configure
@@ -2531,7 +2531,6 @@ case "${target}" in
   msp430*-*-elf)
 	subdirs="$subdirs msp430"
 
-	config_libnosys=false
 	;;
   rl78*-*-elf)
 	subdirs="$subdirs rl78"
diff --git a/libgloss/configure.in b/libgloss/configure.in
index 14287e7..93cc369 100644
--- a/libgloss/configure.in
+++ b/libgloss/configure.in
@@ -137,7 +137,6 @@ case "${target}" in
 	;;
   msp430*-*-elf)
 	AC_CONFIG_SUBDIRS([msp430])
-	config_libnosys=false
 	;;
   rl78*-*-elf)
 	AC_CONFIG_SUBDIRS([rl78])
diff --git a/libgloss/msp430/Makefile.in b/libgloss/msp430/Makefile.in
index 57c7f10..d72051d 100644
--- a/libgloss/msp430/Makefile.in
+++ b/libgloss/msp430/Makefile.in
@@ -63,7 +63,7 @@ SCRIPTS += $(srcdir)/intr_vectors.ld
 
 CRT = gcrt0.o crt0.o crt0-minrt.o crtn.o crtn-minrt.o
 SIM_BSP = libsim.a
-LIBNOSYS = libnosys.a
+LIB_CIO = libcio.a
 LIB_CRT = libcrt.a
 
 SIM_OBJS = syscalls.o \
@@ -71,7 +71,7 @@ SIM_OBJS = syscalls.o \
 	write.o \
 	sbrk.o
 
-NOSYS_OBJS = nosyscalls.o \
+CIO_OBJS = ciosyscalls.o \
 	cio.o \
 	write.o \
 	unlink.o \
@@ -91,7 +91,7 @@ CRT_OBJS = \
 @host_makefile_frag@
 
 
-all: $(CRT) $(SIM_BSP) $(LIBNOSYS) $(LIB_CRT) copy_scripts_to_objdir
+all: $(CRT) $(SIM_BSP) $(LIB_CIO) $(LIB_CRT) copy_scripts_to_objdir
 
 crt_%.o : crt0.S
 	$(CC) -DL$* -Wa,-gdwarf2 -Wa,-I$(srcdir) $(CFLAGS_FOR_TARGET) $(INCLUDES) $(CFLAGS) -c $< -o $@
@@ -110,7 +110,7 @@ $(SIM_BSP): $(SIM_OBJS)
 	$(AR) $(ARFLAGS) $@ $?
 	$(RANLIB) $@
 
-$(LIBNOSYS): $(NOSYS_OBJS)
+$(LIB_CIO): $(CIO_OBJS)
 	$(AR) $(ARFLAGS) $@ $?
 	$(RANLIB) $@
 
@@ -151,8 +151,8 @@ unlink.o : $(SDEPS)
 utime.o : $(SDEPS)
 write.o : $(SDEPS)
 
-install: $(CRT) $(SIM_BSP) $(LIBNOSYS) $(LIB_CRT) $(SCRIPTS)
-	for c in $(CRT) $(SIM_BSP) $(LIBNOSYS) $(LIB_CRT); do \
+install: $(CRT) $(SIM_BSP) $(LIB_CIO) $(LIB_CRT) $(SCRIPTS)
+	for c in $(CRT) $(SIM_BSP) $(LIB_CIO) $(LIB_CRT); do \
 	  $(INSTALL_DATA) $$c $(tooldir)/lib${MULTISUBDIR}/$$c ;\
 	done
 	for c in $(SCRIPTS); do \
diff --git a/libgloss/msp430/ciosyscalls.S b/libgloss/msp430/ciosyscalls.S
new file mode 100644
index 0000000..abb01b0
--- /dev/null
+++ b/libgloss/msp430/ciosyscalls.S
@@ -0,0 +1,69 @@
+/* Copyright (c) 2012, 2013 Red Hat, Inc. All rights reserved.
+
+   This copyrighted material is made available to anyone wishing to use, modify,
+   copy, or redistribute it subject to the terms and conditions of the BSD
+   License.   This program is distributed in the hope that it will be useful,
+   but WITHOUT ANY WARRANTY expressed or implied, including the implied warranties
+   of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  A copy of this license
+   is available at http://www.opensource.org/licenses. Any Red Hat trademarks that
+   are incorporated in the source code or documentation are not subject to the BSD
+   License and may only be used or replicated with the express permission of
+   Red Hat, Inc.
+*/
+
+/* Empty syscall definitions for when we run on real hardware.  */
+
+#include "../syscall.h"
+#include "memmodel.h"
+	
+#define ENOSYS 88
+
+.macro	sc,a
+	sc2 \a,\a
+.endm
+	
+.macro	sc2,name,num
+	.weak	\name
+	.global	\name
+\name:
+        call_   #__errno                 
+        movx_   #ENOSYS, @R12                
+	MOV.W	#-1,R12
+	ret_
+.endm
+
+	.weak	exit
+	.weak	_exit
+	.global	exit
+	.global	_exit
+exit:
+_exit:
+	/* For some reason, the board fails to stop at a breakpoint
+	   placed on top of a software breakpoint instruction.  */
+/*	MOV.B	#0,R3		; this is a software breakpoint instruction */
+1:	br_	#1b
+
+#define SC(n) sc2 n,SYS_##n
+
+	SC (open)
+	SC (close)
+	SC (read)
+/*	SC (write)*/
+	SC (fstat)
+	SC (lseek)
+	SC (kill)
+
+	.weak	isatty
+	.global	isatty
+isatty:
+	.weak	_isatty
+	.global	_isatty
+_isatty:
+	MOV	#1,R12
+	ret_
+	
+	.weak	getpid
+	.global	getpid
+getpid:
+	MOV	#42,R12
+	ret_
diff --git a/libgloss/msp430/nosyscalls.S b/libgloss/msp430/nosyscalls.S
deleted file mode 100644
index abb01b0..0000000
--- a/libgloss/msp430/nosyscalls.S
+++ /dev/null
@@ -1,69 +0,0 @@
-/* Copyright (c) 2012, 2013 Red Hat, Inc. All rights reserved.
-
-   This copyrighted material is made available to anyone wishing to use, modify,
-   copy, or redistribute it subject to the terms and conditions of the BSD
-   License.   This program is distributed in the hope that it will be useful,
-   but WITHOUT ANY WARRANTY expressed or implied, including the implied warranties
-   of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  A copy of this license
-   is available at http://www.opensource.org/licenses. Any Red Hat trademarks that
-   are incorporated in the source code or documentation are not subject to the BSD
-   License and may only be used or replicated with the express permission of
-   Red Hat, Inc.
-*/
-
-/* Empty syscall definitions for when we run on real hardware.  */
-
-#include "../syscall.h"
-#include "memmodel.h"
-	
-#define ENOSYS 88
-
-.macro	sc,a
-	sc2 \a,\a
-.endm
-	
-.macro	sc2,name,num
-	.weak	\name
-	.global	\name
-\name:
-        call_   #__errno                 
-        movx_   #ENOSYS, @R12                
-	MOV.W	#-1,R12
-	ret_
-.endm
-
-	.weak	exit
-	.weak	_exit
-	.global	exit
-	.global	_exit
-exit:
-_exit:
-	/* For some reason, the board fails to stop at a breakpoint
-	   placed on top of a software breakpoint instruction.  */
-/*	MOV.B	#0,R3		; this is a software breakpoint instruction */
-1:	br_	#1b
-
-#define SC(n) sc2 n,SYS_##n
-
-	SC (open)
-	SC (close)
-	SC (read)
-/*	SC (write)*/
-	SC (fstat)
-	SC (lseek)
-	SC (kill)
-
-	.weak	isatty
-	.global	isatty
-isatty:
-	.weak	_isatty
-	.global	_isatty
-_isatty:
-	MOV	#1,R12
-	ret_
-	
-	.weak	getpid
-	.global	getpid
-getpid:
-	MOV	#42,R12
-	ret_
-- 
1.8.5.5



More information about the Newlib mailing list