From 179e25f0df0e8e6703be95ef7efa5819d6f3af7d Mon Sep 17 00:00:00 2001 From: Nick Clifton Date: Wed, 30 Apr 2014 11:30:14 +0000 Subject: [PATCH] * msp430/Makefile.in (NOSYS_OBJS): Add unlink.o. (SCRIPTS): Remove msp430F5438A-s.ld and msp430F5438A-s.ld. * unlink.c: New file. --- libgloss/ChangeLog | 6 ++++++ libgloss/msp430/Makefile.in | 14 ++++++-------- libgloss/msp430/unlink.c | 25 +++++++++++++++++++++++++ 3 files changed, 37 insertions(+), 8 deletions(-) create mode 100644 libgloss/msp430/unlink.c diff --git a/libgloss/ChangeLog b/libgloss/ChangeLog index 5770b5e60..02949f878 100644 --- a/libgloss/ChangeLog +++ b/libgloss/ChangeLog @@ -1,3 +1,9 @@ +2014-04-30 Nick Clifton + + * msp430/Makefile.in (NOSYS_OBJS): Add unlink.o. + (SCRIPTS): Remove msp430F5438A-s.ld and msp430F5438A-s.ld. + * unlink.c: New file. + 2014-04-04 Ashish Kapania * arm/configure.in: (*-*-tirtos*) Accept TIRTOS target when setting diff --git a/libgloss/msp430/Makefile.in b/libgloss/msp430/Makefile.in index 4d098104f..57c7f10c3 100644 --- a/libgloss/msp430/Makefile.in +++ b/libgloss/msp430/Makefile.in @@ -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}/../binutils/objcopy ] ; \ 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 = \ diff --git a/libgloss/msp430/unlink.c b/libgloss/msp430/unlink.c new file mode 100644 index 000000000..1c8c6f233 --- /dev/null +++ b/libgloss/msp430/unlink.c @@ -0,0 +1,25 @@ +#include + +#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; +} + +