Nios® II Embedded Design Suite (EDS)
Support for Embedded Development Tools, Processors (SoCs and Nios® II processor), Embedded Development Suites (EDSs), Boot and Configuration, Operating Systems, C and C++
Announcements
Intel Support hours are Monday-Fridays, 8am-5pm PST, except Holidays. Thanks to our community members who provide support during our down time or before we get to your questions. We appreciate you!

Need Forum Guidance? Click here
Search our FPGA Knowledge Articles here.
12367 Discussions

questions for interrupt register function:alt_irq_register

Altera_Forum
Honored Contributor I
1,261 Views

hi everyone: 

the interrupt register function in nios: 

int alt_ic_isr_register (alt_u32 ic_id, 

alt_u32 irq,  

alt_isr_func isr,  

void* isr_context,  

void* flags) 

isr_context is the input argument to isr . isr_context points to a data structure  

associated with the device driver instance. 

 

 

i do not understand what is "isr_context " , so i find some codes from internet: 

some people write base_addr to the void* isr_context; 

some people write NULLto the void* isr_context; 

and nois examples write others. 

 

in my project, i write base_addr, and the interrupt works 

 

what is the meaning of isr_context ?  

is it right to write base_addr to it? 

 

thanks,qd0090.
0 Kudos
1 Reply
Altera_Forum
Honored Contributor I
209 Views

Interrupt function looks something like: 

 

void ISR_Handler (void* isr_context){ *** code here *** }  

 

isr_context is a pointer which gets passed to the interrupt function, you can use it as a data storage.
Reply