Skip to content

Commit

Permalink
Update system header
Browse files Browse the repository at this point in the history
  • Loading branch information
offa committed Dec 18, 2024
1 parent 0b49ea8 commit 21a37f9
Show file tree
Hide file tree
Showing 8 changed files with 37 additions and 28 deletions.
51 changes: 30 additions & 21 deletions system/include/arm/semihosting.h
Original file line number Diff line number Diff line change
@@ -1,35 +1,33 @@
/*
* This file is part of the µOS++ distribution.
* (https://github.com/micro-os-plus)
* Copyright (c) 2015 Liviu Ionescu.
* Copyright (c) 2015-2023 Liviu Ionescu. All rights reserved.
*
* Permission is hereby granted, free of charge, to any person
* obtaining a copy of this software and associated documentation
* files (the "Software"), to deal in the Software without
* restriction, including without limitation the rights to use,
* copy, modify, merge, publish, distribute, sublicense, and/or
* sell copies of the Software, and to permit persons to whom
* the Software is furnished to do so, subject to the following
* conditions:
* Permission to use, copy, modify, and/or distribute this software
* for any purpose is hereby granted, under the terms of the MIT license.
*
* The above copyright notice and this permission notice shall be
* included in all copies or substantial portions of the Software.
*
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
* EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES
* OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
* NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT
* HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY,
* WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
* FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR
* OTHER DEALINGS IN THE SOFTWARE.
* If a copy of the license was not distributed with this file, it can
* be obtained from https://opensource.org/licenses/mit/.
*/

#ifndef CMSIS_PLUS_ARM_SEMIHOSTING_H_
#define CMSIS_PLUS_ARM_SEMIHOSTING_H_

// ----------------------------------------------------------------------------

#if defined(OS_USE_OS_APP_CONFIG_H)
#include <cmsis-plus/os-app-config.h>
#endif

// ----------------------------------------------------------------------------

#if defined(__cplusplus)
extern "C"
{
#endif // defined(__cplusplus)

// ----------------------------------------------------------------------------

// Semihosting operations.
enum OperationNumber
{
Expand Down Expand Up @@ -94,12 +92,15 @@ enum OperationNumber
#define AngelSWITestFaultOpCode (0xB658)
#endif

#pragma GCC diagnostic push
#pragma GCC diagnostic ignored "-Wunused-parameter"

static inline int
__attribute__ ((always_inline))
call_host (int reason, void* arg)
{
int value;
asm volatile (
__asm__ volatile (

" mov r0, %[rsn] \n"
" mov r1, %[arg] \n"
Expand All @@ -124,6 +125,8 @@ call_host (int reason, void* arg)
return value;
}

#pragma GCC diagnostic pop

// ----------------------------------------------------------------------------

// Function used in _exit() to return the status code as Angel exception.
Expand All @@ -139,4 +142,10 @@ report_exception (int reason)

// ----------------------------------------------------------------------------

#if defined(__cplusplus)
}
#endif // defined(__cplusplus)

// ----------------------------------------------------------------------------

#endif /* CMSIS_PLUS_ARM_SEMIHOSTING_H_ */
2 changes: 1 addition & 1 deletion system/include/cmsis/core_cm0.h
Original file line number Diff line number Diff line change
Expand Up @@ -98,7 +98,7 @@
#define __STATIC_INLINE static __inline

#elif defined ( __GNUC__ )
#define __ASM __asm /*!< asm keyword for GNU Compiler */
#define __ASM __asm__ /*!< asm keyword for GNU Compiler */
#define __INLINE inline /*!< inline keyword for GNU Compiler */
#define __STATIC_INLINE static inline

Expand Down
2 changes: 1 addition & 1 deletion system/include/cmsis/core_cm0plus.h
Original file line number Diff line number Diff line change
Expand Up @@ -98,7 +98,7 @@
#define __STATIC_INLINE static __inline

#elif defined ( __GNUC__ )
#define __ASM __asm /*!< asm keyword for GNU Compiler */
#define __ASM __asm__ /*!< asm keyword for GNU Compiler */
#define __INLINE inline /*!< inline keyword for GNU Compiler */
#define __STATIC_INLINE static inline

Expand Down
2 changes: 1 addition & 1 deletion system/include/cmsis/core_cm3.h
Original file line number Diff line number Diff line change
Expand Up @@ -98,7 +98,7 @@
#define __STATIC_INLINE static __inline

#elif defined ( __GNUC__ )
#define __ASM __asm /*!< asm keyword for GNU Compiler */
#define __ASM __asm__ /*!< asm keyword for GNU Compiler */
#define __INLINE inline /*!< inline keyword for GNU Compiler */
#define __STATIC_INLINE static inline

Expand Down
2 changes: 1 addition & 1 deletion system/include/cmsis/core_cm4.h
Original file line number Diff line number Diff line change
Expand Up @@ -98,7 +98,7 @@
#define __STATIC_INLINE static __inline

#elif defined ( __GNUC__ )
#define __ASM __asm /*!< asm keyword for GNU Compiler */
#define __ASM __asm__ /*!< asm keyword for GNU Compiler */
#define __INLINE inline /*!< inline keyword for GNU Compiler */
#define __STATIC_INLINE static inline

Expand Down
2 changes: 1 addition & 1 deletion system/include/cmsis/core_cm7.h
Original file line number Diff line number Diff line change
Expand Up @@ -98,7 +98,7 @@
#define __STATIC_INLINE static __inline

#elif defined ( __GNUC__ )
#define __ASM __asm /*!< asm keyword for GNU Compiler */
#define __ASM __asm__ /*!< asm keyword for GNU Compiler */
#define __INLINE inline /*!< inline keyword for GNU Compiler */
#define __STATIC_INLINE static inline

Expand Down
2 changes: 1 addition & 1 deletion system/include/cmsis/core_sc000.h
Original file line number Diff line number Diff line change
Expand Up @@ -90,7 +90,7 @@
#define __STATIC_INLINE static __inline

#elif defined ( __GNUC__ )
#define __ASM __asm /*!< asm keyword for GNU Compiler */
#define __ASM __asm__ /*!< asm keyword for GNU Compiler */
#define __INLINE inline /*!< inline keyword for GNU Compiler */
#define __STATIC_INLINE static inline

Expand Down
2 changes: 1 addition & 1 deletion system/include/cmsis/core_sc300.h
Original file line number Diff line number Diff line change
Expand Up @@ -90,7 +90,7 @@
#define __STATIC_INLINE static __inline

#elif defined ( __GNUC__ )
#define __ASM __asm /*!< asm keyword for GNU Compiler */
#define __ASM __asm__ /*!< asm keyword for GNU Compiler */
#define __INLINE inline /*!< inline keyword for GNU Compiler */
#define __STATIC_INLINE static inline

Expand Down

0 comments on commit 21a37f9

Please sign in to comment.