This is the mail archive of the
newlib@sourceware.org
mailing list for the newlib project.
Commit: MSP430: Libgloss: Add unlink system call
- From: Nick Clifton <nickc at redhat dot com>
- To: newlib at sourceware dot org
- Date: Wed, 30 Apr 2014 12:29:39 +0100
- Subject: Commit: MSP430: Libgloss: Add unlink system call
- Authentication-results: sourceware.org; auth=none
Hi Guys,
I am applying the patch below to fix a couple of problems with the
MSP430 port of the libgloss library. The first is that the unlink
system call was missing. The second is that some obsolete linker
scripts were still being installed.
Cheers
Nick
libgloss/ChangeLog
2014-04-30 Nick Clifton <nickc@redhat.com>
* msp430/Makefile.in (NOSYS_OBJS): Add unlink.o.
(SCRIPTS): Remove msp430F5438A-s.ld and msp430F5438A-s.ld.
* unlink.c: New file.
Index: libgloss/msp430/Makefile.in
===================================================================
RCS file: /cvs/src/src/libgloss/msp430/Makefile.in,v
retrieving revision 1.3
diff -u -3 -p -r1.3 Makefile.in
--- libgloss/msp430/Makefile.in 30 Jan 2014 02:46:34 -0000 1.3
+++ libgloss/msp430/Makefile.in 30 Apr 2014 11:24:49 -0000
@@ -1,4 +1,4 @@
-# Copyright (c) 2008, 2009, 2011, 2013 Red Hat, Inc. All rights reserved.
+# Copyright (c) 2008-2014 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
@@ -56,14 +56,15 @@ OBJCOPY = `if [ -f ${objroot}/../binutil
then echo ${objroot}/../binutils/objcopy ; \
else t='$(program_transform_name)'; echo objcopy | sed -e $$t ; fi`
-SCRIPTS = $(srcdir)/msp430.ld $(srcdir)/msp430-sim.ld
+SCRIPTS = $(srcdir)/msp430.ld
+SCRIPTS += $(srcdir)/msp430-sim.ld
SCRIPTS += $(srcdir)/msp430xl-sim.ld
-SCRIPTS += $(srcdir)/msp430F5438A-s.ld
-SCRIPTS += $(srcdir)/msp430F5438A-l.ld
+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_CRT = libcrt.a
SIM_OBJS = syscalls.o \
cio.o \
@@ -73,12 +74,9 @@ SIM_OBJS = syscalls.o \
NOSYS_OBJS = nosyscalls.o \
cio.o \
write.o \
+ unlink.o \
sbrk.o
-SCRIPTS += $(srcdir)/intr_vectors.ld
-
-LIB_CRT = libcrt.a
-
# Each crt_*.o is built from crt0.S using -DL*. crt0.o is built from
# crt0.s with -DL0 via the default rule below.
CRT_OBJS = \
*** /dev/null 2014-04-30 09:23:07.177833682 +0100
--- libgloss/msp430/unlink.c 2014-03-07 09:38:08.720679462 +0000
***************
*** 0 ****
--- 1,25 ----
+ #include <string.h>
+
+ #include "cio.h"
+
+ signed int
+ unlink (const char * name)
+ {
+ unsigned len = strlen (name);
+
+ if (len >= CIO_BUF_SIZE)
+ return -1;
+
+ __CIOBUF__.length[0] = len;
+ __CIOBUF__.length[1] = len >> 8;
+ __CIOBUF__.parms[0] = CIO_UNLINK;
+ __CIOBUF__.parms[1] = len;
+ __CIOBUF__.parms[2] = len >> 8;
+ memcpy (__CIOBUF__.buf, name, len);
+
+ _libgloss_cio_hook ();
+
+ return __CIOBUF__.parms[0] + __CIOBUF__.parms[1] * 256;
+ }
+
+