Search
SailfishOS Open Build Service
>
Projects
>
nemo
:
testing:hw
:
volla
:
yggdrasil
>
linux-hidl
> _service:tar_git:0010-systemcore-Add-building-and-generating-for-HIDL-headers-src-and.patch
Log In
Username
Password
Cancel
Overview
Repositories
Revisions
Requests
Users
Advanced
Attributes
Meta
File _service:tar_git:0010-systemcore-Add-building-and-generating-for-HIDL-headers-src-and.patch of Package linux-hidl
From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001 From: Marius Gripsgard <marius@ubports.com> Date: Fri, 2 Nov 2018 19:24:25 +0100 Subject: [PATCH] Add building and generating for HIDL headers, src and libraries --- libcutils/ashmem-dev.cpp | 7 ++++++- libcutils/include/cutils/atomic.h | 6 ++++++ libcutils/include/cutils/trace.h | 17 +++++++++++++---- libcutils/trace-dev.inc | 9 +++++++-- libutils/Printer.cpp | 4 +++- libutils/Threads.cpp | 2 +- libutils/include/utils/ThreadDefs.h | 1 - 7 files changed, 36 insertions(+), 10 deletions(-) diff --git a/src/system_core/libcutils/ashmem-dev.cpp b/src/system_core/libcutils/ashmem-dev.cpp index e67b45808..42abbccf1 100644 --- a/src/system_core/libcutils/ashmem-dev.cpp +++ b/src/system_core/libcutils/ashmem-dev.cpp @@ -57,6 +57,11 @@ #define MIN_MEMFD_VENDOR_API_LEVEL 29 #define MIN_MEMFD_VENDOR_API_LEVEL_CHAR 'Q' +#ifndef F_ADD_SEALS +#define F_LINUX_SPECIFIC_BASE F_SETLEASE +#define F_ADD_SEALS (F_LINUX_SPECIFIC_BASE + 9) +#endif + /* ashmem identity */ static dev_t __ashmem_rdev; /* @@ -389,7 +394,7 @@ int ashmem_create_region(const char *name, size_t size) if (name) { char buf[ASHMEM_NAME_LEN] = {0}; - strlcpy(buf, name, sizeof(buf)); + strncpy(buf, name, sizeof(buf)); ret = TEMP_FAILURE_RETRY(ioctl(fd, ASHMEM_SET_NAME, buf)); if (ret < 0) { goto error; diff --git a/src/system_core/libcutils/include/cutils/atomic.h b/src/system_core/libcutils/include/cutils/atomic.h index 0c88bfedd..84606e307 100644 --- a/src/system_core/libcutils/include/cutils/atomic.h +++ b/src/system_core/libcutils/include/cutils/atomic.h @@ -19,7 +19,13 @@ #include <stdint.h> #include <sys/types.h> + +#ifdef __cplusplus +#include <atomic> +using namespace std; +#else #include <stdatomic.h> +#endif #ifndef ANDROID_ATOMIC_INLINE #define ANDROID_ATOMIC_INLINE static inline diff --git a/src/system_core/libcutils/include/cutils/trace.h b/src/system_core/libcutils/include/cutils/trace.h index 79b4b355b..e2c4bf513 100644 --- a/src/system_core/libcutils/include/cutils/trace.h +++ b/src/system_core/libcutils/include/cutils/trace.h @@ -18,7 +18,13 @@ #define _LIBS_CUTILS_TRACE_H #include <inttypes.h> + +#ifdef __cplusplus +#include <atomic> +using namespace std; +#else #include <stdatomic.h> +#endif #include <stdbool.h> #include <stdint.h> #include <stdio.h> @@ -181,8 +187,10 @@ static inline uint64_t atrace_is_tag_enabled(uint64_t tag) static inline void atrace_begin(uint64_t tag, const char* name) { if (CC_UNLIKELY(atrace_is_tag_enabled(tag))) { - void atrace_begin_body(const char*); - atrace_begin_body(name); + //void atrace_begin_body(const char*); + //atrace_begin_body(name); + (void) tag; + (void) name; } } @@ -194,8 +202,9 @@ static inline void atrace_begin(uint64_t tag, const char* name) static inline void atrace_end(uint64_t tag) { if (CC_UNLIKELY(atrace_is_tag_enabled(tag))) { - void atrace_end_body(); - atrace_end_body(); + //void atrace_end_body(); + //atrace_end_body(); + (void)tag; } } diff --git a/src/system_core/libcutils/trace-dev.inc b/src/system_core/libcutils/trace-dev.inc index e3da77bec..076bec303 100644 --- a/src/system_core/libcutils/trace-dev.inc +++ b/src/system_core/libcutils/trace-dev.inc @@ -23,7 +23,12 @@ #include <fcntl.h> #include <limits.h> #include <pthread.h> +#ifdef __cplusplus +#include <atomic> +using namespace std; +#else #include <stdatomic.h> +#endif #include <stdlib.h> #include <string.h> #include <sys/types.h> @@ -32,7 +37,7 @@ #include <cutils/properties.h> #include <cutils/trace.h> #include <log/log.h> -#include <log/log_properties.h> +//#include <log/log_properties.h> /** * Maximum size of a message that can be logged to the trace buffer. @@ -80,7 +85,7 @@ static bool atrace_is_cmdline_match(const char* cmdline) // Determine whether application-level tracing is enabled for this process. static bool atrace_is_app_tracing_enabled() { - bool sys_debuggable = property_get_bool("ro.debuggable", 0); + bool sys_debuggable = true;//__android_log_is_debuggable(); bool result = false; if (sys_debuggable || atrace_is_debuggable) { diff --git a/src/system_core/libutils/Printer.cpp b/src/system_core/libutils/Printer.cpp index c9ae210ba..999c6f7b8 100644 --- a/src/system_core/libutils/Printer.cpp +++ b/src/system_core/libutils/Printer.cpp @@ -22,6 +22,7 @@ #include <utils/Log.h> #include <stdlib.h> +#include <iostream> namespace android { @@ -88,7 +89,8 @@ void LogPrinter::printLine(const char* string) { } void LogPrinter::printRaw(const char* string) { - __android_log_print(mPriority, mLogTag, "%s%s", mPrefix, string); + std::cout << string; + //__android_log_print(mPriority, mLogTag, "%s%s", mPrefix, string); } diff --git a/src/system_core/libutils/Threads.cpp b/src/system_core/libutils/Threads.cpp index 31ca1383e..64bc4025d 100644 --- a/src/system_core/libutils/Threads.cpp +++ b/src/system_core/libutils/Threads.cpp @@ -36,7 +36,7 @@ #include <utils/Log.h> -#include <processgroup/sched_policy.h> +#include <cutils/sched_policy.h> #if defined(__ANDROID__) # define __android_unused diff --git a/src/system_core/libutils/include/utils/ThreadDefs.h b/src/system_core/libutils/include/utils/ThreadDefs.h index 8eb3d1cbe..2ed1a6911 100644 --- a/src/system_core/libutils/include/utils/ThreadDefs.h +++ b/src/system_core/libutils/include/utils/ThreadDefs.h @@ -19,7 +19,6 @@ #include <stdint.h> #include <sys/types.h> -#include <system/graphics.h> #include <system/thread_defs.h> // --------------------------------------------------------------------------- -- 2.30.1