summaryrefslogtreecommitdiff
path: root/website-kernel/fs/exec.S
blob: 745761d7a92f6ec09cd2231ea789b42b7f9c6131 (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
.section .text
.global __userspace_invoke
.type __userspace_invoke, @function

# __userspace_invoke(fn exec *entry)
__userspace_invoke:
    csrw mepc, a0
    csrw mie, zero

    csrr t0, mstatus
    li t1, (3 << 11)
    not t1, t1
    and t0, t0, t1

    li t1, (1 << 7)
    not t1, t1
    and t0, t0, t1

    li t1, (1 << 3)
    not t1, t1
    and t0, t0, t1

    csrw mstatus, t0

    mret