Ouss4 commented on a change in pull request #5336:
URL: https://github.com/apache/incubator-nuttx/pull/5336#discussion_r810018617
##########
File path: arch/xtensa/include/syscall.h
##########
@@ -41,6 +65,204 @@
* Inline functions
****************************************************************************/
+#ifndef __ASSEMBLY__
+
+/* Software interrupt with SYS_ call number and no parameters */
+
+static inline uintptr_t sys_call0(unsigned int nbr)
+{
+ register long reg0 __asm__("a2") = (long)(nbr);
+
+ __asm__ __volatile__
+ (
+ "movi a3, %1\n"
+ "wsr a3, intset\n"
+ "isync\n"
+ "dsync\n"
+ "esync\n"
+ "memw\n"
+ : "=r"(reg0)
+ : "i"(XCHAL_SWINT_CALL), "r"(reg0)
+ : "a3", "memory"
+ );
+
+ return reg0;
+}
+
+/* Software interrupt with SYS_ call number and one parameter */
+
+static inline uintptr_t sys_call1(unsigned int nbr, uintptr_t parm1)
+{
+ register long reg0 __asm__("a2") = (long)(nbr);
+ register long reg1 __asm__("a3") = (long)(parm1);
+
+ __asm__ __volatile__
+ (
+ "movi a4, %1\n"
+ "wsr a4, intset\n"
+ "isync\n"
+ "dsync\n"
+ "esync\n"
Review comment:
Are `dsync` and `esync` necessary here? I think only `isync` suffice
since `dsync` and `esync` are performed as part of `isync`.
Also, the TRM mentions that `rsync` is enough here.
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]