| // SPDX-License-Identifier: GPL-2.0+ |
| * Copyright (c) 2018 Heinrich Schuchardt <xypron.glpk@gmx.de> |
| * Test unaligned memory access on ARMv7. |
| #include <efi_selftest.h> |
| * Return an u32 at a given address. |
| * If the address is not four byte aligned, an unaligned memory access |
| * Return: value at the address |
| static inline u32 deref(void *addr) |
| "ldr %[out], [%[in]]\n\t" |
| * An unaligned memory access is executed. The result is checked. |
| * Return: EFI_ST_SUCCESS for success |
| struct aligned_buffer buf = { |
| {0, 1, 2, 3, 4, 5, 6, 7}, |
| /* Read an unaligned address */ |
| /* UEFI only supports low endian systems */ |
| efi_st_error("Unaligned access failed"); |
| EFI_UNIT_TEST(unaligned) = { |
| .name = "unaligned memory access", |
| .phase = EFI_EXECUTE_BEFORE_BOOTTIME_EXIT, |