1
Fork 0
mirror of https://github.com/RGBCube/serenity synced 2025-05-18 11:05:06 +00:00
serenity/Userland/Libraries/LibC/arch/i386/setjmp.S
Brian Gianforcaro 1682f0b760 Everything: Move to SPDX license identifiers in all files.
SPDX License Identifiers are a more compact / standardized
way of representing file license information.

See: https://spdx.dev/resources/use/#identifiers

This was done with the `ambr` search and replace tool.

 ambr --no-parent-ignore --key-from-file --rep-from-file key.txt rep.txt *
2021-04-22 11:22:27 +02:00

37 lines
670 B
ArmAsm

/*
* Copyright (c) 2018-2020, Andreas Kling <kling@serenityos.org>
*
* SPDX-License-Identifier: BSD-2-Clause
*/
.global setjmp
setjmp:
mov 4(%esp), %eax
mov %ebx, 0(%eax)
mov %esi, 4(%eax)
mov %edi, 8(%eax)
mov %ebp, 12(%eax)
lea 4(%esp), %ecx
mov %ecx, 16(%eax)
mov (%esp), %ecx
mov %ecx, 20(%eax)
xor %eax, %eax
ret
.global longjmp
longjmp:
mov 4(%esp), %edx
mov 8(%esp), %eax
mov 0(%edx), %ebx
mov 4(%edx), %esi
mov 8(%edx), %edi
mov 12(%edx), %ebp
mov 16(%edx), %ecx
mov %ecx, %esp
mov 20(%edx), %ecx
test %eax, %eax
jnz .nonzero
mov 1, %eax
.nonzero:
jmp *%ecx