Removed DS, ES, FS and GS registers from task switch routines

This commit is contained in:
Jacek Galowicz 2012-04-14 09:18:36 +02:00
parent f4a7d6bd3a
commit 43fc6c94e5
3 changed files with 3 additions and 34 deletions

View file

@ -70,18 +70,6 @@ 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

@ -515,25 +515,16 @@ sw_switch_context:
push DWORD 0
push DWORD 0xc0edbabe
pusha
push ds
push es
push fs
push gs
pushf
pop eax
mov [esp+64], eax
mov [esp+48], eax
mov ecx, [esp+68]
mov ecx, [esp+52]
mov [ecx], esp
mov ecx, [esp+72]
mov ecx, [esp+56]
mov esp, [ecx]
sw_rollback:
pop gs
pop fs
pop es
pop ds
popa
add esp, 8
@ -800,22 +791,13 @@ 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 ds
popa
add esp, 8
iret

View file

@ -157,7 +157,6 @@ int create_default_frame(task_t* task, internal_entry_point_t ep, void* arg)
stptr = stack;
memset(stptr, 0x00, short_state_size*sizeof(uint32_t));
stptr->gs = stptr->fs = stptr->es = stptr->ds = ds;
stptr->esp = stack +short_state_size;
stptr->int_no = 0xB16B00B5;
stptr->error = 0xC03DB4B3;