Upgrade OpenCSD to v0.12.0

Exempt-From-Owner-Approval: Upgrade library
Test: None
Change-Id: I090b1a6273477f22acff08d1746957f347961490
diff --git a/Android.bp b/Android.bp
new file mode 100644
index 0000000..6f11f53
--- /dev/null
+++ b/Android.bp
@@ -0,0 +1,91 @@
+//
+// Copyright (C) 2019 The Android Open Source Project
+//
+// Licensed under the Apache License, Version 2.0 (the "License");
+// you may not use this file except in compliance with the License.
+// You may obtain a copy of the License at
+//
+//      http://www.apache.org/licenses/LICENSE-2.0
+//
+// Unless required by applicable law or agreed to in writing, software
+// distributed under the License is distributed on an "AS IS" BASIS,
+// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+// See the License for the specific language governing permissions and
+// limitations under the License.
+//
+
+package {
+    default_visibility: ["//visibility:private"],
+}
+
+cc_library_static {
+    name: "libopencsd_decoder",
+    host_supported: true,
+    visibility: [
+        "//cts/tests/tests/simpleperf",
+        "//system/extras/simpleperf",
+    ],
+    export_include_dirs: ["decoder/include"],
+
+    cppflags: [
+        "-Wno-ignored-qualifiers",
+        "-Wno-unused-parameter",
+        "-Wno-switch",
+        "-Wno-unused-private-field",
+        "-Wno-implicit-fallthrough",
+        "-fexceptions",
+    ],
+    rtti: true,
+
+    target: {
+        windows: {
+            enabled: true,
+        },
+    },
+
+    srcs: [
+        "decoder/source/etmv3/trc_cmp_cfg_etmv3.cpp",
+        "decoder/source/etmv3/trc_pkt_decode_etmv3.cpp",
+        "decoder/source/etmv3/trc_pkt_elem_etmv3.cpp",
+        "decoder/source/etmv3/trc_pkt_proc_etmv3.cpp",
+        "decoder/source/etmv3/trc_pkt_proc_etmv3_impl.cpp",
+        "decoder/source/etmv4/trc_cmp_cfg_etmv4.cpp",
+        "decoder/source/etmv4/trc_etmv4_stack_elem.cpp",
+        "decoder/source/etmv4/trc_pkt_decode_etmv4i.cpp",
+        "decoder/source/etmv4/trc_pkt_elem_etmv4d.cpp",
+        "decoder/source/etmv4/trc_pkt_elem_etmv4i.cpp",
+        "decoder/source/etmv4/trc_pkt_proc_etmv4.cpp",
+        "decoder/source/etmv4/trc_pkt_proc_etmv4i_impl.cpp",
+        "decoder/source/i_dec/trc_idec_arminst.cpp",
+        "decoder/source/i_dec/trc_i_decode.cpp",
+        "decoder/source/mem_acc/trc_mem_acc_base.cpp",
+        "decoder/source/mem_acc/trc_mem_acc_bufptr.cpp",
+        "decoder/source/mem_acc/trc_mem_acc_cache.cpp",
+        "decoder/source/mem_acc/trc_mem_acc_cb.cpp",
+        "decoder/source/mem_acc/trc_mem_acc_file.cpp",
+        "decoder/source/mem_acc/trc_mem_acc_mapper.cpp",
+        "decoder/source/ocsd_code_follower.cpp",
+        "decoder/source/ocsd_dcd_tree.cpp",
+        "decoder/source/ocsd_error.cpp",
+        "decoder/source/ocsd_error_logger.cpp",
+        "decoder/source/ocsd_gen_elem_list.cpp",
+        "decoder/source/ocsd_lib_dcd_register.cpp",
+        "decoder/source/ocsd_msg_logger.cpp",
+        "decoder/source/ocsd_version.cpp",
+        "decoder/source/pkt_printers/raw_frame_printer.cpp",
+        "decoder/source/pkt_printers/trc_print_fact.cpp",
+        "decoder/source/ptm/trc_cmp_cfg_ptm.cpp",
+        "decoder/source/ptm/trc_pkt_decode_ptm.cpp",
+        "decoder/source/ptm/trc_pkt_elem_ptm.cpp",
+        "decoder/source/ptm/trc_pkt_proc_ptm.cpp",
+        "decoder/source/stm/trc_pkt_decode_stm.cpp",
+        "decoder/source/stm/trc_pkt_elem_stm.cpp",
+        "decoder/source/stm/trc_pkt_proc_stm.cpp",
+        "decoder/source/trc_component.cpp",
+        "decoder/source/trc_core_arch_map.cpp",
+        "decoder/source/trc_frame_deformatter.cpp",
+        "decoder/source/trc_gen_elem.cpp",
+        "decoder/source/trc_printable_elem.cpp",
+        "decoder/source/trc_ret_stack.cpp",
+    ],
+}
\ No newline at end of file
diff --git a/METADATA b/METADATA
new file mode 100644
index 0000000..34a61a7
--- /dev/null
+++ b/METADATA
@@ -0,0 +1,18 @@
+name: "OpenCSD"
+description: "This library provides an API suitable for the decode of ARM(r) CoreSight(tm) trace streams."
+third_party {
+  url {
+    type: HOMEPAGE
+    value: "https://github.com/Linaro/OpenCSD"
+  }
+  url {
+    type: GIT
+    value: "https://github.com/Linaro/OpenCSD.git"
+  }
+  version: "v0.12.0"
+  last_upgrade_date {
+    year: 2019
+    month: 7
+    day: 31
+  }
+}
diff --git a/MODULE_LICENSE_BSD b/MODULE_LICENSE_BSD
new file mode 100644
index 0000000..e69de29
--- /dev/null
+++ b/MODULE_LICENSE_BSD
diff --git a/NOTICE b/NOTICE
new file mode 100644
index 0000000..8c80288
--- /dev/null
+++ b/NOTICE
@@ -0,0 +1,30 @@
+                        BSD 3Clause License
+            http://directory.fsf.org/wiki/License:BSD_3Clause
+
+Redistribution and use in source and binary forms, with or without
+modification, are permitted provided that the following conditions are
+met:
+
+    (1) Redistributions of source code must retain the above copyright
+    notice, this list of conditions and the following disclaimer. 
+
+    (2) Redistributions in binary form must reproduce the above copyright
+    notice, this list of conditions and the following disclaimer in
+    the documentation and/or other materials provided with the
+    distribution.  
+    
+    (3)The name of the author may not be used to
+    endorse or promote products derived from this software without
+    specific prior written permission.
+
+THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR
+IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
+WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
+DISCLAIMED. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT,
+INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
+(INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
+SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
+HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT,
+STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING
+IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+POSSIBILITY OF SUCH DAMAGE.
diff --git a/OWNERS b/OWNERS
new file mode 100644
index 0000000..e5b5f6f
--- /dev/null
+++ b/OWNERS
@@ -0,0 +1 @@
+include toolchain/llvm_android:/OWNERS