From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 14541 invoked by alias); 31 Jul 2014 20:22:57 -0000 Mailing-List: contact systemtap-help@sourceware.org; run by ezmlm Precedence: bulk List-Id: List-Subscribe: List-Post: List-Help: , Sender: systemtap-owner@sourceware.org Received: (qmail 14476 invoked by uid 89); 31 Jul 2014 20:22:57 -0000 Authentication-Results: sourceware.org; auth=none X-Spam-SWARE-Status: No, score=-2.3 required=5.0 tests=AWL,BAYES_00,FREEMAIL_FROM,RCVD_IN_DNSWL_LOW,SPF_PASS autolearn=ham version=3.3.2 X-HELO: mail-wi0-f178.google.com Received: from mail-wi0-f178.google.com (HELO mail-wi0-f178.google.com) (209.85.212.178) by sourceware.org (qpsmtpd/0.93/v0.84-503-g423c35a) with (AES128-SHA encrypted) ESMTPS; Thu, 31 Jul 2014 20:22:54 +0000 Received: by mail-wi0-f178.google.com with SMTP id hi2so236605wib.5 for ; Thu, 31 Jul 2014 13:22:51 -0700 (PDT) X-Received: by 10.180.37.70 with SMTP id w6mr1053821wij.49.1406838171185; Thu, 31 Jul 2014 13:22:51 -0700 (PDT) Received: from ixro-lcrestez-lin.ixiacom.com ([109.100.41.154]) by mx.google.com with ESMTPSA id lk7sm15678895wjb.24.2014.07.31.13.22.49 for (version=TLSv1.2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Thu, 31 Jul 2014 13:22:50 -0700 (PDT) From: Crestez Dan Leonard To: systemtap@sourceware.org Subject: [RFC 11/13] mips64: Initial unwind support Date: Thu, 31 Jul 2014 20:22:00 -0000 Message-Id: In-Reply-To: References: In-Reply-To: References: MIME-Version: 1.0 Content-Type: multipart/mixed; boundary="------------true" X-IsSubscribed: yes X-SW-Source: 2014-q3/txt/msg00109.txt.bz2 From: Crestez Dan Leonard This is a multi-part message in MIME format. --------------true Content-Type: text/plain; charset=UTF-8; format=fixed Content-Transfer-Encoding: 8bit Content-length: 302 Signed-off-by: Crestez Dan Leonard --- runtime/linux/runtime.h | 2 +- runtime/unwind/mips64.h | 80 +++++++++++++++++++++++++++++++++++++++++++++++++ runtime/unwind/unwind.h | 2 ++ 3 files changed, 83 insertions(+), 1 deletion(-) create mode 100644 runtime/unwind/mips64.h --------------true Content-Type: text/x-patch; name="0011-mips64-Initial-unwind-support.patch" Content-Transfer-Encoding: 8bit Content-Disposition: attachment; filename="0011-mips64-Initial-unwind-support.patch" Content-length: 3336 diff --git a/runtime/linux/runtime.h b/runtime/linux/runtime.h index 66710fc..bd45a80 100644 --- a/runtime/linux/runtime.h +++ b/runtime/linux/runtime.h @@ -157,7 +157,7 @@ static struct Only define STP_USE_DWARF_UNWINDER when STP_NEED_UNWIND_DATA, as set through a pragma:unwind in one of the [u]context-unwind.stp functions. */ -#if (defined(__arm__) || defined(__i386__) || defined(__x86_64__) || defined(__powerpc64__)) || defined (__s390x__) +#if (defined(__arm__) || defined(__i386__) || defined(__x86_64__) || defined(__powerpc64__)) || defined (__s390x__) || defined(__mips64) #ifdef STP_NEED_UNWIND_DATA #ifndef STP_USE_DWARF_UNWINDER #define STP_USE_DWARF_UNWINDER diff --git a/runtime/unwind/mips64.h b/runtime/unwind/mips64.h new file mode 100644 index 0000000..562d12b --- /dev/null +++ b/runtime/unwind/mips64.h @@ -0,0 +1,80 @@ +/* -*- linux-c -*- + * + * mips64 dwarf unwinder header file + * + * This file is part of systemtap, and is free software. You can + * redistribute it and/or modify it under the terms of the GNU General + * Public License (GPL); either version 2, or (at your option) any + * later version. + */ +#ifndef _STP_MIPS64_UNWIND_H +#define _STP_MIPS64_UNWIND_H + +#include +#include + +#define _stp_get_unaligned(ptr) (*(ptr)) + +#define UNW_PC(frame) (frame)->regs.cp0_epc +#define UNW_SP(frame) (frame)->regs.regs[29] + +#define STACK_LIMIT(ptr) (((ptr) - 1) & ~(THREAD_SIZE - 1)) + +#define UNW_REGISTER_INFO \ + PTREGS_INFO(regs[0]), \ + PTREGS_INFO(regs[1]), \ + PTREGS_INFO(regs[2]), \ + PTREGS_INFO(regs[3]), \ + PTREGS_INFO(regs[4]), \ + PTREGS_INFO(regs[5]), \ + PTREGS_INFO(regs[6]), \ + PTREGS_INFO(regs[7]), \ + PTREGS_INFO(regs[8]), \ + PTREGS_INFO(regs[9]), \ + PTREGS_INFO(regs[10]), \ + PTREGS_INFO(regs[11]), \ + PTREGS_INFO(regs[12]), \ + PTREGS_INFO(regs[13]), \ + PTREGS_INFO(regs[14]), \ + PTREGS_INFO(regs[15]), \ + PTREGS_INFO(regs[16]), \ + PTREGS_INFO(regs[17]), \ + PTREGS_INFO(regs[18]), \ + PTREGS_INFO(regs[19]), \ + PTREGS_INFO(regs[20]), \ + PTREGS_INFO(regs[21]), \ + PTREGS_INFO(regs[22]), \ + PTREGS_INFO(regs[23]), \ + PTREGS_INFO(regs[24]), \ + PTREGS_INFO(regs[25]), \ + PTREGS_INFO(regs[26]), \ + PTREGS_INFO(regs[27]), \ + PTREGS_INFO(regs[28]), \ + PTREGS_INFO(regs[29]), \ + PTREGS_INFO(regs[30]), \ + PTREGS_INFO(regs[31]), \ + PTREGS_INFO(cp0_status), \ + PTREGS_INFO(hi), \ + PTREGS_INFO(lo), \ + PTREGS_INFO(cp0_epc) + +#define UNW_PC_IDX 35 +#define UNW_SP_IDX 29 + +#define UNW_NR_REAL_REGS 36 + +static inline void arch_unw_init_frame_info(struct unwind_frame_info *info, + /*const*/ struct pt_regs *regs, + int sanitize) +{ + if (&info->regs == regs) { /* happens when unwinding kernel->user */ + info->call_frame = 1; + return; + } + + memset(info, 0, sizeof(*info)); + /* XXX handle sanitize??? */ + info->regs = *regs; +} + +#endif /* _STP_MIPS64_UNWIND_H */ diff --git a/runtime/unwind/unwind.h b/runtime/unwind/unwind.h index ea3f266..e8f6d7d 100644 --- a/runtime/unwind/unwind.h +++ b/runtime/unwind/unwind.h @@ -30,6 +30,8 @@ struct unwind_frame_info #include "s390x.h" #elif defined (__arm__) #include "arm.h" +#elif defined (__mips64) +#include "mips64.h" #else #error "Unsupported dwarf unwind architecture" #endif --------------true--