Made the interrupt entry also safe the registers DS to GS.

This may be removed in the future for speed purposes.
This commit is contained in:
Jacek Galowicz 2012-04-11 08:41:58 +02:00
parent f4950981b2
commit 49533df72e
2 changed files with 21 additions and 0 deletions

View file

@ -70,6 +70,18 @@ typedef unsigned int wint_t;
* All the interrupt handler routines use this type for their only parameter.
*/
struct state {
/// GS register
unsigned short gs;
unsigned short __gs;
/// FS register
unsigned short fs;
unsigned short __fs;
/// ES register
unsigned short es;
unsigned short __es;
/// ds register
unsigned short ds;
unsigned short __ds;
/// EDI register
unsigned int edi;
/// ESI register

View file

@ -767,13 +767,22 @@ extern irq_handler
common_stub:
pusha
push ds
push es
push fs
push gs
; use the same handler for interrupts and exceptions
push esp
call irq_handler
add esp, 4
pop gs
pop fs
pop es
pop gs
popa
add esp, 8
iret