Skip to content

Commit

Permalink
Ring3: Defined CallInstallMultipleProtocolInterfaces() for AARCH64.
Browse files Browse the repository at this point in the history
  • Loading branch information
Mikhail Krichanov committed May 24, 2024
1 parent 737945d commit cb9534c
Showing 1 changed file with 34 additions and 1 deletion.
35 changes: 34 additions & 1 deletion MdeModulePkg/Core/Dxe/SysCall/AARCH64/CoreBootServices.S
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,39 @@
// );
//------------------------------------------------------------------------------
ASM_FUNC(CallInstallMultipleProtocolInterfaces)
stp x29, x30, [sp, #-0x10]!
mov x29, sp
// Save funtion input.
mov x9, x1
mov x10, x2
mov x11, x3
// Prepare registers for call.
ldp x1, x2, [x9]
ldp x3, x4, [x9, #0x10]
ldp x5, x6, [x9, #0x20]
ldr x7, [x9, #0x30]
// Prepare stack for call.
cmp x10, #7
b.le call
add x9, x9, x10, LSL #3
sub x10, x10, #7
tst x10, #1
b.eq copy
// To align stack on 16 bytes.
add x9, x9, #0x8
add x10, x10, #1
copy:
ldp x12, x13, [x9, #-0x10]!
stp x12, x13, [sp, #-0x10]!
subs x10, x10, #2
b.ne copy

call:
blr x11

mov sp, x29
ldp x29, x30, [sp]
add sp, sp, #0x10
ret

//------------------------------------------------------------------------------
Expand All @@ -35,7 +68,7 @@ ASM_FUNC(CallInstallMultipleProtocolInterfaces)
//------------------------------------------------------------------------------
ASM_FUNC(ArmCallRing3)
// Save FP and LR on Core Stack.
stp x29, x30, [sp, #-0x10]!
stp x29, x30, [sp, #-0x10]!
// Disable interrupts
msr daifset, #0xf
isb
Expand Down

0 comments on commit cb9534c

Please sign in to comment.