-
Notifications
You must be signed in to change notification settings - Fork 87
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
add draft to support WebAssembly within the kernel
- Loading branch information
Showing
11 changed files
with
1,076 additions
and
3 deletions.
There are no files selected for viewing
Large diffs are not rendered by default.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,14 @@ | ||
.section .text | ||
.global longjmp | ||
longjmp: | ||
xor eax,eax | ||
cmp esi, 1 /* CF = val ? 0 : 1 */ | ||
adc eax, esi /* eax = val + !val */ | ||
mov rbx, [rdi] | ||
mov rbp, [rdi+8] | ||
mov r12, [rdi+16] | ||
mov r13, [rdi+24] | ||
mov r14, [rdi+32] | ||
mov r15, [rdi+40] | ||
mov rsp, [rdi+48] | ||
jmp [rdi+56] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,15 @@ | ||
.section .text | ||
.global setjmp | ||
setjmp: | ||
mov [rdi], rbx | ||
mov [rdi+8], rbp | ||
mov [rdi+16], r12 | ||
mov [rdi+24], r13 | ||
mov [rdi+32], r14 | ||
mov [rdi+40], r15 | ||
lea rdx, [rsp+8] # rsp without current ret addr | ||
mov [rdi+48], rdx | ||
mov rdi, rsp # save return addr ptr for new rip | ||
mov [rdi+56], rdx | ||
xor rax, rax | ||
ret |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.