| .. | .. |
|---|
| 1 | +// SPDX-License-Identifier: GPL-2.0-or-later |
|---|
| 1 | 2 | /* |
|---|
| 2 | 3 | * Userspace test harness for load_unaligned_zeropad. Creates two |
|---|
| 3 | 4 | * pages and uses mprotect to prevent access to the second page and |
|---|
| .. | .. |
|---|
| 8 | 9 | * performed while access to the second page is enabled via mprotect. |
|---|
| 9 | 10 | * |
|---|
| 10 | 11 | * Copyright (C) 2014 Anton Blanchard <anton@au.ibm.com>, IBM |
|---|
| 11 | | - * |
|---|
| 12 | | - * This program is free software; you can redistribute it and/or |
|---|
| 13 | | - * modify it under the terms of the GNU General Public License |
|---|
| 14 | | - * as published by the Free Software Foundation; either version |
|---|
| 15 | | - * 2 of the License, or (at your option) any later version. |
|---|
| 16 | 12 | */ |
|---|
| 17 | 13 | |
|---|
| 18 | 14 | #include <stdlib.h> |
|---|
| .. | .. |
|---|
| 64 | 60 | |
|---|
| 65 | 61 | extern char __start___ex_table[]; |
|---|
| 66 | 62 | extern char __stop___ex_table[]; |
|---|
| 67 | | - |
|---|
| 68 | | -#if defined(__powerpc64__) |
|---|
| 69 | | -#define UCONTEXT_NIA(UC) (UC)->uc_mcontext.gp_regs[PT_NIP] |
|---|
| 70 | | -#elif defined(__powerpc__) |
|---|
| 71 | | -#define UCONTEXT_NIA(UC) (UC)->uc_mcontext.uc_regs->gregs[PT_NIP] |
|---|
| 72 | | -#else |
|---|
| 73 | | -#error implement UCONTEXT_NIA |
|---|
| 74 | | -#endif |
|---|
| 75 | 63 | |
|---|
| 76 | 64 | struct extbl_entry { |
|---|
| 77 | 65 | int insn; |
|---|