Skip to content

Commit 9749b16

Browse files
committed
---
yaml --- r: 6214 b: refs/heads/master c: 2edd313 h: refs/heads/master v: v3
1 parent ef5b097 commit 9749b16

File tree

2 files changed

+11
-32
lines changed

2 files changed

+11
-32
lines changed

[refs]

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,2 +1,2 @@
11
---
2-
refs/heads/master: 1a28ad4fa4c3b2dfa3f57eed9e0115559d4263e7
2+
refs/heads/master: 2edd3135adcf4a3812487df75c503a95fbbc1a38

trunk/src/rt/arch/i386/_context.S

Lines changed: 10 additions & 31 deletions
Original file line numberDiff line numberDiff line change
@@ -20,56 +20,35 @@ The registers_t variable is in (%esp)
2020
swap_registers:
2121
// save the old context
2222
movl 4(%esp), %eax
23-
//movl %eax, 0(%eax)
2423
movl %ebx, 4(%eax)
25-
//movl %ecx, 8(%eax)
26-
//movl %edx, 12(%eax)
2724
movl %ebp, 16(%eax)
2825
movl %esi, 20(%eax)
2926
movl %edi, 24(%eax)
30-
//movl %cs, 32(%eax)
31-
//movl %ds, 34(%eax)
32-
//movl %ss, 36(%eax)
33-
//movl %es, 38(%eax)
34-
//movl %fs, 40(%eax)
35-
//movl %gs, 42(%eax)
3627

37-
// save the flags
38-
pushf
39-
popl %ecx
40-
movl %ecx, 44(%eax)
28+
// save the flags
29+
pushf
30+
popl %ecx
31+
movl %ecx, 44(%eax)
4132

42-
// save the return address as the instruction pointer
33+
// save the return address as the instruction pointer
4334
// and save the stack pointer of the caller
4435
popl %ecx
4536
movl %esp, 28(%eax)
46-
movl %ecx, 48(%eax)
37+
movl %ecx, 48(%eax)
4738

4839
// restore the new context
4940
movl 4(%esp), %eax
5041

5142
movl 4(%eax), %ebx
52-
// save ecx for later...
53-
//movl 12(%eax), %edx
5443
movl 16(%eax), %ebp
5544
movl 20(%eax), %esi
5645
movl 24(%eax), %edi
5746
movl 28(%eax), %esp
58-
// We can't actually change this...
59-
//movl 32(%eax), %cs
60-
//movl 34(%eax), %ds
61-
//movl 36(%eax), %ss
62-
//movl 38(%eax), %es
63-
//movl 40(%eax), %fs
64-
//movl 42(%eax), %gs
65-
66-
// restore the flags
67-
movl 44(%eax), %ecx
68-
push %ecx
69-
popf
7047

71-
// ok, now we can restore ecx
72-
//movl 8(%eax), %ecx
48+
// restore the flags
49+
movl 44(%eax), %ecx
50+
push %ecx
51+
popf
7352

7453
// Return!
7554
jmp *48(%eax)

0 commit comments

Comments
 (0)