mirror of
https://github.com/apache/nuttx.git
synced 2025-12-14 07:25:51 +08:00
arch/arm/src/include/xxx/syscall.h: Align semi-hosting call style with other syscalls
This commit is contained in:
@@ -56,6 +56,12 @@
|
|||||||
|
|
||||||
#define SYS_syscall 0x900001
|
#define SYS_syscall 0x900001
|
||||||
|
|
||||||
|
#if defined(__thumb__) || defined(__thumb2__)
|
||||||
|
# define SYS_smhcall 0xab
|
||||||
|
#else
|
||||||
|
# define SYS_smhcall 0x123456
|
||||||
|
#endif
|
||||||
|
|
||||||
/****************************************************************************
|
/****************************************************************************
|
||||||
* Public Types
|
* Public Types
|
||||||
****************************************************************************/
|
****************************************************************************/
|
||||||
@@ -226,16 +232,12 @@ static inline long smh_call(unsigned int nbr, void *parm)
|
|||||||
register long reg1 __asm__("r1") = (long)(parm);
|
register long reg1 __asm__("r1") = (long)(parm);
|
||||||
|
|
||||||
__asm__ __volatile__
|
__asm__ __volatile__
|
||||||
(
|
(
|
||||||
#if defined(__thumb__) || defined(__thumb2__)
|
"svc %1"
|
||||||
"svc #0xab"
|
|
||||||
#else
|
|
||||||
"svc #0x123456"
|
|
||||||
#endif
|
|
||||||
: "=r"(reg0)
|
: "=r"(reg0)
|
||||||
: "r"(reg0), "r"(reg1)
|
: "i"(SYS_smhcall), "r"(reg0), "r"(reg1)
|
||||||
: "memory"
|
: "memory", "r14"
|
||||||
);
|
);
|
||||||
|
|
||||||
return reg0;
|
return reg0;
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -59,6 +59,7 @@
|
|||||||
*/
|
*/
|
||||||
|
|
||||||
#define SYS_syscall 0x00
|
#define SYS_syscall 0x00
|
||||||
|
#define SYS_smhcall 0xab
|
||||||
|
|
||||||
/* The SYS_signal_handler_return is executed here... its value is not always
|
/* The SYS_signal_handler_return is executed here... its value is not always
|
||||||
* available in this context and so is assumed to be 7.
|
* available in this context and so is assumed to be 7.
|
||||||
@@ -250,9 +251,9 @@ static inline long smh_call(unsigned int nbr, void *parm)
|
|||||||
|
|
||||||
__asm__ __volatile__
|
__asm__ __volatile__
|
||||||
(
|
(
|
||||||
"bkpt #0xab"
|
"bkpt %1"
|
||||||
: "=r"(reg0)
|
: "=r"(reg0)
|
||||||
: "r"(reg0), "r"(reg1)
|
: "i"(SYS_smhcall), "r"(reg0), "r"(reg1)
|
||||||
: "memory"
|
: "memory"
|
||||||
);
|
);
|
||||||
|
|
||||||
|
|||||||
@@ -56,6 +56,12 @@
|
|||||||
|
|
||||||
#define SYS_syscall 0x900001
|
#define SYS_syscall 0x900001
|
||||||
|
|
||||||
|
#if defined(__thumb__) || defined(__thumb2__)
|
||||||
|
# define SYS_smhcall 0xab
|
||||||
|
#else
|
||||||
|
# define SYS_smhcall 0x123456
|
||||||
|
#endif
|
||||||
|
|
||||||
/****************************************************************************
|
/****************************************************************************
|
||||||
* Public Types
|
* Public Types
|
||||||
****************************************************************************/
|
****************************************************************************/
|
||||||
@@ -227,14 +233,10 @@ static inline long smh_call(unsigned int nbr, void *parm)
|
|||||||
|
|
||||||
__asm__ __volatile__
|
__asm__ __volatile__
|
||||||
(
|
(
|
||||||
#if defined(__thumb__) || defined(__thumb2__)
|
"svc %1"
|
||||||
"svc #0xab"
|
|
||||||
#else
|
|
||||||
"svc #0x123456"
|
|
||||||
#endif
|
|
||||||
: "=r"(reg0)
|
: "=r"(reg0)
|
||||||
: "r"(reg0), "r"(reg1)
|
: "i"(SYS_smhcall), "r"(reg0), "r"(reg1)
|
||||||
: "memory"
|
: "memory", "r14"
|
||||||
);
|
);
|
||||||
|
|
||||||
return reg0;
|
return reg0;
|
||||||
|
|||||||
@@ -59,6 +59,7 @@
|
|||||||
*/
|
*/
|
||||||
|
|
||||||
#define SYS_syscall 0x00
|
#define SYS_syscall 0x00
|
||||||
|
#define SYS_smhcall 0xab
|
||||||
|
|
||||||
/* The SYS_signal_handler_return is executed here... its value is not always
|
/* The SYS_signal_handler_return is executed here... its value is not always
|
||||||
* available in this context and so is assumed to be 7.
|
* available in this context and so is assumed to be 7.
|
||||||
@@ -250,9 +251,9 @@ static inline long smh_call(unsigned int nbr, void *parm)
|
|||||||
|
|
||||||
__asm__ __volatile__
|
__asm__ __volatile__
|
||||||
(
|
(
|
||||||
"bkpt #0xab"
|
"bkpt %1"
|
||||||
: "=r"(reg0)
|
: "=r"(reg0)
|
||||||
: "r"(reg0), "r"(reg1)
|
: "i"(SYS_smhcall), "r"(reg0), "r"(reg1)
|
||||||
: "memory"
|
: "memory"
|
||||||
);
|
);
|
||||||
|
|
||||||
|
|||||||
@@ -56,6 +56,12 @@
|
|||||||
|
|
||||||
#define SYS_syscall 0x900001
|
#define SYS_syscall 0x900001
|
||||||
|
|
||||||
|
#if defined(__thumb__) || defined(__thumb2__)
|
||||||
|
# define SYS_smhcall 0xab
|
||||||
|
#else
|
||||||
|
# define SYS_smhcall 0x123456
|
||||||
|
#endif
|
||||||
|
|
||||||
/****************************************************************************
|
/****************************************************************************
|
||||||
* Public Types
|
* Public Types
|
||||||
****************************************************************************/
|
****************************************************************************/
|
||||||
@@ -227,14 +233,10 @@ static inline long smh_call(unsigned int nbr, void *parm)
|
|||||||
|
|
||||||
__asm__ __volatile__
|
__asm__ __volatile__
|
||||||
(
|
(
|
||||||
#if defined(__thumb__) || defined(__thumb2__)
|
"svc %1"
|
||||||
"svc #0xab"
|
|
||||||
#else
|
|
||||||
"svc #0x123456"
|
|
||||||
#endif
|
|
||||||
: "=r"(reg0)
|
: "=r"(reg0)
|
||||||
: "r"(reg0), "r"(reg1)
|
: "i"(SYS_smhcall), "r"(reg0), "r"(reg1)
|
||||||
: "memory"
|
: "memory", "r14"
|
||||||
);
|
);
|
||||||
|
|
||||||
return reg0;
|
return reg0;
|
||||||
|
|||||||
Reference in New Issue
Block a user