~ [ source navigation ] ~ [ diff markup ] ~ [ identifier search ] ~

TOMOYO Linux Cross Reference
Linux/arch/ia64/kernel/unwind.c

Version: ~ [ linux-5.0-rc6 ] ~ [ linux-4.20.10 ] ~ [ linux-4.19.23 ] ~ [ linux-4.18.20 ] ~ [ linux-4.17.19 ] ~ [ linux-4.16.18 ] ~ [ linux-4.15.18 ] ~ [ linux-4.14.101 ] ~ [ linux-4.13.16 ] ~ [ linux-4.12.14 ] ~ [ linux-4.11.12 ] ~ [ linux-4.10.17 ] ~ [ linux-4.9.158 ] ~ [ linux-4.8.17 ] ~ [ linux-4.7.10 ] ~ [ linux-4.6.7 ] ~ [ linux-4.5.7 ] ~ [ linux-4.4.174 ] ~ [ linux-4.3.6 ] ~ [ linux-4.2.8 ] ~ [ linux-4.1.52 ] ~ [ linux-4.0.9 ] ~ [ linux-3.19.8 ] ~ [ linux-3.18.134 ] ~ [ linux-3.17.8 ] ~ [ linux-3.16.63 ] ~ [ linux-3.15.10 ] ~ [ linux-3.14.79 ] ~ [ linux-3.13.11 ] ~ [ linux-3.12.74 ] ~ [ linux-3.11.10 ] ~ [ linux-3.10.108 ] ~ [ linux-3.9.11 ] ~ [ linux-3.8.13 ] ~ [ linux-3.7.10 ] ~ [ linux-3.6.11 ] ~ [ linux-3.5.7 ] ~ [ linux-3.4.113 ] ~ [ linux-3.3.8 ] ~ [ linux-3.2.102 ] ~ [ linux-3.1.10 ] ~ [ linux-3.0.101 ] ~ [ linux-2.6.39.4 ] ~ [ linux-2.6.38.8 ] ~ [ linux-2.6.37.6 ] ~ [ linux-2.6.36.4 ] ~ [ linux-2.6.35.14 ] ~ [ linux-2.6.34.15 ] ~ [ linux-2.6.33.20 ] ~ [ linux-2.6.32.71 ] ~ [ linux-2.6.0 ] ~ [ linux-2.4.37.11 ] ~ [ unix-v6-master ] ~ [ ccs-tools-1.8.5 ] ~ [ policy-sample ] ~
Architecture: ~ [ i386 ] ~ [ alpha ] ~ [ m68k ] ~ [ mips ] ~ [ ppc ] ~ [ sparc ] ~ [ sparc64 ] ~

  1 // SPDX-License-Identifier: GPL-2.0
  2 /*
  3  * Copyright (C) 1999-2004 Hewlett-Packard Co
  4  *      David Mosberger-Tang <davidm@hpl.hp.com>
  5  * Copyright (C) 2003 Fenghua Yu <fenghua.yu@intel.com>
  6  *      - Change pt_regs_off() to make it less dependent on pt_regs structure.
  7  */
  8 /*
  9  * This file implements call frame unwind support for the Linux
 10  * kernel.  Parsing and processing the unwind information is
 11  * time-consuming, so this implementation translates the unwind
 12  * descriptors into unwind scripts.  These scripts are very simple
 13  * (basically a sequence of assignments) and efficient to execute.
 14  * They are cached for later re-use.  Each script is specific for a
 15  * given instruction pointer address and the set of predicate values
 16  * that the script depends on (most unwind descriptors are
 17  * unconditional and scripts often do not depend on predicates at
 18  * all).  This code is based on the unwind conventions described in
 19  * the "IA-64 Software Conventions and Runtime Architecture" manual.
 20  *
 21  * SMP conventions:
 22  *      o updates to the global unwind data (in structure "unw") are serialized
 23  *        by the unw.lock spinlock
 24  *      o each unwind script has its own read-write lock; a thread must acquire
 25  *        a read lock before executing a script and must acquire a write lock
 26  *        before modifying a script
 27  *      o if both the unw.lock spinlock and a script's read-write lock must be
 28  *        acquired, then the read-write lock must be acquired first.
 29  */
 30 #include <linux/module.h>
 31 #include <linux/memblock.h>
 32 #include <linux/elf.h>
 33 #include <linux/kernel.h>
 34 #include <linux/sched.h>
 35 #include <linux/slab.h>
 36 
 37 #include <asm/unwind.h>
 38 
 39 #include <asm/delay.h>
 40 #include <asm/page.h>
 41 #include <asm/ptrace.h>
 42 #include <asm/ptrace_offsets.h>
 43 #include <asm/rse.h>
 44 #include <asm/sections.h>
 45 #include <linux/uaccess.h>
 46 
 47 #include "entry.h"
 48 #include "unwind_i.h"
 49 
 50 #define UNW_LOG_CACHE_SIZE      7       /* each unw_script is ~256 bytes in size */
 51 #define UNW_CACHE_SIZE          (1 << UNW_LOG_CACHE_SIZE)
 52 
 53 #define UNW_LOG_HASH_SIZE       (UNW_LOG_CACHE_SIZE + 1)
 54 #define UNW_HASH_SIZE           (1 << UNW_LOG_HASH_SIZE)
 55 
 56 #define UNW_STATS       0       /* WARNING: this disabled interrupts for long time-spans!! */
 57 
 58 #ifdef UNW_DEBUG
 59   static unsigned int unw_debug_level = UNW_DEBUG;
 60 #  define UNW_DEBUG_ON(n)       unw_debug_level >= n
 61    /* Do not code a printk level, not all debug lines end in newline */
 62 #  define UNW_DPRINT(n, ...)  if (UNW_DEBUG_ON(n)) printk(__VA_ARGS__)
 63 #  undef inline
 64 #  define inline
 65 #else /* !UNW_DEBUG */
 66 #  define UNW_DEBUG_ON(n)  0
 67 #  define UNW_DPRINT(n, ...)