- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Hi Team,
we tried creating a trap class 6 using syscallfunc(TIN) as specified in tasking compiler user guide "ctc_user_guide" (section 1.11.4.3) as shown below. here control is going to trap6 but not getting the TIN number as expected for syscall_a(1,2); and syscall_b(4,3);
#pragma alias syscall_a=trap6
#pragma alias syscall_b=trap6
__syscallfunc(1) int syscall_a( int, int );
__syscallfunc(2) int syscall_b( int, int );
int x;
void main( void )
{
x = syscall_a(1,2); // causes a trap class 6 with TIN = 1
x = syscall_b(4,3); // causes a trap class 6 with TIN = 2
}
int __trap( 6 ) trap6( int a, int b ) // trap class 6 handler
{
int tin;
tin = __get_tin(); // get the TIN
switch( tin )
{
case 1:
a += b;
break;
case 2:
a -= b;
break;
default:
break;
}
return a;
}
please help us in getting the tin number here.
Thanks,
Uma
Solved! Go to Solution.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Hello Uma,
I cannot reproduce the problem. I used the TASKING TriCore tools v6.3r1 and executed the example code on a TC39xB TriBoard hardware. It works fine.
I did face a locate error though which is related to a known issue. To mitigate this I had to disable the default trap 6 handler for all 6 cores of the TC39xB. See attached screenshot.
Best regards,
Ulrich Kloidt
TASKING tools support
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Hello Uma,
I cannot reproduce the problem. I used the TASKING TriCore tools v6.3r1 and executed the example code on a TC39xB TriBoard hardware. It works fine.
I did face a locate error though which is related to a known issue. To mitigate this I had to disable the default trap 6 handler for all 6 cores of the TC39xB. See attached screenshot.
Best regards,
Ulrich Kloidt
TASKING tools support