summaryrefslogtreecommitdiffstats
path: root/src/occ_gpe1/occ_gpe1_mck_handler.S
blob: 6583bc817fb0ba00d3cf8b6faa99265403a2cee6 (plain)
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
55
56
57
58
59
60
61
62
63
64
.nolist
#include "pk.h"
.list

.section .text, "ax", @progbits
.global __gpe1_machine_check_handler
.global __pk_ctx_pop

__gpe1_machine_check_handler:
#if !defined(__PPE42X__)
    stwu    %r1,    -PK_CTX_SIZE(%r1)
    stw     %r0,    PK_CTX_GPR0(%r1)
    stvd    %d3,    PK_CTX_GPR3(%r1)
    stvd    %d5,    PK_CTX_GPR5(%r1)
    stvd    %d7,    PK_CTX_GPR7(%r1)
    stvd    %d9,    PK_CTX_GPR9(%r1)
    stvd    %d28,   PK_CTX_GPR28(%r1)
    stvd    %d30,   PK_CTX_GPR30(%r1)
    mflr    %r3
    stw     %r3,    PK_CTX_LR(%r1)
    mfcr    %r3
    mfsprg0 %r4
    stvd    %d3,    PK_CTX_CR(%r1)
    mfxer   %r3
    mfctr   %r4
    stvd    %d3,    PK_CTX_XER(%r1)
    mfsrr0  %r3
    mfsrr1  %r4
    stvd    %d3,    PK_CTX_SRR0(%r1)
#else
    stcxtu  %r1,    -PK_CTX_SIZE(%r1)
    mfsrr0  %r3
    mfsrr1  %r4
#endif

    mfedr   %r5

    bl  gpe1_machine_check_handler
    stw %r3,    PK_CTX_SRR0(%r1)

#if !defined(__PPE42X__)
    lwz     %r0,    PK_CTX_GPR0(%r1)
    lvd     %d7,    PK_CTX_SRR0(%r1)
    mtsrr1  %r8
    mtsrr0  %r7
    lvd     %d5,    PK_CTX_XER(%r1)
    mtctr   %r6
    mtxer   %r5
    lvd     %d30,   PK_CTX_GPR30(%r1)
    lvd     %d28,   PK_CTX_GPR28(%r1)
    lvd     %d9,    PK_CTX_GPR9(%r1)
    lvd     %d7,    PK_CTX_GPR7(%r1)
    lvd     %d5,    PK_CTX_GPR5(%r1)
    lvd     %d3,    PK_CTX_CR(%r1)  ## CR,SPRG0
    mtcr0   %r3
    lwz     %r4,    PK_CTX_LR(%r1)
    mtlr    %r4
    lvd     %d3,    PK_CTX_GPR3(%r1)
    addi    %r1,    %r1, PK_CTX_SIZE
#else
    lcxt    %r1,%r1
#endif
    rfi

OpenPOWER on IntegriCloud