Linux 5.7.6
[linux/fpc-iii.git] / arch / x86 / include / asm / orc_lookup.h
blob241631282e43e7a28cf53af8867656d29c81e24d
1 /* SPDX-License-Identifier: GPL-2.0-or-later */
2 /*
3 * Copyright (C) 2017 Josh Poimboeuf <jpoimboe@redhat.com>
4 */
5 #ifndef _ORC_LOOKUP_H
6 #define _ORC_LOOKUP_H
8 /*
9 * This is a lookup table for speeding up access to the .orc_unwind table.
10 * Given an input address offset, the corresponding lookup table entry
11 * specifies a subset of the .orc_unwind table to search.
13 * Each block represents the end of the previous range and the start of the
14 * next range. An extra block is added to give the last range an end.
16 * The block size should be a power of 2 to avoid a costly 'div' instruction.
18 * A block size of 256 was chosen because it roughly doubles unwinder
19 * performance while only adding ~5% to the ORC data footprint.
21 #define LOOKUP_BLOCK_ORDER 8
22 #define LOOKUP_BLOCK_SIZE (1 << LOOKUP_BLOCK_ORDER)
24 #ifndef LINKER_SCRIPT
26 extern unsigned int orc_lookup[];
27 extern unsigned int orc_lookup_end[];
29 #define LOOKUP_START_IP (unsigned long)_stext
30 #define LOOKUP_STOP_IP (unsigned long)_etext
32 #endif /* LINKER_SCRIPT */
34 #endif /* _ORC_LOOKUP_H */