The ret fromexception Function

The ret_from_exception( ) function is essentially equivalent to the following assembly language code:

ret from exception:

movl 0x30(%esp),%eax movb 0x2C(%esp),%al testl $(0x000200003),%eax jne ret_from_sys_call restore_all: popl %ebx popl %ecx popl %edx popl %esi popl %edi popl %ebp popl %eax popl %ds popl %es addl $4,%esp iret

The values of the cs and eflags registers, which were pushed on the stack when the exception occurred, are used by the function to determine whether the interrupted program was running in User Mode or if the VM flag of eflags was set.[15] In either case, a jump is made to the ret_from_sys_call( ) function. Otherwise, the interrupted kernel control path is to be restarted. The function loads the registers with the values saved by the SAVE_ALL macro when the exception started, and the function yields control to the interrupted program by executing the iret instruction.

Continue reading here: The ret fromintr Function

Was this article helpful?

0 0