Blame 0001-sandbox-linux-Implement-partial-support-for-ppc64-sy.patch

aacff36
From 036d209a3f1a771de9aed31dfbe804aaf91d1c27 Mon Sep 17 00:00:00 2001
aacff36
From: Shawn Anastasio <shawnanastasio@yahoo.com>
aacff36
Date: Thu, 9 Aug 2018 23:35:21 -0500
aacff36
Subject: [PATCH] sandbox/linux: Implement partial support for ppc64 syscalls
aacff36
 and ucontext
aacff36
aacff36
Unlike other architectures, the ppc64 files currently rely on applicable
aacff36
headers being provided by the system. It is sufficient for standard
aacff36
GNU/Linux environments, but may require expansion elsewhere.
aacff36
---
aacff36
 sandbox/linux/BUILD.gn                              |  2 ++
aacff36
 sandbox/linux/system_headers/linux_syscalls.h       |  4 ++++
aacff36
 sandbox/linux/system_headers/linux_ucontext.h       |  2 ++
aacff36
 sandbox/linux/system_headers/ppc64_linux_syscalls.h | 12 ++++++++++++
aacff36
 sandbox/linux/system_headers/ppc64_linux_ucontext.h | 12 ++++++++++++
aacff36
 5 files changed, 32 insertions(+)
aacff36
 create mode 100644 sandbox/linux/system_headers/ppc64_linux_syscalls.h
aacff36
 create mode 100644 sandbox/linux/system_headers/ppc64_linux_ucontext.h
aacff36
aacff36
Index: chromium-120.0.6099.71/sandbox/linux/BUILD.gn
aacff36
===================================================================
aacff36
--- chromium-120.0.6099.71.orig/sandbox/linux/BUILD.gn
aacff36
+++ chromium-120.0.6099.71/sandbox/linux/BUILD.gn
aacff36
@@ -383,6 +383,8 @@ component("sandbox_services") {
aacff36
 
aacff36
 source_set("sandbox_services_headers") {
aacff36
   sources = [
aacff36
+    "system_headers/ppc64_linux_syscalls.h",
aacff36
+    "system_headers/ppc64_linux_ucontext.h",
aacff36
     "system_headers/arm64_linux_syscalls.h",
aacff36
     "system_headers/arm_linux_syscalls.h",
aacff36
     "system_headers/arm_linux_ucontext.h",
aacff36
Index: chromium-120.0.6099.71/sandbox/linux/system_headers/linux_syscalls.h
aacff36
===================================================================
aacff36
--- chromium-120.0.6099.71.orig/sandbox/linux/system_headers/linux_syscalls.h
aacff36
+++ chromium-120.0.6099.71/sandbox/linux/system_headers/linux_syscalls.h
aacff36
@@ -35,5 +35,9 @@
aacff36
 #include "sandbox/linux/system_headers/arm64_linux_syscalls.h"
aacff36
 #endif
aacff36
 
aacff36
+#if defined(__powerpc64__)
aacff36
+#include "sandbox/linux/system_headers/ppc64_linux_syscalls.h"
aacff36
+#endif
aacff36
+
aacff36
 #endif  // SANDBOX_LINUX_SYSTEM_HEADERS_LINUX_SYSCALLS_H_
aacff36
 
aacff36
Index: chromium-120.0.6099.71/sandbox/linux/system_headers/ppc64_linux_syscalls.h
aacff36
===================================================================
aacff36
--- /dev/null
aacff36
+++ chromium-120.0.6099.71/sandbox/linux/system_headers/ppc64_linux_syscalls.h
aacff36
@@ -0,0 +1,12 @@
aacff36
+// Copyright 2014 The Chromium Authors. All rights reserved.
aacff36
+// Use of this source code is governed by a BSD-style license that can be
aacff36
+// found in the LICENSE file.
aacff36
+
aacff36
+#ifndef SANDBOX_LINUX_SYSTEM_HEADERS_PPC64_LINUX_SYSCALLS_H_
aacff36
+#define SANDBOX_LINUX_SYSTEM_HEADERS_PPC64_LINUX_SYSCALLS_H_
aacff36
+
aacff36
+#include <asm/unistd.h>
aacff36
+
aacff36
+//TODO: is it necessary to redefine syscall numbers for PPC64?
aacff36
+
aacff36
+#endif  // SANDBOX_LINUX_SYSTEM_HEADERS_PPC64_LINUX_SYSCALLS_H_
aacff36
Index: chromium-120.0.6099.71/sandbox/linux/system_headers/ppc64_linux_ucontext.h
aacff36
===================================================================
aacff36
--- /dev/null
aacff36
+++ chromium-120.0.6099.71/sandbox/linux/system_headers/ppc64_linux_ucontext.h
aacff36
@@ -0,0 +1,12 @@
aacff36
+// Copyright 2014 The Chromium Authors. All rights reserved.
aacff36
+// Use of this source code is governed by a BSD-style license that can be
aacff36
+// found in the LICENSE file.
aacff36
+
aacff36
+#ifndef SANDBOX_LINUX_SYSTEM_HEADERS_PPC64_LINUX_UCONTEXT_H_
aacff36
+#define SANDBOX_LINUX_SYSTEM_HEADERS_PPC64_LINUX_UCONTEXT_H_
aacff36
+
aacff36
+#include <sys/ucontext.h>
aacff36
+
aacff36
+//TODO: is it necessary to redefine ucontext on PPC64?
aacff36
+
aacff36
+#endif  // SANDBOX_LINUX_SYSTEM_HEADERS_PPC64_LINUX_UCONTEXT_H_