From mboxrd@z Thu Jan 1 00:00:00 1970 From: Nick Garnett To: ecos-discuss@sourceware.cygnus.com Subject: Re: [ECOS] nested interrupts Date: Thu, 18 Jan 2001 05:46:00 -0000 Message-id: References: <003b01c0811f$196395e0$6f2314ac@realtek.com.tw> <002f01c0814d$d618fa80$6f2314ac@realtek.com.tw> X-SW-Source: 2001-01/msg00309.html "Xavier Wang" writes: > Thanks, Jesper. > > One more question. By looking into the source code, I still can't > figure out that why DSRs can call most kernel functions but > ISRs can't. Is it the stack problem or scheduler locking problem > or something else? The kernel does not block interrupts during critical sections, so an ISR can occur at any point, even while the scheduler is manipulating the run queues. If the ISR then tries to manipulate the same data structures, by calling a kernel function, then they will be corrupted. Hence the use of DSRs to defer these calls until the data structures are in a consistent state. -- Nick Garnett, eCos Kernel Architect Red Hat, Cambridge, UK