Deffered callback manager

cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 

Deffered callback manager

2,245 Views
tsybezoff
Contributor II

Hi to all
I develop Deffered callback manager at P1010. DCM is designed to handle low priority task queues. Deffered callback manager is started by asynchronous low-priority interrupt (PRIORITY_1 = 0x10000), but asynchronous high-priority interrupts are not processed, for example INT_UART (PRIORITY_4 = 0x40000), INT_TSEC (PRIORITY_3 = 0x30000) and INT_TIMERS (PRIORITY_2 = 0x20000).
So how to preempt a job DCM to begin processing the high-priority asynchronous interrupts???
Is it possible to preempt the current task execution with a higher priority event at P1010???

0 Kudos
6 Replies

2,026 Views
alexander_yakov
NXP Employee
NXP Employee

Please look P1010 Reference Manual, Figure 9-1. All interrupt sources are signaled to the core through the same "int" input. That is, from the core point of view, all interrupts have the same entry point, and every "int" assertion jumps to this point. Then this interrupt handler is called, the core have to do something with external "int" request to clear it, so it may be asserted again to call interrupt handler again for higher-priority interrupt. To clear "int" request, the core should read IACK. Reading IACK returns interrupt vector to process, and also clears external "int" request to the core, to the interrupt controller can assert it once again, if higher-priority interrupt is pending. In addition to clear "int", you should also enable back "int" recognition by the core. When the "int" is asserted and core takes interrupt, it clears MSR[EE], so further assertion of "int" is ignored. This is done to prevent re-entrance to the same interrupt handler and loosing context, because subsequent interrupt may overwrite state registers. After the state of all required state registers is saved, and processor state becomes safe for re-entering the same interrupt handled, you can enable back "int" recognition by the core by setting MSR[EE].   


Have a great day,
Alexander,
TIC

-------------------------------------------------------------------------------
Note:
- If this post answers your question, please click the "Mark Correct" button. Thank you!

- We are following threads for 7 weeks after the last post, later replies are ignored
Please open a new thread and refer to the closed one, if you have a related question at a later point in time.
-------------------------------------------------------------------------------

2,026 Views
tsybezoff
Contributor II

Thanx, sasha!!!
Can i use system_call() to handle my derred callback manager???

0 Kudos

2,026 Views
alexander_yakov
NXP Employee
NXP Employee

If my understanding is correct, system_call()  is more specific to Linux than to P1010 hardware, so I recommend referring to Linux-related documentation for system_call() -related questions.

2,026 Views
tsybezoff
Contributor II

I see, Alex.
How can i set task priority in interrupt handler? should i use pic->cptr0? 
I see that syscall is executed when asynch higher priority interrupt is being handled((((
Does syscall priority greater each other asynch interrupt priorities?

0 Kudos

2,026 Views
alexander_yakov
NXP Employee
NXP Employee

I'm sorry, these your questions are more specific to Linux than to P1010 hardware, so I recommend referring to Linux-related documentation for these questions.

0 Kudos

2,026 Views
tsybezoff
Contributor II

Alex, help me with decrementer interrupt!!! I don't know how its set. I couldn't set TCR & TSR registers. Do you have an example to setup DEC, TCR & TSR registers?

My code

//read from TSR

mfspr r3,336

//set TSR[DIS] = 1
ori r3, r3, 0x8000

//write to TSR
mtspr 336,r3

//read from TCR
mfspr r3,340

//set TCR[DIE] = 1 and TCR[ARE] = 1
ori r3, r3, 0x4400

//write to TCR
mtspr 340,r3

//write to DEC value = 1
mtspr 22,1

0 Kudos