get:
Show a patch.

patch:
Update a patch.

put:
Update a patch.

GET /api/patches/835/?format=api
HTTP 200 OK
Allow: GET, PUT, PATCH, HEAD, OPTIONS
Content-Type: application/json
Vary: Accept

{
    "id": 835,
    "url": "http://patchwork.ozlabs.org/api/patches/835/?format=api",
    "web_url": "http://patchwork.ozlabs.org/project/linuxppc-dev/patch/200809221602.32616.srinivasa@in.ibm.com/",
    "project": {
        "id": 2,
        "url": "http://patchwork.ozlabs.org/api/projects/2/?format=api",
        "name": "Linux PPC development",
        "link_name": "linuxppc-dev",
        "list_id": "linuxppc-dev.lists.ozlabs.org",
        "list_email": "linuxppc-dev@lists.ozlabs.org",
        "web_url": "https://github.com/linuxppc/wiki/wiki",
        "scm_url": "https://git.kernel.org/pub/scm/linux/kernel/git/powerpc/linux.git",
        "webscm_url": "https://git.kernel.org/pub/scm/linux/kernel/git/powerpc/linux.git/",
        "list_archive_url": "https://lore.kernel.org/linuxppc-dev/",
        "list_archive_url_format": "https://lore.kernel.org/linuxppc-dev/{}/",
        "commit_url_format": "https://git.kernel.org/pub/scm/linux/kernel/git/powerpc/linux.git/commit/?id={}"
    },
    "msgid": "<200809221602.32616.srinivasa@in.ibm.com>",
    "list_archive_url": "https://lore.kernel.org/linuxppc-dev/200809221602.32616.srinivasa@in.ibm.com/",
    "date": "2008-09-22T10:32:32",
    "name": "[RFC] Demultiplexing SIGTRAP signal",
    "commit_ref": null,
    "pull_url": null,
    "state": "rfc",
    "archived": true,
    "hash": "be5c41b86405a4e802b897028264642f6a5b050a",
    "submitter": {
        "id": 390,
        "url": "http://patchwork.ozlabs.org/api/people/390/?format=api",
        "name": "Srinivasa Ds",
        "email": "srinivasa@in.ibm.com"
    },
    "delegate": null,
    "mbox": "http://patchwork.ozlabs.org/project/linuxppc-dev/patch/200809221602.32616.srinivasa@in.ibm.com/mbox/",
    "series": [],
    "comments": "http://patchwork.ozlabs.org/api/patches/835/comments/",
    "check": "pending",
    "checks": "http://patchwork.ozlabs.org/api/patches/835/checks/",
    "tags": {},
    "related": [],
    "headers": {
        "Return-Path": "<linuxppc-dev-bounces+patchwork-incoming=ozlabs.org@ozlabs.org>",
        "X-Original-To": [
            "patchwork-incoming@ozlabs.org",
            "linuxppc-dev@ozlabs.org"
        ],
        "Delivered-To": [
            "patchwork-incoming@ozlabs.org",
            "linuxppc-dev@ozlabs.org"
        ],
        "Received": [
            "from ozlabs.org (localhost [127.0.0.1])\n\tby ozlabs.org (Postfix) with ESMTP id CDBC0DE071\n\tfor <patchwork-incoming@ozlabs.org>;\n\tMon, 22 Sep 2008 20:32:27 +1000 (EST)",
            "from e28esmtp06.in.ibm.com (e28smtp06.in.ibm.com [59.145.155.6])\n\t(using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits))\n\t(Client CN \"e28smtp06.in.ibm.com\", Issuer \"Equifax\" (verified OK))\n\tby ozlabs.org (Postfix) with ESMTPS id E97D1DDF17\n\tfor <linuxppc-dev@ozlabs.org>; Mon, 22 Sep 2008 20:32:13 +1000 (EST)",
            "from d28relay02.in.ibm.com (d28relay02.in.ibm.com [9.184.220.59])\n\tby e28esmtp06.in.ibm.com (8.13.1/8.13.1) with ESMTP id\n\tm8MAVwQm004126\n\tfor <linuxppc-dev@ozlabs.org>; Mon, 22 Sep 2008 16:01:58 +0530",
            "from d28av01.in.ibm.com (d28av01.in.ibm.com [9.184.220.63])\n\tby d28relay02.in.ibm.com (8.13.8/8.13.8/NCO v9.1) with ESMTP id\n\tm8MAVwbf1695862\n\tfor <linuxppc-dev@ozlabs.org>; Mon, 22 Sep 2008 16:01:58 +0530",
            "from d28av01.in.ibm.com (loopback [127.0.0.1])\n\tby d28av01.in.ibm.com (8.13.1/8.13.3) with ESMTP id m8MAVvGm010622\n\tfor <linuxppc-dev@ozlabs.org>; Mon, 22 Sep 2008 16:01:58 +0530",
            "from srinivasa-009124031087.in.ibm.com ([9.124.31.87])\n\tby d28av01.in.ibm.com (8.13.1/8.12.11) with ESMTP id m8MAVvAW009779; \n\tMon, 22 Sep 2008 16:01:57 +0530"
        ],
        "From": "Srinivasa Ds <srinivasa@in.ibm.com>",
        "Organization": "IBM",
        "To": "linux-kernel@vger.kernel.org, akpm@linux-foundation.org, paulus@samba.org,\n\troland@redhat.com, linuxppc-dev@ozlabs.org, mingo@elte.hu,\n\tlinux-parisc@vger.kernel.org",
        "Subject": "[RFC][PATCH] Demultiplexing SIGTRAP signal",
        "Date": "Mon, 22 Sep 2008 16:02:32 +0530",
        "User-Agent": "KMail/1.9.9",
        "MIME-Version": "1.0",
        "Content-Disposition": "inline",
        "Message-Id": "<200809221602.32616.srinivasa@in.ibm.com>",
        "X-BeenThere": "linuxppc-dev@ozlabs.org",
        "X-Mailman-Version": "2.1.11",
        "Precedence": "list",
        "List-Id": "Linux on PowerPC Developers Mail List <linuxppc-dev.ozlabs.org>",
        "List-Unsubscribe": "<https://ozlabs.org/mailman/options/linuxppc-dev>,\n\t<mailto:linuxppc-dev-request@ozlabs.org?subject=unsubscribe>",
        "List-Archive": "<http://ozlabs.org/pipermail/linuxppc-dev>",
        "List-Post": "<mailto:linuxppc-dev@ozlabs.org>",
        "List-Help": "<mailto:linuxppc-dev-request@ozlabs.org?subject=help>",
        "List-Subscribe": "<https://ozlabs.org/mailman/listinfo/linuxppc-dev>,\n\t<mailto:linuxppc-dev-request@ozlabs.org?subject=subscribe>",
        "Content-Type": "text/plain; charset=\"us-ascii\"",
        "Content-Transfer-Encoding": "7bit",
        "Sender": "linuxppc-dev-bounces+patchwork-incoming=ozlabs.org@ozlabs.org",
        "Errors-To": "linuxppc-dev-bounces+patchwork-incoming=ozlabs.org@ozlabs.org"
    },
    "content": "Currently a SIGTRAP signal can denote any one of below reasons.\n\t- Breakpoint hit\n\t- H/W debug register hit\n\t- Single step\n\t- SIGTRAP signal sent through kill() or rasie()\n\nArchitectures like powerpc/parisc provides infrastructure to demultiplex\nSIGTRAP signal by passing down the information for receiving SIGTRAP through\nsi_code of siginfot_t structure. Here is an attempt is generalise this \ninfrastructure by extending it to x86 and x86_64 archs. \n\nSigned-off-by: Srinivasa DS <srinivasa@in.ibm.com>\n\n\n\n---\n arch/ia64/include/asm/siginfo.h    |    5 -----\n arch/powerpc/include/asm/siginfo.h |    5 -----\n arch/x86/kernel/traps_32.c         |   19 +++++++++++++++++--\n arch/x86/kernel/traps_64.c         |    7 ++++++-\n include/asm-generic/siginfo.h      |    2 ++\n include/asm-parisc/siginfo.h       |    5 -----\n 6 files changed, 25 insertions(+), 18 deletions(-)",
    "diff": "Index: linux-2.6.27-rc7/arch/ia64/include/asm/siginfo.h\n===================================================================\n--- linux-2.6.27-rc7.orig/arch/ia64/include/asm/siginfo.h\n+++ linux-2.6.27-rc7/arch/ia64/include/asm/siginfo.h\n@@ -113,11 +113,6 @@ typedef struct siginfo {\n #undef NSIGSEGV\n #define NSIGSEGV\t3\n \n-/*\n- * SIGTRAP si_codes\n- */\n-#define TRAP_BRANCH\t(__SI_FAULT|3)\t/* process taken branch trap */\n-#define TRAP_HWBKPT\t(__SI_FAULT|4)\t/* hardware breakpoint or watchpoint */\n #undef NSIGTRAP\n #define NSIGTRAP\t4\n \nIndex: linux-2.6.27-rc7/arch/powerpc/include/asm/siginfo.h\n===================================================================\n--- linux-2.6.27-rc7.orig/arch/powerpc/include/asm/siginfo.h\n+++ linux-2.6.27-rc7/arch/powerpc/include/asm/siginfo.h\n@@ -15,11 +15,6 @@\n \n #include <asm-generic/siginfo.h>\n \n-/*\n- * SIGTRAP si_codes\n- */\n-#define TRAP_BRANCH\t(__SI_FAULT|3)\t/* process taken branch trap */\n-#define TRAP_HWBKPT\t(__SI_FAULT|4)\t/* hardware breakpoint or watchpoint */\n #undef NSIGTRAP\n #define NSIGTRAP\t4\n \nIndex: linux-2.6.27-rc7/arch/x86/kernel/traps_32.c\n===================================================================\n--- linux-2.6.27-rc7.orig/arch/x86/kernel/traps_32.c\n+++ linux-2.6.27-rc7/arch/x86/kernel/traps_32.c\n@@ -890,6 +890,7 @@ void __kprobes do_int3(struct pt_regs *r\n void __kprobes do_debug(struct pt_regs *regs, long error_code)\n {\n \tstruct task_struct *tsk = current;\n+\tstruct siginfo info;\n \tunsigned int condition;\n \n \ttrace_hardirqs_fixup();\n@@ -935,8 +936,22 @@ void __kprobes do_debug(struct pt_regs *\n \t\t\tgoto clear_TF_reenable;\n \t}\n \n-\t/* Ok, finally something we can handle */\n-\tsend_sigtrap(tsk, regs, error_code);\n+\ttsk->thread.trap_no = 1;\n+\ttsk->thread.error_code = error_code;\n+\n+\tmemset(&info, 0, sizeof(info));\n+\tinfo.si_signo = SIGTRAP;\n+\tif (condition & DR_STEP)\n+\t\tinfo.si_code = TRAP_TRACE;\n+\telse if (condition & (DR_TRAP0|DR_TRAP1|DR_TRAP2|DR_TRAP3))\n+\t\tinfo.si_code = TRAP_HWBKPT;\n+\telse\n+\t\tinfo.si_code = TRAP_BRKPT;\n+\t/* User-mode ip? */\n+\tinfo.si_addr = user_mode_vm(regs) ? (void __user *) regs->ip : NULL;\n+\n+\t/* Send us the fake SIGTRAP */\n+\tforce_sig_info(SIGTRAP, &info, tsk);\n \n \t/*\n \t * Disable additional traps. They'll be re-enabled when\nIndex: linux-2.6.27-rc7/arch/x86/kernel/traps_64.c\n===================================================================\n--- linux-2.6.27-rc7.orig/arch/x86/kernel/traps_64.c\n+++ linux-2.6.27-rc7/arch/x86/kernel/traps_64.c\n@@ -936,7 +936,12 @@ asmlinkage void __kprobes do_debug(struc\n \ttsk->thread.error_code = error_code;\n \tinfo.si_signo = SIGTRAP;\n \tinfo.si_errno = 0;\n-\tinfo.si_code = TRAP_BRKPT;\n+\tif (condition & DR_STEP)\n+\t\tinfo.si_code = TRAP_TRACE;\n+\telse if (condition & (DR_TRAP0|DR_TRAP1|DR_TRAP2|DR_TRAP3))\n+\t\tinfo.si_code = TRAP_HWBKPT;\n+\telse\n+\t\tinfo.si_code = TRAP_BRKPT;\n \tinfo.si_addr = user_mode(regs) ? (void __user *)regs->ip : NULL;\n \tforce_sig_info(SIGTRAP, &info, tsk);\n \nIndex: linux-2.6.27-rc7/include/asm-generic/siginfo.h\n===================================================================\n--- linux-2.6.27-rc7.orig/include/asm-generic/siginfo.h\n+++ linux-2.6.27-rc7/include/asm-generic/siginfo.h\n@@ -199,6 +199,8 @@ typedef struct siginfo {\n  */\n #define TRAP_BRKPT\t(__SI_FAULT|1)\t/* process breakpoint */\n #define TRAP_TRACE\t(__SI_FAULT|2)\t/* process trace trap */\n+#define TRAP_BRANCH     (__SI_FAULT|3)  /* process taken branch trap */\n+#define TRAP_HWBKPT     (__SI_FAULT|4)  /* hardware breakpoint or watchpoint \n*/\n #define NSIGTRAP\t2\n \n /*\nIndex: linux-2.6.27-rc7/include/asm-parisc/siginfo.h\n===================================================================\n--- linux-2.6.27-rc7.orig/include/asm-parisc/siginfo.h\n+++ linux-2.6.27-rc7/include/asm-parisc/siginfo.h\n@@ -3,11 +3,6 @@\n \n #include <asm-generic/siginfo.h>\n \n-/*\n- * SIGTRAP si_codes\n- */\n-#define TRAP_BRANCH\t(__SI_FAULT|3)\t/* process taken branch trap */\n-#define TRAP_HWBKPT\t(__SI_FAULT|4)\t/* hardware breakpoint or watchpoint */\n #undef NSIGTRAP\n #define NSIGTRAP\t4\n \n",
    "prefixes": [
        "RFC"
    ]
}