﻿id	summary	reporter	owner	description	type	status	priority	milestone	component	version	resolution	keywords	cc	field_blocks	field_dependson	field_seealso
100	Exceptions should not be handled in a dedicated CPU mode	Jakub Jermář	Vineeth Pillai	"So far, IRQs have ben handled in the ""undefined"" processor mode, while the syscalls and kernel threads execute in the ""supervisor"" mode. This looks like a design inconsistency, because e.g. the timer interrupt can result in a scheduler call, proliferating thus the ""undefined"" CPU mode to unrelated parts of the kernel. Moreover, nested interrupts have very interesting interactions which resulted in (not very correct) workarounds such as that of revision 4652.

What should be done instead is to have some sort of ""preemptible"" trap handler for all kinds of exceptions. The goal of this preemptible trap handler is to save the necessary state to the memory stack and switch to the CPU mode, which is used for running normal kernel code. Then the respective C handler would be called and after it returns, the interrupted state would be restored.

The normal kernel CPU mode can be either the ""system"" mode or the ""supervisor"" mode."	defect	closed	major	0.4.1	helenos/kernel/arm32	mainline	fixed	arm				
