Loading...
1/* SPDX-License-Identifier: GPL-2.0 */
2#ifndef _ASM_IA64_SECTIONS_H
3#define _ASM_IA64_SECTIONS_H
4
5/*
6 * Copyright (C) 1998-2003 Hewlett-Packard Co
7 * David Mosberger-Tang <davidm@hpl.hp.com>
8 */
9
10#include <linux/elf.h>
11#include <linux/uaccess.h>
12#include <asm-generic/sections.h>
13
14extern char __phys_per_cpu_start[];
15#ifdef CONFIG_SMP
16extern char __cpu0_per_cpu[];
17#endif
18extern char __start___vtop_patchlist[], __end___vtop_patchlist[];
19extern char __start___rse_patchlist[], __end___rse_patchlist[];
20extern char __start___mckinley_e9_bundles[], __end___mckinley_e9_bundles[];
21extern char __start___phys_stack_reg_patchlist[], __end___phys_stack_reg_patchlist[];
22extern char __start_gate_section[];
23extern char __start_gate_mckinley_e9_patchlist[], __end_gate_mckinley_e9_patchlist[];
24extern char __start_gate_vtop_patchlist[], __end_gate_vtop_patchlist[];
25extern char __start_gate_fsyscall_patchlist[], __end_gate_fsyscall_patchlist[];
26extern char __start_gate_brl_fsys_bubble_down_patchlist[], __end_gate_brl_fsys_bubble_down_patchlist[];
27extern char __start_unwind[], __end_unwind[];
28extern char __start_ivt_text[], __end_ivt_text[];
29
30#define HAVE_DEREFERENCE_FUNCTION_DESCRIPTOR 1
31
32#undef dereference_function_descriptor
33static inline void *dereference_function_descriptor(void *ptr)
34{
35 struct fdesc *desc = ptr;
36 void *p;
37
38 if (!get_kernel_nofault(p, (void *)&desc->ip))
39 ptr = p;
40 return ptr;
41}
42
43#undef dereference_kernel_function_descriptor
44static inline void *dereference_kernel_function_descriptor(void *ptr)
45{
46 if (ptr < (void *)__start_opd || ptr >= (void *)__end_opd)
47 return ptr;
48 return dereference_function_descriptor(ptr);
49}
50
51#endif /* _ASM_IA64_SECTIONS_H */
1#ifndef _ASM_IA64_SECTIONS_H
2#define _ASM_IA64_SECTIONS_H
3
4/*
5 * Copyright (C) 1998-2003 Hewlett-Packard Co
6 * David Mosberger-Tang <davidm@hpl.hp.com>
7 */
8
9#include <linux/elf.h>
10#include <linux/uaccess.h>
11#include <asm-generic/sections.h>
12
13extern char __per_cpu_start[], __per_cpu_end[], __phys_per_cpu_start[];
14#ifdef CONFIG_SMP
15extern char __cpu0_per_cpu[];
16#endif
17extern char __start___vtop_patchlist[], __end___vtop_patchlist[];
18extern char __start___rse_patchlist[], __end___rse_patchlist[];
19extern char __start___mckinley_e9_bundles[], __end___mckinley_e9_bundles[];
20extern char __start___phys_stack_reg_patchlist[], __end___phys_stack_reg_patchlist[];
21extern char __start_gate_section[];
22extern char __start_gate_mckinley_e9_patchlist[], __end_gate_mckinley_e9_patchlist[];
23extern char __start_gate_vtop_patchlist[], __end_gate_vtop_patchlist[];
24extern char __start_gate_fsyscall_patchlist[], __end_gate_fsyscall_patchlist[];
25extern char __start_gate_brl_fsys_bubble_down_patchlist[], __end_gate_brl_fsys_bubble_down_patchlist[];
26extern char __start_unwind[], __end_unwind[];
27extern char __start_ivt_text[], __end_ivt_text[];
28
29#undef dereference_function_descriptor
30static inline void *dereference_function_descriptor(void *ptr)
31{
32 struct fdesc *desc = ptr;
33 void *p;
34
35 if (!probe_kernel_address(&desc->ip, p))
36 ptr = p;
37 return ptr;
38}
39
40
41#endif /* _ASM_IA64_SECTIONS_H */
42