Announcements

Help us improve the Power & Sensing Selection Guide. Share feedback

Tip / Sign in to post questions, reply, level up, and achieve exciting badges. Know more

cross mob
User17897
Level 2
Level 2
hello, aurix experts:
I have a problem about __syscall(0) during integrating freeRTOS
I found the definition in toolchains, as following:

#define __syscall(service) __tric_syscall (service)
#define __SYSCALL(service) __tric_syscall (service)

#define __tric_syscall(service) \
__asm__ volatile ("syscall "__STRINGIFY (service) ::: "memory")

static __inline__ __attribute__((__always_inline__))
void _syscall (const unsigned __service)
{
__asm__ volatile ("syscall %0" :: "i" (__service) : "memory");
}

In freeRTOS,the "portYIELD" is defined as __syscall(0)
how to understand the current task yeild cpu after "__syscall(0)"?
I found the instruction of "syscall" just raised a trap, so, I think the "0" is an ID of trap
but, I didn't find the definition about traps' id in Aurix document.
Is there any one would tell me how to understand "the current task yeild cpu after __syscall(0)"?
my mcu is tc297b

thank you very much
0 Likes
2 Replies
NeMa_4793301
Level 6
Level 6
10 likes received 10 solutions authored 5 solutions authored
Hi icework. The CPU details are covered in the TriCore Architecture Manual Volume 1:
https://www.infineon.com/dgdl/Infineon-TC2xx_Architecture_vol1-UM-v01_00-EN.pdf?fileId=5546d46269bda...

See 6.3.7 System Call on page 107. In your trap handler for Trap Class 6, register D15 holds the 8-bit argument from the SYSCALL instruction.
0 Likes
User17897
Level 2
Level 2
thank you very much
0 Likes