Hi Everyone,
I am getting error during compiling TI RTOS project as "_lock.h" and "_unlock.h" files not found in gcc compiler which is present in exit.c program here ill attach the code, _lock.h file is present in TI compiler and exit.c program is available in Ti arm compiler , where can i find the exit.c file in GCC compiler or similar program where i can replace exit.c in my code.
Thank you in advance.
Chiranth
exit,c file provided by TI arm compiler.
/****************************************************************************/
/* EXIT.C v15.4.0I15142 */
/* */
/* Copyright (c) 1995-2015 Texas Instruments Incorporated */
/* http://www.ti.com/ */
/* */
/* Redistribution and use in source and binary forms, with or without */
/* modification, are permitted provided that the following conditions */
/* are met: */
/* */
/* Redistributions of source code must retain the above copyright */
/* notice, this list of conditions and the following disclaimer. */
/* */
/* Redistributions in binary form must reproduce the above copyright */
/* notice, this list of conditions and the following disclaimer in */
/* the documentation and/or other materials provided with the */
/* distribution. */
/* */
/* Neither the name of Texas Instruments Incorporated nor the names */
/* of its contributors may be used to endorse or promote products */
/* derived from this software without specific prior written */
/* permission. */
/* */
/* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS */
/* "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT */
/* LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR */
/* A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT */
/* OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, */
/* SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT */
/* LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, */
/* DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY */
/* THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT */
/* (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE */
/* OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. */
/* */
/****************************************************************************/
#include <stdlib.h>
#include <_lock.h>
void (*__TI_cleanup_ptr)(void) = NULL;
void _DATA_ACCESS (*__TI_dtors_ptr)(int) = NULL;
void JumpToBootLoader(void);
/****************************************************************************/
/* */
/* LOADER_EXIT - */
/* */
/* SET C$$EXIT LABEL SO THE DEBUGGER KNOWS WHEN THE C++ PROGRAM HAS */
/* COMPLETED. THIS CAN BE REMOVED IF THE DEBUGGER IS NOT USED. */
/* */
/****************************************************************************/
static void loader_exit(void)
{
#if defined(EMBED_CIO_BP)
__asm(" .global C$$EXITE");
#if defined(__32bis__)
__asm("C$$EXITE:.word 0xDEFED0FE");
#else
__asm(" .align 4");
#if defined(__big_endian__)
__asm("C$$EXITE:.half 0xDEFE");
#else
__asm("C$$EXITE:.half 0xD0FE");
#endif /* __big_endian__ */
#endif /* __32bis__ */
#else /* !EMBED_CIO_BP */
__asm(" .global C$$EXITE");
__asm("C$$EXITE: nop");
#endif
}
/****************************************************************************/
/* EXIT() - NORMAL PROGRAM TERMINATION. */
/****************************************************************************/
extern void exit(int status)
{
/*-------------------------------------------------------------------*/
/* MUST LOCK WHEN ACCESSING GLOBALS, like __TI_dtors_ptr, */
/* __TI_cleanup_ptr */
/*-------------------------------------------------------------------*/
_lock();
/*-------------------------------------------------------------------*/
/* BOTH ATEXIT FUNCTIONS AND STATIC OBJECT DESTRUCTORS ARE */
/* REGISTERED IN A LINK LIST TO BE PROCESSED BY THE FUNCTION POINTED */
/* TO BY __TI_dtors_ptr. PROCESS THEM NOW. */
/*-------------------------------------------------------------------*/
if (__TI_dtors_ptr) (*__TI_dtors_ptr)(status);
#if defined(_C_IN_NS)
/*-------------------------------------------------------------------*/
/* _C_IN_NS IS A FLAG WE SET ONLY IN DINKUMWARE HEADERS. SO US IT TO */
/* TELL IF IT IS IN DINKUMWARE. */
/* FOR DINKUMWARE LIBRARY, CALL CLOSEALL() TO CLOSE ALL IO STREAMS. */
/* CLOSEALL() is a DINKUMWARE FUNCTION DEFINED IN FCLOSE.C TO CLOSE */
/* ALL OPENED IOSTREAMS. */
/*-------------------------------------------------------------------*/
closeall();
#else
/*-------------------------------------------------------------------*/
/* IF FILES ARE POSSIBLY OPEN, __TI_cleanup_ptr() WILL BE SETUP TO */
/* CLOSE THEM. */
/*-------------------------------------------------------------------*/
if (__TI_cleanup_ptr) (*__TI_cleanup_ptr)();
#endif
_unlock();
abort();
}
/****************************************************************************/
/* ABORT - ABNORMAL PROGRAM TERMINATION. CURRENTLY JUST HALTS EXECUTION. */
/****************************************************************************/
void abort(void)
{
JumpToBootLoader();
loader_exit();
for (;;); /* SPINS FOREVER */
}
_lock.h file called by exit.c file
/*****************************************************************************/
/* _lock.h v5.2.9 */
/* */
/* Copyright (c) 2000-2017 Texas Instruments Incorporated */
/* http://www.ti.com/ */
/* */
/* Redistribution and use in source and binary forms, with or without */
/* modification, are permitted provided that the following conditions */
/* are met: */
/* */
/* Redistributions of source code must retain the above copyright */
/* notice, this list of conditions and the following disclaimer. */
/* */
/* Redistributions in binary form must reproduce the above copyright */
/* notice, this list of conditions and the following disclaimer in */
/* the documentation and/or other materials provided with the */
/* distribution. */
/* */
/* Neither the name of Texas Instruments Incorporated nor the names */
/* of its contributors may be used to endorse or promote products */
/* derived from this software without specific prior written */
/* permission. */
/* */
/* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS */
/* "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT */
/* LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR */
/* A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT */
/* OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, */
/* SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT */
/* LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, */
/* DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY */
/* THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT */
/* (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE */
/* OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. */
/* */
/*****************************************************************************/
#ifndef __LOCK_H
#define __LOCK_H
#include <linkage.h>
#ifdef __cplusplus
extern "C" {
#endif
#pragma diag_push
/* _nop(), _lock(), and _unlock() all accept zero or more optional arguments,
which must remain as empty rather than (void) parameter lists to avoid
breaking the API */
#pragma CHECK_MISRA("-16.5")
_CODE_ACCESS void _nop();
extern _DATA_ACCESS void ( *_lock)();
extern _DATA_ACCESS void (*_unlock)();
_CODE_ACCESS void _register_lock (void ( *lock)());
_CODE_ACCESS void _register_unlock(void (*unlock)());
#pragma diag_pop
#define SYSTEM_WIDE_LOCK_REGISTERED (_lock != _nop)
#define SYSTEM_WIDE_UNLOCK_REGISTERED (_unlock != _nop)
#ifdef __cplusplus
} /* extern "C" */
#endif
#endif /* __LOCK_H */
linkage.h file called by _lock.h file
/*****************************************************************************/
/* linkage.h v5.2.9 */
/* */
/* Copyright (c) 1998-2017 Texas Instruments Incorporated */
/* http://www.ti.com/ */
/* */
/* Redistribution and use in source and binary forms, with or without */
/* modification, are permitted provided that the following conditions */
/* are met: */
/* */
/* Redistributions of source code must retain the above copyright */
/* notice, this list of conditions and the following disclaimer. */
/* */
/* Redistributions in binary form must reproduce the above copyright */
/* notice, this list of conditions and the following disclaimer in */
/* the documentation and/or other materials provided with the */
/* distribution. */
/* */
/* Neither the name of Texas Instruments Incorporated nor the names */
/* of its contributors may be used to endorse or promote products */
/* derived from this software without specific prior written */
/* permission. */
/* */
/* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS */
/* "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT */
/* LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR */
/* A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT */
/* OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, */
/* SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT */
/* LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, */
/* DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY */
/* THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT */
/* (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE */
/* OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. */
/* */
/*****************************************************************************/
#ifndef _LINKAGE
#define _LINKAGE
#pragma diag_push
#pragma CHECK_MISRA("-19.4") /* macros required for implementation */
/* No modifiers are needed to access code or data */
#define _CODE_ACCESS
#define _DATA_ACCESS
#define _DATA_ACCESS_NEAR
/*--------------------------------------------------------------------------*/
/* Define _IDECL ==> how inline functions are declared */
/*--------------------------------------------------------------------------*/
#ifdef _INLINE
#define _IDECL static __inline
#define _IDEFN static __inline
#define __INLINE static __inline
#else
#define _IDECL extern _CODE_ACCESS
#define _IDEFN _CODE_ACCESS
#define __INLINE __EXTERN
#endif
#pragma diag_pop
#endif /* ifndef _LINKAGE */