Skip to content

Commit

Permalink
aarch64: Use 32-bit sized register names
Browse files Browse the repository at this point in the history
The fault assembly code manipulates an integer sized argument and so
32-bit register names need to be used in order to avoid compiler
warnings.

Signed-off-by: Kent McLeod <[email protected]>
  • Loading branch information
kent-mcleod committed May 9, 2023
1 parent e6f4f52 commit c9d077c
Showing 1 changed file with 8 additions and 8 deletions.
16 changes: 8 additions & 8 deletions apps/sel4test-tests/src/tests/faults.c
Original file line number Diff line number Diff line change
Expand Up @@ -86,11 +86,11 @@ do_read_fault(void)
);
#elif defined(CONFIG_ARCH_AARCH64)
asm volatile(
"mov x0, %[val]\n\t"
"mov w0, %w[val]\n\t"
"read_fault_address:\n\t"
"ldr x0, [%[addrreg]]\n\t"
"read_fault_restart_address:\n\t"
"mov %[val], x0\n\t"
"mov %w[val], w0\n\t"
: [val] "+r"(val)
: [addrreg] "r"(x)
: "x0"
Expand Down Expand Up @@ -144,11 +144,11 @@ do_write_fault(void)
);
#elif defined(CONFIG_ARCH_AARCH64)
asm volatile(
"mov x0, %[val]\n\t"
"mov w0, %w[val]\n\t"
"write_fault_address:\n\t"
"str x0, [%[addrreg]]\n\t"
"write_fault_restart_address:\n\t"
"mov %[val], x0\n\t"
"mov %w[val], w0\n\t"
: [val] "+r"(val)
: [addrreg] "r"(x)
: "x0"
Expand Down Expand Up @@ -200,10 +200,10 @@ do_instruction_fault(void)
);
#elif defined(CONFIG_ARCH_AARCH64)
asm volatile(
"mov x0, %[val]\n\t"
"mov w0, %w[val]\n\t"
"blr %[addrreg]\n\t"
"instruction_fault_restart_address:\n\t"
"mov %[val], x0\n\t"
"mov %w[val], w0\n\t"
: [val] "+r"(val)
: [addrreg] "r"(x)
: "x0", "x30"
Expand Down Expand Up @@ -259,11 +259,11 @@ do_bad_syscall(void)
#elif defined(CONFIG_ARCH_AARCH64)
asm volatile(
"mov x7, %[scno]\n\t"
"mov x0, %[val]\n\t"
"mov w0, %w[val]\n\t"
"bad_syscall_address:\n\t"
"svc %[scno]\n\t"
"bad_syscall_restart_address:\n\t"
"mov %[val], x0\n\t"
"mov %w[val], w0\n\t"
: [val] "+r"(val)
: [addrreg] "r"(x),
[scno] "i"(BAD_SYSCALL_NUMBER)
Expand Down

0 comments on commit c9d077c

Please sign in to comment.