Back to home page

OSCL-LXR

 
 

    


0001 /* SPDX-License-Identifier: GPL-2.0-or-later */
0002 /*
0003  * Copyright (C) 2017 Josh Poimboeuf <jpoimboe@redhat.com>
0004  */
0005 #ifndef _ORC_LOOKUP_H
0006 #define _ORC_LOOKUP_H
0007 
0008 /*
0009  * This is a lookup table for speeding up access to the .orc_unwind table.
0010  * Given an input address offset, the corresponding lookup table entry
0011  * specifies a subset of the .orc_unwind table to search.
0012  *
0013  * Each block represents the end of the previous range and the start of the
0014  * next range.  An extra block is added to give the last range an end.
0015  *
0016  * The block size should be a power of 2 to avoid a costly 'div' instruction.
0017  *
0018  * A block size of 256 was chosen because it roughly doubles unwinder
0019  * performance while only adding ~5% to the ORC data footprint.
0020  */
0021 #define LOOKUP_BLOCK_ORDER  8
0022 #define LOOKUP_BLOCK_SIZE   (1 << LOOKUP_BLOCK_ORDER)
0023 
0024 #ifndef LINKER_SCRIPT
0025 
0026 extern unsigned int orc_lookup[];
0027 extern unsigned int orc_lookup_end[];
0028 
0029 #define LOOKUP_START_IP     (unsigned long)_stext
0030 #define LOOKUP_STOP_IP      (unsigned long)_etext
0031 
0032 #endif /* LINKER_SCRIPT */
0033 
0034 #endif /* _ORC_LOOKUP_H */