summaryrefslogtreecommitdiffstats
path: root/arch/x86_64/proc/switch.s
blob: 16b2198c01cac80507c4ebefa12bb12ab7189200 (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
.global scheduler_switch
.type scheduler_switch @function

scheduler_switch:
    movq %rsp, (%rdi)
    movq %rsi, %rsp
    retq

.size scheduler_switch, . - scheduler_switch

.global scheduler_savestate
.type scheduler_savestate @function

scheduler_savestate:
    pushq %r15
    pushq %r14
    pushq %r13
    pushq %r12
    pushq %r11
    pushq %r10
    pushq %r9
    pushq %r8
    pushq %rbp
    pushq %rdi
    pushq %rsi
    pushq %rdx
    pushq %rcx
    pushq %rbx
    pushq %rax

.size scheduler_savestate, . - scheduler_savestate

.global scheduler_restorestate
.type scheduler_restorestate @function

scheduler_restorestate:
    popq %rax
    popq %rbx
    popq %rcx
    popq %rdx
    popq %rsi
    popq %rdi
    popq %rbp
    popq %r8
    popq %r9
    popq %r10
    popq %r11
    popq %r12
    popq %r13
    popq %r14
    popq %r15

.size scheduler_restorestate, . - scheduler_restorestate