Generated files from "arm64-generic-codesearch" build 8748892985589120497, revision a928733149a72345d55d7b2973c019e346c6dc0f
diff --git a/chroot/opt/android-master/amd64/usr/include/android-base/errors.h b/chroot/opt/android-master/amd64/usr/include/android-base/errors.h
new file mode 100644
index 0000000..06f29fc
--- /dev/null
+++ b/chroot/opt/android-master/amd64/usr/include/android-base/errors.h
@@ -0,0 +1,43 @@
+/*
+ * Copyright (C) 2016 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.
+ */
+
+// Portable error handling functions. This is only necessary for host-side
+// code that needs to be cross-platform; code that is only run on Unix should
+// just use errno and strerror() for simplicity.
+//
+// There is some complexity since Windows has (at least) three different error
+// numbers, not all of which share the same type:
+// * errno: for C runtime errors.
+// * GetLastError(): Windows non-socket errors.
+// * WSAGetLastError(): Windows socket errors.
+// errno can be passed to strerror() on all platforms, but the other two require
+// special handling to get the error string. Refer to Microsoft documentation
+// to determine which error code to check for each function.
+
+#pragma once
+
+#include <string>
+
+namespace android {
+namespace base {
+
+// Returns a string describing the given system error code. |error_code| must
+// be errno on Unix or GetLastError()/WSAGetLastError() on Windows. Passing
+// errno on Windows has undefined behavior.
+std::string SystemErrorCodeToString(int error_code);
+
+} // namespace base
+} // namespace android
diff --git a/chroot/opt/android-master/amd64/usr/include/android-base/result.h b/chroot/opt/android-master/amd64/usr/include/android-base/result.h
new file mode 100644
index 0000000..5e65876
--- /dev/null
+++ b/chroot/opt/android-master/amd64/usr/include/android-base/result.h
@@ -0,0 +1,234 @@
+/*
+ * Copyright (C) 2017 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.
+ */
+
+// This file contains classes for returning a successful result along with an optional
+// arbitrarily typed return value or for returning a failure result along with an optional string
+// indicating why the function failed.
+
+// There are 3 classes that implement this functionality and one additional helper type.
+//
+// Result<T> either contains a member of type T that can be accessed using similar semantics as
+// std::optional<T> or it contains a ResultError describing an error, which can be accessed via
+// Result<T>::error().
+//
+// ResultError is a type that contains both a std::string describing the error and a copy of errno
+// from when the error occurred. ResultError can be used in an ostream directly to print its
+// string value.
+//
+// Result<void> is the correct return type for a function that either returns successfully or
+// returns an error value. Returning {} from a function that returns Result<void> is the
+// correct way to indicate that a function without a return type has completed successfully.
+//
+// A successful Result<T> is constructed implicitly from any type that can be implicitly converted
+// to T or from the constructor arguments for T. This allows you to return a type T directly from
+// a function that returns Result<T>.
+//
+// Error and ErrnoError are used to construct a Result<T> that has failed. The Error class takes
+// an ostream as an input and are implicitly cast to a Result<T> containing that failure.
+// ErrnoError() is a helper function to create an Error class that appends ": " + strerror(errno)
+// to the end of the failure string to aid in interacting with C APIs. Alternatively, an errno
+// value can be directly specified via the Error() constructor.
+//
+// Errorf and ErrnoErrorf accept the format string syntax of the fmblib (https://fmt.dev).
+// Errorf("{} errors", num) is equivalent to Error() << num << " errors".
+//
+// ResultError can be used in the ostream and when using Error/Errorf to construct a Result<T>.
+// In this case, the string that the ResultError takes is passed through the stream normally, but
+// the errno is passed to the Result<T>. This can be used to pass errno from a failing C function up
+// multiple callers. Note that when the outer Result<T> is created with ErrnoError/ErrnoErrorf then
+// the errno from the inner ResultError is not passed. Also when multiple ResultError objects are
+// used, the errno of the last one is respected.
+//
+// ResultError can also directly construct a Result<T>. This is particularly useful if you have a
+// function that return Result<T> but you have a Result<U> and want to return its error. In this
+// case, you can return the .error() from the Result<U> to construct the Result<T>.
+
+// An example of how to use these is below:
+// Result<U> CalculateResult(const T& input) {
+// U output;
+// if (!SomeOtherCppFunction(input, &output)) {
+// return Errorf("SomeOtherCppFunction {} failed", input);
+// }
+// if (!c_api_function(output)) {
+// return ErrnoErrorf("c_api_function {} failed", output);
+// }
+// return output;
+// }
+//
+// auto output = CalculateResult(input);
+// if (!output) return Error() << "CalculateResult failed: " << output.error();
+// UseOutput(*output);
+
+#pragma once
+
+#include <errno.h>
+
+#include <sstream>
+#include <string>
+
+#include "android-base/expected.h"
+#include "android-base/format.h"
+
+namespace android {
+namespace base {
+
+struct ResultError {
+ template <typename T>
+ ResultError(T&& message, int code) : message_(std::forward<T>(message)), code_(code) {}
+
+ template <typename T>
+ // NOLINTNEXTLINE(google-explicit-constructor)
+ operator android::base::expected<T, ResultError>() {
+ return android::base::unexpected(ResultError(message_, code_));
+ }
+
+ std::string message() const { return message_; }
+ int code() const { return code_; }
+
+ private:
+ std::string message_;
+ int code_;
+};
+
+inline bool operator==(const ResultError& lhs, const ResultError& rhs) {
+ return lhs.message() == rhs.message() && lhs.code() == rhs.code();
+}
+
+inline bool operator!=(const ResultError& lhs, const ResultError& rhs) {
+ return !(lhs == rhs);
+}
+
+inline std::ostream& operator<<(std::ostream& os, const ResultError& t) {
+ os << t.message();
+ return os;
+}
+
+class Error {
+ public:
+ Error() : errno_(0), append_errno_(false) {}
+ // NOLINTNEXTLINE(google-explicit-constructor)
+ Error(int errno_to_append) : errno_(errno_to_append), append_errno_(true) {}
+
+ template <typename T>
+ // NOLINTNEXTLINE(google-explicit-constructor)
+ operator android::base::expected<T, ResultError>() {
+ return android::base::unexpected(ResultError(str(), errno_));
+ }
+
+ template <typename T>
+ Error& operator<<(T&& t) {
+ if constexpr (std::is_same_v<std::remove_cv_t<std::remove_reference_t<T>>, ResultError>) {
+ errno_ = t.code();
+ return (*this) << t.message();
+ }
+ int saved = errno;
+ ss_ << t;
+ errno = saved;
+ return *this;
+ }
+
+ const std::string str() const {
+ std::string str = ss_.str();
+ if (append_errno_) {
+ if (str.empty()) {
+ return strerror(errno_);
+ }
+ return std::move(str) + ": " + strerror(errno_);
+ }
+ return str;
+ }
+
+ Error(const Error&) = delete;
+ Error(Error&&) = delete;
+ Error& operator=(const Error&) = delete;
+ Error& operator=(Error&&) = delete;
+
+ template <typename T, typename... Args>
+ friend Error ErrorfImpl(const T&& fmt, const Args&... args);
+
+ template <typename T, typename... Args>
+ friend Error ErrnoErrorfImpl(const T&& fmt, const Args&... args);
+
+ private:
+ Error(bool append_errno, int errno_to_append, const std::string& message)
+ : errno_(errno_to_append), append_errno_(append_errno) {
+ (*this) << message;
+ }
+
+ std::stringstream ss_;
+ int errno_;
+ const bool append_errno_;
+};
+
+inline Error ErrnoError() {
+ return Error(errno);
+}
+
+inline int ErrorCode(int code) {
+ return code;
+}
+
+// Return the error code of the last ResultError object, if any.
+// Otherwise, return `code` as it is.
+template <typename T, typename... Args>
+inline int ErrorCode(int code, T&& t, const Args&... args) {
+ if constexpr (std::is_same_v<std::remove_cv_t<std::remove_reference_t<T>>, ResultError>) {
+ return ErrorCode(t.code(), args...);
+ }
+ return ErrorCode(code, args...);
+}
+
+template <typename T, typename... Args>
+inline Error ErrorfImpl(const T&& fmt, const Args&... args) {
+ return Error(false, ErrorCode(0, args...), fmt::format(fmt, args...));
+}
+
+template <typename T, typename... Args>
+inline Error ErrnoErrorfImpl(const T&& fmt, const Args&... args) {
+ return Error(true, errno, fmt::format(fmt, args...));
+}
+
+#define Errorf(fmt, ...) android::base::ErrorfImpl(FMT_STRING(fmt), ##__VA_ARGS__)
+#define ErrnoErrorf(fmt, ...) android::base::ErrnoErrorfImpl(FMT_STRING(fmt), ##__VA_ARGS__)
+
+template <typename T>
+using Result = android::base::expected<T, ResultError>;
+
+// Macros for testing the results of functions that return android::base::Result.
+// These also work with base::android::expected.
+
+#define CHECK_RESULT_OK(stmt) \
+ do { \
+ const auto& tmp = (stmt); \
+ CHECK(tmp.ok()) << tmp.error(); \
+ } while (0)
+
+#define ASSERT_RESULT_OK(stmt) \
+ do { \
+ const auto& tmp = (stmt); \
+ ASSERT_TRUE(tmp.ok()) << tmp.error(); \
+ } while (0)
+
+#define EXPECT_RESULT_OK(stmt) \
+ do { \
+ auto tmp = (stmt); \
+ EXPECT_TRUE(tmp.ok()) << tmp.error(); \
+ } while (0)
+
+// TODO: Maybe add RETURN_IF_ERROR() and ASSIGN_OR_RETURN()
+
+} // namespace base
+} // namespace android
diff --git a/chroot/opt/android-master/amd64/usr/include/android/log.h b/chroot/opt/android-master/amd64/usr/include/android/log.h
new file mode 100644
index 0000000..512c7cd
--- /dev/null
+++ b/chroot/opt/android-master/amd64/usr/include/android/log.h
@@ -0,0 +1,350 @@
+/*
+ * Copyright (C) 2009 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.
+ */
+
+#pragma once
+
+/**
+ * @addtogroup Logging
+ * @{
+ */
+
+/**
+ * \file
+ *
+ * Support routines to send messages to the Android log buffer,
+ * which can later be accessed through the `logcat` utility.
+ *
+ * Each log message must have
+ * - a priority
+ * - a log tag
+ * - some text
+ *
+ * The tag normally corresponds to the component that emits the log message,
+ * and should be reasonably small.
+ *
+ * Log message text may be truncated to less than an implementation-specific
+ * limit (1023 bytes).
+ *
+ * Note that a newline character ("\n") will be appended automatically to your
+ * log message, if not already there. It is not possible to send several
+ * messages and have them appear on a single line in logcat.
+ *
+ * Please use logging in moderation:
+ *
+ * - Sending log messages eats CPU and slow down your application and the
+ * system.
+ *
+ * - The circular log buffer is pretty small, so sending many messages
+ * will hide other important log messages.
+ *
+ * - In release builds, only send log messages to account for exceptional
+ * conditions.
+ */
+
+#include <stdarg.h>
+#include <stddef.h>
+#include <stdint.h>
+#include <sys/cdefs.h>
+
+#if !defined(__BIONIC__) && !defined(__INTRODUCED_IN)
+#define __INTRODUCED_IN(x)
+#endif
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+/**
+ * Android log priority values, in increasing order of priority.
+ */
+typedef enum android_LogPriority {
+ /** For internal use only. */
+ ANDROID_LOG_UNKNOWN = 0,
+ /** The default priority, for internal use only. */
+ ANDROID_LOG_DEFAULT, /* only for SetMinPriority() */
+ /** Verbose logging. Should typically be disabled for a release apk. */
+ ANDROID_LOG_VERBOSE,
+ /** Debug logging. Should typically be disabled for a release apk. */
+ ANDROID_LOG_DEBUG,
+ /** Informational logging. Should typically be disabled for a release apk. */
+ ANDROID_LOG_INFO,
+ /** Warning logging. For use with recoverable failures. */
+ ANDROID_LOG_WARN,
+ /** Error logging. For use with unrecoverable failures. */
+ ANDROID_LOG_ERROR,
+ /** Fatal logging. For use when aborting. */
+ ANDROID_LOG_FATAL,
+ /** For internal use only. */
+ ANDROID_LOG_SILENT, /* only for SetMinPriority(); must be last */
+} android_LogPriority;
+
+/**
+ * Writes the constant string `text` to the log, with priority `prio` and tag
+ * `tag`.
+ */
+int __android_log_write(int prio, const char* tag, const char* text);
+
+/**
+ * Writes a formatted string to the log, with priority `prio` and tag `tag`.
+ * The details of formatting are the same as for
+ * [printf(3)](http://man7.org/linux/man-pages/man3/printf.3.html).
+ */
+int __android_log_print(int prio, const char* tag, const char* fmt, ...)
+ __attribute__((__format__(printf, 3, 4)));
+
+/**
+ * Equivalent to `__android_log_print`, but taking a `va_list`.
+ * (If `__android_log_print` is like `printf`, this is like `vprintf`.)
+ */
+int __android_log_vprint(int prio, const char* tag, const char* fmt, va_list ap)
+ __attribute__((__format__(printf, 3, 0)));
+
+/**
+ * Writes an assertion failure to the log (as `ANDROID_LOG_FATAL`) and to
+ * stderr, before calling
+ * [abort(3)](http://man7.org/linux/man-pages/man3/abort.3.html).
+ *
+ * If `fmt` is non-null, `cond` is unused. If `fmt` is null, the string
+ * `Assertion failed: %s` is used with `cond` as the string argument.
+ * If both `fmt` and `cond` are null, a default string is provided.
+ *
+ * Most callers should use
+ * [assert(3)](http://man7.org/linux/man-pages/man3/assert.3.html) from
+ * `<assert.h>` instead, or the `__assert` and `__assert2` functions
+ * provided by bionic if more control is needed. They support automatically
+ * including the source filename and line number more conveniently than this
+ * function.
+ */
+void __android_log_assert(const char* cond, const char* tag, const char* fmt, ...)
+ __attribute__((__noreturn__)) __attribute__((__format__(printf, 3, 4)));
+
+/**
+ * Identifies a specific log buffer for __android_log_buf_write()
+ * and __android_log_buf_print().
+ */
+typedef enum log_id {
+ LOG_ID_MIN = 0,
+
+ /** The main log buffer. This is the only log buffer available to apps. */
+ LOG_ID_MAIN = 0,
+ /** The radio log buffer. */
+ LOG_ID_RADIO = 1,
+ /** The event log buffer. */
+ LOG_ID_EVENTS = 2,
+ /** The system log buffer. */
+ LOG_ID_SYSTEM = 3,
+ /** The crash log buffer. */
+ LOG_ID_CRASH = 4,
+ /** The statistics log buffer. */
+ LOG_ID_STATS = 5,
+ /** The security log buffer. */
+ LOG_ID_SECURITY = 6,
+ /** The kernel log buffer. */
+ LOG_ID_KERNEL = 7,
+
+ LOG_ID_MAX,
+
+ /** Let the logging function choose the best log target. */
+ LOG_ID_DEFAULT = 0x7FFFFFFF
+} log_id_t;
+
+/**
+ * Writes the constant string `text` to the log buffer `id`,
+ * with priority `prio` and tag `tag`.
+ *
+ * Apps should use __android_log_write() instead.
+ */
+int __android_log_buf_write(int bufID, int prio, const char* tag, const char* text);
+
+/**
+ * Writes a formatted string to log buffer `id`,
+ * with priority `prio` and tag `tag`.
+ * The details of formatting are the same as for
+ * [printf(3)](http://man7.org/linux/man-pages/man3/printf.3.html).
+ *
+ * Apps should use __android_log_print() instead.
+ */
+int __android_log_buf_print(int bufID, int prio, const char* tag, const char* fmt, ...)
+ __attribute__((__format__(printf, 4, 5)));
+
+/**
+ * Logger data struct used for writing log messages to liblog via __android_log_write_logger_data()
+ * and sending log messages to user defined loggers specified in __android_log_set_logger().
+ */
+struct __android_log_message {
+ size_t
+ struct_size; /** Must be set to sizeof(__android_log_message) and is used for versioning. */
+ int32_t buffer_id; /** {@link log_id_t} values. */
+ int32_t priority; /** {@link android_LogPriority} values. */
+ const char* tag; /** The tag for the log message. */
+ const char* file; /** Optional file name, may be set to nullptr. */
+ uint32_t line; /** Optional line number, ignore if file is nullptr. */
+ const char* message; /** The log message itself. */
+};
+
+/**
+ * Prototype for the 'logger' function that is called for every log message.
+ */
+typedef void (*__android_logger_function)(const struct __android_log_message* log_message);
+/**
+ * Prototype for the 'abort' function that is called when liblog will abort due to
+ * __android_log_assert() failures.
+ */
+typedef void (*__android_aborter_function)(const char* abort_message);
+
+#if !defined(__ANDROID__) || __ANDROID_API__ >= 30
+/**
+ * Writes the log message specified by log_message. log_message includes additional file name and
+ * line number information that a logger may use. log_message is versioned for backwards
+ * compatibility.
+ * This assumes that loggability has already been checked through __android_log_is_loggable().
+ * Higher level logging libraries, such as libbase, first check loggability, then format their
+ * buffers, then pass the message to liblog via this function, and therefore we do not want to
+ * duplicate the loggability check here.
+ *
+ * @param log_message the log message itself, see {@link __android_log_message}.
+ *
+ * Available since API level 30.
+ */
+void __android_log_write_log_message(struct __android_log_message* log_message) __INTRODUCED_IN(30);
+
+/**
+ * Sets a user defined logger function. All log messages sent to liblog will be set to the
+ * function pointer specified by logger for processing. It is not expected that log messages are
+ * already terminated with a new line. This function should add new lines if required for line
+ * separation.
+ *
+ * @param logger the new function that will handle log messages.
+ *
+ * Available since API level 30.
+ */
+void __android_log_set_logger(__android_logger_function logger) __INTRODUCED_IN(30);
+
+/**
+ * Writes the log message to logd. This is an __android_logger_function and can be provided to
+ * __android_log_set_logger(). It is the default logger when running liblog on a device.
+ *
+ * @param log_message the log message to write, see {@link __android_log_message}.
+ *
+ * Available since API level 30.
+ */
+void __android_log_logd_logger(const struct __android_log_message* log_message) __INTRODUCED_IN(30);
+
+/**
+ * Writes the log message to stderr. This is an __android_logger_function and can be provided to
+ * __android_log_set_logger(). It is the default logger when running liblog on host.
+ *
+ * @param log_message the log message to write, see {@link __android_log_message}.
+ *
+ * Available since API level 30.
+ */
+void __android_log_stderr_logger(const struct __android_log_message* log_message)
+ __INTRODUCED_IN(30);
+
+/**
+ * Sets a user defined aborter function that is called for __android_log_assert() failures. This
+ * user defined aborter function is highly recommended to abort and be noreturn, but is not strictly
+ * required to.
+ *
+ * @param aborter the new aborter function, see {@link __android_aborter_function}.
+ *
+ * Available since API level 30.
+ */
+void __android_log_set_aborter(__android_aborter_function aborter) __INTRODUCED_IN(30);
+
+/**
+ * Calls the stored aborter function. This allows for other logging libraries to use the same
+ * aborter function by calling this function in liblog.
+ *
+ * @param abort_message an additional message supplied when aborting, for example this is used to
+ * call android_set_abort_message() in __android_log_default_aborter().
+ *
+ * Available since API level 30.
+ */
+void __android_log_call_aborter(const char* abort_message) __INTRODUCED_IN(30);
+
+/**
+ * Sets android_set_abort_message() on device then aborts(). This is the default aborter.
+ *
+ * @param abort_message an additional message supplied when aborting. This functions calls
+ * android_set_abort_message() with its contents.
+ *
+ * Available since API level 30.
+ */
+void __android_log_default_aborter(const char* abort_message) __attribute__((noreturn))
+__INTRODUCED_IN(30);
+
+/**
+ * Use the per-tag properties "log.tag.<tagname>" along with the minimum priority from
+ * __android_log_set_minimum_priority() to determine if a log message with a given prio and tag will
+ * be printed. A non-zero result indicates yes, zero indicates false.
+ *
+ * If both a priority for a tag and a minimum priority are set by
+ * __android_log_set_minimum_priority(), then the lowest of the two values are to determine the
+ * minimum priority needed to log. If only one is set, then that value is used to determine the
+ * minimum priority needed. If none are set, then default_priority is used.
+ *
+ * @param prio the priority to test, takes {@link android_LogPriority} values.
+ * @param tag the tag to test.
+ * @param len the length of the tag.
+ * @param default_prio the default priority to use if no properties or minimum priority are set.
+ * @return an integer where 1 indicates that the message is loggable and 0 indicates that it is not.
+ *
+ * Available since API level 30.
+ */
+int __android_log_is_loggable(int prio, const char* tag, int default_prio) __INTRODUCED_IN(30);
+int __android_log_is_loggable_len(int prio, const char* tag, size_t len, int default_prio)
+ __INTRODUCED_IN(30);
+
+/**
+ * Sets the minimum priority that will be logged for this process.
+ *
+ * @param priority the new minimum priority to set, takes @{link android_LogPriority} values.
+ * @return the previous set minimum priority as @{link android_LogPriority} values, or
+ * ANDROID_LOG_DEFAULT if none was set.
+ *
+ * Available since API level 30.
+ */
+int32_t __android_log_set_minimum_priority(int32_t priority) __INTRODUCED_IN(30);
+
+/**
+ * Gets the minimum priority that will be logged for this process. If none has been set by a
+ * previous __android_log_set_minimum_priority() call, this returns ANDROID_LOG_DEFAULT.
+ *
+ * @return the current minimum priority as @{link android_LogPriority} values, or
+ * ANDROID_LOG_DEFAULT if none is set.
+ *
+ * Available since API level 30.
+ */
+int32_t __android_log_get_minimum_priority(void) __INTRODUCED_IN(30);
+
+/**
+ * Sets the default tag if no tag is provided when writing a log message. Defaults to
+ * getprogname(). This truncates tag to the maximum log message size, though appropriate tags
+ * should be much smaller.
+ *
+ * @param tag the new log tag.
+ *
+ * Available since API level 30.
+ */
+void __android_log_set_default_tag(const char* tag) __INTRODUCED_IN(30);
+#endif
+
+#ifdef __cplusplus
+}
+#endif
+
+/** @} */
diff --git a/chroot/opt/android-master/amd64/usr/include/android/sync.h b/chroot/opt/android-master/amd64/usr/include/android/sync.h
new file mode 100644
index 0000000..32bb878
--- /dev/null
+++ b/chroot/opt/android-master/amd64/usr/include/android/sync.h
@@ -0,0 +1,49 @@
+/*
+ * sync.h
+ *
+ * Copyright 2012 Google, Inc
+ *
+ * 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.
+ */
+
+#ifndef __SYS_CORE_SYNC_H
+#define __SYS_CORE_SYNC_H
+
+/* This file contains the legacy sync interface used by Android platform and
+ * device code. The direct contents will be removed over time as code
+ * transitions to using the updated interface in ndk/sync.h. When this file is
+ * empty other than the ndk/sync.h include, that file will be renamed to
+ * replace this one.
+ *
+ * New code should continue to include this file (#include <android/sync.h>)
+ * instead of ndk/sync.h so the eventual rename is seamless, but should only
+ * use the things declared in ndk/sync.h.
+ *
+ * This file used to be called sync/sync.h, but we renamed to that both the
+ * platform and NDK call it android/sync.h. A symlink from the old name to this
+ * one exists temporarily to avoid having to change all sync clients
+ * simultaneously. It will be removed when they've been updated, and probably
+ * after this change has been delivered to AOSP so that integrations don't
+ * break builds.
+ */
+
+#include "../ndk/sync.h"
+
+__BEGIN_DECLS
+
+/* timeout in msecs */
+int sync_wait(int fd, int timeout);
+
+__END_DECLS
+
+#endif /* __SYS_CORE_SYNC_H */
diff --git a/chroot/opt/android-master/amd64/usr/include/android/versioning.h b/chroot/opt/android-master/amd64/usr/include/android/versioning.h
new file mode 100644
index 0000000..3ea414a
--- /dev/null
+++ b/chroot/opt/android-master/amd64/usr/include/android/versioning.h
@@ -0,0 +1,47 @@
+/*
+ * Copyright (C) 2016 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.
+ */
+
+#pragma once
+
+// The `annotate` attribute always pulls the annotated (inline) function into the object files, thus
+// we should only annotate headers when we are running versioner.
+#if defined(__BIONIC_VERSIONER)
+
+#define __INTRODUCED_IN(api_level) __attribute__((annotate("introduced_in=" #api_level)))
+#define __DEPRECATED_IN(api_level) __attribute__((annotate("deprecated_in=" #api_level)))
+#define __REMOVED_IN(api_level) __attribute__((annotate("obsoleted_in=" #api_level)))
+#define __INTRODUCED_IN_32(api_level) __attribute__((annotate("introduced_in_32=" #api_level)))
+#define __INTRODUCED_IN_64(api_level) __attribute__((annotate("introduced_in_64=" #api_level)))
+#define __INTRODUCED_IN_ARM(api_level) __attribute__((annotate("introduced_in_arm=" #api_level)))
+#define __INTRODUCED_IN_X86(api_level) __attribute__((annotate("introduced_in_x86=" #api_level)))
+
+#define __VERSIONER_NO_GUARD __attribute__((annotate("versioner_no_guard")))
+#define __VERSIONER_FORTIFY_INLINE __attribute__((annotate("versioner_fortify_inline")))
+
+#else
+
+#define __INTRODUCED_IN(api_level)
+#define __DEPRECATED_IN(api_level)
+#define __REMOVED_IN(api_level)
+#define __INTRODUCED_IN_32(api_level)
+#define __INTRODUCED_IN_64(api_level)
+#define __INTRODUCED_IN_ARM(api_level)
+#define __INTRODUCED_IN_X86(api_level)
+
+#define __VERSIONER_NO_GUARD
+#define __VERSIONER_FORTIFY_INLINE
+
+#endif // defined(__BIONIC_VERSIONER)
diff --git a/chroot/opt/android-master/amd64/usr/include/arpa/nameser.h b/chroot/opt/android-master/amd64/usr/include/arpa/nameser.h
new file mode 100644
index 0000000..89ece1c
--- /dev/null
+++ b/chroot/opt/android-master/amd64/usr/include/arpa/nameser.h
@@ -0,0 +1,625 @@
+/* $NetBSD: nameser.h,v 1.25 2009/04/12 17:07:34 christos Exp $ */
+
+/*
+ * Portions Copyright (C) 2004, 2005, 2008, 2009 Internet Systems Consortium, Inc. ("ISC")
+ * Portions Copyright (C) 1996-2003 Internet Software Consortium.
+ *
+ * Permission to use, copy, modify, and/or distribute this software for any
+ * purpose with or without fee is hereby granted, provided that the above
+ * copyright notice and this permission notice appear in all copies.
+ *
+ * THE SOFTWARE IS PROVIDED "AS IS" AND ISC DISCLAIMS ALL WARRANTIES WITH
+ * REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY
+ * AND FITNESS. IN NO EVENT SHALL ISC BE LIABLE FOR ANY SPECIAL, DIRECT,
+ * INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM
+ * LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE
+ * OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
+ * PERFORMANCE OF THIS SOFTWARE.
+ */
+
+/*
+ * Copyright (c) 1983, 1989, 1993
+ * The Regents of the University of California. All rights reserved.
+ *
+ * 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. Neither the name of the University nor the names of its contributors
+ * may be used to endorse or promote products derived from this software
+ * without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``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 REGENTS OR CONTRIBUTORS 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.
+ */
+
+/*
+ * Id: nameser.h,v 1.16 2009/03/03 01:52:48 each Exp
+ */
+
+#ifndef _ARPA_NAMESER_H_
+#define _ARPA_NAMESER_H_
+
+#define BIND_4_COMPAT
+
+#include <sys/types.h>
+#include <sys/cdefs.h>
+
+/*
+ * Revision information. This is the release date in YYYYMMDD format.
+ * It can change every day so the right thing to do with it is use it
+ * in preprocessor commands such as "#if (__NAMESER > 19931104)". Do not
+ * compare for equality; rather, use it to determine whether your libbind.a
+ * contains a new enough lib/nameser/ to support the feature you need.
+ */
+
+#define __NAMESER 20090302 /*%< New interface version stamp. */
+
+/*
+ * Define constants based on RFC0883, RFC1034, RFC 1035
+ */
+#define NS_PACKETSZ 512 /* default UDP packet size */
+#define NS_MAXDNAME 1025 /* maximum domain name (presentation format)*/
+#define NS_MAXMSG 65535 /* maximum message size */
+#define NS_MAXCDNAME 255 /* maximum compressed domain name */
+#define NS_MAXLABEL 63 /* maximum length of domain label */
+#define NS_MAXLABELS 128 /* theoretical max #/labels per domain name */
+#define NS_MAXNNAME 256 /* maximum uncompressed (binary) domain name*/
+#define NS_MAXPADDR (sizeof "ffff:ffff:ffff:ffff:ffff:ffff:ffff:ffff")
+#define NS_HFIXEDSZ 12 /* #/bytes of fixed data in header */
+#define NS_QFIXEDSZ 4 /* #/bytes of fixed data in query */
+#define NS_RRFIXEDSZ 10 /* #/bytes of fixed data in r record */
+#define NS_INT32SZ 4 /* #/bytes of data in a uint32_t */
+#define NS_INT16SZ 2 /* #/bytes of data in a uint16_t */
+#define NS_INT8SZ 1 /* #/bytes of data in a uint8_t */
+#define NS_INADDRSZ 4 /* IPv4 T_A */
+#define NS_IN6ADDRSZ 16 /* IPv6 T_AAAA */
+#define NS_CMPRSFLGS 0xc0 /* Flag bits indicating name compression. */
+#define NS_DEFAULTPORT 53 /* For both TCP and UDP. */
+
+/*
+ * These can be expanded with synonyms, just keep ns_parse.c:ns_parserecord()
+ * in synch with it.
+ */
+typedef enum __ns_sect {
+ ns_s_qd = 0, /* Query: Question. */
+ ns_s_zn = 0, /* Update: Zone. */
+ ns_s_an = 1, /* Query: Answer. */
+ ns_s_pr = 1, /* Update: Prerequisites. */
+ ns_s_ns = 2, /* Query: Name servers. */
+ ns_s_ud = 2, /* Update: Update. */
+ ns_s_ar = 3, /* Query|Update: Additional records. */
+ ns_s_max = 4
+} ns_sect;
+
+/*
+ * Network name (compressed or not) type. Equivilent to a pointer when used
+ * in a function prototype. Can be const'd.
+ */
+typedef u_char ns_nname[NS_MAXNNAME];
+typedef const u_char *ns_nname_ct;
+typedef u_char *ns_nname_t;
+
+struct ns_namemap { ns_nname_ct base; int len; };
+typedef struct ns_namemap *ns_namemap_t;
+typedef const struct ns_namemap *ns_namemap_ct;
+
+/*
+ * This is a message handle. It is caller allocated and has no dynamic data.
+ * This structure is intended to be opaque to all but ns_parse.c, thus the
+ * leading _'s on the member names. Use the accessor functions, not the _'s.
+ */
+typedef struct __ns_msg {
+ const u_char *_msg, *_eom;
+ uint16_t _id, _flags, _counts[ns_s_max];
+ const u_char *_sections[ns_s_max];
+ ns_sect _sect;
+ int _rrnum;
+ const u_char *_msg_ptr;
+} ns_msg;
+/*
+ * This is a newmsg handle, used when constructing new messages with
+ * ns_newmsg_init, et al.
+ */
+struct ns_newmsg {
+ ns_msg msg;
+ const u_char *dnptrs[25];
+ const u_char **lastdnptr;
+};
+typedef struct ns_newmsg ns_newmsg;
+
+/* Accessor macros - this is part of the public interface. */
+
+#define ns_msg_id(handle) ((handle)._id + 0)
+#define ns_msg_base(handle) ((handle)._msg + 0)
+#define ns_msg_end(handle) ((handle)._eom + 0)
+#define ns_msg_size(handle) ((size_t)((handle)._eom - (handle)._msg))
+#define ns_msg_count(handle, section) ((handle)._counts[section] + 0)
+
+/*
+ * This is a parsed record. It is caller allocated and has no dynamic data.
+ */
+typedef struct __ns_rr {
+ char name[NS_MAXDNAME];
+ uint16_t type;
+ uint16_t rr_class;
+ uint32_t ttl;
+ uint16_t rdlength;
+ const u_char * rdata;
+} ns_rr;
+
+/*
+ * Same thing, but using uncompressed network binary names, and real C types.
+ */
+typedef struct __ns_rr2 {
+ ns_nname nname;
+ size_t nnamel;
+ int type;
+ int rr_class;
+ u_int ttl;
+ int rdlength;
+ const u_char * rdata;
+} ns_rr2;
+/* Accessor macros - this is part of the public interface. */
+#define ns_rr_name(rr) (((rr).name[0] != '\0') ? (rr).name : ".")
+#define ns_rr_nname(rr) ((const ns_nname_t)(rr).nname)
+#define ns_rr_nnamel(rr) ((rr).nnamel + 0)
+#define ns_rr_type(rr) ((ns_type)((rr).type + 0))
+#define ns_rr_class(rr) ((ns_class)((rr).rr_class + 0))
+#define ns_rr_ttl(rr) ((u_long)(rr).ttl + 0)
+#define ns_rr_rdlen(rr) ((size_t)(rr).rdlength + 0)
+#define ns_rr_rdata(rr) ((rr).rdata + 0)
+
+/*
+ * These don't have to be in the same order as in the packet flags word,
+ * and they can even overlap in some cases, but they will need to be kept
+ * in synch with ns_parse.c:ns_flagdata[].
+ */
+typedef enum __ns_flag {
+ ns_f_qr, /* Question/Response. */
+ ns_f_opcode, /* Operation code. */
+ ns_f_aa, /* Authoritative Answer. */
+ ns_f_tc, /* Truncation occurred. */
+ ns_f_rd, /* Recursion Desired. */
+ ns_f_ra, /* Recursion Available. */
+ ns_f_z, /* MBZ. */
+ ns_f_ad, /* Authentic Data (DNSSEC). */
+ ns_f_cd, /* Checking Disabled (DNSSEC). */
+ ns_f_rcode, /* Response code. */
+ ns_f_max
+} ns_flag;
+
+/*
+ * Currently defined opcodes.
+ */
+typedef enum __ns_opcode {
+ ns_o_query = 0, /* Standard query. */
+ ns_o_iquery = 1, /* Inverse query (deprecated/unsupported). */
+ ns_o_status = 2, /* Name server status query (unsupported). */
+ /* Opcode 3 is undefined/reserved. */
+ ns_o_notify = 4, /* Zone change notification. */
+ ns_o_update = 5, /* Zone update message. */
+ ns_o_max = 6
+} ns_opcode;
+
+/*
+ * Currently defined response codes.
+ */
+typedef enum __ns_rcode {
+ ns_r_noerror = 0, /* No error occurred. */
+ ns_r_formerr = 1, /* Format error. */
+ ns_r_servfail = 2, /* Server failure. */
+ ns_r_nxdomain = 3, /* Name error. */
+ ns_r_notimpl = 4, /* Unimplemented. */
+ ns_r_refused = 5, /* Operation refused. */
+ /* these are for BIND_UPDATE */
+ ns_r_yxdomain = 6, /* Name exists */
+ ns_r_yxrrset = 7, /* RRset exists */
+ ns_r_nxrrset = 8, /* RRset does not exist */
+ ns_r_notauth = 9, /* Not authoritative for zone */
+ ns_r_notzone = 10, /* Zone of record different from zone section */
+ ns_r_max = 11,
+ /* The following are EDNS extended rcodes */
+ ns_r_badvers = 16,
+ /* The following are TSIG errors */
+ ns_r_badsig = 16,
+ ns_r_badkey = 17,
+ ns_r_badtime = 18
+} ns_rcode;
+
+/* BIND_UPDATE */
+typedef enum __ns_update_operation {
+ ns_uop_delete = 0,
+ ns_uop_add = 1,
+ ns_uop_max = 2
+} ns_update_operation;
+
+/*
+ * This structure is used for TSIG authenticated messages
+ */
+struct ns_tsig_key {
+ char name[NS_MAXDNAME], alg[NS_MAXDNAME];
+ unsigned char *data;
+ int len;
+};
+typedef struct ns_tsig_key ns_tsig_key;
+
+/*
+ * This structure is used for TSIG authenticated TCP messages
+ */
+struct ns_tcp_tsig_state {
+ int counter;
+ struct dst_key *key;
+ void *ctx;
+ unsigned char sig[NS_PACKETSZ];
+ int siglen;
+};
+typedef struct ns_tcp_tsig_state ns_tcp_tsig_state;
+
+#define NS_TSIG_FUDGE 300
+#define NS_TSIG_TCP_COUNT 100
+#define NS_TSIG_ALG_HMAC_MD5 "HMAC-MD5.SIG-ALG.REG.INT"
+
+#define NS_TSIG_ERROR_NO_TSIG -10
+#define NS_TSIG_ERROR_NO_SPACE -11
+#define NS_TSIG_ERROR_FORMERR -12
+
+/*
+ * Currently defined type values for resources and queries.
+ */
+typedef enum __ns_type {
+ ns_t_invalid = 0, /* Cookie. */
+ ns_t_a = 1, /* Host address. */
+ ns_t_ns = 2, /* Authoritative server. */
+ ns_t_md = 3, /* Mail destination. */
+ ns_t_mf = 4, /* Mail forwarder. */
+ ns_t_cname = 5, /* Canonical name. */
+ ns_t_soa = 6, /* Start of authority zone. */
+ ns_t_mb = 7, /* Mailbox domain name. */
+ ns_t_mg = 8, /* Mail group member. */
+ ns_t_mr = 9, /* Mail rename name. */
+ ns_t_null = 10, /* Null resource record. */
+ ns_t_wks = 11, /* Well known service. */
+ ns_t_ptr = 12, /* Domain name pointer. */
+ ns_t_hinfo = 13, /* Host information. */
+ ns_t_minfo = 14, /* Mailbox information. */
+ ns_t_mx = 15, /* Mail routing information. */
+ ns_t_txt = 16, /* Text strings. */
+ ns_t_rp = 17, /* Responsible person. */
+ ns_t_afsdb = 18, /* AFS cell database. */
+ ns_t_x25 = 19, /* X_25 calling address. */
+ ns_t_isdn = 20, /* ISDN calling address. */
+ ns_t_rt = 21, /* Router. */
+ ns_t_nsap = 22, /* NSAP address. */
+ ns_t_nsap_ptr = 23, /* Reverse NSAP lookup (deprecated). */
+ ns_t_sig = 24, /* Security signature. */
+ ns_t_key = 25, /* Security key. */
+ ns_t_px = 26, /* X.400 mail mapping. */
+ ns_t_gpos = 27, /* Geographical position (withdrawn). */
+ ns_t_aaaa = 28, /* IPv6 Address. */
+ ns_t_loc = 29, /* Location Information. */
+ ns_t_nxt = 30, /* Next domain (security). */
+ ns_t_eid = 31, /* Endpoint identifier. */
+ ns_t_nimloc = 32, /* Nimrod Locator. */
+ ns_t_srv = 33, /* Server Selection. */
+ ns_t_atma = 34, /* ATM Address */
+ ns_t_naptr = 35, /* Naming Authority PoinTeR */
+ ns_t_kx = 36, /* Key Exchange */
+ ns_t_cert = 37, /* Certification record */
+ ns_t_a6 = 38, /* IPv6 address (experimental) */
+ ns_t_dname = 39, /* Non-terminal DNAME */
+ ns_t_sink = 40, /* Kitchen sink (experimentatl) */
+ ns_t_opt = 41, /* EDNS0 option (meta-RR) */
+ ns_t_apl = 42, /* Address prefix list (RFC 3123) */
+ ns_t_ds = 43, /* Delegation Signer */
+ ns_t_sshfp = 44, /* SSH Fingerprint */
+ ns_t_ipseckey = 45, /* IPSEC Key */
+ ns_t_rrsig = 46, /* RRset Signature */
+ ns_t_nsec = 47, /* Negative security */
+ ns_t_dnskey = 48, /* DNS Key */
+ ns_t_dhcid = 49, /* Dynamic host configuratin identifier */
+ ns_t_nsec3 = 50, /* Negative security type 3 */
+ ns_t_nsec3param = 51, /* Negative security type 3 parameters */
+ ns_t_hip = 55, /* Host Identity Protocol */
+ ns_t_spf = 99, /* Sender Policy Framework */
+ ns_t_tkey = 249, /* Transaction key */
+ ns_t_tsig = 250, /* Transaction signature. */
+ ns_t_ixfr = 251, /* Incremental zone transfer. */
+ ns_t_axfr = 252, /* Transfer zone of authority. */
+ ns_t_mailb = 253, /* Transfer mailbox records. */
+ ns_t_maila = 254, /* Transfer mail agent records. */
+ ns_t_any = 255, /* Wildcard match. */
+ ns_t_zxfr = 256, /* BIND-specific, nonstandard. */
+ ns_t_dlv = 32769, /* DNSSEC look-aside validatation. */
+ ns_t_max = 65536
+} ns_type;
+
+/* Exclusively a QTYPE? (not also an RTYPE) */
+#define ns_t_qt_p(t) (ns_t_xfr_p(t) || (t) == ns_t_any || \
+ (t) == ns_t_mailb || (t) == ns_t_maila)
+/* Some kind of meta-RR? (not a QTYPE, but also not an RTYPE) */
+#define ns_t_mrr_p(t) ((t) == ns_t_tsig || (t) == ns_t_opt)
+/* Exclusively an RTYPE? (not also a QTYPE or a meta-RR) */
+#define ns_t_rr_p(t) (!ns_t_qt_p(t) && !ns_t_mrr_p(t))
+#define ns_t_udp_p(t) ((t) != ns_t_axfr && (t) != ns_t_zxfr)
+#define ns_t_xfr_p(t) ((t) == ns_t_axfr || (t) == ns_t_ixfr || \
+ (t) == ns_t_zxfr)
+
+/*
+ * Values for class field
+ */
+typedef enum __ns_class {
+ ns_c_invalid = 0, /* Cookie. */
+ ns_c_in = 1, /* Internet. */
+ ns_c_2 = 2, /* unallocated/unsupported. */
+ ns_c_chaos = 3, /* MIT Chaos-net. */
+ ns_c_hs = 4, /* MIT Hesiod. */
+ /* Query class values which do not appear in resource records */
+ ns_c_none = 254, /* for prereq. sections in update requests */
+ ns_c_any = 255, /* Wildcard match. */
+ ns_c_max = 65536
+} ns_class;
+
+/* DNSSEC constants. */
+
+typedef enum __ns_key_types {
+ ns_kt_rsa = 1, /* key type RSA/MD5 */
+ ns_kt_dh = 2, /* Diffie Hellman */
+ ns_kt_dsa = 3, /* Digital Signature Standard (MANDATORY) */
+ ns_kt_private = 254 /* Private key type starts with OID */
+} ns_key_types;
+
+typedef enum __ns_cert_types {
+ cert_t_pkix = 1, /* PKIX (X.509v3) */
+ cert_t_spki = 2, /* SPKI */
+ cert_t_pgp = 3, /* PGP */
+ cert_t_url = 253, /* URL private type */
+ cert_t_oid = 254 /* OID private type */
+} ns_cert_types;
+
+/* Flags field of the KEY RR rdata. */
+#define NS_KEY_TYPEMASK 0xC000 /* Mask for "type" bits */
+#define NS_KEY_TYPE_AUTH_CONF 0x0000 /* Key usable for both */
+#define NS_KEY_TYPE_CONF_ONLY 0x8000 /* Key usable for confidentiality */
+#define NS_KEY_TYPE_AUTH_ONLY 0x4000 /* Key usable for authentication */
+#define NS_KEY_TYPE_NO_KEY 0xC000 /* No key usable for either; no key */
+/* The type bits can also be interpreted independently, as single bits: */
+#define NS_KEY_NO_AUTH 0x8000 /* Key unusable for authentication */
+#define NS_KEY_NO_CONF 0x4000 /* Key unusable for confidentiality */
+#define NS_KEY_RESERVED2 0x2000 /* Security is *mandatory* if bit=0 */
+#define NS_KEY_EXTENDED_FLAGS 0x1000 /* reserved - must be zero */
+#define NS_KEY_RESERVED4 0x0800 /* reserved - must be zero */
+#define NS_KEY_RESERVED5 0x0400 /* reserved - must be zero */
+#define NS_KEY_NAME_TYPE 0x0300 /* these bits determine the type */
+#define NS_KEY_NAME_USER 0x0000 /* key is assoc. with user */
+#define NS_KEY_NAME_ENTITY 0x0200 /* key is assoc. with entity eg host */
+#define NS_KEY_NAME_ZONE 0x0100 /* key is zone key */
+#define NS_KEY_NAME_RESERVED 0x0300 /* reserved meaning */
+#define NS_KEY_RESERVED8 0x0080 /* reserved - must be zero */
+#define NS_KEY_RESERVED9 0x0040 /* reserved - must be zero */
+#define NS_KEY_RESERVED10 0x0020 /* reserved - must be zero */
+#define NS_KEY_RESERVED11 0x0010 /* reserved - must be zero */
+#define NS_KEY_SIGNATORYMASK 0x000F /* key can sign RR's of same name */
+#define NS_KEY_RESERVED_BITMASK ( NS_KEY_RESERVED2 | \
+ NS_KEY_RESERVED4 | \
+ NS_KEY_RESERVED5 | \
+ NS_KEY_RESERVED8 | \
+ NS_KEY_RESERVED9 | \
+ NS_KEY_RESERVED10 | \
+ NS_KEY_RESERVED11 )
+#define NS_KEY_RESERVED_BITMASK2 0xFFFF /* no bits defined here */
+
+/* The Algorithm field of the KEY and SIG RR's is an integer, {1..254} */
+#define NS_ALG_MD5RSA 1 /* MD5 with RSA */
+#define NS_ALG_DH 2 /* Diffie Hellman KEY */
+#define NS_ALG_DSA 3 /* DSA KEY */
+#define NS_ALG_DSS NS_ALG_DSA
+#define NS_ALG_EXPIRE_ONLY 253 /* No alg, no security */
+#define NS_ALG_PRIVATE_OID 254 /* Key begins with OID giving alg */
+
+/* Protocol values */
+/* value 0 is reserved */
+#define NS_KEY_PROT_TLS 1
+#define NS_KEY_PROT_EMAIL 2
+#define NS_KEY_PROT_DNSSEC 3
+#define NS_KEY_PROT_IPSEC 4
+#define NS_KEY_PROT_ANY 255
+
+/* Signatures */
+#define NS_MD5RSA_MIN_BITS 512 /* Size of a mod or exp in bits */
+#define NS_MD5RSA_MAX_BITS 4096
+ /* Total of binary mod and exp */
+#define NS_MD5RSA_MAX_BYTES ((NS_MD5RSA_MAX_BITS+7/8)*2+3)
+ /* Max length of text sig block */
+#define NS_MD5RSA_MAX_BASE64 (((NS_MD5RSA_MAX_BYTES+2)/3)*4)
+#define NS_MD5RSA_MIN_SIZE ((NS_MD5RSA_MIN_BITS+7)/8)
+#define NS_MD5RSA_MAX_SIZE ((NS_MD5RSA_MAX_BITS+7)/8)
+
+#define NS_DSA_SIG_SIZE 41
+#define NS_DSA_MIN_SIZE 213
+#define NS_DSA_MAX_BYTES 405
+
+/* Offsets into SIG record rdata to find various values */
+#define NS_SIG_TYPE 0 /* Type flags */
+#define NS_SIG_ALG 2 /* Algorithm */
+#define NS_SIG_LABELS 3 /* How many labels in name */
+#define NS_SIG_OTTL 4 /* Original TTL */
+#define NS_SIG_EXPIR 8 /* Expiration time */
+#define NS_SIG_SIGNED 12 /* Signature time */
+#define NS_SIG_FOOT 16 /* Key footprint */
+#define NS_SIG_SIGNER 18 /* Domain name of who signed it */
+
+/* How RR types are represented as bit-flags in NXT records */
+#define NS_NXT_BITS 8
+#define NS_NXT_BIT_SET( n,p) (p[(n)/NS_NXT_BITS] |= (0x80>>((n)%NS_NXT_BITS)))
+#define NS_NXT_BIT_CLEAR(n,p) (p[(n)/NS_NXT_BITS] &= ~(0x80>>((n)%NS_NXT_BITS)))
+#define NS_NXT_BIT_ISSET(n,p) (p[(n)/NS_NXT_BITS] & (0x80>>((n)%NS_NXT_BITS)))
+#define NS_NXT_MAX 127
+
+/*
+ * EDNS0 extended flags and option codes, host order.
+ */
+#define NS_OPT_DNSSEC_OK 0x8000U
+#define NS_OPT_NSID 3
+#define NS_OPT_PADDING 12
+
+/*
+ * Inline versions of get/put short/long. Pointer is advanced.
+ */
+#define NS_GET16(s, cp) do { \
+ const u_char *t_cp = (const u_char *)(cp); \
+ (s) = ((uint16_t)t_cp[0] << 8) \
+ | ((uint16_t)t_cp[1]) \
+ ; \
+ (cp) += NS_INT16SZ; \
+} while (/*CONSTCOND*/0)
+
+#define NS_GET32(l, cp) do { \
+ const u_char *t_cp = (const u_char *)(cp); \
+ (l) = ((uint32_t)t_cp[0] << 24) \
+ | ((uint32_t)t_cp[1] << 16) \
+ | ((uint32_t)t_cp[2] << 8) \
+ | ((uint32_t)t_cp[3]) \
+ ; \
+ (cp) += NS_INT32SZ; \
+} while (/*CONSTCOND*/0)
+
+#define NS_PUT16(s, cp) do { \
+ uint32_t t_s = (uint32_t)(s); \
+ u_char *t_cp = (u_char *)(cp); \
+ *t_cp++ = t_s >> 8; \
+ *t_cp = t_s; \
+ (cp) += NS_INT16SZ; \
+} while (/*CONSTCOND*/0)
+
+#define NS_PUT32(l, cp) do { \
+ uint32_t t_l = (uint32_t)(l); \
+ u_char *t_cp = (u_char *)(cp); \
+ *t_cp++ = t_l >> 24; \
+ *t_cp++ = t_l >> 16; \
+ *t_cp++ = t_l >> 8; \
+ *t_cp = t_l; \
+ (cp) += NS_INT32SZ; \
+} while (/*CONSTCOND*/0)
+
+__BEGIN_DECLS
+
+#if !defined(__LP64__)
+/* Annoyingly, LP32 shipped with __ names. */
+#define ns_msg_getflag __ns_msg_getflag
+#define ns_get16 __ns_get16
+#define ns_get32 __ns_get32
+#define ns_put16 __ns_put16
+#define ns_put32 __ns_put32
+#define ns_initparse __ns_initparse
+#define ns_skiprr __ns_skiprr
+#define ns_parserr __ns_parserr
+#define ns_parserr2 __ns_parserr2
+#define ns_sprintrr __ns_sprintrr
+#define ns_sprintrrf __ns_sprintrrf
+#define ns_format_ttl __ns_format_ttl
+#define ns_parse_ttl __ns_parse_ttl
+#define ns_datetosecs __ns_datetosecs
+#define ns_name_ntol __ns_name_ntol
+#define ns_name_ntop __ns_name_ntop
+#define ns_name_pton __ns_name_pton
+#define ns_name_pton2 __ns_name_pton2
+#define ns_name_unpack __ns_name_unpack
+#define ns_name_unpack2 __ns_name_unpack2
+#define ns_name_pack __ns_name_pack
+#define ns_name_compress __ns_name_compress
+#define ns_name_uncompress __ns_name_uncompress
+#define ns_name_skip __ns_name_skip
+#define ns_name_rollback __ns_name_rollback
+#define ns_name_length __ns_name_length
+#define ns_name_eq __ns_name_eq
+#define ns_name_owned __ns_name_owned
+#define ns_name_map __ns_name_map
+#define ns_name_labels __ns_name_labels
+#define ns_sign __ns_sign
+#define ns_sign2 __ns_sign2
+#define ns_sign_tcp __ns_sign_tcp
+#define ns_sign_tcp2 __ns_sign_tcp2
+#define ns_sign_tcp_init __ns_sign_tcp_init
+#define ns_find_tsig __ns_find_tsig
+#define ns_verify __ns_verify
+#define ns_verify_tcp __ns_verify_tcp
+#define ns_verify_tcp_init __ns_verify_tcp_init
+#define ns_samedomain __ns_samedomain
+#define ns_subdomain __ns_subdomain
+#define ns_makecanon __ns_makecanon
+#define ns_samename __ns_samename
+
+int ns_msg_getflag(ns_msg __handle, int __flag);
+uint16_t ns_get16(const u_char* __src);
+uint32_t ns_get32(const u_char* __src);
+void ns_put16(uint16_t __src, u_char* __dst);
+void ns_put32(uint32_t __src, u_char* __dst);
+int ns_initparse(const u_char* __msg, int __msg_size, ns_msg* __handle);
+int ns_skiprr(const u_char* __ptr, const u_char* __eom, ns_sect __section, int __count);
+int ns_parserr(ns_msg* __handle, ns_sect __section, int __rr_number, ns_rr* __rr);
+int ns_sprintrr(const ns_msg* __handle, const ns_rr* __rr, const char* __name_ctx, const char* __origin, char* __buf, size_t __buf_size);
+int ns_sprintrrf(const u_char* __msg, size_t __msg_size, const char* __name, ns_class __class, ns_type __type, u_long __ttl, const u_char* __rdata, size_t __rdata_size, const char* __name_ctx, const char* __origin, char* __buf, size_t __buf_size);
+int ns_format_ttl(u_long __ttl, char* __dst, size_t __dst_size);
+int ns_name_ntol(const u_char* __src, u_char* __dst, size_t __dst_size);
+int ns_name_ntop(const u_char* __src, char* __dst, size_t __dst_size);
+int ns_name_pton(const char* __src, u_char* __dst, size_t __dst_size);
+int ns_name_unpack(const u_char* __msg, const u_char* __eom, const u_char* __src, u_char* __dst, size_t __dst_size);
+int ns_name_pack(const u_char* __src, u_char* __dst, int __dst_size, const u_char** __dn_ptrs, const u_char** __last_dn_ptr);
+int ns_name_uncompress(const u_char* __msg, const u_char* __eom, const u_char* __src, char* __dst, size_t __dst_size);
+int ns_name_compress(const char* __src, u_char* __dst, size_t __dst_size, const u_char** __dn_ptrs, const u_char** __last_dn_ptr);
+int ns_name_skip(const u_char** __ptr_ptr, const u_char* __eom);
+void ns_name_rollback(const u_char* __src, const u_char** __dn_ptrs, const u_char** __last_dn_ptr);
+
+int ns_makecanon(const char* __src, char* __dst, size_t __dst_size);
+int ns_samename(const char* __lhs, const char* __rhs);
+
+#else
+/* The names of these symbols were accidentally prefixed with __ in L. */
+/* The duplication here is intentional to avoid declaring different symbols with the same
+ * declaration. */
+int ns_msg_getflag(ns_msg __handle, int __flag) __INTRODUCED_IN_64(22);
+uint16_t ns_get16(const u_char* __src) __INTRODUCED_IN_64(22);
+uint32_t ns_get32(const u_char* __src) __INTRODUCED_IN_64(22);
+void ns_put16(uint16_t __src, u_char* __dst) __INTRODUCED_IN_64(22);
+void ns_put32(uint32_t __src, u_char* __dst) __INTRODUCED_IN_64(22);
+int ns_initparse(const u_char* __msg, int __msg_size, ns_msg* __handle) __INTRODUCED_IN_64(22);
+int ns_skiprr(const u_char* __ptr, const u_char* __eom, ns_sect __section, int __count) __INTRODUCED_IN_64(22);
+int ns_parserr(ns_msg* __handle, ns_sect __section, int __rr_number, ns_rr* __rr) __INTRODUCED_IN_64(22);
+int ns_sprintrr(const ns_msg* __handle, const ns_rr* __rr, const char* __name_ctx, const char* __origin, char* __buf, size_t __buf_size) __INTRODUCED_IN_64(22);
+int ns_sprintrrf(const u_char* __msg, size_t __msg_size, const char* __name, ns_class __class, ns_type __type, u_long __ttl, const u_char* __rdata, size_t __rdata_size, const char* __name_ctx, const char* __origin, char* __buf, size_t __buf_size) __INTRODUCED_IN_64(22);
+int ns_format_ttl(u_long __ttl, char* __dst, size_t __dst_size) __INTRODUCED_IN_64(22);
+int ns_name_ntol(const u_char* __src, u_char* __dst, size_t __dst_size) __INTRODUCED_IN_64(22);
+int ns_name_ntop(const u_char* __src, char* __dst, size_t __dst_size) __INTRODUCED_IN_64(22);
+int ns_name_pton(const char* __src, u_char* __dst, size_t __dst_size) __INTRODUCED_IN_64(22);
+int ns_name_unpack(const u_char* __msg, const u_char* __eom, const u_char* __src, u_char* __dst, size_t __dst_size) __INTRODUCED_IN_64(22);
+int ns_name_pack(const u_char* __src, u_char* __dst, int __dst_size, const u_char** __dn_ptrs, const u_char** __last_dn_ptr) __INTRODUCED_IN_64(22);
+int ns_name_uncompress(const u_char* __msg, const u_char* __eom, const u_char* __src, char* __dst, size_t __dst_size) __INTRODUCED_IN_64(22);
+int ns_name_compress(const char* __src, u_char* __dst, size_t __dst_size, const u_char** __dn_ptrs, const u_char** __last_dn_ptr) __INTRODUCED_IN_64(22);
+int ns_name_skip(const u_char** __ptr_ptr, const u_char* __eom) __INTRODUCED_IN_64(22);
+void ns_name_rollback(const u_char* __src, const u_char** __dn_ptrs, const u_char** __last_dn_ptr) __INTRODUCED_IN_64(22);
+
+int ns_makecanon(const char* __src, char* __dst, size_t __dst_size) __INTRODUCED_IN_64(22);
+int ns_samename(const char* __lhs, const char* __rhs) __INTRODUCED_IN_64(22);
+#endif /* !defined(__LP64__) */
+
+__END_DECLS
+
+#ifdef BIND_4_COMPAT
+#include <arpa/nameser_compat.h>
+#endif
+
+#endif /* !_ARPA_NAMESER_H_ */
diff --git a/chroot/opt/android-master/amd64/usr/include/arpa/nameser_compat.h b/chroot/opt/android-master/amd64/usr/include/arpa/nameser_compat.h
new file mode 100644
index 0000000..e4e9335
--- /dev/null
+++ b/chroot/opt/android-master/amd64/usr/include/arpa/nameser_compat.h
@@ -0,0 +1,176 @@
+/* $NetBSD: nameser_compat.h,v 1.1.1.2 2004/11/07 01:28:27 christos Exp $ */
+
+/* Copyright (c) 1983, 1989
+ * The Regents of the University of California. All rights reserved.
+ *
+ * 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. All advertising materials mentioning features or use of this software
+ * must display the following acknowledgement:
+ * This product includes software developed by the University of
+ * California, Berkeley and its contributors.
+ * 4. Neither the name of the University nor the names of its contributors
+ * may be used to endorse or promote products derived from this software
+ * without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``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 REGENTS OR CONTRIBUTORS 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.
+ */
+
+/*
+ * from nameser.h 8.1 (Berkeley) 6/2/93
+ * Id: nameser_compat.h,v 1.8 2006/05/19 02:33:40 marka Exp
+ */
+
+#ifndef _ARPA_NAMESER_COMPAT_
+#define _ARPA_NAMESER_COMPAT_
+
+#include <endian.h>
+#include <sys/cdefs.h>
+
+#define __BIND 19950621 /* (DEAD) interface version stamp. */
+
+/*
+ * Structure for query header. The order of the fields is machine- and
+ * compiler-dependent, depending on the byte/bit order and the layout
+ * of bit fields. We use bit fields only in int variables, as this
+ * is all ANSI requires. This requires a somewhat confusing rearrangement.
+ */
+
+typedef struct {
+ unsigned id :16; /* query identification number */
+ /* fields in third byte */
+ unsigned rd :1; /* recursion desired */
+ unsigned tc :1; /* truncated message */
+ unsigned aa :1; /* authoritive answer */
+ unsigned opcode :4; /* purpose of message */
+ unsigned qr :1; /* response flag */
+ /* fields in fourth byte */
+ unsigned rcode :4; /* response code */
+ unsigned cd: 1; /* checking disabled by resolver */
+ unsigned ad: 1; /* authentic data from named */
+ unsigned unused :1; /* unused bits (MBZ as of 4.9.3a3) */
+ unsigned ra :1; /* recursion available */
+ /* remaining bytes */
+ unsigned qdcount :16; /* number of question entries */
+ unsigned ancount :16; /* number of answer entries */
+ unsigned nscount :16; /* number of authority entries */
+ unsigned arcount :16; /* number of resource entries */
+} HEADER;
+
+#define PACKETSZ NS_PACKETSZ
+#define MAXDNAME NS_MAXDNAME
+#define MAXCDNAME NS_MAXCDNAME
+#define MAXLABEL NS_MAXLABEL
+#define HFIXEDSZ NS_HFIXEDSZ
+#define QFIXEDSZ NS_QFIXEDSZ
+#define RRFIXEDSZ NS_RRFIXEDSZ
+#define INT32SZ NS_INT32SZ
+#define INT16SZ NS_INT16SZ
+#define INT8SZ NS_INT8SZ
+#define INADDRSZ NS_INADDRSZ
+#define IN6ADDRSZ NS_IN6ADDRSZ
+#define INDIR_MASK NS_CMPRSFLGS
+#define NAMESERVER_PORT NS_DEFAULTPORT
+
+#define S_ZONE ns_s_zn
+#define S_PREREQ ns_s_pr
+#define S_UPDATE ns_s_ud
+#define S_ADDT ns_s_ar
+
+#define QUERY ns_o_query
+#define IQUERY ns_o_iquery
+#define STATUS ns_o_status
+#define NS_NOTIFY_OP ns_o_notify
+#define NS_UPDATE_OP ns_o_update
+
+#define NOERROR ns_r_noerror
+#define FORMERR ns_r_formerr
+#define SERVFAIL ns_r_servfail
+#define NXDOMAIN ns_r_nxdomain
+#define NOTIMP ns_r_notimpl
+#define REFUSED ns_r_refused
+#define YXDOMAIN ns_r_yxdomain
+#define YXRRSET ns_r_yxrrset
+#define NXRRSET ns_r_nxrrset
+#define NOTAUTH ns_r_notauth
+#define NOTZONE ns_r_notzone
+/*#define BADSIG ns_r_badsig*/
+/*#define BADKEY ns_r_badkey*/
+/*#define BADTIME ns_r_badtime*/
+
+
+#define DELETE ns_uop_delete
+#define ADD ns_uop_add
+
+#define T_A ns_t_a
+#define T_NS ns_t_ns
+#define T_MD ns_t_md
+#define T_MF ns_t_mf
+#define T_CNAME ns_t_cname
+#define T_SOA ns_t_soa
+#define T_MB ns_t_mb
+#define T_MG ns_t_mg
+#define T_MR ns_t_mr
+#define T_NULL ns_t_null
+#define T_WKS ns_t_wks
+#define T_PTR ns_t_ptr
+#define T_HINFO ns_t_hinfo
+#define T_MINFO ns_t_minfo
+#define T_MX ns_t_mx
+#define T_TXT ns_t_txt
+#define T_RP ns_t_rp
+#define T_AFSDB ns_t_afsdb
+#define T_X25 ns_t_x25
+#define T_ISDN ns_t_isdn
+#define T_RT ns_t_rt
+#define T_NSAP ns_t_nsap
+#define T_NSAP_PTR ns_t_nsap_ptr
+#define T_SIG ns_t_sig
+#define T_KEY ns_t_key
+#define T_PX ns_t_px
+#define T_GPOS ns_t_gpos
+#define T_AAAA ns_t_aaaa
+#define T_LOC ns_t_loc
+#define T_NXT ns_t_nxt
+#define T_EID ns_t_eid
+#define T_NIMLOC ns_t_nimloc
+#define T_SRV ns_t_srv
+#define T_ATMA ns_t_atma
+#define T_NAPTR ns_t_naptr
+#define T_A6 ns_t_a6
+#define T_TSIG ns_t_tsig
+#define T_IXFR ns_t_ixfr
+#define T_AXFR ns_t_axfr
+#define T_MAILB ns_t_mailb
+#define T_MAILA ns_t_maila
+#define T_ANY ns_t_any
+
+#define C_IN ns_c_in
+#define C_CHAOS ns_c_chaos
+#define C_HS ns_c_hs
+/* BIND_UPDATE */
+#define C_NONE ns_c_none
+#define C_ANY ns_c_any
+
+#define GETSHORT NS_GET16
+#define GETLONG NS_GET32
+#define PUTSHORT NS_PUT16
+#define PUTLONG NS_PUT32
+
+#endif /* _ARPA_NAMESER_COMPAT_ */
diff --git a/chroot/opt/android-master/amd64/usr/include/asm-generic/termios.h b/chroot/opt/android-master/amd64/usr/include/asm-generic/termios.h
new file mode 100644
index 0000000..77b260b
--- /dev/null
+++ b/chroot/opt/android-master/amd64/usr/include/asm-generic/termios.h
@@ -0,0 +1,52 @@
+/****************************************************************************
+ ****************************************************************************
+ ***
+ *** This header was automatically generated from a Linux kernel header
+ *** of the same name, to make information necessary for userspace to
+ *** call into the kernel available to libc. It contains only constants,
+ *** structures, and macros generated from the original header, and thus,
+ *** contains no copyrightable information.
+ ***
+ *** To edit the content of this header, modify the corresponding
+ *** source file (e.g. under external/kernel-headers/original/) then
+ *** run bionic/libc/kernel/tools/update_all.py
+ ***
+ *** Any manual change here will be lost the next time this script will
+ *** be run. You've been warned!
+ ***
+ ****************************************************************************
+ ****************************************************************************/
+#ifndef _UAPI_ASM_GENERIC_TERMIOS_H
+#define _UAPI_ASM_GENERIC_TERMIOS_H
+#include <asm/termbits.h>
+#include <asm/ioctls.h>
+struct winsize {
+ unsigned short ws_row;
+ unsigned short ws_col;
+ unsigned short ws_xpixel;
+ unsigned short ws_ypixel;
+};
+#define NCC 8
+struct termio {
+ unsigned short c_iflag;
+ unsigned short c_oflag;
+ unsigned short c_cflag;
+ unsigned short c_lflag;
+ unsigned char c_line;
+ unsigned char c_cc[NCC];
+};
+#define TIOCM_LE 0x001
+#define TIOCM_DTR 0x002
+#define TIOCM_RTS 0x004
+#define TIOCM_ST 0x008
+#define TIOCM_SR 0x010
+#define TIOCM_CTS 0x020
+#define TIOCM_CAR 0x040
+#define TIOCM_RNG 0x080
+#define TIOCM_DSR 0x100
+#define TIOCM_CD TIOCM_CAR
+#define TIOCM_RI TIOCM_RNG
+#define TIOCM_OUT1 0x2000
+#define TIOCM_OUT2 0x4000
+#define TIOCM_LOOP 0x8000
+#endif
diff --git a/chroot/opt/android-master/amd64/usr/include/asm/prctl.h b/chroot/opt/android-master/amd64/usr/include/asm/prctl.h
new file mode 100644
index 0000000..0e6bed9
--- /dev/null
+++ b/chroot/opt/android-master/amd64/usr/include/asm/prctl.h
@@ -0,0 +1,30 @@
+/****************************************************************************
+ ****************************************************************************
+ ***
+ *** This header was automatically generated from a Linux kernel header
+ *** of the same name, to make information necessary for userspace to
+ *** call into the kernel available to libc. It contains only constants,
+ *** structures, and macros generated from the original header, and thus,
+ *** contains no copyrightable information.
+ ***
+ *** To edit the content of this header, modify the corresponding
+ *** source file (e.g. under external/kernel-headers/original/) then
+ *** run bionic/libc/kernel/tools/update_all.py
+ ***
+ *** Any manual change here will be lost the next time this script will
+ *** be run. You've been warned!
+ ***
+ ****************************************************************************
+ ****************************************************************************/
+#ifndef _ASM_X86_PRCTL_H
+#define _ASM_X86_PRCTL_H
+#define ARCH_SET_GS 0x1001
+#define ARCH_SET_FS 0x1002
+#define ARCH_GET_FS 0x1003
+#define ARCH_GET_GS 0x1004
+#define ARCH_GET_CPUID 0x1011
+#define ARCH_SET_CPUID 0x1012
+#define ARCH_MAP_VDSO_X32 0x2001
+#define ARCH_MAP_VDSO_32 0x2002
+#define ARCH_MAP_VDSO_64 0x2003
+#endif
diff --git a/chroot/opt/android-master/amd64/usr/include/asm/termios.h b/chroot/opt/android-master/amd64/usr/include/asm/termios.h
new file mode 100644
index 0000000..feca4c6
--- /dev/null
+++ b/chroot/opt/android-master/amd64/usr/include/asm/termios.h
@@ -0,0 +1,19 @@
+/****************************************************************************
+ ****************************************************************************
+ ***
+ *** This header was automatically generated from a Linux kernel header
+ *** of the same name, to make information necessary for userspace to
+ *** call into the kernel available to libc. It contains only constants,
+ *** structures, and macros generated from the original header, and thus,
+ *** contains no copyrightable information.
+ ***
+ *** To edit the content of this header, modify the corresponding
+ *** source file (e.g. under external/kernel-headers/original/) then
+ *** run bionic/libc/kernel/tools/update_all.py
+ ***
+ *** Any manual change here will be lost the next time this script will
+ *** be run. You've been warned!
+ ***
+ ****************************************************************************
+ ****************************************************************************/
+#include <asm-generic/termios.h>
diff --git a/chroot/opt/android-master/amd64/usr/include/crc32.h b/chroot/opt/android-master/amd64/usr/include/crc32.h
new file mode 100644
index 0000000..9e0c778
--- /dev/null
+++ b/chroot/opt/android-master/amd64/usr/include/crc32.h
@@ -0,0 +1,441 @@
+/* crc32.h -- tables for rapid CRC calculation
+ * Generated automatically by crc32.c
+ */
+
+local const z_crc_t FAR crc_table[TBLS][256] =
+{
+ {
+ 0x00000000UL, 0x77073096UL, 0xee0e612cUL, 0x990951baUL, 0x076dc419UL,
+ 0x706af48fUL, 0xe963a535UL, 0x9e6495a3UL, 0x0edb8832UL, 0x79dcb8a4UL,
+ 0xe0d5e91eUL, 0x97d2d988UL, 0x09b64c2bUL, 0x7eb17cbdUL, 0xe7b82d07UL,
+ 0x90bf1d91UL, 0x1db71064UL, 0x6ab020f2UL, 0xf3b97148UL, 0x84be41deUL,
+ 0x1adad47dUL, 0x6ddde4ebUL, 0xf4d4b551UL, 0x83d385c7UL, 0x136c9856UL,
+ 0x646ba8c0UL, 0xfd62f97aUL, 0x8a65c9ecUL, 0x14015c4fUL, 0x63066cd9UL,
+ 0xfa0f3d63UL, 0x8d080df5UL, 0x3b6e20c8UL, 0x4c69105eUL, 0xd56041e4UL,
+ 0xa2677172UL, 0x3c03e4d1UL, 0x4b04d447UL, 0xd20d85fdUL, 0xa50ab56bUL,
+ 0x35b5a8faUL, 0x42b2986cUL, 0xdbbbc9d6UL, 0xacbcf940UL, 0x32d86ce3UL,
+ 0x45df5c75UL, 0xdcd60dcfUL, 0xabd13d59UL, 0x26d930acUL, 0x51de003aUL,
+ 0xc8d75180UL, 0xbfd06116UL, 0x21b4f4b5UL, 0x56b3c423UL, 0xcfba9599UL,
+ 0xb8bda50fUL, 0x2802b89eUL, 0x5f058808UL, 0xc60cd9b2UL, 0xb10be924UL,
+ 0x2f6f7c87UL, 0x58684c11UL, 0xc1611dabUL, 0xb6662d3dUL, 0x76dc4190UL,
+ 0x01db7106UL, 0x98d220bcUL, 0xefd5102aUL, 0x71b18589UL, 0x06b6b51fUL,
+ 0x9fbfe4a5UL, 0xe8b8d433UL, 0x7807c9a2UL, 0x0f00f934UL, 0x9609a88eUL,
+ 0xe10e9818UL, 0x7f6a0dbbUL, 0x086d3d2dUL, 0x91646c97UL, 0xe6635c01UL,
+ 0x6b6b51f4UL, 0x1c6c6162UL, 0x856530d8UL, 0xf262004eUL, 0x6c0695edUL,
+ 0x1b01a57bUL, 0x8208f4c1UL, 0xf50fc457UL, 0x65b0d9c6UL, 0x12b7e950UL,
+ 0x8bbeb8eaUL, 0xfcb9887cUL, 0x62dd1ddfUL, 0x15da2d49UL, 0x8cd37cf3UL,
+ 0xfbd44c65UL, 0x4db26158UL, 0x3ab551ceUL, 0xa3bc0074UL, 0xd4bb30e2UL,
+ 0x4adfa541UL, 0x3dd895d7UL, 0xa4d1c46dUL, 0xd3d6f4fbUL, 0x4369e96aUL,
+ 0x346ed9fcUL, 0xad678846UL, 0xda60b8d0UL, 0x44042d73UL, 0x33031de5UL,
+ 0xaa0a4c5fUL, 0xdd0d7cc9UL, 0x5005713cUL, 0x270241aaUL, 0xbe0b1010UL,
+ 0xc90c2086UL, 0x5768b525UL, 0x206f85b3UL, 0xb966d409UL, 0xce61e49fUL,
+ 0x5edef90eUL, 0x29d9c998UL, 0xb0d09822UL, 0xc7d7a8b4UL, 0x59b33d17UL,
+ 0x2eb40d81UL, 0xb7bd5c3bUL, 0xc0ba6cadUL, 0xedb88320UL, 0x9abfb3b6UL,
+ 0x03b6e20cUL, 0x74b1d29aUL, 0xead54739UL, 0x9dd277afUL, 0x04db2615UL,
+ 0x73dc1683UL, 0xe3630b12UL, 0x94643b84UL, 0x0d6d6a3eUL, 0x7a6a5aa8UL,
+ 0xe40ecf0bUL, 0x9309ff9dUL, 0x0a00ae27UL, 0x7d079eb1UL, 0xf00f9344UL,
+ 0x8708a3d2UL, 0x1e01f268UL, 0x6906c2feUL, 0xf762575dUL, 0x806567cbUL,
+ 0x196c3671UL, 0x6e6b06e7UL, 0xfed41b76UL, 0x89d32be0UL, 0x10da7a5aUL,
+ 0x67dd4accUL, 0xf9b9df6fUL, 0x8ebeeff9UL, 0x17b7be43UL, 0x60b08ed5UL,
+ 0xd6d6a3e8UL, 0xa1d1937eUL, 0x38d8c2c4UL, 0x4fdff252UL, 0xd1bb67f1UL,
+ 0xa6bc5767UL, 0x3fb506ddUL, 0x48b2364bUL, 0xd80d2bdaUL, 0xaf0a1b4cUL,
+ 0x36034af6UL, 0x41047a60UL, 0xdf60efc3UL, 0xa867df55UL, 0x316e8eefUL,
+ 0x4669be79UL, 0xcb61b38cUL, 0xbc66831aUL, 0x256fd2a0UL, 0x5268e236UL,
+ 0xcc0c7795UL, 0xbb0b4703UL, 0x220216b9UL, 0x5505262fUL, 0xc5ba3bbeUL,
+ 0xb2bd0b28UL, 0x2bb45a92UL, 0x5cb36a04UL, 0xc2d7ffa7UL, 0xb5d0cf31UL,
+ 0x2cd99e8bUL, 0x5bdeae1dUL, 0x9b64c2b0UL, 0xec63f226UL, 0x756aa39cUL,
+ 0x026d930aUL, 0x9c0906a9UL, 0xeb0e363fUL, 0x72076785UL, 0x05005713UL,
+ 0x95bf4a82UL, 0xe2b87a14UL, 0x7bb12baeUL, 0x0cb61b38UL, 0x92d28e9bUL,
+ 0xe5d5be0dUL, 0x7cdcefb7UL, 0x0bdbdf21UL, 0x86d3d2d4UL, 0xf1d4e242UL,
+ 0x68ddb3f8UL, 0x1fda836eUL, 0x81be16cdUL, 0xf6b9265bUL, 0x6fb077e1UL,
+ 0x18b74777UL, 0x88085ae6UL, 0xff0f6a70UL, 0x66063bcaUL, 0x11010b5cUL,
+ 0x8f659effUL, 0xf862ae69UL, 0x616bffd3UL, 0x166ccf45UL, 0xa00ae278UL,
+ 0xd70dd2eeUL, 0x4e048354UL, 0x3903b3c2UL, 0xa7672661UL, 0xd06016f7UL,
+ 0x4969474dUL, 0x3e6e77dbUL, 0xaed16a4aUL, 0xd9d65adcUL, 0x40df0b66UL,
+ 0x37d83bf0UL, 0xa9bcae53UL, 0xdebb9ec5UL, 0x47b2cf7fUL, 0x30b5ffe9UL,
+ 0xbdbdf21cUL, 0xcabac28aUL, 0x53b39330UL, 0x24b4a3a6UL, 0xbad03605UL,
+ 0xcdd70693UL, 0x54de5729UL, 0x23d967bfUL, 0xb3667a2eUL, 0xc4614ab8UL,
+ 0x5d681b02UL, 0x2a6f2b94UL, 0xb40bbe37UL, 0xc30c8ea1UL, 0x5a05df1bUL,
+ 0x2d02ef8dUL
+#ifdef BYFOUR
+ },
+ {
+ 0x00000000UL, 0x191b3141UL, 0x32366282UL, 0x2b2d53c3UL, 0x646cc504UL,
+ 0x7d77f445UL, 0x565aa786UL, 0x4f4196c7UL, 0xc8d98a08UL, 0xd1c2bb49UL,
+ 0xfaefe88aUL, 0xe3f4d9cbUL, 0xacb54f0cUL, 0xb5ae7e4dUL, 0x9e832d8eUL,
+ 0x87981ccfUL, 0x4ac21251UL, 0x53d92310UL, 0x78f470d3UL, 0x61ef4192UL,
+ 0x2eaed755UL, 0x37b5e614UL, 0x1c98b5d7UL, 0x05838496UL, 0x821b9859UL,
+ 0x9b00a918UL, 0xb02dfadbUL, 0xa936cb9aUL, 0xe6775d5dUL, 0xff6c6c1cUL,
+ 0xd4413fdfUL, 0xcd5a0e9eUL, 0x958424a2UL, 0x8c9f15e3UL, 0xa7b24620UL,
+ 0xbea97761UL, 0xf1e8e1a6UL, 0xe8f3d0e7UL, 0xc3de8324UL, 0xdac5b265UL,
+ 0x5d5daeaaUL, 0x44469febUL, 0x6f6bcc28UL, 0x7670fd69UL, 0x39316baeUL,
+ 0x202a5aefUL, 0x0b07092cUL, 0x121c386dUL, 0xdf4636f3UL, 0xc65d07b2UL,
+ 0xed705471UL, 0xf46b6530UL, 0xbb2af3f7UL, 0xa231c2b6UL, 0x891c9175UL,
+ 0x9007a034UL, 0x179fbcfbUL, 0x0e848dbaUL, 0x25a9de79UL, 0x3cb2ef38UL,
+ 0x73f379ffUL, 0x6ae848beUL, 0x41c51b7dUL, 0x58de2a3cUL, 0xf0794f05UL,
+ 0xe9627e44UL, 0xc24f2d87UL, 0xdb541cc6UL, 0x94158a01UL, 0x8d0ebb40UL,
+ 0xa623e883UL, 0xbf38d9c2UL, 0x38a0c50dUL, 0x21bbf44cUL, 0x0a96a78fUL,
+ 0x138d96ceUL, 0x5ccc0009UL, 0x45d73148UL, 0x6efa628bUL, 0x77e153caUL,
+ 0xbabb5d54UL, 0xa3a06c15UL, 0x888d3fd6UL, 0x91960e97UL, 0xded79850UL,
+ 0xc7cca911UL, 0xece1fad2UL, 0xf5facb93UL, 0x7262d75cUL, 0x6b79e61dUL,
+ 0x4054b5deUL, 0x594f849fUL, 0x160e1258UL, 0x0f152319UL, 0x243870daUL,
+ 0x3d23419bUL, 0x65fd6ba7UL, 0x7ce65ae6UL, 0x57cb0925UL, 0x4ed03864UL,
+ 0x0191aea3UL, 0x188a9fe2UL, 0x33a7cc21UL, 0x2abcfd60UL, 0xad24e1afUL,
+ 0xb43fd0eeUL, 0x9f12832dUL, 0x8609b26cUL, 0xc94824abUL, 0xd05315eaUL,
+ 0xfb7e4629UL, 0xe2657768UL, 0x2f3f79f6UL, 0x362448b7UL, 0x1d091b74UL,
+ 0x04122a35UL, 0x4b53bcf2UL, 0x52488db3UL, 0x7965de70UL, 0x607eef31UL,
+ 0xe7e6f3feUL, 0xfefdc2bfUL, 0xd5d0917cUL, 0xcccba03dUL, 0x838a36faUL,
+ 0x9a9107bbUL, 0xb1bc5478UL, 0xa8a76539UL, 0x3b83984bUL, 0x2298a90aUL,
+ 0x09b5fac9UL, 0x10aecb88UL, 0x5fef5d4fUL, 0x46f46c0eUL, 0x6dd93fcdUL,
+ 0x74c20e8cUL, 0xf35a1243UL, 0xea412302UL, 0xc16c70c1UL, 0xd8774180UL,
+ 0x9736d747UL, 0x8e2de606UL, 0xa500b5c5UL, 0xbc1b8484UL, 0x71418a1aUL,
+ 0x685abb5bUL, 0x4377e898UL, 0x5a6cd9d9UL, 0x152d4f1eUL, 0x0c367e5fUL,
+ 0x271b2d9cUL, 0x3e001cddUL, 0xb9980012UL, 0xa0833153UL, 0x8bae6290UL,
+ 0x92b553d1UL, 0xddf4c516UL, 0xc4eff457UL, 0xefc2a794UL, 0xf6d996d5UL,
+ 0xae07bce9UL, 0xb71c8da8UL, 0x9c31de6bUL, 0x852aef2aUL, 0xca6b79edUL,
+ 0xd37048acUL, 0xf85d1b6fUL, 0xe1462a2eUL, 0x66de36e1UL, 0x7fc507a0UL,
+ 0x54e85463UL, 0x4df36522UL, 0x02b2f3e5UL, 0x1ba9c2a4UL, 0x30849167UL,
+ 0x299fa026UL, 0xe4c5aeb8UL, 0xfdde9ff9UL, 0xd6f3cc3aUL, 0xcfe8fd7bUL,
+ 0x80a96bbcUL, 0x99b25afdUL, 0xb29f093eUL, 0xab84387fUL, 0x2c1c24b0UL,
+ 0x350715f1UL, 0x1e2a4632UL, 0x07317773UL, 0x4870e1b4UL, 0x516bd0f5UL,
+ 0x7a468336UL, 0x635db277UL, 0xcbfad74eUL, 0xd2e1e60fUL, 0xf9ccb5ccUL,
+ 0xe0d7848dUL, 0xaf96124aUL, 0xb68d230bUL, 0x9da070c8UL, 0x84bb4189UL,
+ 0x03235d46UL, 0x1a386c07UL, 0x31153fc4UL, 0x280e0e85UL, 0x674f9842UL,
+ 0x7e54a903UL, 0x5579fac0UL, 0x4c62cb81UL, 0x8138c51fUL, 0x9823f45eUL,
+ 0xb30ea79dUL, 0xaa1596dcUL, 0xe554001bUL, 0xfc4f315aUL, 0xd7626299UL,
+ 0xce7953d8UL, 0x49e14f17UL, 0x50fa7e56UL, 0x7bd72d95UL, 0x62cc1cd4UL,
+ 0x2d8d8a13UL, 0x3496bb52UL, 0x1fbbe891UL, 0x06a0d9d0UL, 0x5e7ef3ecUL,
+ 0x4765c2adUL, 0x6c48916eUL, 0x7553a02fUL, 0x3a1236e8UL, 0x230907a9UL,
+ 0x0824546aUL, 0x113f652bUL, 0x96a779e4UL, 0x8fbc48a5UL, 0xa4911b66UL,
+ 0xbd8a2a27UL, 0xf2cbbce0UL, 0xebd08da1UL, 0xc0fdde62UL, 0xd9e6ef23UL,
+ 0x14bce1bdUL, 0x0da7d0fcUL, 0x268a833fUL, 0x3f91b27eUL, 0x70d024b9UL,
+ 0x69cb15f8UL, 0x42e6463bUL, 0x5bfd777aUL, 0xdc656bb5UL, 0xc57e5af4UL,
+ 0xee530937UL, 0xf7483876UL, 0xb809aeb1UL, 0xa1129ff0UL, 0x8a3fcc33UL,
+ 0x9324fd72UL
+ },
+ {
+ 0x00000000UL, 0x01c26a37UL, 0x0384d46eUL, 0x0246be59UL, 0x0709a8dcUL,
+ 0x06cbc2ebUL, 0x048d7cb2UL, 0x054f1685UL, 0x0e1351b8UL, 0x0fd13b8fUL,
+ 0x0d9785d6UL, 0x0c55efe1UL, 0x091af964UL, 0x08d89353UL, 0x0a9e2d0aUL,
+ 0x0b5c473dUL, 0x1c26a370UL, 0x1de4c947UL, 0x1fa2771eUL, 0x1e601d29UL,
+ 0x1b2f0bacUL, 0x1aed619bUL, 0x18abdfc2UL, 0x1969b5f5UL, 0x1235f2c8UL,
+ 0x13f798ffUL, 0x11b126a6UL, 0x10734c91UL, 0x153c5a14UL, 0x14fe3023UL,
+ 0x16b88e7aUL, 0x177ae44dUL, 0x384d46e0UL, 0x398f2cd7UL, 0x3bc9928eUL,
+ 0x3a0bf8b9UL, 0x3f44ee3cUL, 0x3e86840bUL, 0x3cc03a52UL, 0x3d025065UL,
+ 0x365e1758UL, 0x379c7d6fUL, 0x35dac336UL, 0x3418a901UL, 0x3157bf84UL,
+ 0x3095d5b3UL, 0x32d36beaUL, 0x331101ddUL, 0x246be590UL, 0x25a98fa7UL,
+ 0x27ef31feUL, 0x262d5bc9UL, 0x23624d4cUL, 0x22a0277bUL, 0x20e69922UL,
+ 0x2124f315UL, 0x2a78b428UL, 0x2bbade1fUL, 0x29fc6046UL, 0x283e0a71UL,
+ 0x2d711cf4UL, 0x2cb376c3UL, 0x2ef5c89aUL, 0x2f37a2adUL, 0x709a8dc0UL,
+ 0x7158e7f7UL, 0x731e59aeUL, 0x72dc3399UL, 0x7793251cUL, 0x76514f2bUL,
+ 0x7417f172UL, 0x75d59b45UL, 0x7e89dc78UL, 0x7f4bb64fUL, 0x7d0d0816UL,
+ 0x7ccf6221UL, 0x798074a4UL, 0x78421e93UL, 0x7a04a0caUL, 0x7bc6cafdUL,
+ 0x6cbc2eb0UL, 0x6d7e4487UL, 0x6f38fadeUL, 0x6efa90e9UL, 0x6bb5866cUL,
+ 0x6a77ec5bUL, 0x68315202UL, 0x69f33835UL, 0x62af7f08UL, 0x636d153fUL,
+ 0x612bab66UL, 0x60e9c151UL, 0x65a6d7d4UL, 0x6464bde3UL, 0x662203baUL,
+ 0x67e0698dUL, 0x48d7cb20UL, 0x4915a117UL, 0x4b531f4eUL, 0x4a917579UL,
+ 0x4fde63fcUL, 0x4e1c09cbUL, 0x4c5ab792UL, 0x4d98dda5UL, 0x46c49a98UL,
+ 0x4706f0afUL, 0x45404ef6UL, 0x448224c1UL, 0x41cd3244UL, 0x400f5873UL,
+ 0x4249e62aUL, 0x438b8c1dUL, 0x54f16850UL, 0x55330267UL, 0x5775bc3eUL,
+ 0x56b7d609UL, 0x53f8c08cUL, 0x523aaabbUL, 0x507c14e2UL, 0x51be7ed5UL,
+ 0x5ae239e8UL, 0x5b2053dfUL, 0x5966ed86UL, 0x58a487b1UL, 0x5deb9134UL,
+ 0x5c29fb03UL, 0x5e6f455aUL, 0x5fad2f6dUL, 0xe1351b80UL, 0xe0f771b7UL,
+ 0xe2b1cfeeUL, 0xe373a5d9UL, 0xe63cb35cUL, 0xe7fed96bUL, 0xe5b86732UL,
+ 0xe47a0d05UL, 0xef264a38UL, 0xeee4200fUL, 0xeca29e56UL, 0xed60f461UL,
+ 0xe82fe2e4UL, 0xe9ed88d3UL, 0xebab368aUL, 0xea695cbdUL, 0xfd13b8f0UL,
+ 0xfcd1d2c7UL, 0xfe976c9eUL, 0xff5506a9UL, 0xfa1a102cUL, 0xfbd87a1bUL,
+ 0xf99ec442UL, 0xf85cae75UL, 0xf300e948UL, 0xf2c2837fUL, 0xf0843d26UL,
+ 0xf1465711UL, 0xf4094194UL, 0xf5cb2ba3UL, 0xf78d95faUL, 0xf64fffcdUL,
+ 0xd9785d60UL, 0xd8ba3757UL, 0xdafc890eUL, 0xdb3ee339UL, 0xde71f5bcUL,
+ 0xdfb39f8bUL, 0xddf521d2UL, 0xdc374be5UL, 0xd76b0cd8UL, 0xd6a966efUL,
+ 0xd4efd8b6UL, 0xd52db281UL, 0xd062a404UL, 0xd1a0ce33UL, 0xd3e6706aUL,
+ 0xd2241a5dUL, 0xc55efe10UL, 0xc49c9427UL, 0xc6da2a7eUL, 0xc7184049UL,
+ 0xc25756ccUL, 0xc3953cfbUL, 0xc1d382a2UL, 0xc011e895UL, 0xcb4dafa8UL,
+ 0xca8fc59fUL, 0xc8c97bc6UL, 0xc90b11f1UL, 0xcc440774UL, 0xcd866d43UL,
+ 0xcfc0d31aUL, 0xce02b92dUL, 0x91af9640UL, 0x906dfc77UL, 0x922b422eUL,
+ 0x93e92819UL, 0x96a63e9cUL, 0x976454abUL, 0x9522eaf2UL, 0x94e080c5UL,
+ 0x9fbcc7f8UL, 0x9e7eadcfUL, 0x9c381396UL, 0x9dfa79a1UL, 0x98b56f24UL,
+ 0x99770513UL, 0x9b31bb4aUL, 0x9af3d17dUL, 0x8d893530UL, 0x8c4b5f07UL,
+ 0x8e0de15eUL, 0x8fcf8b69UL, 0x8a809decUL, 0x8b42f7dbUL, 0x89044982UL,
+ 0x88c623b5UL, 0x839a6488UL, 0x82580ebfUL, 0x801eb0e6UL, 0x81dcdad1UL,
+ 0x8493cc54UL, 0x8551a663UL, 0x8717183aUL, 0x86d5720dUL, 0xa9e2d0a0UL,
+ 0xa820ba97UL, 0xaa6604ceUL, 0xaba46ef9UL, 0xaeeb787cUL, 0xaf29124bUL,
+ 0xad6fac12UL, 0xacadc625UL, 0xa7f18118UL, 0xa633eb2fUL, 0xa4755576UL,
+ 0xa5b73f41UL, 0xa0f829c4UL, 0xa13a43f3UL, 0xa37cfdaaUL, 0xa2be979dUL,
+ 0xb5c473d0UL, 0xb40619e7UL, 0xb640a7beUL, 0xb782cd89UL, 0xb2cddb0cUL,
+ 0xb30fb13bUL, 0xb1490f62UL, 0xb08b6555UL, 0xbbd72268UL, 0xba15485fUL,
+ 0xb853f606UL, 0xb9919c31UL, 0xbcde8ab4UL, 0xbd1ce083UL, 0xbf5a5edaUL,
+ 0xbe9834edUL
+ },
+ {
+ 0x00000000UL, 0xb8bc6765UL, 0xaa09c88bUL, 0x12b5afeeUL, 0x8f629757UL,
+ 0x37def032UL, 0x256b5fdcUL, 0x9dd738b9UL, 0xc5b428efUL, 0x7d084f8aUL,
+ 0x6fbde064UL, 0xd7018701UL, 0x4ad6bfb8UL, 0xf26ad8ddUL, 0xe0df7733UL,
+ 0x58631056UL, 0x5019579fUL, 0xe8a530faUL, 0xfa109f14UL, 0x42acf871UL,
+ 0xdf7bc0c8UL, 0x67c7a7adUL, 0x75720843UL, 0xcdce6f26UL, 0x95ad7f70UL,
+ 0x2d111815UL, 0x3fa4b7fbUL, 0x8718d09eUL, 0x1acfe827UL, 0xa2738f42UL,
+ 0xb0c620acUL, 0x087a47c9UL, 0xa032af3eUL, 0x188ec85bUL, 0x0a3b67b5UL,
+ 0xb28700d0UL, 0x2f503869UL, 0x97ec5f0cUL, 0x8559f0e2UL, 0x3de59787UL,
+ 0x658687d1UL, 0xdd3ae0b4UL, 0xcf8f4f5aUL, 0x7733283fUL, 0xeae41086UL,
+ 0x525877e3UL, 0x40edd80dUL, 0xf851bf68UL, 0xf02bf8a1UL, 0x48979fc4UL,
+ 0x5a22302aUL, 0xe29e574fUL, 0x7f496ff6UL, 0xc7f50893UL, 0xd540a77dUL,
+ 0x6dfcc018UL, 0x359fd04eUL, 0x8d23b72bUL, 0x9f9618c5UL, 0x272a7fa0UL,
+ 0xbafd4719UL, 0x0241207cUL, 0x10f48f92UL, 0xa848e8f7UL, 0x9b14583dUL,
+ 0x23a83f58UL, 0x311d90b6UL, 0x89a1f7d3UL, 0x1476cf6aUL, 0xaccaa80fUL,
+ 0xbe7f07e1UL, 0x06c36084UL, 0x5ea070d2UL, 0xe61c17b7UL, 0xf4a9b859UL,
+ 0x4c15df3cUL, 0xd1c2e785UL, 0x697e80e0UL, 0x7bcb2f0eUL, 0xc377486bUL,
+ 0xcb0d0fa2UL, 0x73b168c7UL, 0x6104c729UL, 0xd9b8a04cUL, 0x446f98f5UL,
+ 0xfcd3ff90UL, 0xee66507eUL, 0x56da371bUL, 0x0eb9274dUL, 0xb6054028UL,
+ 0xa4b0efc6UL, 0x1c0c88a3UL, 0x81dbb01aUL, 0x3967d77fUL, 0x2bd27891UL,
+ 0x936e1ff4UL, 0x3b26f703UL, 0x839a9066UL, 0x912f3f88UL, 0x299358edUL,
+ 0xb4446054UL, 0x0cf80731UL, 0x1e4da8dfUL, 0xa6f1cfbaUL, 0xfe92dfecUL,
+ 0x462eb889UL, 0x549b1767UL, 0xec277002UL, 0x71f048bbUL, 0xc94c2fdeUL,
+ 0xdbf98030UL, 0x6345e755UL, 0x6b3fa09cUL, 0xd383c7f9UL, 0xc1366817UL,
+ 0x798a0f72UL, 0xe45d37cbUL, 0x5ce150aeUL, 0x4e54ff40UL, 0xf6e89825UL,
+ 0xae8b8873UL, 0x1637ef16UL, 0x048240f8UL, 0xbc3e279dUL, 0x21e91f24UL,
+ 0x99557841UL, 0x8be0d7afUL, 0x335cb0caUL, 0xed59b63bUL, 0x55e5d15eUL,
+ 0x47507eb0UL, 0xffec19d5UL, 0x623b216cUL, 0xda874609UL, 0xc832e9e7UL,
+ 0x708e8e82UL, 0x28ed9ed4UL, 0x9051f9b1UL, 0x82e4565fUL, 0x3a58313aUL,
+ 0xa78f0983UL, 0x1f336ee6UL, 0x0d86c108UL, 0xb53aa66dUL, 0xbd40e1a4UL,
+ 0x05fc86c1UL, 0x1749292fUL, 0xaff54e4aUL, 0x322276f3UL, 0x8a9e1196UL,
+ 0x982bbe78UL, 0x2097d91dUL, 0x78f4c94bUL, 0xc048ae2eUL, 0xd2fd01c0UL,
+ 0x6a4166a5UL, 0xf7965e1cUL, 0x4f2a3979UL, 0x5d9f9697UL, 0xe523f1f2UL,
+ 0x4d6b1905UL, 0xf5d77e60UL, 0xe762d18eUL, 0x5fdeb6ebUL, 0xc2098e52UL,
+ 0x7ab5e937UL, 0x680046d9UL, 0xd0bc21bcUL, 0x88df31eaUL, 0x3063568fUL,
+ 0x22d6f961UL, 0x9a6a9e04UL, 0x07bda6bdUL, 0xbf01c1d8UL, 0xadb46e36UL,
+ 0x15080953UL, 0x1d724e9aUL, 0xa5ce29ffUL, 0xb77b8611UL, 0x0fc7e174UL,
+ 0x9210d9cdUL, 0x2aacbea8UL, 0x38191146UL, 0x80a57623UL, 0xd8c66675UL,
+ 0x607a0110UL, 0x72cfaefeUL, 0xca73c99bUL, 0x57a4f122UL, 0xef189647UL,
+ 0xfdad39a9UL, 0x45115eccUL, 0x764dee06UL, 0xcef18963UL, 0xdc44268dUL,
+ 0x64f841e8UL, 0xf92f7951UL, 0x41931e34UL, 0x5326b1daUL, 0xeb9ad6bfUL,
+ 0xb3f9c6e9UL, 0x0b45a18cUL, 0x19f00e62UL, 0xa14c6907UL, 0x3c9b51beUL,
+ 0x842736dbUL, 0x96929935UL, 0x2e2efe50UL, 0x2654b999UL, 0x9ee8defcUL,
+ 0x8c5d7112UL, 0x34e11677UL, 0xa9362eceUL, 0x118a49abUL, 0x033fe645UL,
+ 0xbb838120UL, 0xe3e09176UL, 0x5b5cf613UL, 0x49e959fdUL, 0xf1553e98UL,
+ 0x6c820621UL, 0xd43e6144UL, 0xc68bceaaUL, 0x7e37a9cfUL, 0xd67f4138UL,
+ 0x6ec3265dUL, 0x7c7689b3UL, 0xc4caeed6UL, 0x591dd66fUL, 0xe1a1b10aUL,
+ 0xf3141ee4UL, 0x4ba87981UL, 0x13cb69d7UL, 0xab770eb2UL, 0xb9c2a15cUL,
+ 0x017ec639UL, 0x9ca9fe80UL, 0x241599e5UL, 0x36a0360bUL, 0x8e1c516eUL,
+ 0x866616a7UL, 0x3eda71c2UL, 0x2c6fde2cUL, 0x94d3b949UL, 0x090481f0UL,
+ 0xb1b8e695UL, 0xa30d497bUL, 0x1bb12e1eUL, 0x43d23e48UL, 0xfb6e592dUL,
+ 0xe9dbf6c3UL, 0x516791a6UL, 0xccb0a91fUL, 0x740cce7aUL, 0x66b96194UL,
+ 0xde0506f1UL
+ },
+ {
+ 0x00000000UL, 0x96300777UL, 0x2c610eeeUL, 0xba510999UL, 0x19c46d07UL,
+ 0x8ff46a70UL, 0x35a563e9UL, 0xa395649eUL, 0x3288db0eUL, 0xa4b8dc79UL,
+ 0x1ee9d5e0UL, 0x88d9d297UL, 0x2b4cb609UL, 0xbd7cb17eUL, 0x072db8e7UL,
+ 0x911dbf90UL, 0x6410b71dUL, 0xf220b06aUL, 0x4871b9f3UL, 0xde41be84UL,
+ 0x7dd4da1aUL, 0xebe4dd6dUL, 0x51b5d4f4UL, 0xc785d383UL, 0x56986c13UL,
+ 0xc0a86b64UL, 0x7af962fdUL, 0xecc9658aUL, 0x4f5c0114UL, 0xd96c0663UL,
+ 0x633d0ffaUL, 0xf50d088dUL, 0xc8206e3bUL, 0x5e10694cUL, 0xe44160d5UL,
+ 0x727167a2UL, 0xd1e4033cUL, 0x47d4044bUL, 0xfd850dd2UL, 0x6bb50aa5UL,
+ 0xfaa8b535UL, 0x6c98b242UL, 0xd6c9bbdbUL, 0x40f9bcacUL, 0xe36cd832UL,
+ 0x755cdf45UL, 0xcf0dd6dcUL, 0x593dd1abUL, 0xac30d926UL, 0x3a00de51UL,
+ 0x8051d7c8UL, 0x1661d0bfUL, 0xb5f4b421UL, 0x23c4b356UL, 0x9995bacfUL,
+ 0x0fa5bdb8UL, 0x9eb80228UL, 0x0888055fUL, 0xb2d90cc6UL, 0x24e90bb1UL,
+ 0x877c6f2fUL, 0x114c6858UL, 0xab1d61c1UL, 0x3d2d66b6UL, 0x9041dc76UL,
+ 0x0671db01UL, 0xbc20d298UL, 0x2a10d5efUL, 0x8985b171UL, 0x1fb5b606UL,
+ 0xa5e4bf9fUL, 0x33d4b8e8UL, 0xa2c90778UL, 0x34f9000fUL, 0x8ea80996UL,
+ 0x18980ee1UL, 0xbb0d6a7fUL, 0x2d3d6d08UL, 0x976c6491UL, 0x015c63e6UL,
+ 0xf4516b6bUL, 0x62616c1cUL, 0xd8306585UL, 0x4e0062f2UL, 0xed95066cUL,
+ 0x7ba5011bUL, 0xc1f40882UL, 0x57c40ff5UL, 0xc6d9b065UL, 0x50e9b712UL,
+ 0xeab8be8bUL, 0x7c88b9fcUL, 0xdf1ddd62UL, 0x492dda15UL, 0xf37cd38cUL,
+ 0x654cd4fbUL, 0x5861b24dUL, 0xce51b53aUL, 0x7400bca3UL, 0xe230bbd4UL,
+ 0x41a5df4aUL, 0xd795d83dUL, 0x6dc4d1a4UL, 0xfbf4d6d3UL, 0x6ae96943UL,
+ 0xfcd96e34UL, 0x468867adUL, 0xd0b860daUL, 0x732d0444UL, 0xe51d0333UL,
+ 0x5f4c0aaaUL, 0xc97c0dddUL, 0x3c710550UL, 0xaa410227UL, 0x10100bbeUL,
+ 0x86200cc9UL, 0x25b56857UL, 0xb3856f20UL, 0x09d466b9UL, 0x9fe461ceUL,
+ 0x0ef9de5eUL, 0x98c9d929UL, 0x2298d0b0UL, 0xb4a8d7c7UL, 0x173db359UL,
+ 0x810db42eUL, 0x3b5cbdb7UL, 0xad6cbac0UL, 0x2083b8edUL, 0xb6b3bf9aUL,
+ 0x0ce2b603UL, 0x9ad2b174UL, 0x3947d5eaUL, 0xaf77d29dUL, 0x1526db04UL,
+ 0x8316dc73UL, 0x120b63e3UL, 0x843b6494UL, 0x3e6a6d0dUL, 0xa85a6a7aUL,
+ 0x0bcf0ee4UL, 0x9dff0993UL, 0x27ae000aUL, 0xb19e077dUL, 0x44930ff0UL,
+ 0xd2a30887UL, 0x68f2011eUL, 0xfec20669UL, 0x5d5762f7UL, 0xcb676580UL,
+ 0x71366c19UL, 0xe7066b6eUL, 0x761bd4feUL, 0xe02bd389UL, 0x5a7ada10UL,
+ 0xcc4add67UL, 0x6fdfb9f9UL, 0xf9efbe8eUL, 0x43beb717UL, 0xd58eb060UL,
+ 0xe8a3d6d6UL, 0x7e93d1a1UL, 0xc4c2d838UL, 0x52f2df4fUL, 0xf167bbd1UL,
+ 0x6757bca6UL, 0xdd06b53fUL, 0x4b36b248UL, 0xda2b0dd8UL, 0x4c1b0aafUL,
+ 0xf64a0336UL, 0x607a0441UL, 0xc3ef60dfUL, 0x55df67a8UL, 0xef8e6e31UL,
+ 0x79be6946UL, 0x8cb361cbUL, 0x1a8366bcUL, 0xa0d26f25UL, 0x36e26852UL,
+ 0x95770cccUL, 0x03470bbbUL, 0xb9160222UL, 0x2f260555UL, 0xbe3bbac5UL,
+ 0x280bbdb2UL, 0x925ab42bUL, 0x046ab35cUL, 0xa7ffd7c2UL, 0x31cfd0b5UL,
+ 0x8b9ed92cUL, 0x1daede5bUL, 0xb0c2649bUL, 0x26f263ecUL, 0x9ca36a75UL,
+ 0x0a936d02UL, 0xa906099cUL, 0x3f360eebUL, 0x85670772UL, 0x13570005UL,
+ 0x824abf95UL, 0x147ab8e2UL, 0xae2bb17bUL, 0x381bb60cUL, 0x9b8ed292UL,
+ 0x0dbed5e5UL, 0xb7efdc7cUL, 0x21dfdb0bUL, 0xd4d2d386UL, 0x42e2d4f1UL,
+ 0xf8b3dd68UL, 0x6e83da1fUL, 0xcd16be81UL, 0x5b26b9f6UL, 0xe177b06fUL,
+ 0x7747b718UL, 0xe65a0888UL, 0x706a0fffUL, 0xca3b0666UL, 0x5c0b0111UL,
+ 0xff9e658fUL, 0x69ae62f8UL, 0xd3ff6b61UL, 0x45cf6c16UL, 0x78e20aa0UL,
+ 0xeed20dd7UL, 0x5483044eUL, 0xc2b30339UL, 0x612667a7UL, 0xf71660d0UL,
+ 0x4d476949UL, 0xdb776e3eUL, 0x4a6ad1aeUL, 0xdc5ad6d9UL, 0x660bdf40UL,
+ 0xf03bd837UL, 0x53aebca9UL, 0xc59ebbdeUL, 0x7fcfb247UL, 0xe9ffb530UL,
+ 0x1cf2bdbdUL, 0x8ac2bacaUL, 0x3093b353UL, 0xa6a3b424UL, 0x0536d0baUL,
+ 0x9306d7cdUL, 0x2957de54UL, 0xbf67d923UL, 0x2e7a66b3UL, 0xb84a61c4UL,
+ 0x021b685dUL, 0x942b6f2aUL, 0x37be0bb4UL, 0xa18e0cc3UL, 0x1bdf055aUL,
+ 0x8def022dUL
+ },
+ {
+ 0x00000000UL, 0x41311b19UL, 0x82623632UL, 0xc3532d2bUL, 0x04c56c64UL,
+ 0x45f4777dUL, 0x86a75a56UL, 0xc796414fUL, 0x088ad9c8UL, 0x49bbc2d1UL,
+ 0x8ae8effaUL, 0xcbd9f4e3UL, 0x0c4fb5acUL, 0x4d7eaeb5UL, 0x8e2d839eUL,
+ 0xcf1c9887UL, 0x5112c24aUL, 0x1023d953UL, 0xd370f478UL, 0x9241ef61UL,
+ 0x55d7ae2eUL, 0x14e6b537UL, 0xd7b5981cUL, 0x96848305UL, 0x59981b82UL,
+ 0x18a9009bUL, 0xdbfa2db0UL, 0x9acb36a9UL, 0x5d5d77e6UL, 0x1c6c6cffUL,
+ 0xdf3f41d4UL, 0x9e0e5acdUL, 0xa2248495UL, 0xe3159f8cUL, 0x2046b2a7UL,
+ 0x6177a9beUL, 0xa6e1e8f1UL, 0xe7d0f3e8UL, 0x2483dec3UL, 0x65b2c5daUL,
+ 0xaaae5d5dUL, 0xeb9f4644UL, 0x28cc6b6fUL, 0x69fd7076UL, 0xae6b3139UL,
+ 0xef5a2a20UL, 0x2c09070bUL, 0x6d381c12UL, 0xf33646dfUL, 0xb2075dc6UL,
+ 0x715470edUL, 0x30656bf4UL, 0xf7f32abbUL, 0xb6c231a2UL, 0x75911c89UL,
+ 0x34a00790UL, 0xfbbc9f17UL, 0xba8d840eUL, 0x79dea925UL, 0x38efb23cUL,
+ 0xff79f373UL, 0xbe48e86aUL, 0x7d1bc541UL, 0x3c2ade58UL, 0x054f79f0UL,
+ 0x447e62e9UL, 0x872d4fc2UL, 0xc61c54dbUL, 0x018a1594UL, 0x40bb0e8dUL,
+ 0x83e823a6UL, 0xc2d938bfUL, 0x0dc5a038UL, 0x4cf4bb21UL, 0x8fa7960aUL,
+ 0xce968d13UL, 0x0900cc5cUL, 0x4831d745UL, 0x8b62fa6eUL, 0xca53e177UL,
+ 0x545dbbbaUL, 0x156ca0a3UL, 0xd63f8d88UL, 0x970e9691UL, 0x5098d7deUL,
+ 0x11a9ccc7UL, 0xd2fae1ecUL, 0x93cbfaf5UL, 0x5cd76272UL, 0x1de6796bUL,
+ 0xdeb55440UL, 0x9f844f59UL, 0x58120e16UL, 0x1923150fUL, 0xda703824UL,
+ 0x9b41233dUL, 0xa76bfd65UL, 0xe65ae67cUL, 0x2509cb57UL, 0x6438d04eUL,
+ 0xa3ae9101UL, 0xe29f8a18UL, 0x21cca733UL, 0x60fdbc2aUL, 0xafe124adUL,
+ 0xeed03fb4UL, 0x2d83129fUL, 0x6cb20986UL, 0xab2448c9UL, 0xea1553d0UL,
+ 0x29467efbUL, 0x687765e2UL, 0xf6793f2fUL, 0xb7482436UL, 0x741b091dUL,
+ 0x352a1204UL, 0xf2bc534bUL, 0xb38d4852UL, 0x70de6579UL, 0x31ef7e60UL,
+ 0xfef3e6e7UL, 0xbfc2fdfeUL, 0x7c91d0d5UL, 0x3da0cbccUL, 0xfa368a83UL,
+ 0xbb07919aUL, 0x7854bcb1UL, 0x3965a7a8UL, 0x4b98833bUL, 0x0aa99822UL,
+ 0xc9fab509UL, 0x88cbae10UL, 0x4f5def5fUL, 0x0e6cf446UL, 0xcd3fd96dUL,
+ 0x8c0ec274UL, 0x43125af3UL, 0x022341eaUL, 0xc1706cc1UL, 0x804177d8UL,
+ 0x47d73697UL, 0x06e62d8eUL, 0xc5b500a5UL, 0x84841bbcUL, 0x1a8a4171UL,
+ 0x5bbb5a68UL, 0x98e87743UL, 0xd9d96c5aUL, 0x1e4f2d15UL, 0x5f7e360cUL,
+ 0x9c2d1b27UL, 0xdd1c003eUL, 0x120098b9UL, 0x533183a0UL, 0x9062ae8bUL,
+ 0xd153b592UL, 0x16c5f4ddUL, 0x57f4efc4UL, 0x94a7c2efUL, 0xd596d9f6UL,
+ 0xe9bc07aeUL, 0xa88d1cb7UL, 0x6bde319cUL, 0x2aef2a85UL, 0xed796bcaUL,
+ 0xac4870d3UL, 0x6f1b5df8UL, 0x2e2a46e1UL, 0xe136de66UL, 0xa007c57fUL,
+ 0x6354e854UL, 0x2265f34dUL, 0xe5f3b202UL, 0xa4c2a91bUL, 0x67918430UL,
+ 0x26a09f29UL, 0xb8aec5e4UL, 0xf99fdefdUL, 0x3accf3d6UL, 0x7bfde8cfUL,
+ 0xbc6ba980UL, 0xfd5ab299UL, 0x3e099fb2UL, 0x7f3884abUL, 0xb0241c2cUL,
+ 0xf1150735UL, 0x32462a1eUL, 0x73773107UL, 0xb4e17048UL, 0xf5d06b51UL,
+ 0x3683467aUL, 0x77b25d63UL, 0x4ed7facbUL, 0x0fe6e1d2UL, 0xccb5ccf9UL,
+ 0x8d84d7e0UL, 0x4a1296afUL, 0x0b238db6UL, 0xc870a09dUL, 0x8941bb84UL,
+ 0x465d2303UL, 0x076c381aUL, 0xc43f1531UL, 0x850e0e28UL, 0x42984f67UL,
+ 0x03a9547eUL, 0xc0fa7955UL, 0x81cb624cUL, 0x1fc53881UL, 0x5ef42398UL,
+ 0x9da70eb3UL, 0xdc9615aaUL, 0x1b0054e5UL, 0x5a314ffcUL, 0x996262d7UL,
+ 0xd85379ceUL, 0x174fe149UL, 0x567efa50UL, 0x952dd77bUL, 0xd41ccc62UL,
+ 0x138a8d2dUL, 0x52bb9634UL, 0x91e8bb1fUL, 0xd0d9a006UL, 0xecf37e5eUL,
+ 0xadc26547UL, 0x6e91486cUL, 0x2fa05375UL, 0xe836123aUL, 0xa9070923UL,
+ 0x6a542408UL, 0x2b653f11UL, 0xe479a796UL, 0xa548bc8fUL, 0x661b91a4UL,
+ 0x272a8abdUL, 0xe0bccbf2UL, 0xa18dd0ebUL, 0x62defdc0UL, 0x23efe6d9UL,
+ 0xbde1bc14UL, 0xfcd0a70dUL, 0x3f838a26UL, 0x7eb2913fUL, 0xb924d070UL,
+ 0xf815cb69UL, 0x3b46e642UL, 0x7a77fd5bUL, 0xb56b65dcUL, 0xf45a7ec5UL,
+ 0x370953eeUL, 0x763848f7UL, 0xb1ae09b8UL, 0xf09f12a1UL, 0x33cc3f8aUL,
+ 0x72fd2493UL
+ },
+ {
+ 0x00000000UL, 0x376ac201UL, 0x6ed48403UL, 0x59be4602UL, 0xdca80907UL,
+ 0xebc2cb06UL, 0xb27c8d04UL, 0x85164f05UL, 0xb851130eUL, 0x8f3bd10fUL,
+ 0xd685970dUL, 0xe1ef550cUL, 0x64f91a09UL, 0x5393d808UL, 0x0a2d9e0aUL,
+ 0x3d475c0bUL, 0x70a3261cUL, 0x47c9e41dUL, 0x1e77a21fUL, 0x291d601eUL,
+ 0xac0b2f1bUL, 0x9b61ed1aUL, 0xc2dfab18UL, 0xf5b56919UL, 0xc8f23512UL,
+ 0xff98f713UL, 0xa626b111UL, 0x914c7310UL, 0x145a3c15UL, 0x2330fe14UL,
+ 0x7a8eb816UL, 0x4de47a17UL, 0xe0464d38UL, 0xd72c8f39UL, 0x8e92c93bUL,
+ 0xb9f80b3aUL, 0x3cee443fUL, 0x0b84863eUL, 0x523ac03cUL, 0x6550023dUL,
+ 0x58175e36UL, 0x6f7d9c37UL, 0x36c3da35UL, 0x01a91834UL, 0x84bf5731UL,
+ 0xb3d59530UL, 0xea6bd332UL, 0xdd011133UL, 0x90e56b24UL, 0xa78fa925UL,
+ 0xfe31ef27UL, 0xc95b2d26UL, 0x4c4d6223UL, 0x7b27a022UL, 0x2299e620UL,
+ 0x15f32421UL, 0x28b4782aUL, 0x1fdeba2bUL, 0x4660fc29UL, 0x710a3e28UL,
+ 0xf41c712dUL, 0xc376b32cUL, 0x9ac8f52eUL, 0xada2372fUL, 0xc08d9a70UL,
+ 0xf7e75871UL, 0xae591e73UL, 0x9933dc72UL, 0x1c259377UL, 0x2b4f5176UL,
+ 0x72f11774UL, 0x459bd575UL, 0x78dc897eUL, 0x4fb64b7fUL, 0x16080d7dUL,
+ 0x2162cf7cUL, 0xa4748079UL, 0x931e4278UL, 0xcaa0047aUL, 0xfdcac67bUL,
+ 0xb02ebc6cUL, 0x87447e6dUL, 0xdefa386fUL, 0xe990fa6eUL, 0x6c86b56bUL,
+ 0x5bec776aUL, 0x02523168UL, 0x3538f369UL, 0x087faf62UL, 0x3f156d63UL,
+ 0x66ab2b61UL, 0x51c1e960UL, 0xd4d7a665UL, 0xe3bd6464UL, 0xba032266UL,
+ 0x8d69e067UL, 0x20cbd748UL, 0x17a11549UL, 0x4e1f534bUL, 0x7975914aUL,
+ 0xfc63de4fUL, 0xcb091c4eUL, 0x92b75a4cUL, 0xa5dd984dUL, 0x989ac446UL,
+ 0xaff00647UL, 0xf64e4045UL, 0xc1248244UL, 0x4432cd41UL, 0x73580f40UL,
+ 0x2ae64942UL, 0x1d8c8b43UL, 0x5068f154UL, 0x67023355UL, 0x3ebc7557UL,
+ 0x09d6b756UL, 0x8cc0f853UL, 0xbbaa3a52UL, 0xe2147c50UL, 0xd57ebe51UL,
+ 0xe839e25aUL, 0xdf53205bUL, 0x86ed6659UL, 0xb187a458UL, 0x3491eb5dUL,
+ 0x03fb295cUL, 0x5a456f5eUL, 0x6d2fad5fUL, 0x801b35e1UL, 0xb771f7e0UL,
+ 0xeecfb1e2UL, 0xd9a573e3UL, 0x5cb33ce6UL, 0x6bd9fee7UL, 0x3267b8e5UL,
+ 0x050d7ae4UL, 0x384a26efUL, 0x0f20e4eeUL, 0x569ea2ecUL, 0x61f460edUL,
+ 0xe4e22fe8UL, 0xd388ede9UL, 0x8a36abebUL, 0xbd5c69eaUL, 0xf0b813fdUL,
+ 0xc7d2d1fcUL, 0x9e6c97feUL, 0xa90655ffUL, 0x2c101afaUL, 0x1b7ad8fbUL,
+ 0x42c49ef9UL, 0x75ae5cf8UL, 0x48e900f3UL, 0x7f83c2f2UL, 0x263d84f0UL,
+ 0x115746f1UL, 0x944109f4UL, 0xa32bcbf5UL, 0xfa958df7UL, 0xcdff4ff6UL,
+ 0x605d78d9UL, 0x5737bad8UL, 0x0e89fcdaUL, 0x39e33edbUL, 0xbcf571deUL,
+ 0x8b9fb3dfUL, 0xd221f5ddUL, 0xe54b37dcUL, 0xd80c6bd7UL, 0xef66a9d6UL,
+ 0xb6d8efd4UL, 0x81b22dd5UL, 0x04a462d0UL, 0x33cea0d1UL, 0x6a70e6d3UL,
+ 0x5d1a24d2UL, 0x10fe5ec5UL, 0x27949cc4UL, 0x7e2adac6UL, 0x494018c7UL,
+ 0xcc5657c2UL, 0xfb3c95c3UL, 0xa282d3c1UL, 0x95e811c0UL, 0xa8af4dcbUL,
+ 0x9fc58fcaUL, 0xc67bc9c8UL, 0xf1110bc9UL, 0x740744ccUL, 0x436d86cdUL,
+ 0x1ad3c0cfUL, 0x2db902ceUL, 0x4096af91UL, 0x77fc6d90UL, 0x2e422b92UL,
+ 0x1928e993UL, 0x9c3ea696UL, 0xab546497UL, 0xf2ea2295UL, 0xc580e094UL,
+ 0xf8c7bc9fUL, 0xcfad7e9eUL, 0x9613389cUL, 0xa179fa9dUL, 0x246fb598UL,
+ 0x13057799UL, 0x4abb319bUL, 0x7dd1f39aUL, 0x3035898dUL, 0x075f4b8cUL,
+ 0x5ee10d8eUL, 0x698bcf8fUL, 0xec9d808aUL, 0xdbf7428bUL, 0x82490489UL,
+ 0xb523c688UL, 0x88649a83UL, 0xbf0e5882UL, 0xe6b01e80UL, 0xd1dadc81UL,
+ 0x54cc9384UL, 0x63a65185UL, 0x3a181787UL, 0x0d72d586UL, 0xa0d0e2a9UL,
+ 0x97ba20a8UL, 0xce0466aaUL, 0xf96ea4abUL, 0x7c78ebaeUL, 0x4b1229afUL,
+ 0x12ac6fadUL, 0x25c6adacUL, 0x1881f1a7UL, 0x2feb33a6UL, 0x765575a4UL,
+ 0x413fb7a5UL, 0xc429f8a0UL, 0xf3433aa1UL, 0xaafd7ca3UL, 0x9d97bea2UL,
+ 0xd073c4b5UL, 0xe71906b4UL, 0xbea740b6UL, 0x89cd82b7UL, 0x0cdbcdb2UL,
+ 0x3bb10fb3UL, 0x620f49b1UL, 0x55658bb0UL, 0x6822d7bbUL, 0x5f4815baUL,
+ 0x06f653b8UL, 0x319c91b9UL, 0xb48adebcUL, 0x83e01cbdUL, 0xda5e5abfUL,
+ 0xed3498beUL
+ },
+ {
+ 0x00000000UL, 0x6567bcb8UL, 0x8bc809aaUL, 0xeeafb512UL, 0x5797628fUL,
+ 0x32f0de37UL, 0xdc5f6b25UL, 0xb938d79dUL, 0xef28b4c5UL, 0x8a4f087dUL,
+ 0x64e0bd6fUL, 0x018701d7UL, 0xb8bfd64aUL, 0xddd86af2UL, 0x3377dfe0UL,
+ 0x56106358UL, 0x9f571950UL, 0xfa30a5e8UL, 0x149f10faUL, 0x71f8ac42UL,
+ 0xc8c07bdfUL, 0xada7c767UL, 0x43087275UL, 0x266fcecdUL, 0x707fad95UL,
+ 0x1518112dUL, 0xfbb7a43fUL, 0x9ed01887UL, 0x27e8cf1aUL, 0x428f73a2UL,
+ 0xac20c6b0UL, 0xc9477a08UL, 0x3eaf32a0UL, 0x5bc88e18UL, 0xb5673b0aUL,
+ 0xd00087b2UL, 0x6938502fUL, 0x0c5fec97UL, 0xe2f05985UL, 0x8797e53dUL,
+ 0xd1878665UL, 0xb4e03addUL, 0x5a4f8fcfUL, 0x3f283377UL, 0x8610e4eaUL,
+ 0xe3775852UL, 0x0dd8ed40UL, 0x68bf51f8UL, 0xa1f82bf0UL, 0xc49f9748UL,
+ 0x2a30225aUL, 0x4f579ee2UL, 0xf66f497fUL, 0x9308f5c7UL, 0x7da740d5UL,
+ 0x18c0fc6dUL, 0x4ed09f35UL, 0x2bb7238dUL, 0xc518969fUL, 0xa07f2a27UL,
+ 0x1947fdbaUL, 0x7c204102UL, 0x928ff410UL, 0xf7e848a8UL, 0x3d58149bUL,
+ 0x583fa823UL, 0xb6901d31UL, 0xd3f7a189UL, 0x6acf7614UL, 0x0fa8caacUL,
+ 0xe1077fbeUL, 0x8460c306UL, 0xd270a05eUL, 0xb7171ce6UL, 0x59b8a9f4UL,
+ 0x3cdf154cUL, 0x85e7c2d1UL, 0xe0807e69UL, 0x0e2fcb7bUL, 0x6b4877c3UL,
+ 0xa20f0dcbUL, 0xc768b173UL, 0x29c70461UL, 0x4ca0b8d9UL, 0xf5986f44UL,
+ 0x90ffd3fcUL, 0x7e5066eeUL, 0x1b37da56UL, 0x4d27b90eUL, 0x284005b6UL,
+ 0xc6efb0a4UL, 0xa3880c1cUL, 0x1ab0db81UL, 0x7fd76739UL, 0x9178d22bUL,
+ 0xf41f6e93UL, 0x03f7263bUL, 0x66909a83UL, 0x883f2f91UL, 0xed589329UL,
+ 0x546044b4UL, 0x3107f80cUL, 0xdfa84d1eUL, 0xbacff1a6UL, 0xecdf92feUL,
+ 0x89b82e46UL, 0x67179b54UL, 0x027027ecUL, 0xbb48f071UL, 0xde2f4cc9UL,
+ 0x3080f9dbUL, 0x55e74563UL, 0x9ca03f6bUL, 0xf9c783d3UL, 0x176836c1UL,
+ 0x720f8a79UL, 0xcb375de4UL, 0xae50e15cUL, 0x40ff544eUL, 0x2598e8f6UL,
+ 0x73888baeUL, 0x16ef3716UL, 0xf8408204UL, 0x9d273ebcUL, 0x241fe921UL,
+ 0x41785599UL, 0xafd7e08bUL, 0xcab05c33UL, 0x3bb659edUL, 0x5ed1e555UL,
+ 0xb07e5047UL, 0xd519ecffUL, 0x6c213b62UL, 0x094687daUL, 0xe7e932c8UL,
+ 0x828e8e70UL, 0xd49eed28UL, 0xb1f95190UL, 0x5f56e482UL, 0x3a31583aUL,
+ 0x83098fa7UL, 0xe66e331fUL, 0x08c1860dUL, 0x6da63ab5UL, 0xa4e140bdUL,
+ 0xc186fc05UL, 0x2f294917UL, 0x4a4ef5afUL, 0xf3762232UL, 0x96119e8aUL,
+ 0x78be2b98UL, 0x1dd99720UL, 0x4bc9f478UL, 0x2eae48c0UL, 0xc001fdd2UL,
+ 0xa566416aUL, 0x1c5e96f7UL, 0x79392a4fUL, 0x97969f5dUL, 0xf2f123e5UL,
+ 0x05196b4dUL, 0x607ed7f5UL, 0x8ed162e7UL, 0xebb6de5fUL, 0x528e09c2UL,
+ 0x37e9b57aUL, 0xd9460068UL, 0xbc21bcd0UL, 0xea31df88UL, 0x8f566330UL,
+ 0x61f9d622UL, 0x049e6a9aUL, 0xbda6bd07UL, 0xd8c101bfUL, 0x366eb4adUL,
+ 0x53090815UL, 0x9a4e721dUL, 0xff29cea5UL, 0x11867bb7UL, 0x74e1c70fUL,
+ 0xcdd91092UL, 0xa8beac2aUL, 0x46111938UL, 0x2376a580UL, 0x7566c6d8UL,
+ 0x10017a60UL, 0xfeaecf72UL, 0x9bc973caUL, 0x22f1a457UL, 0x479618efUL,
+ 0xa939adfdUL, 0xcc5e1145UL, 0x06ee4d76UL, 0x6389f1ceUL, 0x8d2644dcUL,
+ 0xe841f864UL, 0x51792ff9UL, 0x341e9341UL, 0xdab12653UL, 0xbfd69aebUL,
+ 0xe9c6f9b3UL, 0x8ca1450bUL, 0x620ef019UL, 0x07694ca1UL, 0xbe519b3cUL,
+ 0xdb362784UL, 0x35999296UL, 0x50fe2e2eUL, 0x99b95426UL, 0xfcdee89eUL,
+ 0x12715d8cUL, 0x7716e134UL, 0xce2e36a9UL, 0xab498a11UL, 0x45e63f03UL,
+ 0x208183bbUL, 0x7691e0e3UL, 0x13f65c5bUL, 0xfd59e949UL, 0x983e55f1UL,
+ 0x2106826cUL, 0x44613ed4UL, 0xaace8bc6UL, 0xcfa9377eUL, 0x38417fd6UL,
+ 0x5d26c36eUL, 0xb389767cUL, 0xd6eecac4UL, 0x6fd61d59UL, 0x0ab1a1e1UL,
+ 0xe41e14f3UL, 0x8179a84bUL, 0xd769cb13UL, 0xb20e77abUL, 0x5ca1c2b9UL,
+ 0x39c67e01UL, 0x80fea99cUL, 0xe5991524UL, 0x0b36a036UL, 0x6e511c8eUL,
+ 0xa7166686UL, 0xc271da3eUL, 0x2cde6f2cUL, 0x49b9d394UL, 0xf0810409UL,
+ 0x95e6b8b1UL, 0x7b490da3UL, 0x1e2eb11bUL, 0x483ed243UL, 0x2d596efbUL,
+ 0xc3f6dbe9UL, 0xa6916751UL, 0x1fa9b0ccUL, 0x7ace0c74UL, 0x9461b966UL,
+ 0xf10605deUL
+#endif
+ }
+};
diff --git a/chroot/opt/android-master/amd64/usr/include/cutils/bitops.h b/chroot/opt/android-master/amd64/usr/include/cutils/bitops.h
new file mode 100644
index 0000000..38d2840
--- /dev/null
+++ b/chroot/opt/android-master/amd64/usr/include/cutils/bitops.h
@@ -0,0 +1,41 @@
+/*
+ * Copyright (C) 2011 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.
+ */
+
+#ifndef __CUTILS_BITOPS_H
+#define __CUTILS_BITOPS_H
+
+#include <stdbool.h>
+#include <string.h>
+#include <strings.h>
+#include <sys/cdefs.h>
+
+__BEGIN_DECLS
+
+static inline int popcount(unsigned int x) {
+ return __builtin_popcount(x);
+}
+
+static inline int popcountl(unsigned long x) {
+ return __builtin_popcountl(x);
+}
+
+static inline int popcountll(unsigned long long x) {
+ return __builtin_popcountll(x);
+}
+
+__END_DECLS
+
+#endif /* __CUTILS_BITOPS_H */
diff --git a/chroot/opt/android-master/amd64/usr/include/cutils/compiler.h b/chroot/opt/android-master/amd64/usr/include/cutils/compiler.h
new file mode 100644
index 0000000..70f884a
--- /dev/null
+++ b/chroot/opt/android-master/amd64/usr/include/cutils/compiler.h
@@ -0,0 +1,44 @@
+/*
+ * Copyright (C) 2009 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.
+ */
+
+#ifndef ANDROID_CUTILS_COMPILER_H
+#define ANDROID_CUTILS_COMPILER_H
+
+/*
+ * helps the compiler's optimizer predicting branches
+ */
+
+#ifdef __cplusplus
+# define CC_LIKELY( exp ) (__builtin_expect( !!(exp), true ))
+# define CC_UNLIKELY( exp ) (__builtin_expect( !!(exp), false ))
+#else
+# define CC_LIKELY( exp ) (__builtin_expect( !!(exp), 1 ))
+# define CC_UNLIKELY( exp ) (__builtin_expect( !!(exp), 0 ))
+#endif
+
+/**
+ * exports marked symbols
+ *
+ * if used on a C++ class declaration, this macro must be inserted
+ * after the "class" keyword. For instance:
+ *
+ * template <typename TYPE>
+ * class ANDROID_API Singleton { }
+ */
+
+#define ANDROID_API __attribute__((visibility("default")))
+
+#endif // ANDROID_CUTILS_COMPILER_H
diff --git a/chroot/opt/android-master/amd64/usr/include/cutils/hashmap.h b/chroot/opt/android-master/amd64/usr/include/cutils/hashmap.h
new file mode 100644
index 0000000..9cfd669
--- /dev/null
+++ b/chroot/opt/android-master/amd64/usr/include/cutils/hashmap.h
@@ -0,0 +1,104 @@
+/*
+ * Copyright (C) 2007 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.
+ */
+
+/**
+ * Hash map.
+ *
+ * Use std::map or std::unordered_map instead.
+ * https://en.cppreference.com/w/cpp/container
+ */
+
+#ifndef __HASHMAP_H
+#define __HASHMAP_H
+
+#include <stdbool.h>
+#include <stdlib.h>
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+/** A hash map. */
+typedef struct Hashmap Hashmap;
+
+/**
+ * Creates a new hash map. Returns NULL if memory allocation fails.
+ *
+ * @param initialCapacity number of expected entries
+ * @param hash function which hashes keys
+ * @param equals function which compares keys for equality
+ */
+Hashmap* hashmapCreate(size_t initialCapacity,
+ int (*hash)(void* key), bool (*equals)(void* keyA, void* keyB));
+
+/**
+ * Frees the hash map. Does not free the keys or values themselves.
+ */
+void hashmapFree(Hashmap* map);
+
+/**
+ * Hashes the memory pointed to by key with the given size. Useful for
+ * implementing hash functions.
+ */
+int hashmapHash(void* key, size_t keySize);
+
+/**
+ * Puts value for the given key in the map. Returns pre-existing value if
+ * any.
+ *
+ * If memory allocation fails, this function returns NULL, the map's size
+ * does not increase, and errno is set to ENOMEM.
+ */
+void* hashmapPut(Hashmap* map, void* key, void* value);
+
+/**
+ * Gets a value from the map. Returns NULL if no entry for the given key is
+ * found or if the value itself is NULL.
+ */
+void* hashmapGet(Hashmap* map, void* key);
+
+/**
+ * Removes an entry from the map. Returns the removed value or NULL if no
+ * entry was present.
+ */
+void* hashmapRemove(Hashmap* map, void* key);
+
+/**
+ * Invokes the given callback on each entry in the map. Stops iterating if
+ * the callback returns false.
+ */
+void hashmapForEach(Hashmap* map, bool (*callback)(void* key, void* value, void* context),
+ void* context);
+
+/**
+ * Concurrency support.
+ */
+
+/**
+ * Locks the hash map so only the current thread can access it.
+ */
+void hashmapLock(Hashmap* map);
+
+/**
+ * Unlocks the hash map so other threads can access it.
+ */
+void hashmapUnlock(Hashmap* map);
+
+#ifdef __cplusplus
+}
+#endif
+
+#endif /* __HASHMAP_H */
diff --git a/chroot/opt/android-master/amd64/usr/include/cutils/log.h b/chroot/opt/android-master/amd64/usr/include/cutils/log.h
new file mode 100644
index 0000000..0e0248e
--- /dev/null
+++ b/chroot/opt/android-master/amd64/usr/include/cutils/log.h
@@ -0,0 +1 @@
+#include <log/log.h>
diff --git a/chroot/opt/android-master/amd64/usr/include/cutils/native_handle.h b/chroot/opt/android-master/amd64/usr/include/cutils/native_handle.h
new file mode 100644
index 0000000..4f07456
--- /dev/null
+++ b/chroot/opt/android-master/amd64/usr/include/cutils/native_handle.h
@@ -0,0 +1,106 @@
+/*
+ * Copyright (C) 2009 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.
+ */
+
+#ifndef NATIVE_HANDLE_H_
+#define NATIVE_HANDLE_H_
+
+#include <stdalign.h>
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+#define NATIVE_HANDLE_MAX_FDS 1024
+#define NATIVE_HANDLE_MAX_INTS 1024
+
+/* Declare a char array for use with native_handle_init */
+#define NATIVE_HANDLE_DECLARE_STORAGE(name, maxFds, maxInts) \
+ alignas(native_handle_t) char (name)[ \
+ sizeof(native_handle_t) + sizeof(int) * ((maxFds) + (maxInts))]
+
+typedef struct native_handle
+{
+ int version; /* sizeof(native_handle_t) */
+ int numFds; /* number of file-descriptors at &data[0] */
+ int numInts; /* number of ints at &data[numFds] */
+#if defined(__clang__)
+#pragma clang diagnostic push
+#pragma clang diagnostic ignored "-Wzero-length-array"
+#endif
+ int data[0]; /* numFds + numInts ints */
+#if defined(__clang__)
+#pragma clang diagnostic pop
+#endif
+} native_handle_t;
+
+typedef const native_handle_t* buffer_handle_t;
+
+/*
+ * native_handle_close
+ *
+ * closes the file descriptors contained in this native_handle_t
+ *
+ * return 0 on success, or a negative error code on failure
+ *
+ */
+int native_handle_close(const native_handle_t* h);
+
+/*
+ * native_handle_init
+ *
+ * Initializes a native_handle_t from storage. storage must be declared with
+ * NATIVE_HANDLE_DECLARE_STORAGE. numFds and numInts must not respectively
+ * exceed maxFds and maxInts used to declare the storage.
+ */
+native_handle_t* native_handle_init(char* storage, int numFds, int numInts);
+
+/*
+ * native_handle_create
+ *
+ * creates a native_handle_t and initializes it. must be destroyed with
+ * native_handle_delete(). Note that numFds must be <= NATIVE_HANDLE_MAX_FDS,
+ * numInts must be <= NATIVE_HANDLE_MAX_INTS, and both must be >= 0.
+ *
+ */
+native_handle_t* native_handle_create(int numFds, int numInts);
+
+/*
+ * native_handle_clone
+ *
+ * creates a native_handle_t and initializes it from another native_handle_t.
+ * Must be destroyed with native_handle_delete().
+ *
+ */
+native_handle_t* native_handle_clone(const native_handle_t* handle);
+
+/*
+ * native_handle_delete
+ *
+ * frees a native_handle_t allocated with native_handle_create().
+ * This ONLY frees the memory allocated for the native_handle_t, but doesn't
+ * close the file descriptors; which can be achieved with native_handle_close().
+ *
+ * return 0 on success, or a negative error code on failure
+ *
+ */
+int native_handle_delete(native_handle_t* h);
+
+
+#ifdef __cplusplus
+}
+#endif
+
+#endif /* NATIVE_HANDLE_H_ */
diff --git a/chroot/opt/android-master/amd64/usr/include/dlfcn.h b/chroot/opt/android-master/amd64/usr/include/dlfcn.h
new file mode 100644
index 0000000..68d8bc9
--- /dev/null
+++ b/chroot/opt/android-master/amd64/usr/include/dlfcn.h
@@ -0,0 +1,80 @@
+/*
+ * Copyright (C) 2008 The Android Open Source Project
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ * * Redistributions of source code must retain the above copyright
+ * notice, this list of conditions and the following disclaimer.
+ * * 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.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+ * "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
+ * COPYRIGHT OWNER OR CONTRIBUTORS 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.
+ */
+
+#ifndef __DLFCN_H__
+#define __DLFCN_H__
+
+#include <stdint.h>
+#include <sys/cdefs.h>
+
+__BEGIN_DECLS
+
+typedef struct {
+ /* Pathname of shared object that contains address. */
+ const char* dli_fname;
+ /* Address at which shared object is loaded. */
+ void* dli_fbase;
+ /* Name of nearest symbol with address lower than addr. */
+ const char* dli_sname;
+ /* Exact address of symbol named in dli_sname. */
+ void* dli_saddr;
+} Dl_info;
+
+void* dlopen(const char* __filename, int __flag);
+int dlclose(void* __handle);
+char* dlerror(void);
+void* dlsym(void* __handle, const char* __symbol);
+void* dlvsym(void* __handle, const char* __symbol, const char* __version) __INTRODUCED_IN(24);
+int dladdr(const void* __addr, Dl_info* __info);
+
+#define RTLD_LOCAL 0
+#define RTLD_LAZY 0x00001
+#define RTLD_NOW 0x00002
+#define RTLD_NOLOAD 0x00004
+#define RTLD_GLOBAL 0x00100
+#define RTLD_NODELETE 0x01000
+
+#if !defined(__LP64__)
+/* LP32 is broken for historical reasons. */
+#undef RTLD_NOW
+#define RTLD_NOW 0x00000
+#undef RTLD_GLOBAL
+#define RTLD_GLOBAL 0x00002
+#endif
+
+#if defined (__LP64__)
+#define RTLD_DEFAULT __BIONIC_CAST(reinterpret_cast, void*, 0)
+#define RTLD_NEXT __BIONIC_CAST(reinterpret_cast, void*, -1L)
+#else
+#define RTLD_DEFAULT __BIONIC_CAST(reinterpret_cast, void*, 0xffffffff)
+#define RTLD_NEXT __BIONIC_CAST(reinterpret_cast, void*, 0xfffffffe)
+#endif
+
+__END_DECLS
+
+#endif
diff --git a/chroot/opt/android-master/amd64/usr/include/drm/drm_fourcc.h b/chroot/opt/android-master/amd64/usr/include/drm/drm_fourcc.h
new file mode 100644
index 0000000..a316269
--- /dev/null
+++ b/chroot/opt/android-master/amd64/usr/include/drm/drm_fourcc.h
@@ -0,0 +1,203 @@
+/****************************************************************************
+ ****************************************************************************
+ ***
+ *** This header was automatically generated from a Linux kernel header
+ *** of the same name, to make information necessary for userspace to
+ *** call into the kernel available to libc. It contains only constants,
+ *** structures, and macros generated from the original header, and thus,
+ *** contains no copyrightable information.
+ ***
+ *** To edit the content of this header, modify the corresponding
+ *** source file (e.g. under external/kernel-headers/original/) then
+ *** run bionic/libc/kernel/tools/update_all.py
+ ***
+ *** Any manual change here will be lost the next time this script will
+ *** be run. You've been warned!
+ ***
+ ****************************************************************************
+ ****************************************************************************/
+#ifndef DRM_FOURCC_H
+#define DRM_FOURCC_H
+#include "drm.h"
+#ifdef __cplusplus
+extern "C" {
+#endif
+#define fourcc_code(a,b,c,d) ((__u32) (a) | ((__u32) (b) << 8) | ((__u32) (c) << 16) | ((__u32) (d) << 24))
+#define DRM_FORMAT_BIG_ENDIAN (1U << 31)
+#define DRM_FORMAT_INVALID 0
+#define DRM_FORMAT_C8 fourcc_code('C', '8', ' ', ' ')
+#define DRM_FORMAT_R8 fourcc_code('R', '8', ' ', ' ')
+#define DRM_FORMAT_R16 fourcc_code('R', '1', '6', ' ')
+#define DRM_FORMAT_RG88 fourcc_code('R', 'G', '8', '8')
+#define DRM_FORMAT_GR88 fourcc_code('G', 'R', '8', '8')
+#define DRM_FORMAT_RG1616 fourcc_code('R', 'G', '3', '2')
+#define DRM_FORMAT_GR1616 fourcc_code('G', 'R', '3', '2')
+#define DRM_FORMAT_RGB332 fourcc_code('R', 'G', 'B', '8')
+#define DRM_FORMAT_BGR233 fourcc_code('B', 'G', 'R', '8')
+#define DRM_FORMAT_XRGB4444 fourcc_code('X', 'R', '1', '2')
+#define DRM_FORMAT_XBGR4444 fourcc_code('X', 'B', '1', '2')
+#define DRM_FORMAT_RGBX4444 fourcc_code('R', 'X', '1', '2')
+#define DRM_FORMAT_BGRX4444 fourcc_code('B', 'X', '1', '2')
+#define DRM_FORMAT_ARGB4444 fourcc_code('A', 'R', '1', '2')
+#define DRM_FORMAT_ABGR4444 fourcc_code('A', 'B', '1', '2')
+#define DRM_FORMAT_RGBA4444 fourcc_code('R', 'A', '1', '2')
+#define DRM_FORMAT_BGRA4444 fourcc_code('B', 'A', '1', '2')
+#define DRM_FORMAT_XRGB1555 fourcc_code('X', 'R', '1', '5')
+#define DRM_FORMAT_XBGR1555 fourcc_code('X', 'B', '1', '5')
+#define DRM_FORMAT_RGBX5551 fourcc_code('R', 'X', '1', '5')
+#define DRM_FORMAT_BGRX5551 fourcc_code('B', 'X', '1', '5')
+#define DRM_FORMAT_ARGB1555 fourcc_code('A', 'R', '1', '5')
+#define DRM_FORMAT_ABGR1555 fourcc_code('A', 'B', '1', '5')
+#define DRM_FORMAT_RGBA5551 fourcc_code('R', 'A', '1', '5')
+#define DRM_FORMAT_BGRA5551 fourcc_code('B', 'A', '1', '5')
+#define DRM_FORMAT_RGB565 fourcc_code('R', 'G', '1', '6')
+#define DRM_FORMAT_BGR565 fourcc_code('B', 'G', '1', '6')
+#define DRM_FORMAT_RGB888 fourcc_code('R', 'G', '2', '4')
+#define DRM_FORMAT_BGR888 fourcc_code('B', 'G', '2', '4')
+#define DRM_FORMAT_XRGB8888 fourcc_code('X', 'R', '2', '4')
+#define DRM_FORMAT_XBGR8888 fourcc_code('X', 'B', '2', '4')
+#define DRM_FORMAT_RGBX8888 fourcc_code('R', 'X', '2', '4')
+#define DRM_FORMAT_BGRX8888 fourcc_code('B', 'X', '2', '4')
+#define DRM_FORMAT_ARGB8888 fourcc_code('A', 'R', '2', '4')
+#define DRM_FORMAT_ABGR8888 fourcc_code('A', 'B', '2', '4')
+#define DRM_FORMAT_RGBA8888 fourcc_code('R', 'A', '2', '4')
+#define DRM_FORMAT_BGRA8888 fourcc_code('B', 'A', '2', '4')
+#define DRM_FORMAT_XRGB2101010 fourcc_code('X', 'R', '3', '0')
+#define DRM_FORMAT_XBGR2101010 fourcc_code('X', 'B', '3', '0')
+#define DRM_FORMAT_RGBX1010102 fourcc_code('R', 'X', '3', '0')
+#define DRM_FORMAT_BGRX1010102 fourcc_code('B', 'X', '3', '0')
+#define DRM_FORMAT_ARGB2101010 fourcc_code('A', 'R', '3', '0')
+#define DRM_FORMAT_ABGR2101010 fourcc_code('A', 'B', '3', '0')
+#define DRM_FORMAT_RGBA1010102 fourcc_code('R', 'A', '3', '0')
+#define DRM_FORMAT_BGRA1010102 fourcc_code('B', 'A', '3', '0')
+#define DRM_FORMAT_XRGB16161616F fourcc_code('X', 'R', '4', 'H')
+#define DRM_FORMAT_XBGR16161616F fourcc_code('X', 'B', '4', 'H')
+#define DRM_FORMAT_ARGB16161616F fourcc_code('A', 'R', '4', 'H')
+#define DRM_FORMAT_ABGR16161616F fourcc_code('A', 'B', '4', 'H')
+#define DRM_FORMAT_YUYV fourcc_code('Y', 'U', 'Y', 'V')
+#define DRM_FORMAT_YVYU fourcc_code('Y', 'V', 'Y', 'U')
+#define DRM_FORMAT_UYVY fourcc_code('U', 'Y', 'V', 'Y')
+#define DRM_FORMAT_VYUY fourcc_code('V', 'Y', 'U', 'Y')
+#define DRM_FORMAT_AYUV fourcc_code('A', 'Y', 'U', 'V')
+#define DRM_FORMAT_XYUV8888 fourcc_code('X', 'Y', 'U', 'V')
+#define DRM_FORMAT_VUY888 fourcc_code('V', 'U', '2', '4')
+#define DRM_FORMAT_VUY101010 fourcc_code('V', 'U', '3', '0')
+#define DRM_FORMAT_Y210 fourcc_code('Y', '2', '1', '0')
+#define DRM_FORMAT_Y212 fourcc_code('Y', '2', '1', '2')
+#define DRM_FORMAT_Y216 fourcc_code('Y', '2', '1', '6')
+#define DRM_FORMAT_Y410 fourcc_code('Y', '4', '1', '0')
+#define DRM_FORMAT_Y412 fourcc_code('Y', '4', '1', '2')
+#define DRM_FORMAT_Y416 fourcc_code('Y', '4', '1', '6')
+#define DRM_FORMAT_XVYU2101010 fourcc_code('X', 'V', '3', '0')
+#define DRM_FORMAT_XVYU12_16161616 fourcc_code('X', 'V', '3', '6')
+#define DRM_FORMAT_XVYU16161616 fourcc_code('X', 'V', '4', '8')
+#define DRM_FORMAT_Y0L0 fourcc_code('Y', '0', 'L', '0')
+#define DRM_FORMAT_X0L0 fourcc_code('X', '0', 'L', '0')
+#define DRM_FORMAT_Y0L2 fourcc_code('Y', '0', 'L', '2')
+#define DRM_FORMAT_X0L2 fourcc_code('X', '0', 'L', '2')
+#define DRM_FORMAT_YUV420_8BIT fourcc_code('Y', 'U', '0', '8')
+#define DRM_FORMAT_YUV420_10BIT fourcc_code('Y', 'U', '1', '0')
+#define DRM_FORMAT_XRGB8888_A8 fourcc_code('X', 'R', 'A', '8')
+#define DRM_FORMAT_XBGR8888_A8 fourcc_code('X', 'B', 'A', '8')
+#define DRM_FORMAT_RGBX8888_A8 fourcc_code('R', 'X', 'A', '8')
+#define DRM_FORMAT_BGRX8888_A8 fourcc_code('B', 'X', 'A', '8')
+#define DRM_FORMAT_RGB888_A8 fourcc_code('R', '8', 'A', '8')
+#define DRM_FORMAT_BGR888_A8 fourcc_code('B', '8', 'A', '8')
+#define DRM_FORMAT_RGB565_A8 fourcc_code('R', '5', 'A', '8')
+#define DRM_FORMAT_BGR565_A8 fourcc_code('B', '5', 'A', '8')
+#define DRM_FORMAT_NV12 fourcc_code('N', 'V', '1', '2')
+#define DRM_FORMAT_NV21 fourcc_code('N', 'V', '2', '1')
+#define DRM_FORMAT_NV16 fourcc_code('N', 'V', '1', '6')
+#define DRM_FORMAT_NV61 fourcc_code('N', 'V', '6', '1')
+#define DRM_FORMAT_NV24 fourcc_code('N', 'V', '2', '4')
+#define DRM_FORMAT_NV42 fourcc_code('N', 'V', '4', '2')
+#define DRM_FORMAT_P210 fourcc_code('P', '2', '1', '0')
+#define DRM_FORMAT_P010 fourcc_code('P', '0', '1', '0')
+#define DRM_FORMAT_P012 fourcc_code('P', '0', '1', '2')
+#define DRM_FORMAT_P016 fourcc_code('P', '0', '1', '6')
+#define DRM_FORMAT_YUV410 fourcc_code('Y', 'U', 'V', '9')
+#define DRM_FORMAT_YVU410 fourcc_code('Y', 'V', 'U', '9')
+#define DRM_FORMAT_YUV411 fourcc_code('Y', 'U', '1', '1')
+#define DRM_FORMAT_YVU411 fourcc_code('Y', 'V', '1', '1')
+#define DRM_FORMAT_YUV420 fourcc_code('Y', 'U', '1', '2')
+#define DRM_FORMAT_YVU420 fourcc_code('Y', 'V', '1', '2')
+#define DRM_FORMAT_YUV422 fourcc_code('Y', 'U', '1', '6')
+#define DRM_FORMAT_YVU422 fourcc_code('Y', 'V', '1', '6')
+#define DRM_FORMAT_YUV444 fourcc_code('Y', 'U', '2', '4')
+#define DRM_FORMAT_YVU444 fourcc_code('Y', 'V', '2', '4')
+#define DRM_FORMAT_MOD_NONE 0
+#define DRM_FORMAT_MOD_VENDOR_NONE 0
+#define DRM_FORMAT_MOD_VENDOR_INTEL 0x01
+#define DRM_FORMAT_MOD_VENDOR_AMD 0x02
+#define DRM_FORMAT_MOD_VENDOR_NVIDIA 0x03
+#define DRM_FORMAT_MOD_VENDOR_SAMSUNG 0x04
+#define DRM_FORMAT_MOD_VENDOR_QCOM 0x05
+#define DRM_FORMAT_MOD_VENDOR_VIVANTE 0x06
+#define DRM_FORMAT_MOD_VENDOR_BROADCOM 0x07
+#define DRM_FORMAT_MOD_VENDOR_ARM 0x08
+#define DRM_FORMAT_MOD_VENDOR_ALLWINNER 0x09
+#define DRM_FORMAT_RESERVED ((1ULL << 56) - 1)
+#define fourcc_mod_code(vendor,val) ((((__u64) DRM_FORMAT_MOD_VENDOR_ ##vendor) << 56) | ((val) & 0x00ffffffffffffffULL))
+#define DRM_FORMAT_MOD_INVALID fourcc_mod_code(NONE, DRM_FORMAT_RESERVED)
+#define DRM_FORMAT_MOD_LINEAR fourcc_mod_code(NONE, 0)
+#define I915_FORMAT_MOD_X_TILED fourcc_mod_code(INTEL, 1)
+#define I915_FORMAT_MOD_Y_TILED fourcc_mod_code(INTEL, 2)
+#define I915_FORMAT_MOD_Yf_TILED fourcc_mod_code(INTEL, 3)
+#define I915_FORMAT_MOD_Y_TILED_CCS fourcc_mod_code(INTEL, 4)
+#define I915_FORMAT_MOD_Yf_TILED_CCS fourcc_mod_code(INTEL, 5)
+#define DRM_FORMAT_MOD_SAMSUNG_64_32_TILE fourcc_mod_code(SAMSUNG, 1)
+#define DRM_FORMAT_MOD_SAMSUNG_16_16_TILE fourcc_mod_code(SAMSUNG, 2)
+#define DRM_FORMAT_MOD_QCOM_COMPRESSED fourcc_mod_code(QCOM, 1)
+#define DRM_FORMAT_MOD_QCOM_DX fourcc_mod_code(QCOM, 0x2)
+#define DRM_FORMAT_MOD_QCOM_TIGHT fourcc_mod_code(QCOM, 0x4)
+#define DRM_FORMAT_MOD_QCOM_TILE fourcc_mod_code(QCOM, 0x8)
+#define DRM_FORMAT_MOD_VIVANTE_TILED fourcc_mod_code(VIVANTE, 1)
+#define DRM_FORMAT_MOD_VIVANTE_SUPER_TILED fourcc_mod_code(VIVANTE, 2)
+#define DRM_FORMAT_MOD_VIVANTE_SPLIT_TILED fourcc_mod_code(VIVANTE, 3)
+#define DRM_FORMAT_MOD_VIVANTE_SPLIT_SUPER_TILED fourcc_mod_code(VIVANTE, 4)
+#define DRM_FORMAT_MOD_NVIDIA_TEGRA_TILED fourcc_mod_code(NVIDIA, 1)
+#define DRM_FORMAT_MOD_NVIDIA_16BX2_BLOCK(v) fourcc_mod_code(NVIDIA, 0x10 | ((v) & 0xf))
+#define DRM_FORMAT_MOD_NVIDIA_16BX2_BLOCK_ONE_GOB fourcc_mod_code(NVIDIA, 0x10)
+#define DRM_FORMAT_MOD_NVIDIA_16BX2_BLOCK_TWO_GOB fourcc_mod_code(NVIDIA, 0x11)
+#define DRM_FORMAT_MOD_NVIDIA_16BX2_BLOCK_FOUR_GOB fourcc_mod_code(NVIDIA, 0x12)
+#define DRM_FORMAT_MOD_NVIDIA_16BX2_BLOCK_EIGHT_GOB fourcc_mod_code(NVIDIA, 0x13)
+#define DRM_FORMAT_MOD_NVIDIA_16BX2_BLOCK_SIXTEEN_GOB fourcc_mod_code(NVIDIA, 0x14)
+#define DRM_FORMAT_MOD_NVIDIA_16BX2_BLOCK_THIRTYTWO_GOB fourcc_mod_code(NVIDIA, 0x15)
+#define __fourcc_mod_broadcom_param_shift 8
+#define __fourcc_mod_broadcom_param_bits 48
+#define fourcc_mod_broadcom_code(val,params) fourcc_mod_code(BROADCOM, ((((__u64) params) << __fourcc_mod_broadcom_param_shift) | val))
+#define fourcc_mod_broadcom_param(m) ((int) (((m) >> __fourcc_mod_broadcom_param_shift) & ((1ULL << __fourcc_mod_broadcom_param_bits) - 1)))
+#define fourcc_mod_broadcom_mod(m) ((m) & ~(((1ULL << __fourcc_mod_broadcom_param_bits) - 1) << __fourcc_mod_broadcom_param_shift))
+#define DRM_FORMAT_MOD_BROADCOM_VC4_T_TILED fourcc_mod_code(BROADCOM, 1)
+#define DRM_FORMAT_MOD_BROADCOM_SAND32_COL_HEIGHT(v) fourcc_mod_broadcom_code(2, v)
+#define DRM_FORMAT_MOD_BROADCOM_SAND64_COL_HEIGHT(v) fourcc_mod_broadcom_code(3, v)
+#define DRM_FORMAT_MOD_BROADCOM_SAND128_COL_HEIGHT(v) fourcc_mod_broadcom_code(4, v)
+#define DRM_FORMAT_MOD_BROADCOM_SAND256_COL_HEIGHT(v) fourcc_mod_broadcom_code(5, v)
+#define DRM_FORMAT_MOD_BROADCOM_SAND32 DRM_FORMAT_MOD_BROADCOM_SAND32_COL_HEIGHT(0)
+#define DRM_FORMAT_MOD_BROADCOM_SAND64 DRM_FORMAT_MOD_BROADCOM_SAND64_COL_HEIGHT(0)
+#define DRM_FORMAT_MOD_BROADCOM_SAND128 DRM_FORMAT_MOD_BROADCOM_SAND128_COL_HEIGHT(0)
+#define DRM_FORMAT_MOD_BROADCOM_SAND256 DRM_FORMAT_MOD_BROADCOM_SAND256_COL_HEIGHT(0)
+#define DRM_FORMAT_MOD_BROADCOM_UIF fourcc_mod_code(BROADCOM, 6)
+#define DRM_FORMAT_MOD_ARM_CODE(__type,__val) fourcc_mod_code(ARM, ((__u64) (__type) << 52) | ((__val) & 0x000fffffffffffffULL))
+#define DRM_FORMAT_MOD_ARM_TYPE_AFBC 0x00
+#define DRM_FORMAT_MOD_ARM_TYPE_MISC 0x01
+#define DRM_FORMAT_MOD_ARM_AFBC(__afbc_mode) DRM_FORMAT_MOD_ARM_CODE(DRM_FORMAT_MOD_ARM_TYPE_AFBC, __afbc_mode)
+#define AFBC_FORMAT_MOD_BLOCK_SIZE_MASK 0xf
+#define AFBC_FORMAT_MOD_BLOCK_SIZE_16x16 (1ULL)
+#define AFBC_FORMAT_MOD_BLOCK_SIZE_32x8 (2ULL)
+#define AFBC_FORMAT_MOD_BLOCK_SIZE_64x4 (3ULL)
+#define AFBC_FORMAT_MOD_BLOCK_SIZE_32x8_64x4 (4ULL)
+#define AFBC_FORMAT_MOD_YTR (1ULL << 4)
+#define AFBC_FORMAT_MOD_SPLIT (1ULL << 5)
+#define AFBC_FORMAT_MOD_SPARSE (1ULL << 6)
+#define AFBC_FORMAT_MOD_CBR (1ULL << 7)
+#define AFBC_FORMAT_MOD_TILED (1ULL << 8)
+#define AFBC_FORMAT_MOD_SC (1ULL << 9)
+#define AFBC_FORMAT_MOD_DB (1ULL << 10)
+#define AFBC_FORMAT_MOD_BCH (1ULL << 11)
+#define DRM_FORMAT_MOD_ARM_16X16_BLOCK_U_INTERLEAVED DRM_FORMAT_MOD_ARM_CODE(DRM_FORMAT_MOD_ARM_TYPE_MISC, 1ULL)
+#define DRM_FORMAT_MOD_ALLWINNER_TILED fourcc_mod_code(ALLWINNER, 1)
+#ifdef __cplusplus
+}
+#endif
+#endif
diff --git a/chroot/opt/android-master/amd64/usr/include/elf.h b/chroot/opt/android-master/amd64/usr/include/elf.h
new file mode 100644
index 0000000..4739bbd
--- /dev/null
+++ b/chroot/opt/android-master/amd64/usr/include/elf.h
@@ -0,0 +1,555 @@
+/*
+ * Copyright (C) 2008 The Android Open Source Project
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ * * Redistributions of source code must retain the above copyright
+ * notice, this list of conditions and the following disclaimer.
+ * * 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.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+ * "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
+ * COPYRIGHT OWNER OR CONTRIBUTORS 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.
+ */
+
+#pragma once
+
+#include <sys/cdefs.h>
+
+#include <bits/auxvec.h>
+#include <bits/elf_arm.h>
+#include <bits/elf_arm64.h>
+#include <bits/elf_x86.h>
+#include <bits/elf_x86_64.h>
+#include <linux/elf.h>
+#include <linux/elf-em.h>
+
+/* http://www.sco.com/developers/gabi/latest/ch4.intro.html */
+typedef __u64 Elf32_Xword;
+typedef __s64 Elf32_Sxword;
+
+typedef struct {
+ __u32 a_type;
+ union {
+ __u32 a_val;
+ } a_un;
+} Elf32_auxv_t;
+
+typedef struct {
+ __u64 a_type;
+ union {
+ __u64 a_val;
+ } a_un;
+} Elf64_auxv_t;
+
+/* http://www.sco.com/developers/gabi/latest/ch4.sheader.html */
+typedef struct {
+ Elf32_Word ch_type;
+ Elf32_Word ch_size;
+ Elf32_Word ch_addralign;
+} Elf32_Chdr;
+typedef struct {
+ Elf64_Word ch_type;
+ Elf64_Word ch_reserved;
+ Elf64_Xword ch_size;
+ Elf64_Xword ch_addralign;
+} Elf64_Chdr;
+
+typedef struct {
+ Elf32_Word l_name;
+ Elf32_Word l_time_stamp;
+ Elf32_Word l_checksum;
+ Elf32_Word l_version;
+ Elf32_Word l_flags;
+} Elf32_Lib;
+typedef struct {
+ Elf64_Word l_name;
+ Elf64_Word l_time_stamp;
+ Elf64_Word l_checksum;
+ Elf64_Word l_version;
+ Elf64_Word l_flags;
+} Elf64_Lib;
+/* ElfW(Lib)::l_flags values. */
+#define LL_NONE 0x0
+#define LL_EXACT_MATCH 0x1
+#define LL_IGNORE_INT_VER 0x2
+#define LL_REQUIRE_MINOR 0x4
+#define LL_EXPORTS 0x8
+#define LL_DELAY_LOAD 0x10
+#define LL_DELTA 0x20
+
+typedef struct {
+ Elf32_Xword m_value;
+ Elf32_Word m_info;
+ Elf32_Word m_poffset;
+ Elf32_Half m_repeat;
+ Elf32_Half m_stride;
+} Elf32_Move;
+typedef struct {
+ Elf64_Xword m_value;
+ Elf64_Xword m_info;
+ Elf64_Xword m_poffset;
+ Elf64_Half m_repeat;
+ Elf64_Half m_stride;
+} Elf64_Move;
+
+typedef __u16 Elf32_Section;
+typedef __u16 Elf64_Section;
+
+typedef struct {
+ Elf32_Half si_boundto;
+ Elf32_Half si_flags;
+} Elf32_Syminfo;
+typedef struct {
+ Elf64_Half si_boundto;
+ Elf64_Half si_flags;
+} Elf64_Syminfo;
+/* ElfW(Syminfo)::si_boundto values. */
+#define SYMINFO_BT_SELF 0xffff
+#define SYMINFO_BT_PARENT 0xfffe
+/* ElfW(Syminfo)::si_flags values. */
+#define SYMINFO_FLG_DIRECT 0x1
+#define SYMINFO_FLG_PASSTHRU 0x2
+#define SYMINFO_FLG_COPY 0x4
+#define SYMINFO_FLG_LAZYLOAD 0x8
+
+typedef Elf32_Half Elf32_Versym;
+typedef Elf64_Half Elf64_Versym;
+
+typedef struct {
+ Elf32_Half vd_version;
+ Elf32_Half vd_flags;
+ Elf32_Half vd_ndx;
+ Elf32_Half vd_cnt;
+ Elf32_Word vd_hash;
+ Elf32_Word vd_aux;
+ Elf32_Word vd_next;
+} Elf32_Verdef;
+
+typedef struct {
+ Elf32_Word vda_name;
+ Elf32_Word vda_next;
+} Elf32_Verdaux;
+
+typedef struct {
+ Elf64_Half vd_version;
+ Elf64_Half vd_flags;
+ Elf64_Half vd_ndx;
+ Elf64_Half vd_cnt;
+ Elf64_Word vd_hash;
+ Elf64_Word vd_aux;
+ Elf64_Word vd_next;
+} Elf64_Verdef;
+
+typedef struct {
+ Elf64_Word vda_name;
+ Elf64_Word vda_next;
+} Elf64_Verdaux;
+
+typedef struct {
+ Elf32_Half vn_version;
+ Elf32_Half vn_cnt;
+ Elf32_Word vn_file;
+ Elf32_Word vn_aux;
+ Elf32_Word vn_next;
+} Elf32_Verneed;
+
+typedef struct {
+ Elf32_Word vna_hash;
+ Elf32_Half vna_flags;
+ Elf32_Half vna_other;
+ Elf32_Word vna_name;
+ Elf32_Word vna_next;
+} Elf32_Vernaux;
+
+typedef struct {
+ Elf64_Half vn_version;
+ Elf64_Half vn_cnt;
+ Elf64_Word vn_file;
+ Elf64_Word vn_aux;
+ Elf64_Word vn_next;
+} Elf64_Verneed;
+
+typedef struct {
+ Elf64_Word vna_hash;
+ Elf64_Half vna_flags;
+ Elf64_Half vna_other;
+ Elf64_Word vna_name;
+ Elf64_Word vna_next;
+} Elf64_Vernaux;
+
+/* Relocation table entry for relative (in section of type SHT_RELR). */
+typedef Elf32_Word Elf32_Relr;
+typedef Elf64_Xword Elf64_Relr;
+
+/* http://www.sco.com/developers/gabi/latest/ch5.dynamic.html */
+#define DF_ORIGIN 0x00000001
+#define DF_SYMBOLIC 0x00000002
+#define DF_TEXTREL 0x00000004
+#define DF_BIND_NOW 0x00000008
+#define DF_STATIC_TLS 0x00000010
+
+#define DF_1_NOW 0x00000001 /* Perform complete relocation processing. */
+#define DF_1_GLOBAL 0x00000002 /* implies RTLD_GLOBAL */
+#define DF_1_GROUP 0x00000004
+#define DF_1_NODELETE 0x00000008 /* implies RTLD_NODELETE */
+#define DF_1_LOADFLTR 0x00000010
+#define DF_1_INITFIRST 0x00000020
+#define DF_1_NOOPEN 0x00000040 /* Object can not be used with dlopen(3) */
+#define DF_1_ORIGIN 0x00000080
+#define DF_1_DIRECT 0x00000100
+#define DF_1_TRANS 0x00000200
+#define DF_1_INTERPOSE 0x00000400
+#define DF_1_NODEFLIB 0x00000800
+#define DF_1_NODUMP 0x00001000 /* Object cannot be dumped with dldump(3) */
+#define DF_1_CONFALT 0x00002000
+#define DF_1_ENDFILTEE 0x00004000
+#define DF_1_DISPRELDNE 0x00008000
+#define DF_1_DISPRELPND 0x00010000
+#define DF_1_NODIRECT 0x00020000
+#define DF_1_IGNMULDEF 0x00040000 /* Internal use */
+#define DF_1_NOKSYMS 0x00080000 /* Internal use */
+#define DF_1_NOHDR 0x00100000 /* Internal use */
+#define DF_1_EDITED 0x00200000
+#define DF_1_NORELOC 0x00400000 /* Internal use */
+#define DF_1_SYMINTPOSE 0x00800000
+#define DF_1_GLOBAUDIT 0x01000000
+#define DF_1_SINGLETON 0x02000000
+#define DF_1_STUB 0x04000000
+#define DF_1_PIE 0x08000000
+
+/* http://www.sco.com/developers/gabi/latest/ch5.dynamic.html */
+#define DT_BIND_NOW 24
+#define DT_INIT_ARRAY 25
+#define DT_FINI_ARRAY 26
+#define DT_INIT_ARRAYSZ 27
+#define DT_FINI_ARRAYSZ 28
+#define DT_RUNPATH 29
+#define DT_FLAGS 30
+/* glibc and BSD disagree for DT_ENCODING; glibc looks wrong. */
+#define DT_PREINIT_ARRAY 32
+#define DT_PREINIT_ARRAYSZ 33
+#define DT_RELRSZ 35
+#define DT_RELR 36
+#define DT_RELRENT 37
+
+#define DT_GNU_HASH 0x6ffffef5
+#define DT_TLSDESC_PLT 0x6ffffef6
+#define DT_TLSDESC_GOT 0x6ffffef7
+
+/* http://www.sco.com/developers/gabi/latest/ch4.eheader.html */
+#define EI_ABIVERSION 8
+#undef EI_PAD
+#define EI_PAD 9
+
+/* http://www.sco.com/developers/gabi/latest/ch4.sheader.html */
+#define ELFCOMPRESS_ZLIB 1
+#define ELFCOMPRESS_LOOS 0x60000000
+#define ELFCOMPRESS_HIOS 0x6fffffff
+#define ELFCOMPRESS_LOPROC 0x70000000
+#define ELFCOMPRESS_HIPROC 0x7fffffff
+
+/* http://www.sco.com/developers/gabi/latest/ch4.eheader.html */
+#define ELFOSABI_SYSV 0 /* Synonym for ELFOSABI_NONE used by valgrind. */
+#define ELFOSABI_HPUX 1
+#define ELFOSABI_NETBSD 2
+#define ELFOSABI_GNU 3 /* Synonym for ELFOSABI_LINUX. */
+#define ELFOSABI_SOLARIS 6
+#define ELFOSABI_AIX 7
+#define ELFOSABI_IRIX 8
+#define ELFOSABI_FREEBSD 9
+#define ELFOSABI_TRU64 10
+#define ELFOSABI_MODESTO 11
+#define ELFOSABI_OPENBSD 12
+#define ELFOSABI_OPENVMS 13
+#define ELFOSABI_NSK 14
+#define ELFOSABI_AROS 15
+#define ELFOSABI_FENIXOS 16
+#define ELFOSABI_CLOUDABI 17
+#define ELFOSABI_OPENVOS 18
+#define ELFOSABI_ARM_AEABI 64
+
+/* http://www.sco.com/developers/gabi/latest/ch4.reloc.html */
+#define ELF32_R_INFO(sym, type) ((((Elf32_Word)sym) << 8) | ((type) & 0xff))
+#define ELF64_R_INFO(sym, type) ((((Elf64_Xword)sym) << 32) | ((type) & 0xffffffff))
+
+/* http://www.sco.com/developers/gabi/latest/ch4.symtab.html */
+#undef ELF_ST_TYPE
+#define ELF_ST_TYPE(x) ((x) & 0xf)
+#define ELF_ST_INFO(b,t) (((b) << 4) + ((t) & 0xf))
+#define ELF32_ST_INFO(b,t) ELF_ST_INFO(b,t)
+#define ELF64_ST_INFO(b,t) ELF_ST_INFO(b,t)
+
+/* http://www.sco.com/developers/gabi/latest/ch4.eheader.html */
+#define EM_S370 9
+#define EM_VPP500 17
+#define EM_960 19
+#define EM_V800 36
+#define EM_FR20 37
+#define EM_RH32 38
+#define EM_RCE 39
+#define EM_FAKE_ALPHA 41
+#define EM_TRICORE 44
+#define EM_ARC 45
+#define EM_H8_300H 47
+#define EM_H8S 48
+#define EM_H8_500 49
+#define EM_MIPS_X 51
+#define EM_COLDFIRE 52
+#define EM_68HC12 53
+#define EM_MMA 54
+#define EM_PCP 55
+#define EM_NCPU 56
+#define EM_NDR1 57
+#define EM_STARCORE 58
+#define EM_ME16 59
+#define EM_ST100 60
+#define EM_TINYJ 61
+#define EM_PDSP 63
+#define EM_PDP10 64
+#define EM_PDP11 65
+#define EM_FX66 66
+#define EM_ST9PLUS 67
+#define EM_ST7 68
+#define EM_68HC16 69
+#define EM_68HC11 70
+#define EM_68HC08 71
+#define EM_68HC05 72
+#define EM_SVX 73
+#define EM_ST19 74
+#define EM_VAX 75
+#define EM_JAVELIN 77
+#define EM_FIREPATH 78
+#define EM_ZSP 79
+#define EM_MMIX 80
+#define EM_HUANY 81
+#define EM_PRISM 82
+#define EM_AVR 83
+#define EM_FR30 84
+#define EM_D10V 85
+#define EM_D30V 86
+#define EM_V850 87
+#define EM_MN10200 90
+#define EM_PJ 91
+#define EM_ARC_COMPACT 93
+#define EM_XTENSA 94
+#define EM_VIDEOCORE 95
+#define EM_TMM_GPP 96
+#define EM_NS32K 97
+#define EM_TPC 98
+#define EM_SNP1K 99
+#define EM_ST200 100
+#define EM_IP2K 101
+#define EM_MAX 102
+#define EM_CR 103
+#define EM_F2MC16 104
+#define EM_MSP430 105
+#define EM_SE_C33 107
+#define EM_SEP 108
+#define EM_ARCA 109
+#define EM_UNICORE 110
+#define EM_EXCESS 111
+#define EM_DXP 112
+#define EM_CRX 114
+#define EM_XGATE 115
+#define EM_C166 116
+#define EM_M16C 117
+#define EM_DSPIC30F 118
+#define EM_CE 119
+#define EM_M32C 120
+#define EM_TSK3000 131
+#define EM_RS08 132
+#define EM_SHARC 133
+#define EM_ECOG2 134
+#define EM_SCORE7 135
+#define EM_DSP24 136
+#define EM_VIDEOCORE3 137
+#define EM_LATTICEMICO32 138
+#define EM_SE_C17 139
+#define EM_TI_C2000 141
+#define EM_TI_C5500 142
+#define EM_MMDSP_PLUS 160
+#define EM_CYPRESS_M8C 161
+#define EM_R32C 162
+#define EM_TRIMEDIA 163
+#define EM_QDSP6 164
+#define EM_8051 165
+#define EM_STXP7X 166
+#define EM_NDS32 167
+#define EM_ECOG1 168
+#define EM_ECOG1X 168
+#define EM_MAXQ30 169
+#define EM_XIMO16 170
+#define EM_MANIK 171
+#define EM_CRAYNV2 172
+#define EM_RX 173
+#define EM_METAG 174
+#define EM_MCST_ELBRUS 175
+#define EM_ECOG16 176
+#define EM_CR16 177
+#define EM_ETPU 178
+#define EM_SLE9X 179
+#define EM_L10M 180
+#define EM_K10M 181
+#define EM_AVR32 185
+#define EM_STM8 186
+#define EM_TILE64 187
+#define EM_CUDA 190
+#define EM_CLOUDSHIELD 192
+#define EM_COREA_1ST 193
+#define EM_COREA_2ND 194
+#define EM_ARC_COMPACT2 195
+#define EM_OPEN8 196
+#define EM_RL78 197
+#define EM_VIDEOCORE5 198
+#define EM_78KOR 199
+#define EM_56800EX 200
+#define EM_BA1 201
+#define EM_BA2 202
+#define EM_XCORE 203
+#define EM_MCHP_PIC 204
+#define EM_INTEL205 205
+#define EM_INTEL206 206
+#define EM_INTEL207 207
+#define EM_INTEL208 208
+#define EM_INTEL209 209
+#define EM_KM32 210
+#define EM_KMX32 211
+#define EM_KMX16 212
+#define EM_KMX8 213
+#define EM_KVARC 214
+#define EM_CDP 215
+#define EM_COGE 216
+#define EM_COOL 217
+#define EM_NORC 218
+#define EM_CSR_KALIMBA 219
+#define EM_Z80 220
+#define EM_VISIUM 221
+#define EM_FT32 222
+#define EM_MOXIE 223
+#define EM_AMDGPU 224
+#define EM_RISCV 243
+
+/* http://www.sco.com/developers/gabi/latest/ch4.eheader.html */
+#define ET_LOOS 0xfe00
+#define ET_HIOS 0xfeff
+
+/* http://www.sco.com/developers/gabi/latest/ch4.sheader.html */
+#define GRP_COMDAT 0x1
+#define GRP_MASKOS 0x0ff00000
+#define GRP_MASKPROC 0xf0000000
+
+/* http://www.sco.com/developers/gabi/latest/ch5.pheader.html */
+#define PF_X 0x1
+#define PF_W 0x2
+#define PF_R 0x4
+#define PF_MASKOS 0x0ff00000
+#define PF_MASKPROC 0xf0000000
+
+#define PT_GNU_RELRO 0x6474e552
+
+#define STB_LOOS 10
+#define STB_HIOS 12
+#define STB_LOPROC 13
+#define STB_HIPROC 15
+
+/* http://www.sco.com/developers/gabi/latest/ch4.sheader.html */
+#define SHF_MERGE 0x10
+#define SHF_STRINGS 0x20
+#define SHF_INFO_LINK 0x40
+#define SHF_LINK_ORDER 0x80
+#define SHF_OS_NONCONFORMING 0x100
+#define SHF_GROUP 0x200
+#define SHF_TLS 0x400
+#define SHF_COMPRESSED 0x800
+#define SHF_MASKOS 0x0ff00000
+#define SHF_MASKPROC 0xf0000000
+
+/* http://www.sco.com/developers/gabi/latest/ch4.sheader.html */
+#define SHN_LOOS 0xff20
+#define SHN_HIOS 0xff3f
+#define SHN_XINDEX 0xffff
+
+/* http://www.sco.com/developers/gabi/latest/ch4.sheader.html */
+#define SHT_INIT_ARRAY 14
+#define SHT_FINI_ARRAY 15
+#define SHT_PREINIT_ARRAY 16
+#define SHT_GROUP 17
+#define SHT_SYMTAB_SHNDX 18
+#define SHT_RELR 19
+#undef SHT_NUM
+#define SHT_NUM 20
+#define SHT_LOOS 0x60000000
+#define SHT_HIOS 0x6fffffff
+
+/* http://www.sco.com/developers/gabi/latest/ch4.symtab.html */
+#define STN_UNDEF 0
+
+/* http://www.sco.com/developers/gabi/latest/ch4.symtab.html */
+#define STT_GNU_IFUNC 10
+#define STT_LOOS 10
+#define STT_HIOS 12
+#define STT_LOPROC 13
+#define STT_HIPROC 15
+
+/* http://www.sco.com/developers/gabi/latest/ch4.symtab.html */
+#define STV_DEFAULT 0
+#define STV_INTERNAL 1
+#define STV_HIDDEN 2
+#define STV_PROTECTED 3
+
+/* The kernel uses NT_PRFPREG but glibc also offers NT_FPREGSET */
+#define NT_FPREGSET NT_PRFPREG
+
+#define ELF_NOTE_GNU "GNU"
+
+#define NT_GNU_BUILD_ID 3
+
+#define VER_FLG_BASE 0x1
+#define VER_FLG_WEAK 0x2
+
+#define VER_NDX_LOCAL 0
+#define VER_NDX_GLOBAL 1
+
+/*
+ * Experimental support for SHT_RELR sections. For details, see proposal
+ * at https://groups.google.com/forum/#!topic/generic-abi/bX460iggiKg.
+ *
+ * This was eventually replaced by SHT_RELR and DT_RELR (which are identical
+ * other than their different constants), but those constants are only
+ * supported by the OS in API levels >= 30.
+ */
+#define SHT_ANDROID_RELR 0x6fffff00
+#define DT_ANDROID_RELR 0x6fffe000
+#define DT_ANDROID_RELRSZ 0x6fffe001
+#define DT_ANDROID_RELRENT 0x6fffe003
+#define DT_ANDROID_RELRCOUNT 0x6fffe005
+
+/*
+ * Android compressed REL/RELA sections. These were generated by the relocation
+ * packer in old versions of Android, and can be generated directly by lld
+ * with https://reviews.llvm.org/D39152.
+ *
+ * This was replaced by SHT_ANDROID_RELR in API level 28 (but is supported
+ * in all API levels >= 23).
+ */
+#define SHT_ANDROID_REL 0x60000001
+#define SHT_ANDROID_RELA 0x60000002
+#define DT_ANDROID_REL 0x6000000f // DT_LOOS + 2
+#define DT_ANDROID_RELSZ 0x60000010 // DT_LOOS + 3
+#define DT_ANDROID_RELA 0x60000011 // DT_LOOS + 4
+#define DT_ANDROID_RELASZ 0x60000012 // DT_LOOS + 5
diff --git a/chroot/opt/android-master/amd64/usr/include/expat.h b/chroot/opt/android-master/amd64/usr/include/expat.h
new file mode 100644
index 0000000..48a6e2a
--- /dev/null
+++ b/chroot/opt/android-master/amd64/usr/include/expat.h
@@ -0,0 +1,1024 @@
+/*
+ __ __ _
+ ___\ \/ /_ __ __ _| |_
+ / _ \\ /| '_ \ / _` | __|
+ | __// \| |_) | (_| | |_
+ \___/_/\_\ .__/ \__,_|\__|
+ |_| XML parser
+
+ Copyright (c) 1997-2000 Thai Open Source Software Center Ltd
+ Copyright (c) 2000-2017 Expat development team
+ Licensed under the MIT license:
+
+ Permission is hereby granted, free of charge, to any person obtaining
+ a copy of this software and associated documentation files (the
+ "Software"), to deal in the Software without restriction, including
+ without limitation the rights to use, copy, modify, merge, publish,
+ distribute, sublicense, and/or sell copies of the Software, and to permit
+ persons to whom the Software is furnished to do so, subject to the
+ following conditions:
+
+ The above copyright notice and this permission notice shall be included
+ in all copies or substantial portions of the Software.
+
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
+ EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
+ MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN
+ NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM,
+ DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR
+ OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE
+ USE OR OTHER DEALINGS IN THE SOFTWARE.
+*/
+
+#ifndef Expat_INCLUDED
+#define Expat_INCLUDED 1
+
+#include <stdlib.h>
+#include "expat_external.h"
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+struct XML_ParserStruct;
+typedef struct XML_ParserStruct *XML_Parser;
+
+typedef unsigned char XML_Bool;
+#define XML_TRUE ((XML_Bool)1)
+#define XML_FALSE ((XML_Bool)0)
+
+/* The XML_Status enum gives the possible return values for several
+ API functions. The preprocessor #defines are included so this
+ stanza can be added to code that still needs to support older
+ versions of Expat 1.95.x:
+
+ #ifndef XML_STATUS_OK
+ #define XML_STATUS_OK 1
+ #define XML_STATUS_ERROR 0
+ #endif
+
+ Otherwise, the #define hackery is quite ugly and would have been
+ dropped.
+*/
+enum XML_Status {
+ XML_STATUS_ERROR = 0,
+#define XML_STATUS_ERROR XML_STATUS_ERROR
+ XML_STATUS_OK = 1,
+#define XML_STATUS_OK XML_STATUS_OK
+ XML_STATUS_SUSPENDED = 2
+#define XML_STATUS_SUSPENDED XML_STATUS_SUSPENDED
+};
+
+enum XML_Error {
+ XML_ERROR_NONE,
+ XML_ERROR_NO_MEMORY,
+ XML_ERROR_SYNTAX,
+ XML_ERROR_NO_ELEMENTS,
+ XML_ERROR_INVALID_TOKEN,
+ XML_ERROR_UNCLOSED_TOKEN,
+ XML_ERROR_PARTIAL_CHAR,
+ XML_ERROR_TAG_MISMATCH,
+ XML_ERROR_DUPLICATE_ATTRIBUTE,
+ XML_ERROR_JUNK_AFTER_DOC_ELEMENT,
+ XML_ERROR_PARAM_ENTITY_REF,
+ XML_ERROR_UNDEFINED_ENTITY,
+ XML_ERROR_RECURSIVE_ENTITY_REF,
+ XML_ERROR_ASYNC_ENTITY,
+ XML_ERROR_BAD_CHAR_REF,
+ XML_ERROR_BINARY_ENTITY_REF,
+ XML_ERROR_ATTRIBUTE_EXTERNAL_ENTITY_REF,
+ XML_ERROR_MISPLACED_XML_PI,
+ XML_ERROR_UNKNOWN_ENCODING,
+ XML_ERROR_INCORRECT_ENCODING,
+ XML_ERROR_UNCLOSED_CDATA_SECTION,
+ XML_ERROR_EXTERNAL_ENTITY_HANDLING,
+ XML_ERROR_NOT_STANDALONE,
+ XML_ERROR_UNEXPECTED_STATE,
+ XML_ERROR_ENTITY_DECLARED_IN_PE,
+ XML_ERROR_FEATURE_REQUIRES_XML_DTD,
+ XML_ERROR_CANT_CHANGE_FEATURE_ONCE_PARSING,
+ /* Added in 1.95.7. */
+ XML_ERROR_UNBOUND_PREFIX,
+ /* Added in 1.95.8. */
+ XML_ERROR_UNDECLARING_PREFIX,
+ XML_ERROR_INCOMPLETE_PE,
+ XML_ERROR_XML_DECL,
+ XML_ERROR_TEXT_DECL,
+ XML_ERROR_PUBLICID,
+ XML_ERROR_SUSPENDED,
+ XML_ERROR_NOT_SUSPENDED,
+ XML_ERROR_ABORTED,
+ XML_ERROR_FINISHED,
+ XML_ERROR_SUSPEND_PE,
+ /* Added in 2.0. */
+ XML_ERROR_RESERVED_PREFIX_XML,
+ XML_ERROR_RESERVED_PREFIX_XMLNS,
+ XML_ERROR_RESERVED_NAMESPACE_URI,
+ /* Added in 2.2.1. */
+ XML_ERROR_INVALID_ARGUMENT
+};
+
+enum XML_Content_Type {
+ XML_CTYPE_EMPTY = 1,
+ XML_CTYPE_ANY,
+ XML_CTYPE_MIXED,
+ XML_CTYPE_NAME,
+ XML_CTYPE_CHOICE,
+ XML_CTYPE_SEQ
+};
+
+enum XML_Content_Quant {
+ XML_CQUANT_NONE,
+ XML_CQUANT_OPT,
+ XML_CQUANT_REP,
+ XML_CQUANT_PLUS
+};
+
+/* If type == XML_CTYPE_EMPTY or XML_CTYPE_ANY, then quant will be
+ XML_CQUANT_NONE, and the other fields will be zero or NULL.
+ If type == XML_CTYPE_MIXED, then quant will be NONE or REP and
+ numchildren will contain number of elements that may be mixed in
+ and children point to an array of XML_Content cells that will be
+ all of XML_CTYPE_NAME type with no quantification.
+
+ If type == XML_CTYPE_NAME, then the name points to the name, and
+ the numchildren field will be zero and children will be NULL. The
+ quant fields indicates any quantifiers placed on the name.
+
+ CHOICE and SEQ will have name NULL, the number of children in
+ numchildren and children will point, recursively, to an array
+ of XML_Content cells.
+
+ The EMPTY, ANY, and MIXED types will only occur at top level.
+*/
+
+typedef struct XML_cp XML_Content;
+
+struct XML_cp {
+ enum XML_Content_Type type;
+ enum XML_Content_Quant quant;
+ XML_Char *name;
+ unsigned int numchildren;
+ XML_Content *children;
+};
+
+/* This is called for an element declaration. See above for
+ description of the model argument. It's the caller's responsibility
+ to free model when finished with it.
+*/
+typedef void(XMLCALL *XML_ElementDeclHandler)(void *userData,
+ const XML_Char *name,
+ XML_Content *model);
+
+XMLPARSEAPI(void)
+XML_SetElementDeclHandler(XML_Parser parser, XML_ElementDeclHandler eldecl);
+
+/* The Attlist declaration handler is called for *each* attribute. So
+ a single Attlist declaration with multiple attributes declared will
+ generate multiple calls to this handler. The "default" parameter
+ may be NULL in the case of the "#IMPLIED" or "#REQUIRED"
+ keyword. The "isrequired" parameter will be true and the default
+ value will be NULL in the case of "#REQUIRED". If "isrequired" is
+ true and default is non-NULL, then this is a "#FIXED" default.
+*/
+typedef void(XMLCALL *XML_AttlistDeclHandler)(
+ void *userData, const XML_Char *elname, const XML_Char *attname,
+ const XML_Char *att_type, const XML_Char *dflt, int isrequired);
+
+XMLPARSEAPI(void)
+XML_SetAttlistDeclHandler(XML_Parser parser, XML_AttlistDeclHandler attdecl);
+
+/* The XML declaration handler is called for *both* XML declarations
+ and text declarations. The way to distinguish is that the version
+ parameter will be NULL for text declarations. The encoding
+ parameter may be NULL for XML declarations. The standalone
+ parameter will be -1, 0, or 1 indicating respectively that there
+ was no standalone parameter in the declaration, that it was given
+ as no, or that it was given as yes.
+*/
+typedef void(XMLCALL *XML_XmlDeclHandler)(void *userData,
+ const XML_Char *version,
+ const XML_Char *encoding,
+ int standalone);
+
+XMLPARSEAPI(void)
+XML_SetXmlDeclHandler(XML_Parser parser, XML_XmlDeclHandler xmldecl);
+
+typedef struct {
+ void *(*malloc_fcn)(size_t size);
+ void *(*realloc_fcn)(void *ptr, size_t size);
+ void (*free_fcn)(void *ptr);
+} XML_Memory_Handling_Suite;
+
+/* Constructs a new parser; encoding is the encoding specified by the
+ external protocol or NULL if there is none specified.
+*/
+XMLPARSEAPI(XML_Parser)
+XML_ParserCreate(const XML_Char *encoding);
+
+/* Constructs a new parser and namespace processor. Element type
+ names and attribute names that belong to a namespace will be
+ expanded; unprefixed attribute names are never expanded; unprefixed
+ element type names are expanded only if there is a default
+ namespace. The expanded name is the concatenation of the namespace
+ URI, the namespace separator character, and the local part of the
+ name. If the namespace separator is '\0' then the namespace URI
+ and the local part will be concatenated without any separator.
+ It is a programming error to use the separator '\0' with namespace
+ triplets (see XML_SetReturnNSTriplet).
+*/
+XMLPARSEAPI(XML_Parser)
+XML_ParserCreateNS(const XML_Char *encoding, XML_Char namespaceSeparator);
+
+/* Constructs a new parser using the memory management suite referred to
+ by memsuite. If memsuite is NULL, then use the standard library memory
+ suite. If namespaceSeparator is non-NULL it creates a parser with
+ namespace processing as described above. The character pointed at
+ will serve as the namespace separator.
+
+ All further memory operations used for the created parser will come from
+ the given suite.
+*/
+XMLPARSEAPI(XML_Parser)
+XML_ParserCreate_MM(const XML_Char *encoding,
+ const XML_Memory_Handling_Suite *memsuite,
+ const XML_Char *namespaceSeparator);
+
+/* Prepare a parser object to be re-used. This is particularly
+ valuable when memory allocation overhead is disproportionately high,
+ such as when a large number of small documnents need to be parsed.
+ All handlers are cleared from the parser, except for the
+ unknownEncodingHandler. The parser's external state is re-initialized
+ except for the values of ns and ns_triplets.
+
+ Added in Expat 1.95.3.
+*/
+XMLPARSEAPI(XML_Bool)
+XML_ParserReset(XML_Parser parser, const XML_Char *encoding);
+
+/* atts is array of name/value pairs, terminated by 0;
+ names and values are 0 terminated.
+*/
+typedef void(XMLCALL *XML_StartElementHandler)(void *userData,
+ const XML_Char *name,
+ const XML_Char **atts);
+
+typedef void(XMLCALL *XML_EndElementHandler)(void *userData,
+ const XML_Char *name);
+
+/* s is not 0 terminated. */
+typedef void(XMLCALL *XML_CharacterDataHandler)(void *userData,
+ const XML_Char *s, int len);
+
+/* target and data are 0 terminated */
+typedef void(XMLCALL *XML_ProcessingInstructionHandler)(void *userData,
+ const XML_Char *target,
+ const XML_Char *data);
+
+/* data is 0 terminated */
+typedef void(XMLCALL *XML_CommentHandler)(void *userData, const XML_Char *data);
+
+typedef void(XMLCALL *XML_StartCdataSectionHandler)(void *userData);
+typedef void(XMLCALL *XML_EndCdataSectionHandler)(void *userData);
+
+/* This is called for any characters in the XML document for which
+ there is no applicable handler. This includes both characters that
+ are part of markup which is of a kind that is not reported
+ (comments, markup declarations), or characters that are part of a
+ construct which could be reported but for which no handler has been
+ supplied. The characters are passed exactly as they were in the XML
+ document except that they will be encoded in UTF-8 or UTF-16.
+ Line boundaries are not normalized. Note that a byte order mark
+ character is not passed to the default handler. There are no
+ guarantees about how characters are divided between calls to the
+ default handler: for example, a comment might be split between
+ multiple calls.
+*/
+typedef void(XMLCALL *XML_DefaultHandler)(void *userData, const XML_Char *s,
+ int len);
+
+/* This is called for the start of the DOCTYPE declaration, before
+ any DTD or internal subset is parsed.
+*/
+typedef void(XMLCALL *XML_StartDoctypeDeclHandler)(void *userData,
+ const XML_Char *doctypeName,
+ const XML_Char *sysid,
+ const XML_Char *pubid,
+ int has_internal_subset);
+
+/* This is called for the start of the DOCTYPE declaration when the
+ closing > is encountered, but after processing any external
+ subset.
+*/
+typedef void(XMLCALL *XML_EndDoctypeDeclHandler)(void *userData);
+
+/* This is called for entity declarations. The is_parameter_entity
+ argument will be non-zero if the entity is a parameter entity, zero
+ otherwise.
+
+ For internal entities (<!ENTITY foo "bar">), value will
+ be non-NULL and systemId, publicID, and notationName will be NULL.
+ The value string is NOT nul-terminated; the length is provided in
+ the value_length argument. Since it is legal to have zero-length
+ values, do not use this argument to test for internal entities.
+
+ For external entities, value will be NULL and systemId will be
+ non-NULL. The publicId argument will be NULL unless a public
+ identifier was provided. The notationName argument will have a
+ non-NULL value only for unparsed entity declarations.
+
+ Note that is_parameter_entity can't be changed to XML_Bool, since
+ that would break binary compatibility.
+*/
+typedef void(XMLCALL *XML_EntityDeclHandler)(
+ void *userData, const XML_Char *entityName, int is_parameter_entity,
+ const XML_Char *value, int value_length, const XML_Char *base,
+ const XML_Char *systemId, const XML_Char *publicId,
+ const XML_Char *notationName);
+
+XMLPARSEAPI(void)
+XML_SetEntityDeclHandler(XML_Parser parser, XML_EntityDeclHandler handler);
+
+/* OBSOLETE -- OBSOLETE -- OBSOLETE
+ This handler has been superseded by the EntityDeclHandler above.
+ It is provided here for backward compatibility.
+
+ This is called for a declaration of an unparsed (NDATA) entity.
+ The base argument is whatever was set by XML_SetBase. The
+ entityName, systemId and notationName arguments will never be
+ NULL. The other arguments may be.
+*/
+typedef void(XMLCALL *XML_UnparsedEntityDeclHandler)(
+ void *userData, const XML_Char *entityName, const XML_Char *base,
+ const XML_Char *systemId, const XML_Char *publicId,
+ const XML_Char *notationName);
+
+/* This is called for a declaration of notation. The base argument is
+ whatever was set by XML_SetBase. The notationName will never be
+ NULL. The other arguments can be.
+*/
+typedef void(XMLCALL *XML_NotationDeclHandler)(void *userData,
+ const XML_Char *notationName,
+ const XML_Char *base,
+ const XML_Char *systemId,
+ const XML_Char *publicId);
+
+/* When namespace processing is enabled, these are called once for
+ each namespace declaration. The call to the start and end element
+ handlers occur between the calls to the start and end namespace
+ declaration handlers. For an xmlns attribute, prefix will be
+ NULL. For an xmlns="" attribute, uri will be NULL.
+*/
+typedef void(XMLCALL *XML_StartNamespaceDeclHandler)(void *userData,
+ const XML_Char *prefix,
+ const XML_Char *uri);
+
+typedef void(XMLCALL *XML_EndNamespaceDeclHandler)(void *userData,
+ const XML_Char *prefix);
+
+/* This is called if the document is not standalone, that is, it has an
+ external subset or a reference to a parameter entity, but does not
+ have standalone="yes". If this handler returns XML_STATUS_ERROR,
+ then processing will not continue, and the parser will return a
+ XML_ERROR_NOT_STANDALONE error.
+ If parameter entity parsing is enabled, then in addition to the
+ conditions above this handler will only be called if the referenced
+ entity was actually read.
+*/
+typedef int(XMLCALL *XML_NotStandaloneHandler)(void *userData);
+
+/* This is called for a reference to an external parsed general
+ entity. The referenced entity is not automatically parsed. The
+ application can parse it immediately or later using
+ XML_ExternalEntityParserCreate.
+
+ The parser argument is the parser parsing the entity containing the
+ reference; it can be passed as the parser argument to
+ XML_ExternalEntityParserCreate. The systemId argument is the
+ system identifier as specified in the entity declaration; it will
+ not be NULL.
+
+ The base argument is the system identifier that should be used as
+ the base for resolving systemId if systemId was relative; this is
+ set by XML_SetBase; it may be NULL.
+
+ The publicId argument is the public identifier as specified in the
+ entity declaration, or NULL if none was specified; the whitespace
+ in the public identifier will have been normalized as required by
+ the XML spec.
+
+ The context argument specifies the parsing context in the format
+ expected by the context argument to XML_ExternalEntityParserCreate;
+ context is valid only until the handler returns, so if the
+ referenced entity is to be parsed later, it must be copied.
+ context is NULL only when the entity is a parameter entity.
+
+ The handler should return XML_STATUS_ERROR if processing should not
+ continue because of a fatal error in the handling of the external
+ entity. In this case the calling parser will return an
+ XML_ERROR_EXTERNAL_ENTITY_HANDLING error.
+
+ Note that unlike other handlers the first argument is the parser,
+ not userData.
+*/
+typedef int(XMLCALL *XML_ExternalEntityRefHandler)(XML_Parser parser,
+ const XML_Char *context,
+ const XML_Char *base,
+ const XML_Char *systemId,
+ const XML_Char *publicId);
+
+/* This is called in two situations:
+ 1) An entity reference is encountered for which no declaration
+ has been read *and* this is not an error.
+ 2) An internal entity reference is read, but not expanded, because
+ XML_SetDefaultHandler has been called.
+ Note: skipped parameter entities in declarations and skipped general
+ entities in attribute values cannot be reported, because
+ the event would be out of sync with the reporting of the
+ declarations or attribute values
+*/
+typedef void(XMLCALL *XML_SkippedEntityHandler)(void *userData,
+ const XML_Char *entityName,
+ int is_parameter_entity);
+
+/* This structure is filled in by the XML_UnknownEncodingHandler to
+ provide information to the parser about encodings that are unknown
+ to the parser.
+
+ The map[b] member gives information about byte sequences whose
+ first byte is b.
+
+ If map[b] is c where c is >= 0, then b by itself encodes the
+ Unicode scalar value c.
+
+ If map[b] is -1, then the byte sequence is malformed.
+
+ If map[b] is -n, where n >= 2, then b is the first byte of an
+ n-byte sequence that encodes a single Unicode scalar value.
+
+ The data member will be passed as the first argument to the convert
+ function.
+
+ The convert function is used to convert multibyte sequences; s will
+ point to a n-byte sequence where map[(unsigned char)*s] == -n. The
+ convert function must return the Unicode scalar value represented
+ by this byte sequence or -1 if the byte sequence is malformed.
+
+ The convert function may be NULL if the encoding is a single-byte
+ encoding, that is if map[b] >= -1 for all bytes b.
+
+ When the parser is finished with the encoding, then if release is
+ not NULL, it will call release passing it the data member; once
+ release has been called, the convert function will not be called
+ again.
+
+ Expat places certain restrictions on the encodings that are supported
+ using this mechanism.
+
+ 1. Every ASCII character that can appear in a well-formed XML document,
+ other than the characters
+
+ $@\^`{}~
+
+ must be represented by a single byte, and that byte must be the
+ same byte that represents that character in ASCII.
+
+ 2. No character may require more than 4 bytes to encode.
+
+ 3. All characters encoded must have Unicode scalar values <=
+ 0xFFFF, (i.e., characters that would be encoded by surrogates in
+ UTF-16 are not allowed). Note that this restriction doesn't
+ apply to the built-in support for UTF-8 and UTF-16.
+
+ 4. No Unicode character may be encoded by more than one distinct
+ sequence of bytes.
+*/
+typedef struct {
+ int map[256];
+ void *data;
+ int(XMLCALL *convert)(void *data, const char *s);
+ void(XMLCALL *release)(void *data);
+} XML_Encoding;
+
+/* This is called for an encoding that is unknown to the parser.
+
+ The encodingHandlerData argument is that which was passed as the
+ second argument to XML_SetUnknownEncodingHandler.
+
+ The name argument gives the name of the encoding as specified in
+ the encoding declaration.
+
+ If the callback can provide information about the encoding, it must
+ fill in the XML_Encoding structure, and return XML_STATUS_OK.
+ Otherwise it must return XML_STATUS_ERROR.
+
+ If info does not describe a suitable encoding, then the parser will
+ return an XML_UNKNOWN_ENCODING error.
+*/
+typedef int(XMLCALL *XML_UnknownEncodingHandler)(void *encodingHandlerData,
+ const XML_Char *name,
+ XML_Encoding *info);
+
+XMLPARSEAPI(void)
+XML_SetElementHandler(XML_Parser parser, XML_StartElementHandler start,
+ XML_EndElementHandler end);
+
+XMLPARSEAPI(void)
+XML_SetStartElementHandler(XML_Parser parser, XML_StartElementHandler handler);
+
+XMLPARSEAPI(void)
+XML_SetEndElementHandler(XML_Parser parser, XML_EndElementHandler handler);
+
+XMLPARSEAPI(void)
+XML_SetCharacterDataHandler(XML_Parser parser,
+ XML_CharacterDataHandler handler);
+
+XMLPARSEAPI(void)
+XML_SetProcessingInstructionHandler(XML_Parser parser,
+ XML_ProcessingInstructionHandler handler);
+XMLPARSEAPI(void)
+XML_SetCommentHandler(XML_Parser parser, XML_CommentHandler handler);
+
+XMLPARSEAPI(void)
+XML_SetCdataSectionHandler(XML_Parser parser,
+ XML_StartCdataSectionHandler start,
+ XML_EndCdataSectionHandler end);
+
+XMLPARSEAPI(void)
+XML_SetStartCdataSectionHandler(XML_Parser parser,
+ XML_StartCdataSectionHandler start);
+
+XMLPARSEAPI(void)
+XML_SetEndCdataSectionHandler(XML_Parser parser,
+ XML_EndCdataSectionHandler end);
+
+/* This sets the default handler and also inhibits expansion of
+ internal entities. These entity references will be passed to the
+ default handler, or to the skipped entity handler, if one is set.
+*/
+XMLPARSEAPI(void)
+XML_SetDefaultHandler(XML_Parser parser, XML_DefaultHandler handler);
+
+/* This sets the default handler but does not inhibit expansion of
+ internal entities. The entity reference will not be passed to the
+ default handler.
+*/
+XMLPARSEAPI(void)
+XML_SetDefaultHandlerExpand(XML_Parser parser, XML_DefaultHandler handler);
+
+XMLPARSEAPI(void)
+XML_SetDoctypeDeclHandler(XML_Parser parser, XML_StartDoctypeDeclHandler start,
+ XML_EndDoctypeDeclHandler end);
+
+XMLPARSEAPI(void)
+XML_SetStartDoctypeDeclHandler(XML_Parser parser,
+ XML_StartDoctypeDeclHandler start);
+
+XMLPARSEAPI(void)
+XML_SetEndDoctypeDeclHandler(XML_Parser parser, XML_EndDoctypeDeclHandler end);
+
+XMLPARSEAPI(void)
+XML_SetUnparsedEntityDeclHandler(XML_Parser parser,
+ XML_UnparsedEntityDeclHandler handler);
+
+XMLPARSEAPI(void)
+XML_SetNotationDeclHandler(XML_Parser parser, XML_NotationDeclHandler handler);
+
+XMLPARSEAPI(void)
+XML_SetNamespaceDeclHandler(XML_Parser parser,
+ XML_StartNamespaceDeclHandler start,
+ XML_EndNamespaceDeclHandler end);
+
+XMLPARSEAPI(void)
+XML_SetStartNamespaceDeclHandler(XML_Parser parser,
+ XML_StartNamespaceDeclHandler start);
+
+XMLPARSEAPI(void)
+XML_SetEndNamespaceDeclHandler(XML_Parser parser,
+ XML_EndNamespaceDeclHandler end);
+
+XMLPARSEAPI(void)
+XML_SetNotStandaloneHandler(XML_Parser parser,
+ XML_NotStandaloneHandler handler);
+
+XMLPARSEAPI(void)
+XML_SetExternalEntityRefHandler(XML_Parser parser,
+ XML_ExternalEntityRefHandler handler);
+
+/* If a non-NULL value for arg is specified here, then it will be
+ passed as the first argument to the external entity ref handler
+ instead of the parser object.
+*/
+XMLPARSEAPI(void)
+XML_SetExternalEntityRefHandlerArg(XML_Parser parser, void *arg);
+
+XMLPARSEAPI(void)
+XML_SetSkippedEntityHandler(XML_Parser parser,
+ XML_SkippedEntityHandler handler);
+
+XMLPARSEAPI(void)
+XML_SetUnknownEncodingHandler(XML_Parser parser,
+ XML_UnknownEncodingHandler handler,
+ void *encodingHandlerData);
+
+/* This can be called within a handler for a start element, end
+ element, processing instruction or character data. It causes the
+ corresponding markup to be passed to the default handler.
+*/
+XMLPARSEAPI(void)
+XML_DefaultCurrent(XML_Parser parser);
+
+/* If do_nst is non-zero, and namespace processing is in effect, and
+ a name has a prefix (i.e. an explicit namespace qualifier) then
+ that name is returned as a triplet in a single string separated by
+ the separator character specified when the parser was created: URI
+ + sep + local_name + sep + prefix.
+
+ If do_nst is zero, then namespace information is returned in the
+ default manner (URI + sep + local_name) whether or not the name
+ has a prefix.
+
+ Note: Calling XML_SetReturnNSTriplet after XML_Parse or
+ XML_ParseBuffer has no effect.
+*/
+
+XMLPARSEAPI(void)
+XML_SetReturnNSTriplet(XML_Parser parser, int do_nst);
+
+/* This value is passed as the userData argument to callbacks. */
+XMLPARSEAPI(void)
+XML_SetUserData(XML_Parser parser, void *userData);
+
+/* Returns the last value set by XML_SetUserData or NULL. */
+#define XML_GetUserData(parser) (*(void **)(parser))
+
+/* This is equivalent to supplying an encoding argument to
+ XML_ParserCreate. On success XML_SetEncoding returns non-zero,
+ zero otherwise.
+ Note: Calling XML_SetEncoding after XML_Parse or XML_ParseBuffer
+ has no effect and returns XML_STATUS_ERROR.
+*/
+XMLPARSEAPI(enum XML_Status)
+XML_SetEncoding(XML_Parser parser, const XML_Char *encoding);
+
+/* If this function is called, then the parser will be passed as the
+ first argument to callbacks instead of userData. The userData will
+ still be accessible using XML_GetUserData.
+*/
+XMLPARSEAPI(void)
+XML_UseParserAsHandlerArg(XML_Parser parser);
+
+/* If useDTD == XML_TRUE is passed to this function, then the parser
+ will assume that there is an external subset, even if none is
+ specified in the document. In such a case the parser will call the
+ externalEntityRefHandler with a value of NULL for the systemId
+ argument (the publicId and context arguments will be NULL as well).
+ Note: For the purpose of checking WFC: Entity Declared, passing
+ useDTD == XML_TRUE will make the parser behave as if the document
+ had a DTD with an external subset.
+ Note: If this function is called, then this must be done before
+ the first call to XML_Parse or XML_ParseBuffer, since it will
+ have no effect after that. Returns
+ XML_ERROR_CANT_CHANGE_FEATURE_ONCE_PARSING.
+ Note: If the document does not have a DOCTYPE declaration at all,
+ then startDoctypeDeclHandler and endDoctypeDeclHandler will not
+ be called, despite an external subset being parsed.
+ Note: If XML_DTD is not defined when Expat is compiled, returns
+ XML_ERROR_FEATURE_REQUIRES_XML_DTD.
+ Note: If parser == NULL, returns XML_ERROR_INVALID_ARGUMENT.
+*/
+XMLPARSEAPI(enum XML_Error)
+XML_UseForeignDTD(XML_Parser parser, XML_Bool useDTD);
+
+/* Sets the base to be used for resolving relative URIs in system
+ identifiers in declarations. Resolving relative identifiers is
+ left to the application: this value will be passed through as the
+ base argument to the XML_ExternalEntityRefHandler,
+ XML_NotationDeclHandler and XML_UnparsedEntityDeclHandler. The base
+ argument will be copied. Returns XML_STATUS_ERROR if out of memory,
+ XML_STATUS_OK otherwise.
+*/
+XMLPARSEAPI(enum XML_Status)
+XML_SetBase(XML_Parser parser, const XML_Char *base);
+
+XMLPARSEAPI(const XML_Char *)
+XML_GetBase(XML_Parser parser);
+
+/* Returns the number of the attribute/value pairs passed in last call
+ to the XML_StartElementHandler that were specified in the start-tag
+ rather than defaulted. Each attribute/value pair counts as 2; thus
+ this correspondds to an index into the atts array passed to the
+ XML_StartElementHandler. Returns -1 if parser == NULL.
+*/
+XMLPARSEAPI(int)
+XML_GetSpecifiedAttributeCount(XML_Parser parser);
+
+/* Returns the index of the ID attribute passed in the last call to
+ XML_StartElementHandler, or -1 if there is no ID attribute or
+ parser == NULL. Each attribute/value pair counts as 2; thus this
+ correspondds to an index into the atts array passed to the
+ XML_StartElementHandler.
+*/
+XMLPARSEAPI(int)
+XML_GetIdAttributeIndex(XML_Parser parser);
+
+#ifdef XML_ATTR_INFO
+/* Source file byte offsets for the start and end of attribute names and values.
+ The value indices are exclusive of surrounding quotes; thus in a UTF-8 source
+ file an attribute value of "blah" will yield:
+ info->valueEnd - info->valueStart = 4 bytes.
+*/
+typedef struct {
+ XML_Index nameStart; /* Offset to beginning of the attribute name. */
+ XML_Index nameEnd; /* Offset after the attribute name's last byte. */
+ XML_Index valueStart; /* Offset to beginning of the attribute value. */
+ XML_Index valueEnd; /* Offset after the attribute value's last byte. */
+} XML_AttrInfo;
+
+/* Returns an array of XML_AttrInfo structures for the attribute/value pairs
+ passed in last call to the XML_StartElementHandler that were specified
+ in the start-tag rather than defaulted. Each attribute/value pair counts
+ as 1; thus the number of entries in the array is
+ XML_GetSpecifiedAttributeCount(parser) / 2.
+*/
+XMLPARSEAPI(const XML_AttrInfo *)
+XML_GetAttributeInfo(XML_Parser parser);
+#endif
+
+/* Parses some input. Returns XML_STATUS_ERROR if a fatal error is
+ detected. The last call to XML_Parse must have isFinal true; len
+ may be zero for this call (or any other).
+
+ Though the return values for these functions has always been
+ described as a Boolean value, the implementation, at least for the
+ 1.95.x series, has always returned exactly one of the XML_Status
+ values.
+*/
+XMLPARSEAPI(enum XML_Status)
+XML_Parse(XML_Parser parser, const char *s, int len, int isFinal);
+
+XMLPARSEAPI(void *)
+XML_GetBuffer(XML_Parser parser, int len);
+
+XMLPARSEAPI(enum XML_Status)
+XML_ParseBuffer(XML_Parser parser, int len, int isFinal);
+
+/* Stops parsing, causing XML_Parse() or XML_ParseBuffer() to return.
+ Must be called from within a call-back handler, except when aborting
+ (resumable = 0) an already suspended parser. Some call-backs may
+ still follow because they would otherwise get lost. Examples:
+ - endElementHandler() for empty elements when stopped in
+ startElementHandler(),
+ - endNameSpaceDeclHandler() when stopped in endElementHandler(),
+ and possibly others.
+
+ Can be called from most handlers, including DTD related call-backs,
+ except when parsing an external parameter entity and resumable != 0.
+ Returns XML_STATUS_OK when successful, XML_STATUS_ERROR otherwise.
+ Possible error codes:
+ - XML_ERROR_SUSPENDED: when suspending an already suspended parser.
+ - XML_ERROR_FINISHED: when the parser has already finished.
+ - XML_ERROR_SUSPEND_PE: when suspending while parsing an external PE.
+
+ When resumable != 0 (true) then parsing is suspended, that is,
+ XML_Parse() and XML_ParseBuffer() return XML_STATUS_SUSPENDED.
+ Otherwise, parsing is aborted, that is, XML_Parse() and XML_ParseBuffer()
+ return XML_STATUS_ERROR with error code XML_ERROR_ABORTED.
+
+ *Note*:
+ This will be applied to the current parser instance only, that is, if
+ there is a parent parser then it will continue parsing when the
+ externalEntityRefHandler() returns. It is up to the implementation of
+ the externalEntityRefHandler() to call XML_StopParser() on the parent
+ parser (recursively), if one wants to stop parsing altogether.
+
+ When suspended, parsing can be resumed by calling XML_ResumeParser().
+*/
+XMLPARSEAPI(enum XML_Status)
+XML_StopParser(XML_Parser parser, XML_Bool resumable);
+
+/* Resumes parsing after it has been suspended with XML_StopParser().
+ Must not be called from within a handler call-back. Returns same
+ status codes as XML_Parse() or XML_ParseBuffer().
+ Additional error code XML_ERROR_NOT_SUSPENDED possible.
+
+ *Note*:
+ This must be called on the most deeply nested child parser instance
+ first, and on its parent parser only after the child parser has finished,
+ to be applied recursively until the document entity's parser is restarted.
+ That is, the parent parser will not resume by itself and it is up to the
+ application to call XML_ResumeParser() on it at the appropriate moment.
+*/
+XMLPARSEAPI(enum XML_Status)
+XML_ResumeParser(XML_Parser parser);
+
+enum XML_Parsing { XML_INITIALIZED, XML_PARSING, XML_FINISHED, XML_SUSPENDED };
+
+typedef struct {
+ enum XML_Parsing parsing;
+ XML_Bool finalBuffer;
+} XML_ParsingStatus;
+
+/* Returns status of parser with respect to being initialized, parsing,
+ finished, or suspended and processing the final buffer.
+ XXX XML_Parse() and XML_ParseBuffer() should return XML_ParsingStatus,
+ XXX with XML_FINISHED_OK or XML_FINISHED_ERROR replacing XML_FINISHED
+*/
+XMLPARSEAPI(void)
+XML_GetParsingStatus(XML_Parser parser, XML_ParsingStatus *status);
+
+/* Creates an XML_Parser object that can parse an external general
+ entity; context is a '\0'-terminated string specifying the parse
+ context; encoding is a '\0'-terminated string giving the name of
+ the externally specified encoding, or NULL if there is no
+ externally specified encoding. The context string consists of a
+ sequence of tokens separated by formfeeds (\f); a token consisting
+ of a name specifies that the general entity of the name is open; a
+ token of the form prefix=uri specifies the namespace for a
+ particular prefix; a token of the form =uri specifies the default
+ namespace. This can be called at any point after the first call to
+ an ExternalEntityRefHandler so longer as the parser has not yet
+ been freed. The new parser is completely independent and may
+ safely be used in a separate thread. The handlers and userData are
+ initialized from the parser argument. Returns NULL if out of memory.
+ Otherwise returns a new XML_Parser object.
+*/
+XMLPARSEAPI(XML_Parser)
+XML_ExternalEntityParserCreate(XML_Parser parser, const XML_Char *context,
+ const XML_Char *encoding);
+
+enum XML_ParamEntityParsing {
+ XML_PARAM_ENTITY_PARSING_NEVER,
+ XML_PARAM_ENTITY_PARSING_UNLESS_STANDALONE,
+ XML_PARAM_ENTITY_PARSING_ALWAYS
+};
+
+/* Controls parsing of parameter entities (including the external DTD
+ subset). If parsing of parameter entities is enabled, then
+ references to external parameter entities (including the external
+ DTD subset) will be passed to the handler set with
+ XML_SetExternalEntityRefHandler. The context passed will be 0.
+
+ Unlike external general entities, external parameter entities can
+ only be parsed synchronously. If the external parameter entity is
+ to be parsed, it must be parsed during the call to the external
+ entity ref handler: the complete sequence of
+ XML_ExternalEntityParserCreate, XML_Parse/XML_ParseBuffer and
+ XML_ParserFree calls must be made during this call. After
+ XML_ExternalEntityParserCreate has been called to create the parser
+ for the external parameter entity (context must be 0 for this
+ call), it is illegal to make any calls on the old parser until
+ XML_ParserFree has been called on the newly created parser.
+ If the library has been compiled without support for parameter
+ entity parsing (ie without XML_DTD being defined), then
+ XML_SetParamEntityParsing will return 0 if parsing of parameter
+ entities is requested; otherwise it will return non-zero.
+ Note: If XML_SetParamEntityParsing is called after XML_Parse or
+ XML_ParseBuffer, then it has no effect and will always return 0.
+ Note: If parser == NULL, the function will do nothing and return 0.
+*/
+XMLPARSEAPI(int)
+XML_SetParamEntityParsing(XML_Parser parser,
+ enum XML_ParamEntityParsing parsing);
+
+/* Sets the hash salt to use for internal hash calculations.
+ Helps in preventing DoS attacks based on predicting hash
+ function behavior. This must be called before parsing is started.
+ Returns 1 if successful, 0 when called after parsing has started.
+ Note: If parser == NULL, the function will do nothing and return 0.
+*/
+XMLPARSEAPI(int)
+XML_SetHashSalt(XML_Parser parser, unsigned long hash_salt);
+
+/* If XML_Parse or XML_ParseBuffer have returned XML_STATUS_ERROR, then
+ XML_GetErrorCode returns information about the error.
+*/
+XMLPARSEAPI(enum XML_Error)
+XML_GetErrorCode(XML_Parser parser);
+
+/* These functions return information about the current parse
+ location. They may be called from any callback called to report
+ some parse event; in this case the location is the location of the
+ first of the sequence of characters that generated the event. When
+ called from callbacks generated by declarations in the document
+ prologue, the location identified isn't as neatly defined, but will
+ be within the relevant markup. When called outside of the callback
+ functions, the position indicated will be just past the last parse
+ event (regardless of whether there was an associated callback).
+
+ They may also be called after returning from a call to XML_Parse
+ or XML_ParseBuffer. If the return value is XML_STATUS_ERROR then
+ the location is the location of the character at which the error
+ was detected; otherwise the location is the location of the last
+ parse event, as described above.
+
+ Note: XML_GetCurrentLineNumber and XML_GetCurrentColumnNumber
+ return 0 to indicate an error.
+ Note: XML_GetCurrentByteIndex returns -1 to indicate an error.
+*/
+XMLPARSEAPI(XML_Size) XML_GetCurrentLineNumber(XML_Parser parser);
+XMLPARSEAPI(XML_Size) XML_GetCurrentColumnNumber(XML_Parser parser);
+XMLPARSEAPI(XML_Index) XML_GetCurrentByteIndex(XML_Parser parser);
+
+/* Return the number of bytes in the current event.
+ Returns 0 if the event is in an internal entity.
+*/
+XMLPARSEAPI(int)
+XML_GetCurrentByteCount(XML_Parser parser);
+
+/* If XML_CONTEXT_BYTES is defined, returns the input buffer, sets
+ the integer pointed to by offset to the offset within this buffer
+ of the current parse position, and sets the integer pointed to by size
+ to the size of this buffer (the number of input bytes). Otherwise
+ returns a NULL pointer. Also returns a NULL pointer if a parse isn't
+ active.
+
+ NOTE: The character pointer returned should not be used outside
+ the handler that makes the call.
+*/
+XMLPARSEAPI(const char *)
+XML_GetInputContext(XML_Parser parser, int *offset, int *size);
+
+/* For backwards compatibility with previous versions. */
+#define XML_GetErrorLineNumber XML_GetCurrentLineNumber
+#define XML_GetErrorColumnNumber XML_GetCurrentColumnNumber
+#define XML_GetErrorByteIndex XML_GetCurrentByteIndex
+
+/* Frees the content model passed to the element declaration handler */
+XMLPARSEAPI(void)
+XML_FreeContentModel(XML_Parser parser, XML_Content *model);
+
+/* Exposing the memory handling functions used in Expat */
+XMLPARSEAPI(void *)
+XML_ATTR_MALLOC
+XML_ATTR_ALLOC_SIZE(2)
+XML_MemMalloc(XML_Parser parser, size_t size);
+
+XMLPARSEAPI(void *)
+XML_ATTR_ALLOC_SIZE(3)
+XML_MemRealloc(XML_Parser parser, void *ptr, size_t size);
+
+XMLPARSEAPI(void)
+XML_MemFree(XML_Parser parser, void *ptr);
+
+/* Frees memory used by the parser. */
+XMLPARSEAPI(void)
+XML_ParserFree(XML_Parser parser);
+
+/* Returns a string describing the error. */
+XMLPARSEAPI(const XML_LChar *)
+XML_ErrorString(enum XML_Error code);
+
+/* Return a string containing the version number of this expat */
+XMLPARSEAPI(const XML_LChar *)
+XML_ExpatVersion(void);
+
+typedef struct {
+ int major;
+ int minor;
+ int micro;
+} XML_Expat_Version;
+
+/* Return an XML_Expat_Version structure containing numeric version
+ number information for this version of expat.
+*/
+XMLPARSEAPI(XML_Expat_Version)
+XML_ExpatVersionInfo(void);
+
+/* Added in Expat 1.95.5. */
+enum XML_FeatureEnum {
+ XML_FEATURE_END = 0,
+ XML_FEATURE_UNICODE,
+ XML_FEATURE_UNICODE_WCHAR_T,
+ XML_FEATURE_DTD,
+ XML_FEATURE_CONTEXT_BYTES,
+ XML_FEATURE_MIN_SIZE,
+ XML_FEATURE_SIZEOF_XML_CHAR,
+ XML_FEATURE_SIZEOF_XML_LCHAR,
+ XML_FEATURE_NS,
+ XML_FEATURE_LARGE_SIZE,
+ XML_FEATURE_ATTR_INFO
+ /* Additional features must be added to the end of this enum. */
+};
+
+typedef struct {
+ enum XML_FeatureEnum feature;
+ const XML_LChar *name;
+ long int value;
+} XML_Feature;
+
+XMLPARSEAPI(const XML_Feature *)
+XML_GetFeatureList(void);
+
+/* Expat follows the semantic versioning convention.
+ See http://semver.org.
+*/
+#define XML_MAJOR_VERSION 2
+#define XML_MINOR_VERSION 2
+#define XML_MICRO_VERSION 9
+
+#ifdef __cplusplus
+}
+#endif
+
+#endif /* not Expat_INCLUDED */
diff --git a/chroot/opt/android-master/amd64/usr/include/expat_external.h b/chroot/opt/android-master/amd64/usr/include/expat_external.h
new file mode 100644
index 0000000..b3b6e74
--- /dev/null
+++ b/chroot/opt/android-master/amd64/usr/include/expat_external.h
@@ -0,0 +1,158 @@
+/*
+ __ __ _
+ ___\ \/ /_ __ __ _| |_
+ / _ \\ /| '_ \ / _` | __|
+ | __// \| |_) | (_| | |_
+ \___/_/\_\ .__/ \__,_|\__|
+ |_| XML parser
+
+ Copyright (c) 1997-2000 Thai Open Source Software Center Ltd
+ Copyright (c) 2000-2017 Expat development team
+ Licensed under the MIT license:
+
+ Permission is hereby granted, free of charge, to any person obtaining
+ a copy of this software and associated documentation files (the
+ "Software"), to deal in the Software without restriction, including
+ without limitation the rights to use, copy, modify, merge, publish,
+ distribute, sublicense, and/or sell copies of the Software, and to permit
+ persons to whom the Software is furnished to do so, subject to the
+ following conditions:
+
+ The above copyright notice and this permission notice shall be included
+ in all copies or substantial portions of the Software.
+
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
+ EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
+ MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN
+ NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM,
+ DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR
+ OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE
+ USE OR OTHER DEALINGS IN THE SOFTWARE.
+*/
+
+#ifndef Expat_External_INCLUDED
+#define Expat_External_INCLUDED 1
+
+/* External API definitions */
+
+/* Expat tries very hard to make the API boundary very specifically
+ defined. There are two macros defined to control this boundary;
+ each of these can be defined before including this header to
+ achieve some different behavior, but doing so it not recommended or
+ tested frequently.
+
+ XMLCALL - The calling convention to use for all calls across the
+ "library boundary." This will default to cdecl, and
+ try really hard to tell the compiler that's what we
+ want.
+
+ XMLIMPORT - Whatever magic is needed to note that a function is
+ to be imported from a dynamically loaded library
+ (.dll, .so, or .sl, depending on your platform).
+
+ The XMLCALL macro was added in Expat 1.95.7. The only one which is
+ expected to be directly useful in client code is XMLCALL.
+
+ Note that on at least some Unix versions, the Expat library must be
+ compiled with the cdecl calling convention as the default since
+ system headers may assume the cdecl convention.
+*/
+#ifndef XMLCALL
+# if defined(_MSC_VER)
+# define XMLCALL __cdecl
+# elif defined(__GNUC__) && defined(__i386) && ! defined(__INTEL_COMPILER)
+# define XMLCALL __attribute__((cdecl))
+# else
+/* For any platform which uses this definition and supports more than
+ one calling convention, we need to extend this definition to
+ declare the convention used on that platform, if it's possible to
+ do so.
+
+ If this is the case for your platform, please file a bug report
+ with information on how to identify your platform via the C
+ pre-processor and how to specify the same calling convention as the
+ platform's malloc() implementation.
+*/
+# define XMLCALL
+# endif
+#endif /* not defined XMLCALL */
+
+#if ! defined(XML_STATIC) && ! defined(XMLIMPORT)
+# ifndef XML_BUILDING_EXPAT
+/* using Expat from an application */
+
+# if defined(_MSC_EXTENSIONS) && ! defined(__BEOS__) && ! defined(__CYGWIN__)
+# define XMLIMPORT __declspec(dllimport)
+# endif
+
+# endif
+#endif /* not defined XML_STATIC */
+
+#ifndef XML_ENABLE_VISIBILITY
+# define XML_ENABLE_VISIBILITY 0
+#endif
+
+#if ! defined(XMLIMPORT) && XML_ENABLE_VISIBILITY
+# define XMLIMPORT __attribute__((visibility("default")))
+#endif
+
+/* If we didn't define it above, define it away: */
+#ifndef XMLIMPORT
+# define XMLIMPORT
+#endif
+
+#if defined(__GNUC__) \
+ && (__GNUC__ > 2 || (__GNUC__ == 2 && __GNUC_MINOR__ >= 96))
+# define XML_ATTR_MALLOC __attribute__((__malloc__))
+#else
+# define XML_ATTR_MALLOC
+#endif
+
+#if defined(__GNUC__) \
+ && ((__GNUC__ > 4) || (__GNUC__ == 4 && __GNUC_MINOR__ >= 3))
+# define XML_ATTR_ALLOC_SIZE(x) __attribute__((__alloc_size__(x)))
+#else
+# define XML_ATTR_ALLOC_SIZE(x)
+#endif
+
+#define XMLPARSEAPI(type) XMLIMPORT type XMLCALL
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+#ifdef XML_UNICODE_WCHAR_T
+# ifndef XML_UNICODE
+# define XML_UNICODE
+# endif
+# if defined(__SIZEOF_WCHAR_T__) && (__SIZEOF_WCHAR_T__ != 2)
+# error "sizeof(wchar_t) != 2; Need -fshort-wchar for both Expat and libc"
+# endif
+#endif
+
+#ifdef XML_UNICODE /* Information is UTF-16 encoded. */
+# ifdef XML_UNICODE_WCHAR_T
+typedef wchar_t XML_Char;
+typedef wchar_t XML_LChar;
+# else
+typedef unsigned short XML_Char;
+typedef char XML_LChar;
+# endif /* XML_UNICODE_WCHAR_T */
+#else /* Information is UTF-8 encoded. */
+typedef char XML_Char;
+typedef char XML_LChar;
+#endif /* XML_UNICODE */
+
+#ifdef XML_LARGE_SIZE /* Use large integers for file/stream positions. */
+typedef long long XML_Index;
+typedef unsigned long long XML_Size;
+#else
+typedef long XML_Index;
+typedef unsigned long XML_Size;
+#endif /* XML_LARGE_SIZE */
+
+#ifdef __cplusplus
+}
+#endif
+
+#endif /* not Expat_External_INCLUDED */
diff --git a/chroot/opt/android-master/amd64/usr/include/grp.h b/chroot/opt/android-master/amd64/usr/include/grp.h
new file mode 100644
index 0000000..9d67adf
--- /dev/null
+++ b/chroot/opt/android-master/amd64/usr/include/grp.h
@@ -0,0 +1,65 @@
+/*-
+ * Copyright (c) 1989, 1993
+ * The Regents of the University of California. All rights reserved.
+ * (c) UNIX System Laboratories, Inc.
+ * All or some portions of this file are derived from material licensed
+ * to the University of California by American Telephone and Telegraph
+ * Co. or Unix System Laboratories, Inc. and are reproduced herein with
+ * the permission of UNIX System Laboratories, Inc.
+ *
+ * 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. Neither the name of the University nor the names of its contributors
+ * may be used to endorse or promote products derived from this software
+ * without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``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 REGENTS OR CONTRIBUTORS 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.
+ */
+
+#ifndef _GRP_H_
+#define _GRP_H_
+
+#include <sys/cdefs.h>
+#include <sys/types.h>
+
+struct group {
+ char* gr_name; /* group name */
+ char* gr_passwd; /* group password */
+ gid_t gr_gid; /* group id */
+ char** gr_mem; /* group members */
+};
+
+__BEGIN_DECLS
+
+struct group* getgrgid(gid_t __gid);
+struct group* getgrnam(const char* __name);
+
+/* Note: Android has thousands and thousands of ids to iterate through. */
+struct group* getgrent(void) __INTRODUCED_IN(26);
+
+void setgrent(void) __INTRODUCED_IN(26);
+void endgrent(void) __INTRODUCED_IN(26);
+int getgrgid_r(gid_t __gid, struct group* __group, char* __buf, size_t __n, struct group** __result) __INTRODUCED_IN(24);
+int getgrnam_r(const char* __name, struct group* __group, char* __buf, size_t __n, struct group** __result) __INTRODUCED_IN(24);
+int getgrouplist(const char* __user, gid_t __group, gid_t* __groups, int* __group_count);
+int initgroups(const char* __user, gid_t __group);
+
+__END_DECLS
+
+#endif
diff --git a/chroot/opt/android-master/amd64/usr/include/hardware/boot_control.h b/chroot/opt/android-master/amd64/usr/include/hardware/boot_control.h
new file mode 100644
index 0000000..36a867d
--- /dev/null
+++ b/chroot/opt/android-master/amd64/usr/include/hardware/boot_control.h
@@ -0,0 +1,134 @@
+/*
+ * Copyright (C) 2015 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.
+ */
+
+#ifndef ANDROID_INCLUDE_HARDWARE_BOOT_CONTROL_H
+#define ANDROID_INCLUDE_HARDWARE_BOOT_CONTROL_H
+
+#include <hardware/hardware.h>
+
+__BEGIN_DECLS
+
+#define BOOT_CONTROL_MODULE_API_VERSION_0_1 HARDWARE_MODULE_API_VERSION(0, 1)
+
+/**
+ * The id of this module
+ */
+#define BOOT_CONTROL_HARDWARE_MODULE_ID "bootctrl"
+
+/*
+ * The Boot Control HAL is designed to allow for managing sets of redundant
+ * partitions, called slots, that can be booted from independantly. Slots
+ * are sets of partitions whose names differ only by a given suffix.
+ * They are identified here by a 0 indexed number, and associated with their
+ * suffix, which can be appended to the base name for any particular partition
+ * to find the one associated with that slot. The bootloader must pass the suffix
+ * of the currently active slot either through a kernel command line property at
+ * androidboot.slot_suffix, or the device tree at /firmware/android/slot_suffix.
+ * The primary use of this set up is to allow for background updates while the
+ * device is running, and to provide a fallback in the event that the update fails.
+ */
+
+
+/**
+ * Every hardware module must have a data structure named HAL_MODULE_INFO_SYM
+ * and the fields of this data structure must begin with hw_module_t
+ * followed by module specific information.
+ */
+typedef struct boot_control_module {
+ struct hw_module_t common;
+
+ /*
+ * (*init)() perform any initialization tasks needed for the HAL.
+ * This is called only once.
+ */
+ void (*init)(struct boot_control_module *module);
+
+ /*
+ * (*getNumberSlots)() returns the number of available slots.
+ * For instance, a system with a single set of partitions would return
+ * 1, a system with A/B would return 2, A/B/C -> 3...
+ */
+ unsigned (*getNumberSlots)(struct boot_control_module *module);
+
+ /*
+ * (*getCurrentSlot)() returns the value letting the system know
+ * whether the current slot is A or B. The meaning of A and B is
+ * left up to the implementer. It is assumed that if the current slot
+ * is A, then the block devices underlying B can be accessed directly
+ * without any risk of corruption.
+ * The returned value is always guaranteed to be strictly less than the
+ * value returned by getNumberSlots. Slots start at 0 and
+ * finish at getNumberSlots() - 1
+ */
+ unsigned (*getCurrentSlot)(struct boot_control_module *module);
+
+ /*
+ * (*markBootSuccessful)() marks the current slot
+ * as having booted successfully
+ *
+ * Returns 0 on success, -errno on error.
+ */
+ int (*markBootSuccessful)(struct boot_control_module *module);
+
+ /*
+ * (*setActiveBootSlot)() marks the slot passed in parameter as
+ * the active boot slot (see getCurrentSlot for an explanation
+ * of the "slot" parameter). This overrides any previous call to
+ * setSlotAsUnbootable.
+ * Returns 0 on success, -errno on error.
+ */
+ int (*setActiveBootSlot)(struct boot_control_module *module, unsigned slot);
+
+ /*
+ * (*setSlotAsUnbootable)() marks the slot passed in parameter as
+ * an unbootable. This can be used while updating the contents of the slot's
+ * partitions, so that the system will not attempt to boot a known bad set up.
+ * Returns 0 on success, -errno on error.
+ */
+ int (*setSlotAsUnbootable)(struct boot_control_module *module, unsigned slot);
+
+ /*
+ * (*isSlotBootable)() returns if the slot passed in parameter is
+ * bootable. Note that slots can be made unbootable by both the
+ * bootloader and by the OS using setSlotAsUnbootable.
+ * Returns 1 if the slot is bootable, 0 if it's not, and -errno on
+ * error.
+ */
+ int (*isSlotBootable)(struct boot_control_module *module, unsigned slot);
+
+ /*
+ * (*getSuffix)() returns the string suffix used by partitions that
+ * correspond to the slot number passed in parameter. The returned string
+ * is expected to be statically allocated and not need to be freed.
+ * Returns NULL if slot does not match an existing slot.
+ */
+ const char* (*getSuffix)(struct boot_control_module *module, unsigned slot);
+
+ /*
+ * (*isSlotMarkedSucessful)() returns if the slot passed in parameter has
+ * been marked as successful using markBootSuccessful.
+ * Returns 1 if the slot has been marked as successful, 0 if it's
+ * not the case, and -errno on error.
+ */
+ int (*isSlotMarkedSuccessful)(struct boot_control_module *module, unsigned slot);
+
+ void* reserved[31];
+} boot_control_module_t;
+
+
+__END_DECLS
+
+#endif // ANDROID_INCLUDE_HARDWARE_BOOT_CONTROL_H
diff --git a/chroot/opt/android-master/amd64/usr/include/hardware/camera.h b/chroot/opt/android-master/amd64/usr/include/hardware/camera.h
new file mode 100644
index 0000000..b1f18ff
--- /dev/null
+++ b/chroot/opt/android-master/amd64/usr/include/hardware/camera.h
@@ -0,0 +1,298 @@
+/*
+ * Copyright (C) 2010-2011 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.
+ */
+
+#ifndef ANDROID_INCLUDE_CAMERA_H
+#define ANDROID_INCLUDE_CAMERA_H
+
+#include "camera_common.h"
+
+/**
+ * Camera device HAL, initial version [ CAMERA_DEVICE_API_VERSION_1_0 ]
+ *
+ * DEPRECATED. New devices should use Camera HAL v3.2 or newer.
+ *
+ * Supports the android.hardware.Camera API, and the android.hardware.camera2
+ * API in legacy mode only.
+ *
+ * Camera devices that support this version of the HAL must return a value in
+ * the range HARDWARE_DEVICE_API_VERSION(0,0)-(1,FF) in
+ * camera_device_t.common.version. CAMERA_DEVICE_API_VERSION_1_0 is the
+ * recommended value.
+ *
+ * Camera modules that implement version 2.0 or higher of camera_module_t must
+ * also return the value of camera_device_t.common.version in
+ * camera_info_t.device_version.
+ *
+ * See camera_common.h for more details.
+ */
+
+__BEGIN_DECLS
+
+struct camera_memory;
+typedef void (*camera_release_memory)(struct camera_memory *mem);
+
+typedef struct camera_memory {
+ void *data;
+ size_t size;
+ void *handle;
+ camera_release_memory release;
+} camera_memory_t;
+
+typedef camera_memory_t* (*camera_request_memory)(int fd, size_t buf_size, unsigned int num_bufs,
+ void *user);
+
+typedef void (*camera_notify_callback)(int32_t msg_type,
+ int32_t ext1,
+ int32_t ext2,
+ void *user);
+
+typedef void (*camera_data_callback)(int32_t msg_type,
+ const camera_memory_t *data, unsigned int index,
+ camera_frame_metadata_t *metadata, void *user);
+
+typedef void (*camera_data_timestamp_callback)(int64_t timestamp,
+ int32_t msg_type,
+ const camera_memory_t *data, unsigned int index,
+ void *user);
+
+#define HAL_CAMERA_PREVIEW_WINDOW_TAG 0xcafed00d
+
+typedef struct preview_stream_ops {
+ int (*dequeue_buffer)(struct preview_stream_ops* w,
+ buffer_handle_t** buffer, int *stride);
+ int (*enqueue_buffer)(struct preview_stream_ops* w,
+ buffer_handle_t* buffer);
+ int (*cancel_buffer)(struct preview_stream_ops* w,
+ buffer_handle_t* buffer);
+ int (*set_buffer_count)(struct preview_stream_ops* w, int count);
+ int (*set_buffers_geometry)(struct preview_stream_ops* pw,
+ int w, int h, int format);
+ int (*set_crop)(struct preview_stream_ops *w,
+ int left, int top, int right, int bottom);
+ int (*set_usage)(struct preview_stream_ops* w, int usage);
+ int (*set_swap_interval)(struct preview_stream_ops *w, int interval);
+ int (*get_min_undequeued_buffer_count)(const struct preview_stream_ops *w,
+ int *count);
+ int (*lock_buffer)(struct preview_stream_ops* w,
+ buffer_handle_t* buffer);
+ // Timestamps are measured in nanoseconds, and must be comparable
+ // and monotonically increasing between two frames in the same
+ // preview stream. They do not need to be comparable between
+ // consecutive or parallel preview streams, cameras, or app runs.
+ int (*set_timestamp)(struct preview_stream_ops *w, int64_t timestamp);
+} preview_stream_ops_t;
+
+struct camera_device;
+typedef struct camera_device_ops {
+ /** Set the ANativeWindow to which preview frames are sent */
+ int (*set_preview_window)(struct camera_device *,
+ struct preview_stream_ops *window);
+
+ /** Set the notification and data callbacks */
+ void (*set_callbacks)(struct camera_device *,
+ camera_notify_callback notify_cb,
+ camera_data_callback data_cb,
+ camera_data_timestamp_callback data_cb_timestamp,
+ camera_request_memory get_memory,
+ void *user);
+
+ /**
+ * The following three functions all take a msg_type, which is a bitmask of
+ * the messages defined in include/ui/Camera.h
+ */
+
+ /**
+ * Enable a message, or set of messages.
+ */
+ void (*enable_msg_type)(struct camera_device *, int32_t msg_type);
+
+ /**
+ * Disable a message, or a set of messages.
+ *
+ * Once received a call to disableMsgType(CAMERA_MSG_VIDEO_FRAME), camera
+ * HAL should not rely on its client to call releaseRecordingFrame() to
+ * release video recording frames sent out by the cameral HAL before and
+ * after the disableMsgType(CAMERA_MSG_VIDEO_FRAME) call. Camera HAL
+ * clients must not modify/access any video recording frame after calling
+ * disableMsgType(CAMERA_MSG_VIDEO_FRAME).
+ */
+ void (*disable_msg_type)(struct camera_device *, int32_t msg_type);
+
+ /**
+ * Query whether a message, or a set of messages, is enabled. Note that
+ * this is operates as an AND, if any of the messages queried are off, this
+ * will return false.
+ */
+ int (*msg_type_enabled)(struct camera_device *, int32_t msg_type);
+
+ /**
+ * Start preview mode.
+ */
+ int (*start_preview)(struct camera_device *);
+
+ /**
+ * Stop a previously started preview.
+ */
+ void (*stop_preview)(struct camera_device *);
+
+ /**
+ * Returns true if preview is enabled.
+ */
+ int (*preview_enabled)(struct camera_device *);
+
+ /**
+ * Request the camera HAL to store meta data or real YUV data in the video
+ * buffers sent out via CAMERA_MSG_VIDEO_FRAME for a recording session. If
+ * it is not called, the default camera HAL behavior is to store real YUV
+ * data in the video buffers.
+ *
+ * This method should be called before startRecording() in order to be
+ * effective.
+ *
+ * If meta data is stored in the video buffers, it is up to the receiver of
+ * the video buffers to interpret the contents and to find the actual frame
+ * data with the help of the meta data in the buffer. How this is done is
+ * outside of the scope of this method.
+ *
+ * Some camera HALs may not support storing meta data in the video buffers,
+ * but all camera HALs should support storing real YUV data in the video
+ * buffers. If the camera HAL does not support storing the meta data in the
+ * video buffers when it is requested to do do, INVALID_OPERATION must be
+ * returned. It is very useful for the camera HAL to pass meta data rather
+ * than the actual frame data directly to the video encoder, since the
+ * amount of the uncompressed frame data can be very large if video size is
+ * large.
+ *
+ * @param enable if true to instruct the camera HAL to store
+ * meta data in the video buffers; false to instruct
+ * the camera HAL to store real YUV data in the video
+ * buffers.
+ *
+ * @return OK on success.
+ */
+ int (*store_meta_data_in_buffers)(struct camera_device *, int enable);
+
+ /**
+ * Start record mode. When a record image is available, a
+ * CAMERA_MSG_VIDEO_FRAME message is sent with the corresponding
+ * frame. Every record frame must be released by a camera HAL client via
+ * releaseRecordingFrame() before the client calls
+ * disableMsgType(CAMERA_MSG_VIDEO_FRAME). After the client calls
+ * disableMsgType(CAMERA_MSG_VIDEO_FRAME), it is the camera HAL's
+ * responsibility to manage the life-cycle of the video recording frames,
+ * and the client must not modify/access any video recording frames.
+ */
+ int (*start_recording)(struct camera_device *);
+
+ /**
+ * Stop a previously started recording.
+ */
+ void (*stop_recording)(struct camera_device *);
+
+ /**
+ * Returns true if recording is enabled.
+ */
+ int (*recording_enabled)(struct camera_device *);
+
+ /**
+ * Release a record frame previously returned by CAMERA_MSG_VIDEO_FRAME.
+ *
+ * It is camera HAL client's responsibility to release video recording
+ * frames sent out by the camera HAL before the camera HAL receives a call
+ * to disableMsgType(CAMERA_MSG_VIDEO_FRAME). After it receives the call to
+ * disableMsgType(CAMERA_MSG_VIDEO_FRAME), it is the camera HAL's
+ * responsibility to manage the life-cycle of the video recording frames.
+ */
+ void (*release_recording_frame)(struct camera_device *,
+ const void *opaque);
+
+ /**
+ * Start auto focus, the notification callback routine is called with
+ * CAMERA_MSG_FOCUS once when focusing is complete. autoFocus() will be
+ * called again if another auto focus is needed.
+ */
+ int (*auto_focus)(struct camera_device *);
+
+ /**
+ * Cancels auto-focus function. If the auto-focus is still in progress,
+ * this function will cancel it. Whether the auto-focus is in progress or
+ * not, this function will return the focus position to the default. If
+ * the camera does not support auto-focus, this is a no-op.
+ */
+ int (*cancel_auto_focus)(struct camera_device *);
+
+ /**
+ * Take a picture.
+ */
+ int (*take_picture)(struct camera_device *);
+
+ /**
+ * Cancel a picture that was started with takePicture. Calling this method
+ * when no picture is being taken is a no-op.
+ */
+ int (*cancel_picture)(struct camera_device *);
+
+ /**
+ * Set the camera parameters. This returns BAD_VALUE if any parameter is
+ * invalid or not supported.
+ */
+ int (*set_parameters)(struct camera_device *, const char *parms);
+
+ /** Retrieve the camera parameters. The buffer returned by the camera HAL
+ must be returned back to it with put_parameters, if put_parameters
+ is not NULL.
+ */
+ char *(*get_parameters)(struct camera_device *);
+
+ /** The camera HAL uses its own memory to pass us the parameters when we
+ call get_parameters. Use this function to return the memory back to
+ the camera HAL, if put_parameters is not NULL. If put_parameters
+ is NULL, then you have to use free() to release the memory.
+ */
+ void (*put_parameters)(struct camera_device *, char *);
+
+ /**
+ * Send command to camera driver.
+ */
+ int (*send_command)(struct camera_device *,
+ int32_t cmd, int32_t arg1, int32_t arg2);
+
+ /**
+ * Release the hardware resources owned by this object. Note that this is
+ * *not* done in the destructor.
+ */
+ void (*release)(struct camera_device *);
+
+ /**
+ * Dump state of the camera hardware
+ */
+ int (*dump)(struct camera_device *, int fd);
+} camera_device_ops_t;
+
+typedef struct camera_device {
+ /**
+ * camera_device.common.version must be in the range
+ * HARDWARE_DEVICE_API_VERSION(0,0)-(1,FF). CAMERA_DEVICE_API_VERSION_1_0 is
+ * recommended.
+ */
+ hw_device_t common;
+ camera_device_ops_t *ops;
+ void *priv;
+} camera_device_t;
+
+__END_DECLS
+
+#endif /* #ifdef ANDROID_INCLUDE_CAMERA_H */
diff --git a/chroot/opt/android-master/amd64/usr/include/hardware/camera3.h b/chroot/opt/android-master/amd64/usr/include/hardware/camera3.h
new file mode 100644
index 0000000..7fb86df
--- /dev/null
+++ b/chroot/opt/android-master/amd64/usr/include/hardware/camera3.h
@@ -0,0 +1,3564 @@
+/*
+ * Copyright (C) 2013-2018 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.
+ */
+
+#ifndef ANDROID_INCLUDE_CAMERA3_H
+#define ANDROID_INCLUDE_CAMERA3_H
+
+#include <system/camera_metadata.h>
+#include "camera_common.h"
+
+/**
+ * Camera device HAL 3.6[ CAMERA_DEVICE_API_VERSION_3_6 ]
+ *
+ * This is the current recommended version of the camera device HAL.
+ *
+ * Supports the android.hardware.Camera API, and as of v3.2, the
+ * android.hardware.camera2 API as LIMITED or above hardware level.
+ *
+ * Camera devices that support this version of the HAL must return
+ * CAMERA_DEVICE_API_VERSION_3_6 in camera_device_t.common.version and in
+ * camera_info_t.device_version (from camera_module_t.get_camera_info).
+ *
+ * CAMERA_DEVICE_API_VERSION_3_3 and above:
+ * Camera modules that may contain version 3.3 or above devices must
+ * implement at least version 2.2 of the camera module interface (as defined
+ * by camera_module_t.common.module_api_version).
+ *
+ * CAMERA_DEVICE_API_VERSION_3_2:
+ * Camera modules that may contain version 3.2 devices must implement at
+ * least version 2.2 of the camera module interface (as defined by
+ * camera_module_t.common.module_api_version).
+ *
+ * <= CAMERA_DEVICE_API_VERSION_3_1:
+ * Camera modules that may contain version 3.1 (or 3.0) devices must
+ * implement at least version 2.0 of the camera module interface
+ * (as defined by camera_module_t.common.module_api_version).
+ *
+ * See camera_common.h for more versioning details.
+ *
+ * Documentation index:
+ * S1. Version history
+ * S2. Startup and operation sequencing
+ * S3. Operational modes
+ * S4. 3A modes and state machines
+ * S5. Cropping
+ * S6. Error management
+ * S7. Key Performance Indicator (KPI) glossary
+ * S8. Sample Use Cases
+ * S9. Notes on Controls and Metadata
+ * S10. Reprocessing flow and controls
+ */
+
+/**
+ * S1. Version history:
+ *
+ * 1.0: Initial Android camera HAL (Android 4.0) [camera.h]:
+ *
+ * - Converted from C++ CameraHardwareInterface abstraction layer.
+ *
+ * - Supports android.hardware.Camera API.
+ *
+ * 2.0: Initial release of expanded-capability HAL (Android 4.2) [camera2.h]:
+ *
+ * - Sufficient for implementing existing android.hardware.Camera API.
+ *
+ * - Allows for ZSL queue in camera service layer
+ *
+ * - Not tested for any new features such manual capture control, Bayer RAW
+ * capture, reprocessing of RAW data.
+ *
+ * 3.0: First revision of expanded-capability HAL:
+ *
+ * - Major version change since the ABI is completely different. No change to
+ * the required hardware capabilities or operational model from 2.0.
+ *
+ * - Reworked input request and stream queue interfaces: Framework calls into
+ * HAL with next request and stream buffers already dequeued. Sync framework
+ * support is included, necessary for efficient implementations.
+ *
+ * - Moved triggers into requests, most notifications into results.
+ *
+ * - Consolidated all callbacks into framework into one structure, and all
+ * setup methods into a single initialize() call.
+ *
+ * - Made stream configuration into a single call to simplify stream
+ * management. Bidirectional streams replace STREAM_FROM_STREAM construct.
+ *
+ * - Limited mode semantics for older/limited hardware devices.
+ *
+ * 3.1: Minor revision of expanded-capability HAL:
+ *
+ * - configure_streams passes consumer usage flags to the HAL.
+ *
+ * - flush call to drop all in-flight requests/buffers as fast as possible.
+ *
+ * 3.2: Minor revision of expanded-capability HAL:
+ *
+ * - Deprecates get_metadata_vendor_tag_ops. Please use get_vendor_tag_ops
+ * in camera_common.h instead.
+ *
+ * - register_stream_buffers deprecated. All gralloc buffers provided
+ * by framework to HAL in process_capture_request may be new at any time.
+ *
+ * - add partial result support. process_capture_result may be called
+ * multiple times with a subset of the available result before the full
+ * result is available.
+ *
+ * - add manual template to camera3_request_template. The applications may
+ * use this template to control the capture settings directly.
+ *
+ * - Rework the bidirectional and input stream specifications.
+ *
+ * - change the input buffer return path. The buffer is returned in
+ * process_capture_result instead of process_capture_request.
+ *
+ * 3.3: Minor revision of expanded-capability HAL:
+ *
+ * - OPAQUE and YUV reprocessing API updates.
+ *
+ * - Basic support for depth output buffers.
+ *
+ * - Addition of data_space field to camera3_stream_t.
+ *
+ * - Addition of rotation field to camera3_stream_t.
+ *
+ * - Addition of camera3 stream configuration operation mode to camera3_stream_configuration_t
+ *
+ * 3.4: Minor additions to supported metadata and changes to data_space support
+ *
+ * - Add ANDROID_SENSOR_OPAQUE_RAW_SIZE static metadata as mandatory if
+ * RAW_OPAQUE format is supported.
+ *
+ * - Add ANDROID_CONTROL_POST_RAW_SENSITIVITY_BOOST_RANGE static metadata as
+ * mandatory if any RAW format is supported
+ *
+ * - Switch camera3_stream_t data_space field to a more flexible definition,
+ * using the version 0 definition of dataspace encoding.
+ *
+ * - General metadata additions which are available to use for HALv3.2 or
+ * newer:
+ * - ANDROID_INFO_SUPPORTED_HARDWARE_LEVEL_3
+ * - ANDROID_CONTROL_POST_RAW_SENSITIVITY_BOOST
+ * - ANDROID_CONTROL_POST_RAW_SENSITIVITY_BOOST_RANGE
+ * - ANDROID_SENSOR_DYNAMIC_BLACK_LEVEL
+ * - ANDROID_SENSOR_DYNAMIC_WHITE_LEVEL
+ * - ANDROID_SENSOR_OPAQUE_RAW_SIZE
+ * - ANDROID_SENSOR_OPTICAL_BLACK_REGIONS
+ *
+ * 3.5: Minor revisions to support session parameters and logical multi camera:
+ *
+ * - Add ANDROID_REQUEST_AVAILABLE_SESSION_KEYS static metadata, which is
+ * optional for implementations that want to support session parameters. If support is
+ * needed, then Hal should populate the list with all available capture request keys
+ * that can cause severe processing delays when modified by client. Typical examples
+ * include parameters that require time-consuming HW re-configuration or internal camera
+ * pipeline update.
+ *
+ * - Add a session parameter field to camera3_stream_configuration which can be populated
+ * by clients with initial values for the keys found in ANDROID_REQUEST_AVAILABLE_SESSION_KEYS.
+ *
+ * - Metadata additions for logical multi camera capability:
+ * - ANDROID_REQUEST_AVAILABLE_CAPABILITIES_LOGICAL_MULTI_CAMERA
+ * - ANDROID_LOGICAL_MULTI_CAMERA_PHYSICAL_IDS
+ * - ANDROID_LOGICAL_MULTI_CAMERA_SYNC_TYPE
+ *
+ * - Add physical camera id field in camera3_stream, so that for a logical
+ * multi camera, the application has the option to specify which physical camera
+ * a particular stream is configured on.
+ *
+ * - Add physical camera id and settings field in camera3_capture_request, so that
+ * for a logical multi camera, the application has the option to specify individual
+ * settings for a particular physical device.
+ *
+ * 3.6: Minor revisions to support HAL buffer management APIs:
+ *
+ * - Add ANDROID_INFO_SUPPORTED_BUFFER_MANAGEMENT_VERSION static metadata, which allows HAL to
+ * opt in to the new buffer management APIs described below.
+ *
+ * - Add request_stream_buffers() and return_stream_buffers() to camera3_callback_ops_t for HAL to
+ * request and return output buffers from camera service.
+ *
+ * - Add signal_stream_flush() to camera3_device_ops_t for camera service to notify HAL an
+ * upcoming configure_streams() call requires HAL to return buffers of certain streams.
+ *
+ * - Add CAMERA3_JPEG_APP_SEGMENTS_BLOB_ID to support BLOB with only JPEG apps
+ * segments and thumbnail (without main image bitstream). Camera framework
+ * uses such stream togerther with a HAL YUV_420_888/IMPLEMENTATION_DEFINED
+ * stream to encode HEIC (ISO/IEC 23008-12) image.
+ *
+ * - Add is_reconfiguration_required() to camera3_device_ops_t to enable HAL to skip or
+ * trigger stream reconfiguration depending on new session parameter values.
+ *
+ */
+
+/**
+ * S2. Startup and general expected operation sequence:
+ *
+ * 1. Framework calls camera_module_t->common.open(), which returns a
+ * hardware_device_t structure.
+ *
+ * 2. Framework inspects the hardware_device_t->version field, and instantiates
+ * the appropriate handler for that version of the camera hardware device. In
+ * case the version is CAMERA_DEVICE_API_VERSION_3_0, the device is cast to
+ * a camera3_device_t.
+ *
+ * 3. Framework calls camera3_device_t->ops->initialize() with the framework
+ * callback function pointers. This will only be called this one time after
+ * open(), before any other functions in the ops structure are called.
+ *
+ * 4. The framework calls camera3_device_t->ops->configure_streams() with a list
+ * of input/output streams to the HAL device.
+ *
+ * 5. <= CAMERA_DEVICE_API_VERSION_3_1:
+ *
+ * The framework allocates gralloc buffers and calls
+ * camera3_device_t->ops->register_stream_buffers() for at least one of the
+ * output streams listed in configure_streams. The same stream is registered
+ * only once.
+ *
+ * >= CAMERA_DEVICE_API_VERSION_3_2:
+ *
+ * camera3_device_t->ops->register_stream_buffers() is not called and must
+ * be NULL.
+ *
+ * 6. The framework requests default settings for some number of use cases with
+ * calls to camera3_device_t->ops->construct_default_request_settings(). This
+ * may occur any time after step 3.
+ *
+ * 7. The framework constructs and sends the first capture request to the HAL,
+ * with settings based on one of the sets of default settings, and with at
+ * least one output stream, which has been registered earlier by the
+ * framework. This is sent to the HAL with
+ * camera3_device_t->ops->process_capture_request(). The HAL must block the
+ * return of this call until it is ready for the next request to be sent.
+ *
+ * >= CAMERA_DEVICE_API_VERSION_3_2:
+ *
+ * The buffer_handle_t provided in the camera3_stream_buffer_t array
+ * in the camera3_capture_request_t may be new and never-before-seen
+ * by the HAL on any given new request.
+ *
+ * 8. The framework continues to submit requests, and call
+ * construct_default_request_settings to get default settings buffers for
+ * other use cases.
+ *
+ * <= CAMERA_DEVICE_API_VERSION_3_1:
+ *
+ * The framework may call register_stream_buffers() at this time for
+ * not-yet-registered streams.
+ *
+ * 9. When the capture of a request begins (sensor starts exposing for the
+ * capture) or processing a reprocess request begins, the HAL
+ * calls camera3_callback_ops_t->notify() with the SHUTTER event, including
+ * the frame number and the timestamp for start of exposure. For a reprocess
+ * request, the timestamp must be the start of exposure of the input image
+ * which can be looked up with android.sensor.timestamp from
+ * camera3_capture_request_t.settings when process_capture_request() is
+ * called.
+ *
+ * <= CAMERA_DEVICE_API_VERSION_3_1:
+ *
+ * This notify call must be made before the first call to
+ * process_capture_result() for that frame number.
+ *
+ * >= CAMERA_DEVICE_API_VERSION_3_2:
+ *
+ * The camera3_callback_ops_t->notify() call with the SHUTTER event should
+ * be made as early as possible since the framework will be unable to
+ * deliver gralloc buffers to the application layer (for that frame) until
+ * it has a valid timestamp for the start of exposure (or the input image's
+ * start of exposure for a reprocess request).
+ *
+ * Both partial metadata results and the gralloc buffers may be sent to the
+ * framework at any time before or after the SHUTTER event.
+ *
+ * 10. After some pipeline delay, the HAL begins to return completed captures to
+ * the framework with camera3_callback_ops_t->process_capture_result(). These
+ * are returned in the same order as the requests were submitted. Multiple
+ * requests can be in flight at once, depending on the pipeline depth of the
+ * camera HAL device.
+ *
+ * >= CAMERA_DEVICE_API_VERSION_3_2:
+ *
+ * Once a buffer is returned by process_capture_result as part of the
+ * camera3_stream_buffer_t array, and the fence specified by release_fence
+ * has been signaled (this is a no-op for -1 fences), the ownership of that
+ * buffer is considered to be transferred back to the framework. After that,
+ * the HAL must no longer retain that particular buffer, and the
+ * framework may clean up the memory for it immediately.
+ *
+ * process_capture_result may be called multiple times for a single frame,
+ * each time with a new disjoint piece of metadata and/or set of gralloc
+ * buffers. The framework will accumulate these partial metadata results
+ * into one result.
+ *
+ * In particular, it is legal for a process_capture_result to be called
+ * simultaneously for both a frame N and a frame N+1 as long as the
+ * above rule holds for gralloc buffers (both input and output).
+ *
+ * 11. After some time, the framework may stop submitting new requests, wait for
+ * the existing captures to complete (all buffers filled, all results
+ * returned), and then call configure_streams() again. This resets the camera
+ * hardware and pipeline for a new set of input/output streams. Some streams
+ * may be reused from the previous configuration; if these streams' buffers
+ * had already been registered with the HAL, they will not be registered
+ * again. The framework then continues from step 7, if at least one
+ * registered output stream remains (otherwise, step 5 is required first).
+ *
+ * 12. Alternatively, the framework may call camera3_device_t->common->close()
+ * to end the camera session. This may be called at any time when no other
+ * calls from the framework are active, although the call may block until all
+ * in-flight captures have completed (all results returned, all buffers
+ * filled). After the close call returns, no more calls to the
+ * camera3_callback_ops_t functions are allowed from the HAL. Once the
+ * close() call is underway, the framework may not call any other HAL device
+ * functions.
+ *
+ * 13. In case of an error or other asynchronous event, the HAL must call
+ * camera3_callback_ops_t->notify() with the appropriate error/event
+ * message. After returning from a fatal device-wide error notification, the
+ * HAL should act as if close() had been called on it. However, the HAL must
+ * either cancel or complete all outstanding captures before calling
+ * notify(), so that once notify() is called with a fatal error, the
+ * framework will not receive further callbacks from the device. Methods
+ * besides close() should return -ENODEV or NULL after the notify() method
+ * returns from a fatal error message.
+ */
+
+/**
+ * S3. Operational modes:
+ *
+ * The camera 3 HAL device can implement one of two possible operational modes;
+ * limited and full. Full support is expected from new higher-end
+ * devices. Limited mode has hardware requirements roughly in line with those
+ * for a camera HAL device v1 implementation, and is expected from older or
+ * inexpensive devices. Full is a strict superset of limited, and they share the
+ * same essential operational flow, as documented above.
+ *
+ * The HAL must indicate its level of support with the
+ * android.info.supportedHardwareLevel static metadata entry, with 0 indicating
+ * limited mode, and 1 indicating full mode support.
+ *
+ * Roughly speaking, limited-mode devices do not allow for application control
+ * of capture settings (3A control only), high-rate capture of high-resolution
+ * images, raw sensor readout, or support for YUV output streams above maximum
+ * recording resolution (JPEG only for large images).
+ *
+ * ** Details of limited mode behavior:
+ *
+ * - Limited-mode devices do not need to implement accurate synchronization
+ * between capture request settings and the actual image data
+ * captured. Instead, changes to settings may take effect some time in the
+ * future, and possibly not for the same output frame for each settings
+ * entry. Rapid changes in settings may result in some settings never being
+ * used for a capture. However, captures that include high-resolution output
+ * buffers ( > 1080p ) have to use the settings as specified (but see below
+ * for processing rate).
+ *
+ * - Limited-mode devices do not need to support most of the
+ * settings/result/static info metadata. Specifically, only the following settings
+ * are expected to be consumed or produced by a limited-mode HAL device:
+ *
+ * android.control.aeAntibandingMode (controls and dynamic)
+ * android.control.aeExposureCompensation (controls and dynamic)
+ * android.control.aeLock (controls and dynamic)
+ * android.control.aeMode (controls and dynamic)
+ * android.control.aeRegions (controls and dynamic)
+ * android.control.aeTargetFpsRange (controls and dynamic)
+ * android.control.aePrecaptureTrigger (controls and dynamic)
+ * android.control.afMode (controls and dynamic)
+ * android.control.afRegions (controls and dynamic)
+ * android.control.awbLock (controls and dynamic)
+ * android.control.awbMode (controls and dynamic)
+ * android.control.awbRegions (controls and dynamic)
+ * android.control.captureIntent (controls and dynamic)
+ * android.control.effectMode (controls and dynamic)
+ * android.control.mode (controls and dynamic)
+ * android.control.sceneMode (controls and dynamic)
+ * android.control.videoStabilizationMode (controls and dynamic)
+ * android.control.aeAvailableAntibandingModes (static)
+ * android.control.aeAvailableModes (static)
+ * android.control.aeAvailableTargetFpsRanges (static)
+ * android.control.aeCompensationRange (static)
+ * android.control.aeCompensationStep (static)
+ * android.control.afAvailableModes (static)
+ * android.control.availableEffects (static)
+ * android.control.availableSceneModes (static)
+ * android.control.availableVideoStabilizationModes (static)
+ * android.control.awbAvailableModes (static)
+ * android.control.maxRegions (static)
+ * android.control.sceneModeOverrides (static)
+ * android.control.aeState (dynamic)
+ * android.control.afState (dynamic)
+ * android.control.awbState (dynamic)
+ *
+ * android.flash.mode (controls and dynamic)
+ * android.flash.info.available (static)
+ *
+ * android.info.supportedHardwareLevel (static)
+ *
+ * android.jpeg.gpsCoordinates (controls and dynamic)
+ * android.jpeg.gpsProcessingMethod (controls and dynamic)
+ * android.jpeg.gpsTimestamp (controls and dynamic)
+ * android.jpeg.orientation (controls and dynamic)
+ * android.jpeg.quality (controls and dynamic)
+ * android.jpeg.thumbnailQuality (controls and dynamic)
+ * android.jpeg.thumbnailSize (controls and dynamic)
+ * android.jpeg.availableThumbnailSizes (static)
+ * android.jpeg.maxSize (static)
+ *
+ * android.lens.info.minimumFocusDistance (static)
+ *
+ * android.request.id (controls and dynamic)
+ *
+ * android.scaler.cropRegion (controls and dynamic)
+ * android.scaler.availableStreamConfigurations (static)
+ * android.scaler.availableMinFrameDurations (static)
+ * android.scaler.availableStallDurations (static)
+ * android.scaler.availableMaxDigitalZoom (static)
+ * android.scaler.maxDigitalZoom (static)
+ * android.scaler.croppingType (static)
+ *
+ * android.sensor.orientation (static)
+ * android.sensor.timestamp (dynamic)
+ *
+ * android.statistics.faceDetectMode (controls and dynamic)
+ * android.statistics.info.availableFaceDetectModes (static)
+ * android.statistics.faceIds (dynamic)
+ * android.statistics.faceLandmarks (dynamic)
+ * android.statistics.faceRectangles (dynamic)
+ * android.statistics.faceScores (dynamic)
+ *
+ * android.sync.frameNumber (dynamic)
+ * android.sync.maxLatency (static)
+ *
+ * - Captures in limited mode that include high-resolution (> 1080p) output
+ * buffers may block in process_capture_request() until all the output buffers
+ * have been filled. A full-mode HAL device must process sequences of
+ * high-resolution requests at the rate indicated in the static metadata for
+ * that pixel format. The HAL must still call process_capture_result() to
+ * provide the output; the framework must simply be prepared for
+ * process_capture_request() to block until after process_capture_result() for
+ * that request completes for high-resolution captures for limited-mode
+ * devices.
+ *
+ * - Full-mode devices must support below additional capabilities:
+ * - 30fps at maximum resolution is preferred, more than 20fps is required.
+ * - Per frame control (android.sync.maxLatency == PER_FRAME_CONTROL).
+ * - Sensor manual control metadata. See MANUAL_SENSOR defined in
+ * android.request.availableCapabilities.
+ * - Post-processing manual control metadata. See MANUAL_POST_PROCESSING defined
+ * in android.request.availableCapabilities.
+ *
+ */
+
+/**
+ * S4. 3A modes and state machines:
+ *
+ * While the actual 3A algorithms are up to the HAL implementation, a high-level
+ * state machine description is defined by the HAL interface, to allow the HAL
+ * device and the framework to communicate about the current state of 3A, and to
+ * trigger 3A events.
+ *
+ * When the device is opened, all the individual 3A states must be
+ * STATE_INACTIVE. Stream configuration does not reset 3A. For example, locked
+ * focus must be maintained across the configure() call.
+ *
+ * Triggering a 3A action involves simply setting the relevant trigger entry in
+ * the settings for the next request to indicate start of trigger. For example,
+ * the trigger for starting an autofocus scan is setting the entry
+ * ANDROID_CONTROL_AF_TRIGGER to ANDROID_CONTROL_AF_TRIGGER_START for one
+ * request, and cancelling an autofocus scan is triggered by setting
+ * ANDROID_CONTROL_AF_TRIGGER to ANDROID_CONTRL_AF_TRIGGER_CANCEL. Otherwise,
+ * the entry will not exist, or be set to ANDROID_CONTROL_AF_TRIGGER_IDLE. Each
+ * request with a trigger entry set to a non-IDLE value will be treated as an
+ * independent triggering event.
+ *
+ * At the top level, 3A is controlled by the ANDROID_CONTROL_MODE setting, which
+ * selects between no 3A (ANDROID_CONTROL_MODE_OFF), normal AUTO mode
+ * (ANDROID_CONTROL_MODE_AUTO), and using the scene mode setting
+ * (ANDROID_CONTROL_USE_SCENE_MODE).
+ *
+ * - In OFF mode, each of the individual AE/AF/AWB modes are effectively OFF,
+ * and none of the capture controls may be overridden by the 3A routines.
+ *
+ * - In AUTO mode, Auto-focus, auto-exposure, and auto-whitebalance all run
+ * their own independent algorithms, and have their own mode, state, and
+ * trigger metadata entries, as listed in the next section.
+ *
+ * - In USE_SCENE_MODE, the value of the ANDROID_CONTROL_SCENE_MODE entry must
+ * be used to determine the behavior of 3A routines. In SCENE_MODEs other than
+ * FACE_PRIORITY, the HAL must override the values of
+ * ANDROId_CONTROL_AE/AWB/AF_MODE to be the mode it prefers for the selected
+ * SCENE_MODE. For example, the HAL may prefer SCENE_MODE_NIGHT to use
+ * CONTINUOUS_FOCUS AF mode. Any user selection of AE/AWB/AF_MODE when scene
+ * must be ignored for these scene modes.
+ *
+ * - For SCENE_MODE_FACE_PRIORITY, the AE/AWB/AF_MODE controls work as in
+ * ANDROID_CONTROL_MODE_AUTO, but the 3A routines must bias toward metering
+ * and focusing on any detected faces in the scene.
+ *
+ * S4.1. Auto-focus settings and result entries:
+ *
+ * Main metadata entries:
+ *
+ * ANDROID_CONTROL_AF_MODE: Control for selecting the current autofocus
+ * mode. Set by the framework in the request settings.
+ *
+ * AF_MODE_OFF: AF is disabled; the framework/app directly controls lens
+ * position.
+ *
+ * AF_MODE_AUTO: Single-sweep autofocus. No lens movement unless AF is
+ * triggered.
+ *
+ * AF_MODE_MACRO: Single-sweep up-close autofocus. No lens movement unless
+ * AF is triggered.
+ *
+ * AF_MODE_CONTINUOUS_VIDEO: Smooth continuous focusing, for recording
+ * video. Triggering immediately locks focus in current
+ * position. Canceling resumes cotinuous focusing.
+ *
+ * AF_MODE_CONTINUOUS_PICTURE: Fast continuous focusing, for
+ * zero-shutter-lag still capture. Triggering locks focus once currently
+ * active sweep concludes. Canceling resumes continuous focusing.
+ *
+ * AF_MODE_EDOF: Advanced extended depth of field focusing. There is no
+ * autofocus scan, so triggering one or canceling one has no effect.
+ * Images are focused automatically by the HAL.
+ *
+ * ANDROID_CONTROL_AF_STATE: Dynamic metadata describing the current AF
+ * algorithm state, reported by the HAL in the result metadata.
+ *
+ * AF_STATE_INACTIVE: No focusing has been done, or algorithm was
+ * reset. Lens is not moving. Always the state for MODE_OFF or MODE_EDOF.
+ * When the device is opened, it must start in this state.
+ *
+ * AF_STATE_PASSIVE_SCAN: A continuous focus algorithm is currently scanning
+ * for good focus. The lens is moving.
+ *
+ * AF_STATE_PASSIVE_FOCUSED: A continuous focus algorithm believes it is
+ * well focused. The lens is not moving. The HAL may spontaneously leave
+ * this state.
+ *
+ * AF_STATE_PASSIVE_UNFOCUSED: A continuous focus algorithm believes it is
+ * not well focused. The lens is not moving. The HAL may spontaneously
+ * leave this state.
+ *
+ * AF_STATE_ACTIVE_SCAN: A scan triggered by the user is underway.
+ *
+ * AF_STATE_FOCUSED_LOCKED: The AF algorithm believes it is focused. The
+ * lens is not moving.
+ *
+ * AF_STATE_NOT_FOCUSED_LOCKED: The AF algorithm has been unable to
+ * focus. The lens is not moving.
+ *
+ * ANDROID_CONTROL_AF_TRIGGER: Control for starting an autofocus scan, the
+ * meaning of which is mode- and state- dependent. Set by the framework in
+ * the request settings.
+ *
+ * AF_TRIGGER_IDLE: No current trigger.
+ *
+ * AF_TRIGGER_START: Trigger start of AF scan. Effect is mode and state
+ * dependent.
+ *
+ * AF_TRIGGER_CANCEL: Cancel current AF scan if any, and reset algorithm to
+ * default.
+ *
+ * Additional metadata entries:
+ *
+ * ANDROID_CONTROL_AF_REGIONS: Control for selecting the regions of the FOV
+ * that should be used to determine good focus. This applies to all AF
+ * modes that scan for focus. Set by the framework in the request
+ * settings.
+ *
+ * S4.2. Auto-exposure settings and result entries:
+ *
+ * Main metadata entries:
+ *
+ * ANDROID_CONTROL_AE_MODE: Control for selecting the current auto-exposure
+ * mode. Set by the framework in the request settings.
+ *
+ * AE_MODE_OFF: Autoexposure is disabled; the user controls exposure, gain,
+ * frame duration, and flash.
+ *
+ * AE_MODE_ON: Standard autoexposure, with flash control disabled. User may
+ * set flash to fire or to torch mode.
+ *
+ * AE_MODE_ON_AUTO_FLASH: Standard autoexposure, with flash on at HAL's
+ * discretion for precapture and still capture. User control of flash
+ * disabled.
+ *
+ * AE_MODE_ON_ALWAYS_FLASH: Standard autoexposure, with flash always fired
+ * for capture, and at HAL's discretion for precapture.. User control of
+ * flash disabled.
+ *
+ * AE_MODE_ON_AUTO_FLASH_REDEYE: Standard autoexposure, with flash on at
+ * HAL's discretion for precapture and still capture. Use a flash burst
+ * at end of precapture sequence to reduce redeye in the final
+ * picture. User control of flash disabled.
+ *
+ * ANDROID_CONTROL_AE_STATE: Dynamic metadata describing the current AE
+ * algorithm state, reported by the HAL in the result metadata.
+ *
+ * AE_STATE_INACTIVE: Initial AE state after mode switch. When the device is
+ * opened, it must start in this state.
+ *
+ * AE_STATE_SEARCHING: AE is not converged to a good value, and is adjusting
+ * exposure parameters.
+ *
+ * AE_STATE_CONVERGED: AE has found good exposure values for the current
+ * scene, and the exposure parameters are not changing. HAL may
+ * spontaneously leave this state to search for better solution.
+ *
+ * AE_STATE_LOCKED: AE has been locked with the AE_LOCK control. Exposure
+ * values are not changing.
+ *
+ * AE_STATE_FLASH_REQUIRED: The HAL has converged exposure, but believes
+ * flash is required for a sufficiently bright picture. Used for
+ * determining if a zero-shutter-lag frame can be used.
+ *
+ * AE_STATE_PRECAPTURE: The HAL is in the middle of a precapture
+ * sequence. Depending on AE mode, this mode may involve firing the
+ * flash for metering, or a burst of flash pulses for redeye reduction.
+ *
+ * ANDROID_CONTROL_AE_PRECAPTURE_TRIGGER: Control for starting a metering
+ * sequence before capturing a high-quality image. Set by the framework in
+ * the request settings.
+ *
+ * PRECAPTURE_TRIGGER_IDLE: No current trigger.
+ *
+ * PRECAPTURE_TRIGGER_START: Start a precapture sequence. The HAL should
+ * use the subsequent requests to measure good exposure/white balance
+ * for an upcoming high-resolution capture.
+ *
+ * Additional metadata entries:
+ *
+ * ANDROID_CONTROL_AE_LOCK: Control for locking AE controls to their current
+ * values
+ *
+ * ANDROID_CONTROL_AE_EXPOSURE_COMPENSATION: Control for adjusting AE
+ * algorithm target brightness point.
+ *
+ * ANDROID_CONTROL_AE_TARGET_FPS_RANGE: Control for selecting the target frame
+ * rate range for the AE algorithm. The AE routine cannot change the frame
+ * rate to be outside these bounds.
+ *
+ * ANDROID_CONTROL_AE_REGIONS: Control for selecting the regions of the FOV
+ * that should be used to determine good exposure levels. This applies to
+ * all AE modes besides OFF.
+ *
+ * S4.3. Auto-whitebalance settings and result entries:
+ *
+ * Main metadata entries:
+ *
+ * ANDROID_CONTROL_AWB_MODE: Control for selecting the current white-balance
+ * mode.
+ *
+ * AWB_MODE_OFF: Auto-whitebalance is disabled. User controls color matrix.
+ *
+ * AWB_MODE_AUTO: Automatic white balance is enabled; 3A controls color
+ * transform, possibly using more complex transforms than a simple
+ * matrix.
+ *
+ * AWB_MODE_INCANDESCENT: Fixed white balance settings good for indoor
+ * incandescent (tungsten) lighting, roughly 2700K.
+ *
+ * AWB_MODE_FLUORESCENT: Fixed white balance settings good for fluorescent
+ * lighting, roughly 5000K.
+ *
+ * AWB_MODE_WARM_FLUORESCENT: Fixed white balance settings good for
+ * fluorescent lighting, roughly 3000K.
+ *
+ * AWB_MODE_DAYLIGHT: Fixed white balance settings good for daylight,
+ * roughly 5500K.
+ *
+ * AWB_MODE_CLOUDY_DAYLIGHT: Fixed white balance settings good for clouded
+ * daylight, roughly 6500K.
+ *
+ * AWB_MODE_TWILIGHT: Fixed white balance settings good for
+ * near-sunset/sunrise, roughly 15000K.
+ *
+ * AWB_MODE_SHADE: Fixed white balance settings good for areas indirectly
+ * lit by the sun, roughly 7500K.
+ *
+ * ANDROID_CONTROL_AWB_STATE: Dynamic metadata describing the current AWB
+ * algorithm state, reported by the HAL in the result metadata.
+ *
+ * AWB_STATE_INACTIVE: Initial AWB state after mode switch. When the device
+ * is opened, it must start in this state.
+ *
+ * AWB_STATE_SEARCHING: AWB is not converged to a good value, and is
+ * changing color adjustment parameters.
+ *
+ * AWB_STATE_CONVERGED: AWB has found good color adjustment values for the
+ * current scene, and the parameters are not changing. HAL may
+ * spontaneously leave this state to search for better solution.
+ *
+ * AWB_STATE_LOCKED: AWB has been locked with the AWB_LOCK control. Color
+ * adjustment values are not changing.
+ *
+ * Additional metadata entries:
+ *
+ * ANDROID_CONTROL_AWB_LOCK: Control for locking AWB color adjustments to
+ * their current values.
+ *
+ * ANDROID_CONTROL_AWB_REGIONS: Control for selecting the regions of the FOV
+ * that should be used to determine good color balance. This applies only
+ * to auto-WB mode.
+ *
+ * S4.4. General state machine transition notes
+ *
+ * Switching between AF, AE, or AWB modes always resets the algorithm's state
+ * to INACTIVE. Similarly, switching between CONTROL_MODE or
+ * CONTROL_SCENE_MODE if CONTROL_MODE == USE_SCENE_MODE resets all the
+ * algorithm states to INACTIVE.
+ *
+ * The tables below are per-mode.
+ *
+ * S4.5. AF state machines
+ *
+ * when enabling AF or changing AF mode
+ *| state | trans. cause | new state | notes |
+ *+--------------------+---------------+--------------------+------------------+
+ *| Any | AF mode change| INACTIVE | |
+ *+--------------------+---------------+--------------------+------------------+
+ *
+ * mode = AF_MODE_OFF or AF_MODE_EDOF
+ *| state | trans. cause | new state | notes |
+ *+--------------------+---------------+--------------------+------------------+
+ *| INACTIVE | | INACTIVE | Never changes |
+ *+--------------------+---------------+--------------------+------------------+
+ *
+ * mode = AF_MODE_AUTO or AF_MODE_MACRO
+ *| state | trans. cause | new state | notes |
+ *+--------------------+---------------+--------------------+------------------+
+ *| INACTIVE | AF_TRIGGER | ACTIVE_SCAN | Start AF sweep |
+ *| | | | Lens now moving |
+ *+--------------------+---------------+--------------------+------------------+
+ *| ACTIVE_SCAN | AF sweep done | FOCUSED_LOCKED | If AF successful |
+ *| | | | Lens now locked |
+ *+--------------------+---------------+--------------------+------------------+
+ *| ACTIVE_SCAN | AF sweep done | NOT_FOCUSED_LOCKED | If AF successful |
+ *| | | | Lens now locked |
+ *+--------------------+---------------+--------------------+------------------+
+ *| ACTIVE_SCAN | AF_CANCEL | INACTIVE | Cancel/reset AF |
+ *| | | | Lens now locked |
+ *+--------------------+---------------+--------------------+------------------+
+ *| FOCUSED_LOCKED | AF_CANCEL | INACTIVE | Cancel/reset AF |
+ *+--------------------+---------------+--------------------+------------------+
+ *| FOCUSED_LOCKED | AF_TRIGGER | ACTIVE_SCAN | Start new sweep |
+ *| | | | Lens now moving |
+ *+--------------------+---------------+--------------------+------------------+
+ *| NOT_FOCUSED_LOCKED | AF_CANCEL | INACTIVE | Cancel/reset AF |
+ *+--------------------+---------------+--------------------+------------------+
+ *| NOT_FOCUSED_LOCKED | AF_TRIGGER | ACTIVE_SCAN | Start new sweep |
+ *| | | | Lens now moving |
+ *+--------------------+---------------+--------------------+------------------+
+ *| All states | mode change | INACTIVE | |
+ *+--------------------+---------------+--------------------+------------------+
+ *
+ * mode = AF_MODE_CONTINUOUS_VIDEO
+ *| state | trans. cause | new state | notes |
+ *+--------------------+---------------+--------------------+------------------+
+ *| INACTIVE | HAL initiates | PASSIVE_SCAN | Start AF scan |
+ *| | new scan | | Lens now moving |
+ *+--------------------+---------------+--------------------+------------------+
+ *| INACTIVE | AF_TRIGGER | NOT_FOCUSED_LOCKED | AF state query |
+ *| | | | Lens now locked |
+ *+--------------------+---------------+--------------------+------------------+
+ *| PASSIVE_SCAN | HAL completes | PASSIVE_FOCUSED | End AF scan |
+ *| | current scan | | Lens now locked |
+ *+--------------------+---------------+--------------------+------------------+
+ *| PASSIVE_SCAN | HAL fails | PASSIVE_UNFOCUSED | End AF scan |
+ *| | current scan | | Lens now locked |
+ *+--------------------+---------------+--------------------+------------------+
+ *| PASSIVE_SCAN | AF_TRIGGER | FOCUSED_LOCKED | Immediate trans. |
+ *| | | | if focus is good |
+ *| | | | Lens now locked |
+ *+--------------------+---------------+--------------------+------------------+
+ *| PASSIVE_SCAN | AF_TRIGGER | NOT_FOCUSED_LOCKED | Immediate trans. |
+ *| | | | if focus is bad |
+ *| | | | Lens now locked |
+ *+--------------------+---------------+--------------------+------------------+
+ *| PASSIVE_SCAN | AF_CANCEL | INACTIVE | Reset lens |
+ *| | | | position |
+ *| | | | Lens now locked |
+ *+--------------------+---------------+--------------------+------------------+
+ *| PASSIVE_FOCUSED | HAL initiates | PASSIVE_SCAN | Start AF scan |
+ *| | new scan | | Lens now moving |
+ *+--------------------+---------------+--------------------+------------------+
+ *| PASSIVE_UNFOCUSED | HAL initiates | PASSIVE_SCAN | Start AF scan |
+ *| | new scan | | Lens now moving |
+ *+--------------------+---------------+--------------------+------------------+
+ *| PASSIVE_FOCUSED | AF_TRIGGER | FOCUSED_LOCKED | Immediate trans. |
+ *| | | | Lens now locked |
+ *+--------------------+---------------+--------------------+------------------+
+ *| PASSIVE_UNFOCUSED | AF_TRIGGER | NOT_FOCUSED_LOCKED | Immediate trans. |
+ *| | | | Lens now locked |
+ *+--------------------+---------------+--------------------+------------------+
+ *| FOCUSED_LOCKED | AF_TRIGGER | FOCUSED_LOCKED | No effect |
+ *+--------------------+---------------+--------------------+------------------+
+ *| FOCUSED_LOCKED | AF_CANCEL | INACTIVE | Restart AF scan |
+ *+--------------------+---------------+--------------------+------------------+
+ *| NOT_FOCUSED_LOCKED | AF_TRIGGER | NOT_FOCUSED_LOCKED | No effect |
+ *+--------------------+---------------+--------------------+------------------+
+ *| NOT_FOCUSED_LOCKED | AF_CANCEL | INACTIVE | Restart AF scan |
+ *+--------------------+---------------+--------------------+------------------+
+ *
+ * mode = AF_MODE_CONTINUOUS_PICTURE
+ *| state | trans. cause | new state | notes |
+ *+--------------------+---------------+--------------------+------------------+
+ *| INACTIVE | HAL initiates | PASSIVE_SCAN | Start AF scan |
+ *| | new scan | | Lens now moving |
+ *+--------------------+---------------+--------------------+------------------+
+ *| INACTIVE | AF_TRIGGER | NOT_FOCUSED_LOCKED | AF state query |
+ *| | | | Lens now locked |
+ *+--------------------+---------------+--------------------+------------------+
+ *| PASSIVE_SCAN | HAL completes | PASSIVE_FOCUSED | End AF scan |
+ *| | current scan | | Lens now locked |
+ *+--------------------+---------------+--------------------+------------------+
+ *| PASSIVE_SCAN | HAL fails | PASSIVE_UNFOCUSED | End AF scan |
+ *| | current scan | | Lens now locked |
+ *+--------------------+---------------+--------------------+------------------+
+ *| PASSIVE_SCAN | AF_TRIGGER | FOCUSED_LOCKED | Eventual trans. |
+ *| | | | once focus good |
+ *| | | | Lens now locked |
+ *+--------------------+---------------+--------------------+------------------+
+ *| PASSIVE_SCAN | AF_TRIGGER | NOT_FOCUSED_LOCKED | Eventual trans. |
+ *| | | | if cannot focus |
+ *| | | | Lens now locked |
+ *+--------------------+---------------+--------------------+------------------+
+ *| PASSIVE_SCAN | AF_CANCEL | INACTIVE | Reset lens |
+ *| | | | position |
+ *| | | | Lens now locked |
+ *+--------------------+---------------+--------------------+------------------+
+ *| PASSIVE_FOCUSED | HAL initiates | PASSIVE_SCAN | Start AF scan |
+ *| | new scan | | Lens now moving |
+ *+--------------------+---------------+--------------------+------------------+
+ *| PASSIVE_UNFOCUSED | HAL initiates | PASSIVE_SCAN | Start AF scan |
+ *| | new scan | | Lens now moving |
+ *+--------------------+---------------+--------------------+------------------+
+ *| PASSIVE_FOCUSED | AF_TRIGGER | FOCUSED_LOCKED | Immediate trans. |
+ *| | | | Lens now locked |
+ *+--------------------+---------------+--------------------+------------------+
+ *| PASSIVE_UNFOCUSED | AF_TRIGGER | NOT_FOCUSED_LOCKED | Immediate trans. |
+ *| | | | Lens now locked |
+ *+--------------------+---------------+--------------------+------------------+
+ *| FOCUSED_LOCKED | AF_TRIGGER | FOCUSED_LOCKED | No effect |
+ *+--------------------+---------------+--------------------+------------------+
+ *| FOCUSED_LOCKED | AF_CANCEL | INACTIVE | Restart AF scan |
+ *+--------------------+---------------+--------------------+------------------+
+ *| NOT_FOCUSED_LOCKED | AF_TRIGGER | NOT_FOCUSED_LOCKED | No effect |
+ *+--------------------+---------------+--------------------+------------------+
+ *| NOT_FOCUSED_LOCKED | AF_CANCEL | INACTIVE | Restart AF scan |
+ *+--------------------+---------------+--------------------+------------------+
+ *
+ * S4.6. AE and AWB state machines
+ *
+ * The AE and AWB state machines are mostly identical. AE has additional
+ * FLASH_REQUIRED and PRECAPTURE states. So rows below that refer to those two
+ * states should be ignored for the AWB state machine.
+ *
+ * when enabling AE/AWB or changing AE/AWB mode
+ *| state | trans. cause | new state | notes |
+ *+--------------------+---------------+--------------------+------------------+
+ *| Any | mode change | INACTIVE | |
+ *+--------------------+---------------+--------------------+------------------+
+ *
+ * mode = AE_MODE_OFF / AWB mode not AUTO
+ *| state | trans. cause | new state | notes |
+ *+--------------------+---------------+--------------------+------------------+
+ *| INACTIVE | | INACTIVE | AE/AWB disabled |
+ *+--------------------+---------------+--------------------+------------------+
+ *
+ * mode = AE_MODE_ON_* / AWB_MODE_AUTO
+ *| state | trans. cause | new state | notes |
+ *+--------------------+---------------+--------------------+------------------+
+ *| INACTIVE | HAL initiates | SEARCHING | |
+ *| | AE/AWB scan | | |
+ *+--------------------+---------------+--------------------+------------------+
+ *| INACTIVE | AE/AWB_LOCK | LOCKED | values locked |
+ *| | on | | |
+ *+--------------------+---------------+--------------------+------------------+
+ *| SEARCHING | HAL finishes | CONVERGED | good values, not |
+ *| | AE/AWB scan | | changing |
+ *+--------------------+---------------+--------------------+------------------+
+ *| SEARCHING | HAL finishes | FLASH_REQUIRED | converged but too|
+ *| | AE scan | | dark w/o flash |
+ *+--------------------+---------------+--------------------+------------------+
+ *| SEARCHING | AE/AWB_LOCK | LOCKED | values locked |
+ *| | on | | |
+ *+--------------------+---------------+--------------------+------------------+
+ *| CONVERGED | HAL initiates | SEARCHING | values locked |
+ *| | AE/AWB scan | | |
+ *+--------------------+---------------+--------------------+------------------+
+ *| CONVERGED | AE/AWB_LOCK | LOCKED | values locked |
+ *| | on | | |
+ *+--------------------+---------------+--------------------+------------------+
+ *| FLASH_REQUIRED | HAL initiates | SEARCHING | values locked |
+ *| | AE/AWB scan | | |
+ *+--------------------+---------------+--------------------+------------------+
+ *| FLASH_REQUIRED | AE/AWB_LOCK | LOCKED | values locked |
+ *| | on | | |
+ *+--------------------+---------------+--------------------+------------------+
+ *| LOCKED | AE/AWB_LOCK | SEARCHING | values not good |
+ *| | off | | after unlock |
+ *+--------------------+---------------+--------------------+------------------+
+ *| LOCKED | AE/AWB_LOCK | CONVERGED | values good |
+ *| | off | | after unlock |
+ *+--------------------+---------------+--------------------+------------------+
+ *| LOCKED | AE_LOCK | FLASH_REQUIRED | exposure good, |
+ *| | off | | but too dark |
+ *+--------------------+---------------+--------------------+------------------+
+ *| All AE states | PRECAPTURE_ | PRECAPTURE | Start precapture |
+ *| | START | | sequence |
+ *+--------------------+---------------+--------------------+------------------+
+ *| PRECAPTURE | Sequence done.| CONVERGED | Ready for high- |
+ *| | AE_LOCK off | | quality capture |
+ *+--------------------+---------------+--------------------+------------------+
+ *| PRECAPTURE | Sequence done.| LOCKED | Ready for high- |
+ *| | AE_LOCK on | | quality capture |
+ *+--------------------+---------------+--------------------+------------------+
+ *
+ */
+
+/**
+ * S5. Cropping:
+ *
+ * Cropping of the full pixel array (for digital zoom and other use cases where
+ * a smaller FOV is desirable) is communicated through the
+ * ANDROID_SCALER_CROP_REGION setting. This is a per-request setting, and can
+ * change on a per-request basis, which is critical for implementing smooth
+ * digital zoom.
+ *
+ * The region is defined as a rectangle (x, y, width, height), with (x, y)
+ * describing the top-left corner of the rectangle. The rectangle is defined on
+ * the coordinate system of the sensor active pixel array, with (0,0) being the
+ * top-left pixel of the active pixel array. Therefore, the width and height
+ * cannot be larger than the dimensions reported in the
+ * ANDROID_SENSOR_ACTIVE_PIXEL_ARRAY static info field. The minimum allowed
+ * width and height are reported by the HAL through the
+ * ANDROID_SCALER_MAX_DIGITAL_ZOOM static info field, which describes the
+ * maximum supported zoom factor. Therefore, the minimum crop region width and
+ * height are:
+ *
+ * {width, height} =
+ * { floor(ANDROID_SENSOR_ACTIVE_PIXEL_ARRAY[0] /
+ * ANDROID_SCALER_MAX_DIGITAL_ZOOM),
+ * floor(ANDROID_SENSOR_ACTIVE_PIXEL_ARRAY[1] /
+ * ANDROID_SCALER_MAX_DIGITAL_ZOOM) }
+ *
+ * If the crop region needs to fulfill specific requirements (for example, it
+ * needs to start on even coordinates, and its width/height needs to be even),
+ * the HAL must do the necessary rounding and write out the final crop region
+ * used in the output result metadata. Similarly, if the HAL implements video
+ * stabilization, it must adjust the result crop region to describe the region
+ * actually included in the output after video stabilization is applied. In
+ * general, a camera-using application must be able to determine the field of
+ * view it is receiving based on the crop region, the dimensions of the image
+ * sensor, and the lens focal length.
+ *
+ * It is assumed that the cropping is applied after raw to other color space
+ * conversion. Raw streams (RAW16 and RAW_OPAQUE) don't have this conversion stage,
+ * and are not croppable. Therefore, the crop region must be ignored by the HAL
+ * for raw streams.
+ *
+ * Since the crop region applies to all non-raw streams, which may have different aspect
+ * ratios than the crop region, the exact sensor region used for each stream may
+ * be smaller than the crop region. Specifically, each stream should maintain
+ * square pixels and its aspect ratio by minimally further cropping the defined
+ * crop region. If the stream's aspect ratio is wider than the crop region, the
+ * stream should be further cropped vertically, and if the stream's aspect ratio
+ * is narrower than the crop region, the stream should be further cropped
+ * horizontally.
+ *
+ * In all cases, the stream crop must be centered within the full crop region,
+ * and each stream is only either cropped horizontally or vertical relative to
+ * the full crop region, never both.
+ *
+ * For example, if two streams are defined, a 640x480 stream (4:3 aspect), and a
+ * 1280x720 stream (16:9 aspect), below demonstrates the expected output regions
+ * for each stream for a few sample crop regions, on a hypothetical 3 MP (2000 x
+ * 1500 pixel array) sensor.
+ *
+ * Crop region: (500, 375, 1000, 750) (4:3 aspect ratio)
+ *
+ * 640x480 stream crop: (500, 375, 1000, 750) (equal to crop region)
+ * 1280x720 stream crop: (500, 469, 1000, 562) (marked with =)
+ *
+ * 0 1000 2000
+ * +---------+---------+---------+----------+
+ * | Active pixel array |
+ * | |
+ * | |
+ * + +-------------------+ + 375
+ * | | | |
+ * | O===================O |
+ * | I 1280x720 stream I |
+ * + I I + 750
+ * | I I |
+ * | O===================O |
+ * | | | |
+ * + +-------------------+ + 1125
+ * | Crop region, 640x480 stream |
+ * | |
+ * | |
+ * +---------+---------+---------+----------+ 1500
+ *
+ * Crop region: (500, 375, 1333, 750) (16:9 aspect ratio)
+ *
+ * 640x480 stream crop: (666, 375, 1000, 750) (marked with =)
+ * 1280x720 stream crop: (500, 375, 1333, 750) (equal to crop region)
+ *
+ * 0 1000 2000
+ * +---------+---------+---------+----------+
+ * | Active pixel array |
+ * | |
+ * | |
+ * + +---O==================O---+ + 375
+ * | | I 640x480 stream I | |
+ * | | I I | |
+ * | | I I | |
+ * + | I I | + 750
+ * | | I I | |
+ * | | I I | |
+ * | | I I | |
+ * + +---O==================O---+ + 1125
+ * | Crop region, 1280x720 stream |
+ * | |
+ * | |
+ * +---------+---------+---------+----------+ 1500
+ *
+ * Crop region: (500, 375, 750, 750) (1:1 aspect ratio)
+ *
+ * 640x480 stream crop: (500, 469, 750, 562) (marked with =)
+ * 1280x720 stream crop: (500, 543, 750, 414) (marged with #)
+ *
+ * 0 1000 2000
+ * +---------+---------+---------+----------+
+ * | Active pixel array |
+ * | |
+ * | |
+ * + +--------------+ + 375
+ * | O==============O |
+ * | ################ |
+ * | # # |
+ * + # # + 750
+ * | # # |
+ * | ################ 1280x720 |
+ * | O==============O 640x480 |
+ * + +--------------+ + 1125
+ * | Crop region |
+ * | |
+ * | |
+ * +---------+---------+---------+----------+ 1500
+ *
+ * And a final example, a 1024x1024 square aspect ratio stream instead of the
+ * 480p stream:
+ *
+ * Crop region: (500, 375, 1000, 750) (4:3 aspect ratio)
+ *
+ * 1024x1024 stream crop: (625, 375, 750, 750) (marked with #)
+ * 1280x720 stream crop: (500, 469, 1000, 562) (marked with =)
+ *
+ * 0 1000 2000
+ * +---------+---------+---------+----------+
+ * | Active pixel array |
+ * | |
+ * | 1024x1024 stream |
+ * + +--###############--+ + 375
+ * | | # # | |
+ * | O===================O |
+ * | I 1280x720 stream I |
+ * + I I + 750
+ * | I I |
+ * | O===================O |
+ * | | # # | |
+ * + +--###############--+ + 1125
+ * | Crop region |
+ * | |
+ * | |
+ * +---------+---------+---------+----------+ 1500
+ *
+ */
+
+/**
+ * S6. Error management:
+ *
+ * Camera HAL device ops functions that have a return value will all return
+ * -ENODEV / NULL in case of a serious error. This means the device cannot
+ * continue operation, and must be closed by the framework. Once this error is
+ * returned by some method, or if notify() is called with ERROR_DEVICE, only
+ * the close() method can be called successfully. All other methods will return
+ * -ENODEV / NULL.
+ *
+ * If a device op is called in the wrong sequence, for example if the framework
+ * calls configure_streams() is called before initialize(), the device must
+ * return -ENOSYS from the call, and do nothing.
+ *
+ * Transient errors in image capture must be reported through notify() as follows:
+ *
+ * - The failure of an entire capture to occur must be reported by the HAL by
+ * calling notify() with ERROR_REQUEST. Individual errors for the result
+ * metadata or the output buffers must not be reported in this case.
+ *
+ * - If the metadata for a capture cannot be produced, but some image buffers
+ * were filled, the HAL must call notify() with ERROR_RESULT.
+ *
+ * - If an output image buffer could not be filled, but either the metadata was
+ * produced or some other buffers were filled, the HAL must call notify() with
+ * ERROR_BUFFER for each failed buffer.
+ *
+ * In each of these transient failure cases, the HAL must still call
+ * process_capture_result, with valid output and input (if an input buffer was
+ * submitted) buffer_handle_t. If the result metadata could not be produced, it
+ * should be NULL. If some buffers could not be filled, they must be returned with
+ * process_capture_result in the error state, their release fences must be set to
+ * the acquire fences passed by the framework, or -1 if they have been waited on by
+ * the HAL already.
+ *
+ * Invalid input arguments result in -EINVAL from the appropriate methods. In
+ * that case, the framework must act as if that call had never been made.
+ *
+ */
+
+/**
+ * S7. Key Performance Indicator (KPI) glossary:
+ *
+ * This includes some critical definitions that are used by KPI metrics.
+ *
+ * Pipeline Latency:
+ * For a given capture request, the duration from the framework calling
+ * process_capture_request to the HAL sending capture result and all buffers
+ * back by process_capture_result call. To make the Pipeline Latency measure
+ * independent of frame rate, it is measured by frame count.
+ *
+ * For example, when frame rate is 30 (fps), the frame duration (time interval
+ * between adjacent frame capture time) is 33 (ms).
+ * If it takes 5 frames for framework to get the result and buffers back for
+ * a given request, then the Pipeline Latency is 5 (frames), instead of
+ * 5 x 33 = 165 (ms).
+ *
+ * The Pipeline Latency is determined by android.request.pipelineDepth and
+ * android.request.pipelineMaxDepth, see their definitions for more details.
+ *
+ */
+
+/**
+ * S8. Sample Use Cases:
+ *
+ * This includes some typical use case examples the camera HAL may support.
+ *
+ * S8.1 Zero Shutter Lag (ZSL) with CAMERA3_STREAM_BIDIRECTIONAL stream.
+ *
+ * For this use case, the bidirectional stream will be used by the framework as follows:
+ *
+ * 1. The framework includes a buffer from this stream as output buffer in a
+ * request as normal.
+ *
+ * 2. Once the HAL device returns a filled output buffer to the framework,
+ * the framework may do one of two things with the filled buffer:
+ *
+ * 2. a. The framework uses the filled data, and returns the now-used buffer
+ * to the stream queue for reuse. This behavior exactly matches the
+ * OUTPUT type of stream.
+ *
+ * 2. b. The framework wants to reprocess the filled data, and uses the
+ * buffer as an input buffer for a request. Once the HAL device has
+ * used the reprocessing buffer, it then returns it to the
+ * framework. The framework then returns the now-used buffer to the
+ * stream queue for reuse.
+ *
+ * 3. The HAL device will be given the buffer again as an output buffer for
+ * a request at some future point.
+ *
+ * For ZSL use case, the pixel format for bidirectional stream will be
+ * HAL_PIXEL_FORMAT_RAW_OPAQUE or HAL_PIXEL_FORMAT_IMPLEMENTATION_DEFINED if it
+ * is listed in android.scaler.availableInputOutputFormatsMap. When
+ * HAL_PIXEL_FORMAT_IMPLEMENTATION_DEFINED is used, the gralloc
+ * usage flags for the consumer endpoint will be set to GRALLOC_USAGE_HW_CAMERA_ZSL.
+ * A configuration stream list that has BIDIRECTIONAL stream used as input, will
+ * usually also have a distinct OUTPUT stream to get the reprocessing data. For example,
+ * for the ZSL use case, the stream list might be configured with the following:
+ *
+ * - A HAL_PIXEL_FORMAT_RAW_OPAQUE bidirectional stream is used
+ * as input.
+ * - And a HAL_PIXEL_FORMAT_BLOB (JPEG) output stream.
+ *
+ * S8.2 ZSL (OPAQUE) reprocessing with CAMERA3_STREAM_INPUT stream.
+ *
+ * CAMERA_DEVICE_API_VERSION_3_3:
+ * When OPAQUE_REPROCESSING capability is supported by the camera device, the INPUT stream
+ * can be used for application/framework implemented use case like Zero Shutter Lag (ZSL).
+ * This kind of stream will be used by the framework as follows:
+ *
+ * 1. Application/framework configures an opaque (RAW or YUV based) format output stream that is
+ * used to produce the ZSL output buffers. The stream pixel format will be
+ * HAL_PIXEL_FORMAT_IMPLEMENTATION_DEFINED.
+ *
+ * 2. Application/framework configures an opaque format input stream that is used to
+ * send the reprocessing ZSL buffers to the HAL. The stream pixel format will
+ * also be HAL_PIXEL_FORMAT_IMPLEMENTATION_DEFINED.
+ *
+ * 3. Application/framework configures a YUV/JPEG output stream that is used to receive the
+ * reprocessed data. The stream pixel format will be YCbCr_420/HAL_PIXEL_FORMAT_BLOB.
+ *
+ * 4. Application/framework picks a ZSL buffer from the ZSL output stream when a ZSL capture is
+ * issued by the application, and sends the data back as an input buffer in a
+ * reprocessing request, then sends to the HAL for reprocessing.
+ *
+ * 5. The HAL sends back the output YUV/JPEG result to framework.
+ *
+ * The HAL can select the actual opaque buffer format and configure the ISP pipeline
+ * appropriately based on the HAL_PIXEL_FORMAT_IMPLEMENTATION_DEFINED format and
+ * the gralloc usage flag GRALLOC_USAGE_HW_CAMERA_ZSL.
+
+ * S8.3 YUV reprocessing with CAMERA3_STREAM_INPUT stream.
+ *
+ * When YUV reprocessing is supported by the HAL, the INPUT stream
+ * can be used for the YUV reprocessing use cases like lucky-shot and image fusion.
+ * This kind of stream will be used by the framework as follows:
+ *
+ * 1. Application/framework configures an YCbCr_420 format output stream that is
+ * used to produce the output buffers.
+ *
+ * 2. Application/framework configures an YCbCr_420 format input stream that is used to
+ * send the reprocessing YUV buffers to the HAL.
+ *
+ * 3. Application/framework configures a YUV/JPEG output stream that is used to receive the
+ * reprocessed data. The stream pixel format will be YCbCr_420/HAL_PIXEL_FORMAT_BLOB.
+ *
+ * 4. Application/framework processes the output buffers (could be as simple as picking
+ * an output buffer directly) from the output stream when a capture is issued, and sends
+ * the data back as an input buffer in a reprocessing request, then sends to the HAL
+ * for reprocessing.
+ *
+ * 5. The HAL sends back the output YUV/JPEG result to framework.
+ *
+ */
+
+/**
+ * S9. Notes on Controls and Metadata
+ *
+ * This section contains notes about the interpretation and usage of various metadata tags.
+ *
+ * S9.1 HIGH_QUALITY and FAST modes.
+ *
+ * Many camera post-processing blocks may be listed as having HIGH_QUALITY,
+ * FAST, and OFF operating modes. These blocks will typically also have an
+ * 'available modes' tag representing which of these operating modes are
+ * available on a given device. The general policy regarding implementing
+ * these modes is as follows:
+ *
+ * 1. Operating mode controls of hardware blocks that cannot be disabled
+ * must not list OFF in their corresponding 'available modes' tags.
+ *
+ * 2. OFF will always be included in their corresponding 'available modes'
+ * tag if it is possible to disable that hardware block.
+ *
+ * 3. FAST must always be included in the 'available modes' tags for all
+ * post-processing blocks supported on the device. If a post-processing
+ * block also has a slower and higher quality operating mode that does
+ * not meet the framerate requirements for FAST mode, HIGH_QUALITY should
+ * be included in the 'available modes' tag to represent this operating
+ * mode.
+ */
+
+/**
+ * S10. Reprocessing flow and controls
+ *
+ * This section describes the OPAQUE and YUV reprocessing flow and controls. OPAQUE reprocessing
+ * uses an opaque format that is not directly application-visible, and the application can
+ * only select some of the output buffers and send back to HAL for reprocessing, while YUV
+ * reprocessing gives the application opportunity to process the buffers before reprocessing.
+ *
+ * S8 gives the stream configurations for the typical reprocessing uses cases,
+ * this section specifies the buffer flow and controls in more details.
+ *
+ * S10.1 OPAQUE (typically for ZSL use case) reprocessing flow and controls
+ *
+ * For OPAQUE reprocessing (e.g. ZSL) use case, after the application creates the specific
+ * output and input streams, runtime buffer flow and controls are specified as below:
+ *
+ * 1. Application starts output streaming by sending repeating requests for output
+ * opaque buffers and preview. The buffers are held by an application
+ * maintained circular buffer. The requests are based on CAMERA3_TEMPLATE_ZERO_SHUTTER_LAG
+ * capture template, which should have all necessary settings that guarantee output
+ * frame rate is not slowed down relative to sensor output frame rate.
+ *
+ * 2. When a capture is issued, the application selects one output buffer based
+ * on application buffer selection logic, e.g. good AE and AF statistics etc.
+ * Application then creates an reprocess request based on the capture result associated
+ * with this selected buffer. The selected output buffer is now added to this reprocess
+ * request as an input buffer, the output buffer of this reprocess request should be
+ * either JPEG output buffer or YUV output buffer, or both, depending on the application
+ * choice.
+ *
+ * 3. Application then alters the reprocess settings to get best image quality. The HAL must
+ * support and only support below controls if the HAL support OPAQUE_REPROCESSING capability:
+ * - android.jpeg.* (if JPEG buffer is included as one of the output)
+ * - android.noiseReduction.mode (change to HIGH_QUALITY if it is supported)
+ * - android.edge.mode (change to HIGH_QUALITY if it is supported)
+ * All other controls must be ignored by the HAL.
+ * 4. HAL processed the input buffer and return the output buffers in the capture results
+ * as normal.
+ *
+ * S10.2 YUV reprocessing flow and controls
+ *
+ * The YUV reprocessing buffer flow is similar as OPAQUE reprocessing, with below difference:
+ *
+ * 1. Application may want to have finer granularity control of the intermediate YUV images
+ * (before reprocessing). For example, application may choose
+ * - android.noiseReduction.mode == MINIMAL
+ * to make sure the no YUV domain noise reduction has applied to the output YUV buffers,
+ * then it can do its own advanced noise reduction on them. For OPAQUE reprocessing case, this
+ * doesn't matter, as long as the final reprocessed image has the best quality.
+ * 2. Application may modify the YUV output buffer data. For example, for image fusion use
+ * case, where multiple output images are merged together to improve the signal-to-noise
+ * ratio (SNR). The input buffer may be generated from multiple buffers by the application.
+ * To avoid excessive amount of noise reduction and insufficient amount of edge enhancement
+ * being applied to the input buffer, the application can hint the HAL how much effective
+ * exposure time improvement has been done by the application, then the HAL can adjust the
+ * noise reduction and edge enhancement parameters to get best reprocessed image quality.
+ * Below tag can be used for this purpose:
+ * - android.reprocess.effectiveExposureFactor
+ * The value would be exposure time increase factor applied to the original output image,
+ * for example, if there are N image merged, the exposure time increase factor would be up
+ * to sqrt(N). See this tag spec for more details.
+ *
+ * S10.3 Reprocessing pipeline characteristics
+ *
+ * Reprocessing pipeline has below different characteristics comparing with normal output
+ * pipeline:
+ *
+ * 1. The reprocessing result can be returned ahead of the pending normal output results. But
+ * the FIFO ordering must be maintained for all reprocessing results. For example, there are
+ * below requests (A stands for output requests, B stands for reprocessing requests)
+ * being processed by the HAL:
+ * A1, A2, A3, A4, B1, A5, B2, A6...
+ * result of B1 can be returned before A1-A4, but result of B2 must be returned after B1.
+ * 2. Single input rule: For a given reprocessing request, all output buffers must be from the
+ * input buffer, rather than sensor output. For example, if a reprocess request include both
+ * JPEG and preview buffers, all output buffers must be produced from the input buffer
+ * included by the reprocessing request, rather than sensor. The HAL must not output preview
+ * buffers from sensor, while output JPEG buffer from the input buffer.
+ * 3. Input buffer will be from camera output directly (ZSL case) or indirectly(image fusion
+ * case). For the case where buffer is modified, the size will remain same. The HAL can
+ * notify CAMERA3_MSG_ERROR_REQUEST if buffer from unknown source is sent.
+ * 4. Result as reprocessing request: The HAL can expect that a reprocessing request is a copy
+ * of one of the output results with minor allowed setting changes. The HAL can notify
+ * CAMERA3_MSG_ERROR_REQUEST if a request from unknown source is issued.
+ * 5. Output buffers may not be used as inputs across the configure stream boundary, This is
+ * because an opaque stream like the ZSL output stream may have different actual image size
+ * inside of the ZSL buffer to save power and bandwidth for smaller resolution JPEG capture.
+ * The HAL may notify CAMERA3_MSG_ERROR_REQUEST if this case occurs.
+ * 6. HAL Reprocess requests error reporting during flush should follow the same rule specified
+ * by flush() method.
+ *
+ */
+
+__BEGIN_DECLS
+
+struct camera3_device;
+
+/**********************************************************************
+ *
+ * Camera3 stream and stream buffer definitions.
+ *
+ * These structs and enums define the handles and contents of the input and
+ * output streams connecting the HAL to various framework and application buffer
+ * consumers. Each stream is backed by a gralloc buffer queue.
+ *
+ */
+
+/**
+ * camera3_stream_type_t:
+ *
+ * The type of the camera stream, which defines whether the camera HAL device is
+ * the producer or the consumer for that stream, and how the buffers of the
+ * stream relate to the other streams.
+ */
+typedef enum camera3_stream_type {
+ /**
+ * This stream is an output stream; the camera HAL device will be
+ * responsible for filling buffers from this stream with newly captured or
+ * reprocessed image data.
+ */
+ CAMERA3_STREAM_OUTPUT = 0,
+
+ /**
+ * This stream is an input stream; the camera HAL device will be responsible
+ * for reading buffers from this stream and sending them through the camera
+ * processing pipeline, as if the buffer was a newly captured image from the
+ * imager.
+ *
+ * The pixel format for input stream can be any format reported by
+ * android.scaler.availableInputOutputFormatsMap. The pixel format of the
+ * output stream that is used to produce the reprocessing data may be any
+ * format reported by android.scaler.availableStreamConfigurations. The
+ * supported input/output stream combinations depends the camera device
+ * capabilities, see android.scaler.availableInputOutputFormatsMap for
+ * stream map details.
+ *
+ * This kind of stream is generally used to reprocess data into higher
+ * quality images (that otherwise would cause a frame rate performance
+ * loss), or to do off-line reprocessing.
+ *
+ * CAMERA_DEVICE_API_VERSION_3_3:
+ * The typical use cases are OPAQUE (typically ZSL) and YUV reprocessing,
+ * see S8.2, S8.3 and S10 for more details.
+ */
+ CAMERA3_STREAM_INPUT = 1,
+
+ /**
+ * This stream can be used for input and output. Typically, the stream is
+ * used as an output stream, but occasionally one already-filled buffer may
+ * be sent back to the HAL device for reprocessing.
+ *
+ * This kind of stream is meant generally for Zero Shutter Lag (ZSL)
+ * features, where copying the captured image from the output buffer to the
+ * reprocessing input buffer would be expensive. See S8.1 for more details.
+ *
+ * Note that the HAL will always be reprocessing data it produced.
+ *
+ */
+ CAMERA3_STREAM_BIDIRECTIONAL = 2,
+
+ /**
+ * Total number of framework-defined stream types
+ */
+ CAMERA3_NUM_STREAM_TYPES
+
+} camera3_stream_type_t;
+
+/**
+ * camera3_stream_rotation_t:
+ *
+ * The required counterclockwise rotation of camera stream.
+ */
+typedef enum camera3_stream_rotation {
+ /* No rotation */
+ CAMERA3_STREAM_ROTATION_0 = 0,
+
+ /* Rotate by 90 degree counterclockwise */
+ CAMERA3_STREAM_ROTATION_90 = 1,
+
+ /* Rotate by 180 degree counterclockwise */
+ CAMERA3_STREAM_ROTATION_180 = 2,
+
+ /* Rotate by 270 degree counterclockwise */
+ CAMERA3_STREAM_ROTATION_270 = 3
+} camera3_stream_rotation_t;
+
+/**
+ * camera3_stream_configuration_mode_t:
+ *
+ * This defines the general operation mode for the HAL (for a given stream configuration), where
+ * modes besides NORMAL have different semantics, and usually limit the generality of the API in
+ * exchange for higher performance in some particular area.
+ */
+typedef enum camera3_stream_configuration_mode {
+ /**
+ * Normal stream configuration operation mode. This is the default camera operation mode,
+ * where all semantics of HAL APIs and metadata controls apply.
+ */
+ CAMERA3_STREAM_CONFIGURATION_NORMAL_MODE = 0,
+
+ /**
+ * Special constrained high speed operation mode for devices that can not support high
+ * speed output in NORMAL mode. All streams in this configuration are operating at high speed
+ * mode and have different characteristics and limitations to achieve high speed output.
+ * The NORMAL mode can still be used for high speed output if the HAL can support high speed
+ * output while satisfying all the semantics of HAL APIs and metadata controls. It is
+ * recommended for the HAL to support high speed output in NORMAL mode (by advertising the high
+ * speed FPS ranges in android.control.aeAvailableTargetFpsRanges) if possible.
+ *
+ * This mode has below limitations/requirements:
+ *
+ * 1. The HAL must support up to 2 streams with sizes reported by
+ * android.control.availableHighSpeedVideoConfigurations.
+ * 2. In this mode, the HAL is expected to output up to 120fps or higher. This mode must
+ * support the targeted FPS range and size configurations reported by
+ * android.control.availableHighSpeedVideoConfigurations.
+ * 3. The HAL must support HAL_PIXEL_FORMAT_IMPLEMENTATION_DEFINED output stream format.
+ * 4. To achieve efficient high speed streaming, the HAL may have to aggregate
+ * multiple frames together and send to camera device for processing where the request
+ * controls are same for all the frames in this batch (batch mode). The HAL must support
+ * max batch size and the max batch size requirements defined by
+ * android.control.availableHighSpeedVideoConfigurations.
+ * 5. In this mode, the HAL must override aeMode, awbMode, and afMode to ON, ON, and
+ * CONTINUOUS_VIDEO, respectively. All post-processing block mode controls must be
+ * overridden to be FAST. Therefore, no manual control of capture and post-processing
+ * parameters is possible. All other controls operate the same as when
+ * android.control.mode == AUTO. This means that all other android.control.* fields
+ * must continue to work, such as
+ *
+ * android.control.aeTargetFpsRange
+ * android.control.aeExposureCompensation
+ * android.control.aeLock
+ * android.control.awbLock
+ * android.control.effectMode
+ * android.control.aeRegions
+ * android.control.afRegions
+ * android.control.awbRegions
+ * android.control.afTrigger
+ * android.control.aePrecaptureTrigger
+ *
+ * Outside of android.control.*, the following controls must work:
+ *
+ * android.flash.mode (TORCH mode only, automatic flash for still capture will not work
+ * since aeMode is ON)
+ * android.lens.opticalStabilizationMode (if it is supported)
+ * android.scaler.cropRegion
+ * android.statistics.faceDetectMode (if it is supported)
+ * 6. To reduce the amount of data passed across process boundaries at
+ * high frame rate, within one batch, camera framework only propagates
+ * the last shutter notify and the last capture results (including partial
+ * results and final result) to the app. The shutter notifies and capture
+ * results for the other requests in the batch are derived by
+ * the camera framework. As a result, the HAL can return empty metadata
+ * except for the last result in the batch.
+ *
+ * For more details about high speed stream requirements, see
+ * android.control.availableHighSpeedVideoConfigurations and CONSTRAINED_HIGH_SPEED_VIDEO
+ * capability defined in android.request.availableCapabilities.
+ *
+ * This mode only needs to be supported by HALs that include CONSTRAINED_HIGH_SPEED_VIDEO in
+ * the android.request.availableCapabilities static metadata.
+ */
+ CAMERA3_STREAM_CONFIGURATION_CONSTRAINED_HIGH_SPEED_MODE = 1,
+
+ /**
+ * First value for vendor-defined stream configuration modes.
+ */
+ CAMERA3_VENDOR_STREAM_CONFIGURATION_MODE_START = 0x8000
+} camera3_stream_configuration_mode_t;
+
+/**
+ * camera3_stream_t:
+ *
+ * A handle to a single camera input or output stream. A stream is defined by
+ * the framework by its buffer resolution and format, and additionally by the
+ * HAL with the gralloc usage flags and the maximum in-flight buffer count.
+ *
+ * The stream structures are owned by the framework, but pointers to a
+ * camera3_stream passed into the HAL by configure_streams() are valid until the
+ * end of the first subsequent configure_streams() call that _does not_ include
+ * that camera3_stream as an argument, or until the end of the close() call.
+ *
+ * All camera3_stream framework-controlled members are immutable once the
+ * camera3_stream is passed into configure_streams(). The HAL may only change
+ * the HAL-controlled parameters during a configure_streams() call, except for
+ * the contents of the private pointer.
+ *
+ * If a configure_streams() call returns a non-fatal error, all active streams
+ * remain valid as if configure_streams() had not been called.
+ *
+ * The endpoint of the stream is not visible to the camera HAL device.
+ * In DEVICE_API_VERSION_3_1, this was changed to share consumer usage flags
+ * on streams where the camera is a producer (OUTPUT and BIDIRECTIONAL stream
+ * types) see the usage field below.
+ */
+typedef struct camera3_stream {
+
+ /*****
+ * Set by framework before configure_streams()
+ */
+
+ /**
+ * The type of the stream, one of the camera3_stream_type_t values.
+ */
+ int stream_type;
+
+ /**
+ * The width in pixels of the buffers in this stream
+ */
+ uint32_t width;
+
+ /**
+ * The height in pixels of the buffers in this stream
+ */
+ uint32_t height;
+
+ /**
+ * The pixel format for the buffers in this stream. Format is a value from
+ * the HAL_PIXEL_FORMAT_* list in system/core/include/system/graphics.h, or
+ * from device-specific headers.
+ *
+ * If HAL_PIXEL_FORMAT_IMPLEMENTATION_DEFINED is used, then the platform
+ * gralloc module will select a format based on the usage flags provided by
+ * the camera device and the other endpoint of the stream.
+ *
+ * <= CAMERA_DEVICE_API_VERSION_3_1:
+ *
+ * The camera HAL device must inspect the buffers handed to it in the
+ * subsequent register_stream_buffers() call to obtain the
+ * implementation-specific format details, if necessary.
+ *
+ * >= CAMERA_DEVICE_API_VERSION_3_2:
+ *
+ * register_stream_buffers() won't be called by the framework, so the HAL
+ * should configure the ISP and sensor pipeline based purely on the sizes,
+ * usage flags, and formats for the configured streams.
+ */
+ int format;
+
+ /*****
+ * Set by HAL during configure_streams().
+ */
+
+ /**
+ * The gralloc usage flags for this stream, as needed by the HAL. The usage
+ * flags are defined in gralloc.h (GRALLOC_USAGE_*), or in device-specific
+ * headers.
+ *
+ * For output streams, these are the HAL's producer usage flags. For input
+ * streams, these are the HAL's consumer usage flags. The usage flags from
+ * the producer and the consumer will be combined together and then passed
+ * to the platform gralloc HAL module for allocating the gralloc buffers for
+ * each stream.
+ *
+ * Version information:
+ *
+ * == CAMERA_DEVICE_API_VERSION_3_0:
+ *
+ * No initial value guaranteed when passed via configure_streams().
+ * HAL may not use this field as input, and must write over this field
+ * with its usage flags.
+ *
+ * >= CAMERA_DEVICE_API_VERSION_3_1:
+ *
+ * For stream_type OUTPUT and BIDIRECTIONAL, when passed via
+ * configure_streams(), the initial value of this is the consumer's
+ * usage flags. The HAL may use these consumer flags to decide stream
+ * configuration.
+ * For stream_type INPUT, when passed via configure_streams(), the initial
+ * value of this is 0.
+ * For all streams passed via configure_streams(), the HAL must write
+ * over this field with its usage flags.
+ *
+ * From Android O, the usage flag for an output stream may be bitwise
+ * combination of usage flags for multiple consumers, for the purpose of
+ * sharing one camera stream between those consumers. The HAL must fail
+ * configure_streams call with -EINVAL if the combined flags cannot be
+ * supported due to imcompatible buffer format, dataSpace, or other hardware
+ * limitations.
+ */
+ uint32_t usage;
+
+ /**
+ * The maximum number of buffers the HAL device may need to have dequeued at
+ * the same time. The HAL device may not have more buffers in-flight from
+ * this stream than this value.
+ */
+ uint32_t max_buffers;
+
+ /**
+ * A handle to HAL-private information for the stream. Will not be inspected
+ * by the framework code.
+ */
+ void *priv;
+
+ /**
+ * A field that describes the contents of the buffer. The format and buffer
+ * dimensions define the memory layout and structure of the stream buffers,
+ * while dataSpace defines the meaning of the data within the buffer.
+ *
+ * For most formats, dataSpace defines the color space of the image data.
+ * In addition, for some formats, dataSpace indicates whether image- or
+ * depth-based data is requested. See system/core/include/system/graphics.h
+ * for details of formats and valid dataSpace values for each format.
+ *
+ * Version information:
+ *
+ * < CAMERA_DEVICE_API_VERSION_3_3:
+ *
+ * Not defined and should not be accessed. dataSpace should be assumed to
+ * be HAL_DATASPACE_UNKNOWN, and the appropriate color space, etc, should
+ * be determined from the usage flags and the format.
+ *
+ * = CAMERA_DEVICE_API_VERSION_3_3:
+ *
+ * Always set by the camera service. HAL must use this dataSpace to
+ * configure the stream to the correct colorspace, or to select between
+ * color and depth outputs if supported. The dataspace values are the
+ * legacy definitions in graphics.h
+ *
+ * >= CAMERA_DEVICE_API_VERSION_3_4:
+ *
+ * Always set by the camera service. HAL must use this dataSpace to
+ * configure the stream to the correct colorspace, or to select between
+ * color and depth outputs if supported. The dataspace values are set
+ * using the V0 dataspace definitions in graphics.h
+ */
+ android_dataspace_t data_space;
+
+ /**
+ * The required output rotation of the stream, one of
+ * the camera3_stream_rotation_t values. This must be inspected by HAL along
+ * with stream width and height. For example, if the rotation is 90 degree
+ * and the stream width and height is 720 and 1280 respectively, camera service
+ * will supply buffers of size 720x1280, and HAL should capture a 1280x720 image
+ * and rotate the image by 90 degree counterclockwise. The rotation field is
+ * no-op when the stream type is input. Camera HAL must ignore the rotation
+ * field for an input stream.
+ *
+ * <= CAMERA_DEVICE_API_VERSION_3_2:
+ *
+ * Not defined and must not be accessed. HAL must not apply any rotation
+ * on output images.
+ *
+ * >= CAMERA_DEVICE_API_VERSION_3_3:
+ *
+ * Always set by camera service. HAL must inspect this field during stream
+ * configuration and returns -EINVAL if HAL cannot perform such rotation.
+ * HAL must always support CAMERA3_STREAM_ROTATION_0, so a
+ * configure_streams() call must not fail for unsupported rotation if
+ * rotation field of all streams is CAMERA3_STREAM_ROTATION_0.
+ *
+ */
+ int rotation;
+
+ /**
+ * The physical camera id this stream belongs to.
+ *
+ * <= CAMERA_DEVICE_API_VERISON_3_4:
+ *
+ * Not defined and must not be accessed.
+ *
+ * >= CAMERA_DEVICE_API_VERISON_3_5:
+ *
+ * Always set by camera service. If the camera device is not a logical
+ * multi camera, or if the camera is a logical multi camera but the stream
+ * is not a physical output stream, this field will point to a 0-length
+ * string.
+ *
+ * A logical multi camera is a camera device backed by multiple physical
+ * cameras that are also exposed to the application. And for a logical
+ * multi camera, a physical output stream is an output stream specifically
+ * requested on an underlying physical camera.
+ *
+ * For an input stream, this field is guaranteed to be a 0-length string.
+ */
+ const char* physical_camera_id;
+
+ /* reserved for future use */
+ void *reserved[6];
+
+} camera3_stream_t;
+
+/**
+ * camera3_stream_configuration_t:
+ *
+ * A structure of stream definitions, used by configure_streams(). This
+ * structure defines all the output streams and the reprocessing input
+ * stream for the current camera use case.
+ */
+typedef struct camera3_stream_configuration {
+ /**
+ * The total number of streams requested by the framework. This includes
+ * both input and output streams. The number of streams will be at least 1,
+ * and there will be at least one output-capable stream.
+ */
+ uint32_t num_streams;
+
+ /**
+ * An array of camera stream pointers, defining the input/output
+ * configuration for the camera HAL device.
+ *
+ * At most one input-capable stream may be defined (INPUT or BIDIRECTIONAL)
+ * in a single configuration.
+ *
+ * At least one output-capable stream must be defined (OUTPUT or
+ * BIDIRECTIONAL).
+ */
+ camera3_stream_t **streams;
+
+ /**
+ * >= CAMERA_DEVICE_API_VERSION_3_3:
+ *
+ * The operation mode of streams in this configuration, one of the value
+ * defined in camera3_stream_configuration_mode_t. The HAL can use this
+ * mode as an indicator to set the stream property (e.g.,
+ * camera3_stream->max_buffers) appropriately. For example, if the
+ * configuration is
+ * CAMERA3_STREAM_CONFIGURATION_CONSTRAINED_HIGH_SPEED_MODE, the HAL may
+ * want to set aside more buffers for batch mode operation (see
+ * android.control.availableHighSpeedVideoConfigurations for batch mode
+ * definition).
+ *
+ */
+ uint32_t operation_mode;
+
+ /**
+ * >= CAMERA_DEVICE_API_VERSION_3_5:
+ *
+ * The session metadata buffer contains the initial values of
+ * ANDROID_REQUEST_AVAILABLE_SESSION_KEYS. This field is optional
+ * and camera clients can choose to ignore it, in which case it will
+ * be set to NULL. If parameters are present, then Hal should examine
+ * the parameter values and configure its internal camera pipeline
+ * accordingly.
+ */
+ const camera_metadata_t *session_parameters;
+} camera3_stream_configuration_t;
+
+/**
+ * camera3_buffer_status_t:
+ *
+ * The current status of a single stream buffer.
+ */
+typedef enum camera3_buffer_status {
+ /**
+ * The buffer is in a normal state, and can be used after waiting on its
+ * sync fence.
+ */
+ CAMERA3_BUFFER_STATUS_OK = 0,
+
+ /**
+ * The buffer does not contain valid data, and the data in it should not be
+ * used. The sync fence must still be waited on before reusing the buffer.
+ */
+ CAMERA3_BUFFER_STATUS_ERROR = 1
+
+} camera3_buffer_status_t;
+
+/**
+ * camera3_stream_buffer_t:
+ *
+ * A single buffer from a camera3 stream. It includes a handle to its parent
+ * stream, the handle to the gralloc buffer itself, and sync fences
+ *
+ * The buffer does not specify whether it is to be used for input or output;
+ * that is determined by its parent stream type and how the buffer is passed to
+ * the HAL device.
+ */
+typedef struct camera3_stream_buffer {
+ /**
+ * The handle of the stream this buffer is associated with
+ */
+ camera3_stream_t *stream;
+
+ /**
+ * The native handle to the buffer
+ */
+ buffer_handle_t *buffer;
+
+ /**
+ * Current state of the buffer, one of the camera3_buffer_status_t
+ * values. The framework will not pass buffers to the HAL that are in an
+ * error state. In case a buffer could not be filled by the HAL, it must
+ * have its status set to CAMERA3_BUFFER_STATUS_ERROR when returned to the
+ * framework with process_capture_result().
+ */
+ int status;
+
+ /**
+ * The acquire sync fence for this buffer. The HAL must wait on this fence
+ * fd before attempting to read from or write to this buffer.
+ *
+ * The framework may be set to -1 to indicate that no waiting is necessary
+ * for this buffer.
+ *
+ * When the HAL returns an output buffer to the framework with
+ * process_capture_result(), the acquire_fence must be set to -1. If the HAL
+ * never waits on the acquire_fence due to an error in filling a buffer,
+ * when calling process_capture_result() the HAL must set the release_fence
+ * of the buffer to be the acquire_fence passed to it by the framework. This
+ * will allow the framework to wait on the fence before reusing the buffer.
+ *
+ * For input buffers, the HAL must not change the acquire_fence field during
+ * the process_capture_request() call.
+ *
+ * >= CAMERA_DEVICE_API_VERSION_3_2:
+ *
+ * When the HAL returns an input buffer to the framework with
+ * process_capture_result(), the acquire_fence must be set to -1. If the HAL
+ * never waits on input buffer acquire fence due to an error, the sync
+ * fences should be handled similarly to the way they are handled for output
+ * buffers.
+ */
+ int acquire_fence;
+
+ /**
+ * The release sync fence for this buffer. The HAL must set this fence when
+ * returning buffers to the framework, or write -1 to indicate that no
+ * waiting is required for this buffer.
+ *
+ * For the output buffers, the fences must be set in the output_buffers
+ * array passed to process_capture_result().
+ *
+ * <= CAMERA_DEVICE_API_VERSION_3_1:
+ *
+ * For the input buffer, the release fence must be set by the
+ * process_capture_request() call.
+ *
+ * >= CAMERA_DEVICE_API_VERSION_3_2:
+ *
+ * For the input buffer, the fences must be set in the input_buffer
+ * passed to process_capture_result().
+ *
+ * After signaling the release_fence for this buffer, the HAL
+ * should not make any further attempts to access this buffer as the
+ * ownership has been fully transferred back to the framework.
+ *
+ * If a fence of -1 was specified then the ownership of this buffer
+ * is transferred back immediately upon the call of process_capture_result.
+ */
+ int release_fence;
+
+} camera3_stream_buffer_t;
+
+/**
+ * camera3_stream_buffer_set_t:
+ *
+ * The complete set of gralloc buffers for a stream. This structure is given to
+ * register_stream_buffers() to allow the camera HAL device to register/map/etc
+ * newly allocated stream buffers.
+ *
+ * >= CAMERA_DEVICE_API_VERSION_3_2:
+ *
+ * Deprecated (and not used). In particular,
+ * register_stream_buffers is also deprecated and will never be invoked.
+ *
+ */
+typedef struct camera3_stream_buffer_set {
+ /**
+ * The stream handle for the stream these buffers belong to
+ */
+ camera3_stream_t *stream;
+
+ /**
+ * The number of buffers in this stream. It is guaranteed to be at least
+ * stream->max_buffers.
+ */
+ uint32_t num_buffers;
+
+ /**
+ * The array of gralloc buffer handles for this stream. If the stream format
+ * is set to HAL_PIXEL_FORMAT_IMPLEMENTATION_DEFINED, the camera HAL device
+ * should inspect the passed-in buffers to determine any platform-private
+ * pixel format information.
+ */
+ buffer_handle_t **buffers;
+
+} camera3_stream_buffer_set_t;
+
+/**
+ * camera3_jpeg_blob:
+ *
+ * Transport header for compressed JPEG or JPEG_APP_SEGMENTS buffers in output streams.
+ *
+ * To capture JPEG or JPEG_APP_SEGMENTS images, a stream is created using the pixel format
+ * HAL_PIXEL_FORMAT_BLOB. The buffer size for the stream is calculated by the
+ * framework, based on the static metadata field android.jpeg.maxSize for JPEG,
+ * and android.jpeg.maxAppsSegments for JPEG_APP_SEGMENTS.
+ *
+ * Since compressed JPEG/JPEG_APP_SEGMENTS images are of variable size, the HAL needs to
+ * include the final size of the image using this structure inside the output
+ * stream buffer. The JPEG blob ID field must be set to CAMERA3_JPEG_BLOB_ID for
+ * JPEG and CAMERA3_JPEG_APP_SEGMENTS_BLOB_ID for APP segments.
+ *
+ * Transport header should be at the end of the output stream buffer. That
+ * means the jpeg_blob_id must start at byte[buffer_size -
+ * sizeof(camera3_jpeg_blob)], where the buffer_size is the size of gralloc buffer.
+ * The blob data itself starts at the beginning of the buffer and should be
+ * jpeg_size bytes long. HAL using this transport header for JPEG must account for
+ * it in android.jpeg.maxSize. For JPEG APP segments, camera framework makes
+ * sure that the output stream buffer is large enough for the transport header.
+ */
+typedef struct camera3_jpeg_blob {
+ uint16_t jpeg_blob_id;
+ uint32_t jpeg_size;
+} camera3_jpeg_blob_t;
+
+enum {
+ CAMERA3_JPEG_BLOB_ID = 0x00FF,
+ CAMERA3_JPEG_APP_SEGMENTS_BLOB_ID = 0x0100,
+};
+
+/**********************************************************************
+ *
+ * Message definitions for the HAL notify() callback.
+ *
+ * These definitions are used for the HAL notify callback, to signal
+ * asynchronous events from the HAL device to the Android framework.
+ *
+ */
+
+/**
+ * camera3_msg_type:
+ *
+ * Indicates the type of message sent, which specifies which member of the
+ * message union is valid.
+ *
+ */
+typedef enum camera3_msg_type {
+ /**
+ * An error has occurred. camera3_notify_msg.message.error contains the
+ * error information.
+ */
+ CAMERA3_MSG_ERROR = 1,
+
+ /**
+ * The exposure of a given request or processing a reprocess request has
+ * begun. camera3_notify_msg.message.shutter contains the information
+ * the capture.
+ */
+ CAMERA3_MSG_SHUTTER = 2,
+
+ /**
+ * Number of framework message types
+ */
+ CAMERA3_NUM_MESSAGES
+
+} camera3_msg_type_t;
+
+/**
+ * Defined error codes for CAMERA_MSG_ERROR
+ */
+typedef enum camera3_error_msg_code {
+ /**
+ * A serious failure occured. No further frames or buffer streams will
+ * be produced by the device. Device should be treated as closed. The
+ * client must reopen the device to use it again. The frame_number field
+ * is unused.
+ */
+ CAMERA3_MSG_ERROR_DEVICE = 1,
+
+ /**
+ * An error has occurred in processing a request. No output (metadata or
+ * buffers) will be produced for this request. The frame_number field
+ * specifies which request has been dropped. Subsequent requests are
+ * unaffected, and the device remains operational.
+ */
+ CAMERA3_MSG_ERROR_REQUEST = 2,
+
+ /**
+ * An error has occurred in producing an output result metadata buffer
+ * for a request, but output stream buffers for it will still be
+ * available. Subsequent requests are unaffected, and the device remains
+ * operational. The frame_number field specifies the request for which
+ * result metadata won't be available.
+ *
+ * >= CAMERA_DEVICE_API_VERSION_3_6:
+ *
+ * In case the result metadata is absent for a logical camera device, then the
+ * error_stream pointer must be set to NULL.
+ * If the result metadata cannot be produced for a physical camera device, then
+ * error_stream must contain a pointer to a respective stream associated with
+ * that physical device.
+ */
+ CAMERA3_MSG_ERROR_RESULT = 3,
+
+ /**
+ * An error has occurred in placing an output buffer into a stream for a
+ * request. The frame metadata and other buffers may still be
+ * available. Subsequent requests are unaffected, and the device remains
+ * operational. The frame_number field specifies the request for which the
+ * buffer was dropped, and error_stream contains a pointer to the stream
+ * that dropped the frame.
+ */
+ CAMERA3_MSG_ERROR_BUFFER = 4,
+
+ /**
+ * Number of error types
+ */
+ CAMERA3_MSG_NUM_ERRORS
+
+} camera3_error_msg_code_t;
+
+/**
+ * camera3_error_msg_t:
+ *
+ * Message contents for CAMERA3_MSG_ERROR
+ */
+typedef struct camera3_error_msg {
+ /**
+ * Frame number of the request the error applies to. 0 if the frame number
+ * isn't applicable to the error.
+ */
+ uint32_t frame_number;
+
+ /**
+ * Pointer to the stream that had a failure. NULL if the stream isn't
+ * applicable to the error.
+ */
+ camera3_stream_t *error_stream;
+
+ /**
+ * The code for this error; one of the CAMERA_MSG_ERROR enum values.
+ */
+ int error_code;
+
+} camera3_error_msg_t;
+
+/**
+ * camera3_shutter_msg_t:
+ *
+ * Message contents for CAMERA3_MSG_SHUTTER
+ */
+typedef struct camera3_shutter_msg {
+ /**
+ * Frame number of the request that has begun exposure or reprocessing.
+ */
+ uint32_t frame_number;
+
+ /**
+ * Timestamp for the start of capture. For a reprocess request, this must
+ * be input image's start of capture. This must match the capture result
+ * metadata's sensor exposure start timestamp.
+ */
+ uint64_t timestamp;
+
+} camera3_shutter_msg_t;
+
+/**
+ * camera3_notify_msg_t:
+ *
+ * The message structure sent to camera3_callback_ops_t.notify()
+ */
+typedef struct camera3_notify_msg {
+
+ /**
+ * The message type. One of camera3_notify_msg_type, or a private extension.
+ */
+ int type;
+
+ union {
+ /**
+ * Error message contents. Valid if type is CAMERA3_MSG_ERROR
+ */
+ camera3_error_msg_t error;
+
+ /**
+ * Shutter message contents. Valid if type is CAMERA3_MSG_SHUTTER
+ */
+ camera3_shutter_msg_t shutter;
+
+ /**
+ * Generic message contents. Used to ensure a minimum size for custom
+ * message types.
+ */
+ uint8_t generic[32];
+ } message;
+
+} camera3_notify_msg_t;
+
+
+/**********************************************************************
+ *
+ * Types definition for request_stream_buffers() callback.
+ *
+ */
+
+/**
+ * camera3_buffer_request_status_t:
+ *
+ * The overall buffer request status returned by request_stream_buffers()
+ */
+typedef enum camera3_buffer_request_status {
+ /**
+ * request_stream_buffers() call succeeded and all requested buffers are
+ * returned.
+ */
+ CAMERA3_BUF_REQ_OK = 0,
+
+ /**
+ * request_stream_buffers() call failed for some streams.
+ * Check per stream status for each returned camera3_stream_buffer_ret_t.
+ */
+ CAMERA3_BUF_REQ_FAILED_PARTIAL = 1,
+
+ /**
+ * request_stream_buffers() call failed for all streams and no buffers are
+ * returned at all. Camera service is about to or is performing
+ * configure_streams() call. HAL must wait until next configure_streams()
+ * call is finished before requesting buffers again.
+ */
+ CAMERA3_BUF_REQ_FAILED_CONFIGURING = 2,
+
+ /**
+ * request_stream_buffers() call failed for all streams and no buffers are
+ * returned at all. Failure due to bad camera3_buffer_request input, eg:
+ * unknown stream or repeated stream in the list of buffer requests.
+ */
+ CAMERA3_BUF_REQ_FAILED_ILLEGAL_ARGUMENTS = 3,
+
+ /**
+ * request_stream_buffers() call failed for all streams and no buffers are
+ * returned at all. This can happen for unknown reasons or a combination
+ * of different failure reasons per stream. For the latter case, caller can
+ * check per stream failure reason returned in camera3_stream_buffer_ret.
+ */
+ CAMERA3_BUF_REQ_FAILED_UNKNOWN = 4,
+
+ /**
+ * Number of buffer request status
+ */
+ CAMERA3_BUF_REQ_NUM_STATUS
+
+} camera3_buffer_request_status_t;
+
+/**
+ * camera3_stream_buffer_req_status_t:
+ *
+ * The per stream buffer request status returned by request_stream_buffers()
+ */
+typedef enum camera3_stream_buffer_req_status {
+ /**
+ * Get buffer succeeds and all requested buffers are returned.
+ */
+ CAMERA3_PS_BUF_REQ_OK = 0,
+
+ /**
+ * Get buffer failed due to timeout waiting for an available buffer. This is
+ * likely due to the client application holding too many buffers, or the
+ * system is under memory pressure.
+ * This is not a fatal error. HAL can try to request buffer for this stream
+ * later. If HAL cannot get a buffer for certain capture request in time
+ * due to this error, HAL can send an ERROR_REQUEST to camera service and
+ * drop processing that request.
+ */
+ CAMERA3_PS_BUF_REQ_NO_BUFFER_AVAILABLE = 1,
+
+ /**
+ * Get buffer failed due to HAL has reached its maxBuffer count. This is not
+ * a fatal error. HAL can try to request buffer for this stream again after
+ * it returns at least one buffer of that stream to camera service.
+ */
+ CAMERA3_PS_BUF_REQ_MAX_BUFFER_EXCEEDED = 2,
+
+ /**
+ * Get buffer failed due to the stream is disconnected by client
+ * application, has been removed, or not recognized by camera service.
+ * This means application is no longer interested in this stream.
+ * Requesting buffer for this stream will never succeed after this error is
+ * returned. HAL must safely return all buffers of this stream after
+ * getting this error. If HAL gets another capture request later targeting
+ * a disconnected stream, HAL must send an ERROR_REQUEST to camera service
+ * and drop processing that request.
+ */
+ CAMERA3_PS_BUF_REQ_STREAM_DISCONNECTED = 3,
+
+ /**
+ * Get buffer failed for unknown reason. This is a fatal error and HAL must
+ * send ERROR_DEVICE to camera service and be ready to be closed.
+ */
+ CAMERA3_PS_BUF_REQ_UNKNOWN_ERROR = 4,
+
+ /**
+ * Number of buffer request status
+ */
+ CAMERA3_PS_BUF_REQ_NUM_STATUS
+} camera3_stream_buffer_req_status_t;
+
+typedef struct camera3_buffer_request {
+ /**
+ * The stream HAL wants to request buffer from
+ */
+ camera3_stream_t *stream;
+
+ /**
+ * The number of buffers HAL requested
+ */
+ uint32_t num_buffers_requested;
+} camera3_buffer_request_t;
+
+typedef struct camera3_stream_buffer_ret {
+ /**
+ * The stream HAL wants to request buffer from
+ */
+ camera3_stream_t *stream;
+
+ /**
+ * The status of buffer request of this stream
+ */
+ camera3_stream_buffer_req_status_t status;
+
+ /**
+ * Number of output buffers returned. Must be 0 when above status is not
+ * CAMERA3_PS_BUF_REQ_OK; otherwise the value must be equal to
+ * num_buffers_requested in the corresponding camera3_buffer_request_t
+ */
+ uint32_t num_output_buffers;
+
+ /**
+ * The returned output buffers for the stream.
+ * Caller of request_stream_buffers() should supply this with enough memory
+ * (num_buffers_requested * sizeof(camera3_stream_buffer_t))
+ */
+ camera3_stream_buffer_t *output_buffers;
+} camera3_stream_buffer_ret_t;
+
+
+/**********************************************************************
+ *
+ * Capture request/result definitions for the HAL process_capture_request()
+ * method, and the process_capture_result() callback.
+ *
+ */
+
+/**
+ * camera3_request_template_t:
+ *
+ * Available template types for
+ * camera3_device_ops.construct_default_request_settings()
+ */
+typedef enum camera3_request_template {
+ /**
+ * Standard camera preview operation with 3A on auto.
+ */
+ CAMERA3_TEMPLATE_PREVIEW = 1,
+
+ /**
+ * Standard camera high-quality still capture with 3A and flash on auto.
+ */
+ CAMERA3_TEMPLATE_STILL_CAPTURE = 2,
+
+ /**
+ * Standard video recording plus preview with 3A on auto, torch off.
+ */
+ CAMERA3_TEMPLATE_VIDEO_RECORD = 3,
+
+ /**
+ * High-quality still capture while recording video. Application will
+ * include preview, video record, and full-resolution YUV or JPEG streams in
+ * request. Must not cause stuttering on video stream. 3A on auto.
+ */
+ CAMERA3_TEMPLATE_VIDEO_SNAPSHOT = 4,
+
+ /**
+ * Zero-shutter-lag mode. Application will request preview and
+ * full-resolution data for each frame, and reprocess it to JPEG when a
+ * still image is requested by user. Settings should provide highest-quality
+ * full-resolution images without compromising preview frame rate. 3A on
+ * auto.
+ */
+ CAMERA3_TEMPLATE_ZERO_SHUTTER_LAG = 5,
+
+ /**
+ * A basic template for direct application control of capture
+ * parameters. All automatic control is disabled (auto-exposure, auto-white
+ * balance, auto-focus), and post-processing parameters are set to preview
+ * quality. The manual capture parameters (exposure, sensitivity, etc.)
+ * are set to reasonable defaults, but should be overridden by the
+ * application depending on the intended use case.
+ */
+ CAMERA3_TEMPLATE_MANUAL = 6,
+
+ /* Total number of templates */
+ CAMERA3_TEMPLATE_COUNT,
+
+ /**
+ * First value for vendor-defined request templates
+ */
+ CAMERA3_VENDOR_TEMPLATE_START = 0x40000000
+
+} camera3_request_template_t;
+
+/**
+ * camera3_capture_request_t:
+ *
+ * A single request for image capture/buffer reprocessing, sent to the Camera
+ * HAL device by the framework in process_capture_request().
+ *
+ * The request contains the settings to be used for this capture, and the set of
+ * output buffers to write the resulting image data in. It may optionally
+ * contain an input buffer, in which case the request is for reprocessing that
+ * input buffer instead of capturing a new image with the camera sensor. The
+ * capture is identified by the frame_number.
+ *
+ * In response, the camera HAL device must send a camera3_capture_result
+ * structure asynchronously to the framework, using the process_capture_result()
+ * callback.
+ */
+typedef struct camera3_capture_request {
+ /**
+ * The frame number is an incrementing integer set by the framework to
+ * uniquely identify this capture. It needs to be returned in the result
+ * call, and is also used to identify the request in asynchronous
+ * notifications sent to camera3_callback_ops_t.notify().
+ */
+ uint32_t frame_number;
+
+ /**
+ * The settings buffer contains the capture and processing parameters for
+ * the request. As a special case, a NULL settings buffer indicates that the
+ * settings are identical to the most-recently submitted capture request. A
+ * NULL buffer cannot be used as the first submitted request after a
+ * configure_streams() call.
+ */
+ const camera_metadata_t *settings;
+
+ /**
+ * The input stream buffer to use for this request, if any.
+ *
+ * If input_buffer is NULL, then the request is for a new capture from the
+ * imager. If input_buffer is valid, the request is for reprocessing the
+ * image contained in input_buffer.
+ *
+ * In the latter case, the HAL must set the release_fence of the
+ * input_buffer to a valid sync fence, or to -1 if the HAL does not support
+ * sync, before process_capture_request() returns.
+ *
+ * The HAL is required to wait on the acquire sync fence of the input buffer
+ * before accessing it.
+ *
+ * <= CAMERA_DEVICE_API_VERSION_3_1:
+ *
+ * Any input buffer included here will have been registered with the HAL
+ * through register_stream_buffers() before its inclusion in a request.
+ *
+ * >= CAMERA_DEVICE_API_VERSION_3_2:
+ *
+ * The buffers will not have been pre-registered with the HAL.
+ * Subsequent requests may reuse buffers, or provide entirely new buffers.
+ */
+ camera3_stream_buffer_t *input_buffer;
+
+ /**
+ * The number of output buffers for this capture request. Must be at least
+ * 1.
+ */
+ uint32_t num_output_buffers;
+
+ /**
+ * An array of num_output_buffers stream buffers, to be filled with image
+ * data from this capture/reprocess. The HAL must wait on the acquire fences
+ * of each stream buffer before writing to them.
+ *
+ * The HAL takes ownership of the actual buffer_handle_t entries in
+ * output_buffers; the framework does not access them until they are
+ * returned in a camera3_capture_result_t.
+ *
+ * <= CAMERA_DEVICE_API_VERSION_3_1:
+ *
+ * All the buffers included here will have been registered with the HAL
+ * through register_stream_buffers() before their inclusion in a request.
+ *
+ * >= CAMERA_DEVICE_API_VERSION_3_2:
+ *
+ * Any or all of the buffers included here may be brand new in this
+ * request (having never before seen by the HAL).
+ */
+ const camera3_stream_buffer_t *output_buffers;
+
+ /**
+ * <= CAMERA_DEVICE_API_VERISON_3_4:
+ *
+ * Not defined and must not be accessed.
+ *
+ * >= CAMERA_DEVICE_API_VERSION_3_5:
+ * The number of physical camera settings to be applied. If 'num_physcam_settings'
+ * equals 0 or a physical device is not included, then Hal must decide the
+ * specific physical device settings based on the default 'settings'.
+ */
+ uint32_t num_physcam_settings;
+
+ /**
+ * <= CAMERA_DEVICE_API_VERISON_3_4:
+ *
+ * Not defined and must not be accessed.
+ *
+ * >= CAMERA_DEVICE_API_VERSION_3_5:
+ * The physical camera ids. The array will contain 'num_physcam_settings'
+ * camera id strings for all physical devices that have specific settings.
+ * In case some id is invalid, the process capture request must fail and return
+ * -EINVAL.
+ */
+ const char **physcam_id;
+
+ /**
+ * <= CAMERA_DEVICE_API_VERISON_3_4:
+ *
+ * Not defined and must not be accessed.
+ *
+ * >= CAMERA_DEVICE_API_VERSION_3_5:
+ * The capture settings for the physical cameras. The array will contain
+ * 'num_physcam_settings' settings for invididual physical devices. In
+ * case the settings at some particular index are empty, the process capture
+ * request must fail and return -EINVAL.
+ */
+ const camera_metadata_t **physcam_settings;
+
+} camera3_capture_request_t;
+
+/**
+ * camera3_capture_result_t:
+ *
+ * The result of a single capture/reprocess by the camera HAL device. This is
+ * sent to the framework asynchronously with process_capture_result(), in
+ * response to a single capture request sent to the HAL with
+ * process_capture_request(). Multiple process_capture_result() calls may be
+ * performed by the HAL for each request.
+ *
+ * Each call, all with the same frame
+ * number, may contain some subset of the output buffers, and/or the result
+ * metadata. The metadata may only be provided once for a given frame number;
+ * all other calls must set the result metadata to NULL.
+ *
+ * The result structure contains the output metadata from this capture, and the
+ * set of output buffers that have been/will be filled for this capture. Each
+ * output buffer may come with a release sync fence that the framework will wait
+ * on before reading, in case the buffer has not yet been filled by the HAL.
+ *
+ * >= CAMERA_DEVICE_API_VERSION_3_2:
+ *
+ * The metadata may be provided multiple times for a single frame number. The
+ * framework will accumulate together the final result set by combining each
+ * partial result together into the total result set.
+ *
+ * If an input buffer is given in a request, the HAL must return it in one of
+ * the process_capture_result calls, and the call may be to just return the input
+ * buffer, without metadata and output buffers; the sync fences must be handled
+ * the same way they are done for output buffers.
+ *
+ *
+ * Performance considerations:
+ *
+ * Applications will also receive these partial results immediately, so sending
+ * partial results is a highly recommended performance optimization to avoid
+ * the total pipeline latency before sending the results for what is known very
+ * early on in the pipeline.
+ *
+ * A typical use case might be calculating the AF state halfway through the
+ * pipeline; by sending the state back to the framework immediately, we get a
+ * 50% performance increase and perceived responsiveness of the auto-focus.
+ *
+ */
+typedef struct camera3_capture_result {
+ /**
+ * The frame number is an incrementing integer set by the framework in the
+ * submitted request to uniquely identify this capture. It is also used to
+ * identify the request in asynchronous notifications sent to
+ * camera3_callback_ops_t.notify().
+ */
+ uint32_t frame_number;
+
+ /**
+ * The result metadata for this capture. This contains information about the
+ * final capture parameters, the state of the capture and post-processing
+ * hardware, the state of the 3A algorithms, if enabled, and the output of
+ * any enabled statistics units.
+ *
+ * Only one call to process_capture_result() with a given frame_number may
+ * include the result metadata. All other calls for the same frame_number
+ * must set this to NULL.
+ *
+ * If there was an error producing the result metadata, result must be an
+ * empty metadata buffer, and notify() must be called with ERROR_RESULT.
+ *
+ * >= CAMERA_DEVICE_API_VERSION_3_2:
+ *
+ * Multiple calls to process_capture_result() with a given frame_number
+ * may include the result metadata.
+ *
+ * Partial metadata submitted should not include any metadata key returned
+ * in a previous partial result for a given frame. Each new partial result
+ * for that frame must also set a distinct partial_result value.
+ *
+ * If notify has been called with ERROR_RESULT, all further partial
+ * results for that frame are ignored by the framework.
+ */
+ const camera_metadata_t *result;
+
+ /**
+ * The number of output buffers returned in this result structure. Must be
+ * less than or equal to the matching capture request's count. If this is
+ * less than the buffer count in the capture request, at least one more call
+ * to process_capture_result with the same frame_number must be made, to
+ * return the remaining output buffers to the framework. This may only be
+ * zero if the structure includes valid result metadata or an input buffer
+ * is returned in this result.
+ */
+ uint32_t num_output_buffers;
+
+ /**
+ * The handles for the output stream buffers for this capture. They may not
+ * yet be filled at the time the HAL calls process_capture_result(); the
+ * framework will wait on the release sync fences provided by the HAL before
+ * reading the buffers.
+ *
+ * The HAL must set the stream buffer's release sync fence to a valid sync
+ * fd, or to -1 if the buffer has already been filled.
+ *
+ * If the HAL encounters an error while processing the buffer, and the
+ * buffer is not filled, the buffer's status field must be set to
+ * CAMERA3_BUFFER_STATUS_ERROR. If the HAL did not wait on the acquire fence
+ * before encountering the error, the acquire fence should be copied into
+ * the release fence, to allow the framework to wait on the fence before
+ * reusing the buffer.
+ *
+ * The acquire fence must be set to -1 for all output buffers. If
+ * num_output_buffers is zero, this may be NULL. In that case, at least one
+ * more process_capture_result call must be made by the HAL to provide the
+ * output buffers.
+ *
+ * When process_capture_result is called with a new buffer for a frame,
+ * all previous frames' buffers for that corresponding stream must have been
+ * already delivered (the fences need not have yet been signaled).
+ *
+ * >= CAMERA_DEVICE_API_VERSION_3_2:
+ *
+ * Gralloc buffers for a frame may be sent to framework before the
+ * corresponding SHUTTER-notify.
+ *
+ * Performance considerations:
+ *
+ * Buffers delivered to the framework will not be dispatched to the
+ * application layer until a start of exposure timestamp has been received
+ * via a SHUTTER notify() call. It is highly recommended to
+ * dispatch that call as early as possible.
+ */
+ const camera3_stream_buffer_t *output_buffers;
+
+ /**
+ * >= CAMERA_DEVICE_API_VERSION_3_2:
+ *
+ * The handle for the input stream buffer for this capture. It may not
+ * yet be consumed at the time the HAL calls process_capture_result(); the
+ * framework will wait on the release sync fences provided by the HAL before
+ * reusing the buffer.
+ *
+ * The HAL should handle the sync fences the same way they are done for
+ * output_buffers.
+ *
+ * Only one input buffer is allowed to be sent per request. Similarly to
+ * output buffers, the ordering of returned input buffers must be
+ * maintained by the HAL.
+ *
+ * Performance considerations:
+ *
+ * The input buffer should be returned as early as possible. If the HAL
+ * supports sync fences, it can call process_capture_result to hand it back
+ * with sync fences being set appropriately. If the sync fences are not
+ * supported, the buffer can only be returned when it is consumed, which
+ * may take long time; the HAL may choose to copy this input buffer to make
+ * the buffer return sooner.
+ */
+ const camera3_stream_buffer_t *input_buffer;
+
+ /**
+ * >= CAMERA_DEVICE_API_VERSION_3_2:
+ *
+ * In order to take advantage of partial results, the HAL must set the
+ * static metadata android.request.partialResultCount to the number of
+ * partial results it will send for each frame.
+ *
+ * Each new capture result with a partial result must set
+ * this field (partial_result) to a distinct inclusive value between
+ * 1 and android.request.partialResultCount.
+ *
+ * HALs not wishing to take advantage of this feature must not
+ * set an android.request.partialResultCount or partial_result to a value
+ * other than 1.
+ *
+ * This value must be set to 0 when a capture result contains buffers only
+ * and no metadata.
+ */
+ uint32_t partial_result;
+
+ /**
+ * >= CAMERA_DEVICE_API_VERSION_3_5:
+ *
+ * Specifies the number of physical camera metadata this capture result
+ * contains. It must be equal to the number of physical cameras being
+ * requested from.
+ *
+ * If the current camera device is not a logical multi-camera, or the
+ * corresponding capture_request doesn't request on any physical camera,
+ * this field must be 0.
+ */
+ uint32_t num_physcam_metadata;
+
+ /**
+ * >= CAMERA_DEVICE_API_VERSION_3_5:
+ *
+ * An array of strings containing the physical camera ids for the returned
+ * physical camera metadata. The length of the array is
+ * num_physcam_metadata.
+ */
+ const char **physcam_ids;
+
+ /**
+ * >= CAMERA_DEVICE_API_VERSION_3_5:
+ *
+ * The array of physical camera metadata for the physical cameras being
+ * requested upon. This array should have a 1-to-1 mapping with the
+ * physcam_ids. The length of the array is num_physcam_metadata.
+ */
+ const camera_metadata_t **physcam_metadata;
+
+} camera3_capture_result_t;
+
+/**********************************************************************
+ *
+ * Callback methods for the HAL to call into the framework.
+ *
+ * These methods are used to return metadata and image buffers for a completed
+ * or failed captures, and to notify the framework of asynchronous events such
+ * as errors.
+ *
+ * The framework will not call back into the HAL from within these callbacks,
+ * and these calls will not block for extended periods.
+ *
+ */
+typedef struct camera3_callback_ops {
+
+ /**
+ * process_capture_result:
+ *
+ * Send results from a completed capture to the framework.
+ * process_capture_result() may be invoked multiple times by the HAL in
+ * response to a single capture request. This allows, for example, the
+ * metadata and low-resolution buffers to be returned in one call, and
+ * post-processed JPEG buffers in a later call, once it is available. Each
+ * call must include the frame number of the request it is returning
+ * metadata or buffers for.
+ *
+ * A component (buffer or metadata) of the complete result may only be
+ * included in one process_capture_result call. A buffer for each stream,
+ * and the result metadata, must be returned by the HAL for each request in
+ * one of the process_capture_result calls, even in case of errors producing
+ * some of the output. A call to process_capture_result() with neither
+ * output buffers or result metadata is not allowed.
+ *
+ * The order of returning metadata and buffers for a single result does not
+ * matter, but buffers for a given stream must be returned in FIFO order. So
+ * the buffer for request 5 for stream A must always be returned before the
+ * buffer for request 6 for stream A. This also applies to the result
+ * metadata; the metadata for request 5 must be returned before the metadata
+ * for request 6.
+ *
+ * However, different streams are independent of each other, so it is
+ * acceptable and expected that the buffer for request 5 for stream A may be
+ * returned after the buffer for request 6 for stream B is. And it is
+ * acceptable that the result metadata for request 6 for stream B is
+ * returned before the buffer for request 5 for stream A is.
+ *
+ * The HAL retains ownership of result structure, which only needs to be
+ * valid to access during this call. The framework will copy whatever it
+ * needs before this call returns.
+ *
+ * The output buffers do not need to be filled yet; the framework will wait
+ * on the stream buffer release sync fence before reading the buffer
+ * data. Therefore, this method should be called by the HAL as soon as
+ * possible, even if some or all of the output buffers are still in
+ * being filled. The HAL must include valid release sync fences into each
+ * output_buffers stream buffer entry, or -1 if that stream buffer is
+ * already filled.
+ *
+ * If the result buffer cannot be constructed for a request, the HAL should
+ * return an empty metadata buffer, but still provide the output buffers and
+ * their sync fences. In addition, notify() must be called with an
+ * ERROR_RESULT message.
+ *
+ * If an output buffer cannot be filled, its status field must be set to
+ * STATUS_ERROR. In addition, notify() must be called with a ERROR_BUFFER
+ * message.
+ *
+ * If the entire capture has failed, then this method still needs to be
+ * called to return the output buffers to the framework. All the buffer
+ * statuses should be STATUS_ERROR, and the result metadata should be an
+ * empty buffer. In addition, notify() must be called with a ERROR_REQUEST
+ * message. In this case, individual ERROR_RESULT/ERROR_BUFFER messages
+ * should not be sent.
+ *
+ * Performance requirements:
+ *
+ * This is a non-blocking call. The framework will return this call in 5ms.
+ *
+ * The pipeline latency (see S7 for definition) should be less than or equal to
+ * 4 frame intervals, and must be less than or equal to 8 frame intervals.
+ *
+ */
+ void (*process_capture_result)(const struct camera3_callback_ops *,
+ const camera3_capture_result_t *result);
+
+ /**
+ * notify:
+ *
+ * Asynchronous notification callback from the HAL, fired for various
+ * reasons. Only for information independent of frame capture, or that
+ * require specific timing. The ownership of the message structure remains
+ * with the HAL, and the msg only needs to be valid for the duration of this
+ * call.
+ *
+ * Multiple threads may call notify() simultaneously.
+ *
+ * <= CAMERA_DEVICE_API_VERSION_3_1:
+ *
+ * The notification for the start of exposure for a given request must be
+ * sent by the HAL before the first call to process_capture_result() for
+ * that request is made.
+ *
+ * >= CAMERA_DEVICE_API_VERSION_3_2:
+ *
+ * Buffers delivered to the framework will not be dispatched to the
+ * application layer until a start of exposure timestamp (or input image's
+ * start of exposure timestamp for a reprocess request) has been received
+ * via a SHUTTER notify() call. It is highly recommended to dispatch this
+ * call as early as possible.
+ *
+ * ------------------------------------------------------------------------
+ * Performance requirements:
+ *
+ * This is a non-blocking call. The framework will return this call in 5ms.
+ */
+ void (*notify)(const struct camera3_callback_ops *,
+ const camera3_notify_msg_t *msg);
+
+ /**
+ * request_stream_buffers:
+ *
+ * <= CAMERA_DEVICE_API_VERISON_3_5:
+ *
+ * DO NOT USE: not defined and must be NULL.
+ *
+ * >= CAMERA_DEVICE_API_VERISON_3_6:
+ *
+ * Synchronous callback for HAL to ask for output buffer from camera service.
+ *
+ * This call may be serialized in camera service so it is strongly
+ * recommended to only call this method from one thread.
+ *
+ * When camera device advertises
+ * (android.info.supportedBufferManagementVersion ==
+ * ANDROID_INFO_SUPPORTED_BUFFER_MANAGEMENT_VERSION_HIDL_DEVICE_3_5), HAL
+ * can use this method to request buffers from camera service.
+ *
+ * Caller is responsible for allocating enough memory for returned_buf_reqs
+ * argument (num_buffer_reqs * sizeof(camera3_stream_buffer_ret_t)) bytes
+ * and also the memory for the output_buffers field in each
+ * camera3_stream_buffer_ret_t
+ * (num_buffers_requested * sizeof(camera3_stream_buffer_t)) bytes
+ *
+ * Performance requirements:
+ * This is a blocking call that takes more time with more buffers requested.
+ * HAL should not request large amount of buffers on a latency critical code
+ * path. It is highly recommended to use a dedicated thread to perform
+ * all requestStreamBuffer calls, and adjust the thread priority and/or
+ * timing of making the call in order for buffers to arrive before HAL is
+ * ready to fill the buffer.
+ */
+ camera3_buffer_request_status_t (*request_stream_buffers)(
+ const struct camera3_callback_ops *,
+ uint32_t num_buffer_reqs,
+ const camera3_buffer_request_t *buffer_reqs,
+ /*out*/uint32_t *num_returned_buf_reqs,
+ /*out*/camera3_stream_buffer_ret_t *returned_buf_reqs);
+
+ /**
+ * return_stream_buffers:
+ *
+ * <= CAMERA_DEVICE_API_VERISON_3_5:
+ *
+ * DO NOT USE: not defined and must be NULL.
+ *
+ * >= CAMERA_DEVICE_API_VERISON_3_6:
+ *
+ * Synchronous callback for HAL to return output buffers to camera service.
+ *
+ * If this method is called during a configure_streams() call, it will be
+ * blocked until camera service finishes the ongoing configure_streams() call.
+ */
+ void (*return_stream_buffers)(
+ const struct camera3_callback_ops *,
+ uint32_t num_buffers,
+ const camera3_stream_buffer_t* const* buffers);
+
+} camera3_callback_ops_t;
+
+/**********************************************************************
+ *
+ * Camera device operations
+ *
+ */
+typedef struct camera3_device_ops {
+
+ /**
+ * initialize:
+ *
+ * One-time initialization to pass framework callback function pointers to
+ * the HAL. Will be called once after a successful open() call, before any
+ * other functions are called on the camera3_device_ops structure.
+ *
+ * Performance requirements:
+ *
+ * This should be a non-blocking call. The HAL should return from this call
+ * in 5ms, and must return from this call in 10ms.
+ *
+ * Return values:
+ *
+ * 0: On successful initialization
+ *
+ * -ENODEV: If initialization fails. Only close() can be called successfully
+ * by the framework after this.
+ */
+ int (*initialize)(const struct camera3_device *,
+ const camera3_callback_ops_t *callback_ops);
+
+ /**********************************************************************
+ * Stream management
+ */
+
+ /**
+ * configure_streams:
+ *
+ * CAMERA_DEVICE_API_VERSION_3_0 only:
+ *
+ * Reset the HAL camera device processing pipeline and set up new input and
+ * output streams. This call replaces any existing stream configuration with
+ * the streams defined in the stream_list. This method will be called at
+ * least once after initialize() before a request is submitted with
+ * process_capture_request().
+ *
+ * The stream_list must contain at least one output-capable stream, and may
+ * not contain more than one input-capable stream.
+ *
+ * The stream_list may contain streams that are also in the currently-active
+ * set of streams (from the previous call to configure_stream()). These
+ * streams will already have valid values for usage, max_buffers, and the
+ * private pointer.
+ *
+ * If such a stream has already had its buffers registered,
+ * register_stream_buffers() will not be called again for the stream, and
+ * buffers from the stream can be immediately included in input requests.
+ *
+ * If the HAL needs to change the stream configuration for an existing
+ * stream due to the new configuration, it may rewrite the values of usage
+ * and/or max_buffers during the configure call.
+ *
+ * The framework will detect such a change, and will then reallocate the
+ * stream buffers, and call register_stream_buffers() again before using
+ * buffers from that stream in a request.
+ *
+ * If a currently-active stream is not included in stream_list, the HAL may
+ * safely remove any references to that stream. It will not be reused in a
+ * later configure() call by the framework, and all the gralloc buffers for
+ * it will be freed after the configure_streams() call returns.
+ *
+ * The stream_list structure is owned by the framework, and may not be
+ * accessed once this call completes. The address of an individual
+ * camera3_stream_t structure will remain valid for access by the HAL until
+ * the end of the first configure_stream() call which no longer includes
+ * that camera3_stream_t in the stream_list argument. The HAL may not change
+ * values in the stream structure outside of the private pointer, except for
+ * the usage and max_buffers members during the configure_streams() call
+ * itself.
+ *
+ * If the stream is new, the usage, max_buffer, and private pointer fields
+ * of the stream structure will all be set to 0. The HAL device must set
+ * these fields before the configure_streams() call returns. These fields
+ * are then used by the framework and the platform gralloc module to
+ * allocate the gralloc buffers for each stream.
+ *
+ * Before such a new stream can have its buffers included in a capture
+ * request, the framework will call register_stream_buffers() with that
+ * stream. However, the framework is not required to register buffers for
+ * _all_ streams before submitting a request. This allows for quick startup
+ * of (for example) a preview stream, with allocation for other streams
+ * happening later or concurrently.
+ *
+ * ------------------------------------------------------------------------
+ * CAMERA_DEVICE_API_VERSION_3_1 only:
+ *
+ * Reset the HAL camera device processing pipeline and set up new input and
+ * output streams. This call replaces any existing stream configuration with
+ * the streams defined in the stream_list. This method will be called at
+ * least once after initialize() before a request is submitted with
+ * process_capture_request().
+ *
+ * The stream_list must contain at least one output-capable stream, and may
+ * not contain more than one input-capable stream.
+ *
+ * The stream_list may contain streams that are also in the currently-active
+ * set of streams (from the previous call to configure_stream()). These
+ * streams will already have valid values for usage, max_buffers, and the
+ * private pointer.
+ *
+ * If such a stream has already had its buffers registered,
+ * register_stream_buffers() will not be called again for the stream, and
+ * buffers from the stream can be immediately included in input requests.
+ *
+ * If the HAL needs to change the stream configuration for an existing
+ * stream due to the new configuration, it may rewrite the values of usage
+ * and/or max_buffers during the configure call.
+ *
+ * The framework will detect such a change, and will then reallocate the
+ * stream buffers, and call register_stream_buffers() again before using
+ * buffers from that stream in a request.
+ *
+ * If a currently-active stream is not included in stream_list, the HAL may
+ * safely remove any references to that stream. It will not be reused in a
+ * later configure() call by the framework, and all the gralloc buffers for
+ * it will be freed after the configure_streams() call returns.
+ *
+ * The stream_list structure is owned by the framework, and may not be
+ * accessed once this call completes. The address of an individual
+ * camera3_stream_t structure will remain valid for access by the HAL until
+ * the end of the first configure_stream() call which no longer includes
+ * that camera3_stream_t in the stream_list argument. The HAL may not change
+ * values in the stream structure outside of the private pointer, except for
+ * the usage and max_buffers members during the configure_streams() call
+ * itself.
+ *
+ * If the stream is new, max_buffer, and private pointer fields of the
+ * stream structure will all be set to 0. The usage will be set to the
+ * consumer usage flags. The HAL device must set these fields before the
+ * configure_streams() call returns. These fields are then used by the
+ * framework and the platform gralloc module to allocate the gralloc
+ * buffers for each stream.
+ *
+ * Before such a new stream can have its buffers included in a capture
+ * request, the framework will call register_stream_buffers() with that
+ * stream. However, the framework is not required to register buffers for
+ * _all_ streams before submitting a request. This allows for quick startup
+ * of (for example) a preview stream, with allocation for other streams
+ * happening later or concurrently.
+ *
+ * ------------------------------------------------------------------------
+ * >= CAMERA_DEVICE_API_VERSION_3_2:
+ *
+ * Reset the HAL camera device processing pipeline and set up new input and
+ * output streams. This call replaces any existing stream configuration with
+ * the streams defined in the stream_list. This method will be called at
+ * least once after initialize() before a request is submitted with
+ * process_capture_request().
+ *
+ * The stream_list must contain at least one output-capable stream, and may
+ * not contain more than one input-capable stream.
+ *
+ * The stream_list may contain streams that are also in the currently-active
+ * set of streams (from the previous call to configure_stream()). These
+ * streams will already have valid values for usage, max_buffers, and the
+ * private pointer.
+ *
+ * If the HAL needs to change the stream configuration for an existing
+ * stream due to the new configuration, it may rewrite the values of usage
+ * and/or max_buffers during the configure call.
+ *
+ * The framework will detect such a change, and may then reallocate the
+ * stream buffers before using buffers from that stream in a request.
+ *
+ * If a currently-active stream is not included in stream_list, the HAL may
+ * safely remove any references to that stream. It will not be reused in a
+ * later configure() call by the framework, and all the gralloc buffers for
+ * it will be freed after the configure_streams() call returns.
+ *
+ * The stream_list structure is owned by the framework, and may not be
+ * accessed once this call completes. The address of an individual
+ * camera3_stream_t structure will remain valid for access by the HAL until
+ * the end of the first configure_stream() call which no longer includes
+ * that camera3_stream_t in the stream_list argument. The HAL may not change
+ * values in the stream structure outside of the private pointer, except for
+ * the usage and max_buffers members during the configure_streams() call
+ * itself.
+ *
+ * If the stream is new, max_buffer, and private pointer fields of the
+ * stream structure will all be set to 0. The usage will be set to the
+ * consumer usage flags. The HAL device must set these fields before the
+ * configure_streams() call returns. These fields are then used by the
+ * framework and the platform gralloc module to allocate the gralloc
+ * buffers for each stream.
+ *
+ * Newly allocated buffers may be included in a capture request at any time
+ * by the framework. Once a gralloc buffer is returned to the framework
+ * with process_capture_result (and its respective release_fence has been
+ * signaled) the framework may free or reuse it at any time.
+ *
+ * ------------------------------------------------------------------------
+ *
+ * Preconditions:
+ *
+ * The framework will only call this method when no captures are being
+ * processed. That is, all results have been returned to the framework, and
+ * all in-flight input and output buffers have been returned and their
+ * release sync fences have been signaled by the HAL. The framework will not
+ * submit new requests for capture while the configure_streams() call is
+ * underway.
+ *
+ * Postconditions:
+ *
+ * The HAL device must configure itself to provide maximum possible output
+ * frame rate given the sizes and formats of the output streams, as
+ * documented in the camera device's static metadata.
+ *
+ * Performance requirements:
+ *
+ * This call is expected to be heavyweight and possibly take several hundred
+ * milliseconds to complete, since it may require resetting and
+ * reconfiguring the image sensor and the camera processing pipeline.
+ * Nevertheless, the HAL device should attempt to minimize the
+ * reconfiguration delay to minimize the user-visible pauses during
+ * application operational mode changes (such as switching from still
+ * capture to video recording).
+ *
+ * The HAL should return from this call in 500ms, and must return from this
+ * call in 1000ms.
+ *
+ * Return values:
+ *
+ * 0: On successful stream configuration
+ *
+ * -EINVAL: If the requested stream configuration is invalid. Some examples
+ * of invalid stream configurations include:
+ *
+ * - Including more than 1 input-capable stream (INPUT or
+ * BIDIRECTIONAL)
+ *
+ * - Not including any output-capable streams (OUTPUT or
+ * BIDIRECTIONAL)
+ *
+ * - Including streams with unsupported formats, or an unsupported
+ * size for that format.
+ *
+ * - Including too many output streams of a certain format.
+ *
+ * - Unsupported rotation configuration (only applies to
+ * devices with version >= CAMERA_DEVICE_API_VERSION_3_3)
+ *
+ * - Stream sizes/formats don't satisfy the
+ * camera3_stream_configuration_t->operation_mode requirements for non-NORMAL mode,
+ * or the requested operation_mode is not supported by the HAL.
+ * (only applies to devices with version >= CAMERA_DEVICE_API_VERSION_3_3)
+ *
+ * Note that the framework submitting an invalid stream
+ * configuration is not normal operation, since stream
+ * configurations are checked before configure. An invalid
+ * configuration means that a bug exists in the framework code, or
+ * there is a mismatch between the HAL's static metadata and the
+ * requirements on streams.
+ *
+ * -ENODEV: If there has been a fatal error and the device is no longer
+ * operational. Only close() can be called successfully by the
+ * framework after this error is returned.
+ */
+ int (*configure_streams)(const struct camera3_device *,
+ camera3_stream_configuration_t *stream_list);
+
+ /**
+ * register_stream_buffers:
+ *
+ * >= CAMERA_DEVICE_API_VERSION_3_2:
+ *
+ * DEPRECATED. This will not be called and must be set to NULL.
+ *
+ * <= CAMERA_DEVICE_API_VERSION_3_1:
+ *
+ * Register buffers for a given stream with the HAL device. This method is
+ * called by the framework after a new stream is defined by
+ * configure_streams, and before buffers from that stream are included in a
+ * capture request. If the same stream is listed in a subsequent
+ * configure_streams() call, register_stream_buffers will _not_ be called
+ * again for that stream.
+ *
+ * The framework does not need to register buffers for all configured
+ * streams before it submits the first capture request. This allows quick
+ * startup for preview (or similar use cases) while other streams are still
+ * being allocated.
+ *
+ * This method is intended to allow the HAL device to map or otherwise
+ * prepare the buffers for later use. The buffers passed in will already be
+ * locked for use. At the end of the call, all the buffers must be ready to
+ * be returned to the stream. The buffer_set argument is only valid for the
+ * duration of this call.
+ *
+ * If the stream format was set to HAL_PIXEL_FORMAT_IMPLEMENTATION_DEFINED,
+ * the camera HAL should inspect the passed-in buffers here to determine any
+ * platform-private pixel format information.
+ *
+ * Performance requirements:
+ *
+ * This should be a non-blocking call. The HAL should return from this call
+ * in 1ms, and must return from this call in 5ms.
+ *
+ * Return values:
+ *
+ * 0: On successful registration of the new stream buffers
+ *
+ * -EINVAL: If the stream_buffer_set does not refer to a valid active
+ * stream, or if the buffers array is invalid.
+ *
+ * -ENOMEM: If there was a failure in registering the buffers. The framework
+ * must consider all the stream buffers to be unregistered, and can
+ * try to register again later.
+ *
+ * -ENODEV: If there is a fatal error, and the device is no longer
+ * operational. Only close() can be called successfully by the
+ * framework after this error is returned.
+ */
+ int (*register_stream_buffers)(const struct camera3_device *,
+ const camera3_stream_buffer_set_t *buffer_set);
+
+ /**********************************************************************
+ * Request creation and submission
+ */
+
+ /**
+ * construct_default_request_settings:
+ *
+ * Create capture settings for standard camera use cases.
+ *
+ * The device must return a settings buffer that is configured to meet the
+ * requested use case, which must be one of the CAMERA3_TEMPLATE_*
+ * enums. All request control fields must be included.
+ *
+ * The HAL retains ownership of this structure, but the pointer to the
+ * structure must be valid until the device is closed. The framework and the
+ * HAL may not modify the buffer once it is returned by this call. The same
+ * buffer may be returned for subsequent calls for the same template, or for
+ * other templates.
+ *
+ * Performance requirements:
+ *
+ * This should be a non-blocking call. The HAL should return from this call
+ * in 1ms, and must return from this call in 5ms.
+ *
+ * Return values:
+ *
+ * Valid metadata: On successful creation of a default settings
+ * buffer.
+ *
+ * NULL: In case of a fatal error. After this is returned, only
+ * the close() method can be called successfully by the
+ * framework.
+ */
+ const camera_metadata_t* (*construct_default_request_settings)(
+ const struct camera3_device *,
+ int type);
+
+ /**
+ * process_capture_request:
+ *
+ * Send a new capture request to the HAL. The HAL should not return from
+ * this call until it is ready to accept the next request to process. Only
+ * one call to process_capture_request() will be made at a time by the
+ * framework, and the calls will all be from the same thread. The next call
+ * to process_capture_request() will be made as soon as a new request and
+ * its associated buffers are available. In a normal preview scenario, this
+ * means the function will be called again by the framework almost
+ * instantly.
+ *
+ * The actual request processing is asynchronous, with the results of
+ * capture being returned by the HAL through the process_capture_result()
+ * call. This call requires the result metadata to be available, but output
+ * buffers may simply provide sync fences to wait on. Multiple requests are
+ * expected to be in flight at once, to maintain full output frame rate.
+ *
+ * The framework retains ownership of the request structure. It is only
+ * guaranteed to be valid during this call. The HAL device must make copies
+ * of the information it needs to retain for the capture processing. The HAL
+ * is responsible for waiting on and closing the buffers' fences and
+ * returning the buffer handles to the framework.
+ *
+ * The HAL must write the file descriptor for the input buffer's release
+ * sync fence into input_buffer->release_fence, if input_buffer is not
+ * NULL. If the HAL returns -1 for the input buffer release sync fence, the
+ * framework is free to immediately reuse the input buffer. Otherwise, the
+ * framework will wait on the sync fence before refilling and reusing the
+ * input buffer.
+ *
+ * >= CAMERA_DEVICE_API_VERSION_3_2:
+ *
+ * The input/output buffers provided by the framework in each request
+ * may be brand new (having never before seen by the HAL).
+ *
+ * ------------------------------------------------------------------------
+ * Performance considerations:
+ *
+ * Handling a new buffer should be extremely lightweight and there should be
+ * no frame rate degradation or frame jitter introduced.
+ *
+ * This call must return fast enough to ensure that the requested frame
+ * rate can be sustained, especially for streaming cases (post-processing
+ * quality settings set to FAST). The HAL should return this call in 1
+ * frame interval, and must return from this call in 4 frame intervals.
+ *
+ * Return values:
+ *
+ * 0: On a successful start to processing the capture request
+ *
+ * -EINVAL: If the input is malformed (the settings are NULL when not
+ * allowed, invalid physical camera settings,
+ * there are 0 output buffers, etc) and capture processing
+ * cannot start. Failures during request processing should be
+ * handled by calling camera3_callback_ops_t.notify(). In case of
+ * this error, the framework will retain responsibility for the
+ * stream buffers' fences and the buffer handles; the HAL should
+ * not close the fences or return these buffers with
+ * process_capture_result.
+ *
+ * -ENODEV: If the camera device has encountered a serious error. After this
+ * error is returned, only the close() method can be successfully
+ * called by the framework.
+ *
+ */
+ int (*process_capture_request)(const struct camera3_device *,
+ camera3_capture_request_t *request);
+
+ /**********************************************************************
+ * Miscellaneous methods
+ */
+
+ /**
+ * get_metadata_vendor_tag_ops:
+ *
+ * Get methods to query for vendor extension metadata tag information. The
+ * HAL should fill in all the vendor tag operation methods, or leave ops
+ * unchanged if no vendor tags are defined.
+ *
+ * The definition of vendor_tag_query_ops_t can be found in
+ * system/media/camera/include/system/camera_metadata.h.
+ *
+ * >= CAMERA_DEVICE_API_VERSION_3_2:
+ * DEPRECATED. This function has been deprecated and should be set to
+ * NULL by the HAL. Please implement get_vendor_tag_ops in camera_common.h
+ * instead.
+ */
+ void (*get_metadata_vendor_tag_ops)(const struct camera3_device*,
+ vendor_tag_query_ops_t* ops);
+
+ /**
+ * dump:
+ *
+ * Print out debugging state for the camera device. This will be called by
+ * the framework when the camera service is asked for a debug dump, which
+ * happens when using the dumpsys tool, or when capturing a bugreport.
+ *
+ * The passed-in file descriptor can be used to write debugging text using
+ * dprintf() or write(). The text should be in ASCII encoding only.
+ *
+ * Performance requirements:
+ *
+ * This must be a non-blocking call. The HAL should return from this call
+ * in 1ms, must return from this call in 10ms. This call must avoid
+ * deadlocks, as it may be called at any point during camera operation.
+ * Any synchronization primitives used (such as mutex locks or semaphores)
+ * should be acquired with a timeout.
+ */
+ void (*dump)(const struct camera3_device *, int fd);
+
+ /**
+ * flush:
+ *
+ * Flush all currently in-process captures and all buffers in the pipeline
+ * on the given device. The framework will use this to dump all state as
+ * quickly as possible in order to prepare for a configure_streams() call.
+ *
+ * No buffers are required to be successfully returned, so every buffer
+ * held at the time of flush() (whether successfully filled or not) may be
+ * returned with CAMERA3_BUFFER_STATUS_ERROR. Note the HAL is still allowed
+ * to return valid (CAMERA3_BUFFER_STATUS_OK) buffers during this call,
+ * provided they are successfully filled.
+ *
+ * All requests currently in the HAL are expected to be returned as soon as
+ * possible. Not-in-process requests should return errors immediately. Any
+ * interruptible hardware blocks should be stopped, and any uninterruptible
+ * blocks should be waited on.
+ *
+ * flush() may be called concurrently to process_capture_request(), with the expectation that
+ * process_capture_request will return quickly and the request submitted in that
+ * process_capture_request call is treated like all other in-flight requests. Due to
+ * concurrency issues, it is possible that from the HAL's point of view, a
+ * process_capture_request() call may be started after flush has been invoked but has not
+ * returned yet. If such a call happens before flush() returns, the HAL should treat the new
+ * capture request like other in-flight pending requests (see #4 below).
+ *
+ * More specifically, the HAL must follow below requirements for various cases:
+ *
+ * 1. For captures that are too late for the HAL to cancel/stop, and will be
+ * completed normally by the HAL; i.e. the HAL can send shutter/notify and
+ * process_capture_result and buffers as normal.
+ *
+ * 2. For pending requests that have not done any processing, the HAL must call notify
+ * CAMERA3_MSG_ERROR_REQUEST, and return all the output buffers with
+ * process_capture_result in the error state (CAMERA3_BUFFER_STATUS_ERROR).
+ * The HAL must not place the release fence into an error state, instead,
+ * the release fences must be set to the acquire fences passed by the framework,
+ * or -1 if they have been waited on by the HAL already. This is also the path
+ * to follow for any captures for which the HAL already called notify() with
+ * CAMERA3_MSG_SHUTTER but won't be producing any metadata/valid buffers for.
+ * After CAMERA3_MSG_ERROR_REQUEST, for a given frame, only process_capture_results with
+ * buffers in CAMERA3_BUFFER_STATUS_ERROR are allowed. No further notifys or
+ * process_capture_result with non-null metadata is allowed.
+ *
+ * 3. For partially completed pending requests that will not have all the output
+ * buffers or perhaps missing metadata, the HAL should follow below:
+ *
+ * 3.1. Call notify with CAMERA3_MSG_ERROR_RESULT if some of the expected result
+ * metadata (i.e. one or more partial metadata) won't be available for the capture.
+ *
+ * 3.2. Call notify with CAMERA3_MSG_ERROR_BUFFER for every buffer that won't
+ * be produced for the capture.
+ *
+ * 3.3 Call notify with CAMERA3_MSG_SHUTTER with the capture timestamp before
+ * any buffers/metadata are returned with process_capture_result.
+ *
+ * 3.4 For captures that will produce some results, the HAL must not call
+ * CAMERA3_MSG_ERROR_REQUEST, since that indicates complete failure.
+ *
+ * 3.5. Valid buffers/metadata should be passed to the framework as normal.
+ *
+ * 3.6. Failed buffers should be returned to the framework as described for case 2.
+ * But failed buffers do not have to follow the strict ordering valid buffers do,
+ * and may be out-of-order with respect to valid buffers. For example, if buffers
+ * A, B, C, D, E are sent, D and E are failed, then A, E, B, D, C is an acceptable
+ * return order.
+ *
+ * 3.7. For fully-missing metadata, calling CAMERA3_MSG_ERROR_RESULT is sufficient, no
+ * need to call process_capture_result with NULL metadata or equivalent.
+ *
+ * 4. If a flush() is invoked while a process_capture_request() invocation is active, that
+ * process call should return as soon as possible. In addition, if a process_capture_request()
+ * call is made after flush() has been invoked but before flush() has returned, the
+ * capture request provided by the late process_capture_request call should be treated like
+ * a pending request in case #2 above.
+ *
+ * flush() should only return when there are no more outstanding buffers or
+ * requests left in the HAL. The framework may call configure_streams (as
+ * the HAL state is now quiesced) or may issue new requests.
+ *
+ * Note that it's sufficient to only support fully-succeeded and fully-failed result cases.
+ * However, it is highly desirable to support the partial failure cases as well, as it
+ * could help improve the flush call overall performance.
+ *
+ * Performance requirements:
+ *
+ * The HAL should return from this call in 100ms, and must return from this
+ * call in 1000ms. And this call must not be blocked longer than pipeline
+ * latency (see S7 for definition).
+ *
+ * Version information:
+ *
+ * only available if device version >= CAMERA_DEVICE_API_VERSION_3_1.
+ *
+ * Return values:
+ *
+ * 0: On a successful flush of the camera HAL.
+ *
+ * -EINVAL: If the input is malformed (the device is not valid).
+ *
+ * -ENODEV: If the camera device has encountered a serious error. After this
+ * error is returned, only the close() method can be successfully
+ * called by the framework.
+ */
+ int (*flush)(const struct camera3_device *);
+
+ /**
+ * signal_stream_flush:
+ *
+ * <= CAMERA_DEVICE_API_VERISON_3_5:
+ *
+ * Not defined and must be NULL
+ *
+ * >= CAMERA_DEVICE_API_VERISON_3_6:
+ *
+ * Signaling HAL camera service is about to perform configure_streams() call
+ * and HAL must return all buffers of designated streams. HAL must finish
+ * inflight requests normally and return all buffers belonging to the
+ * designated streams through process_capture_result() or
+ * return_stream_buffers() API in a timely manner, or camera service will run
+ * into a fatal error.
+ *
+ * Note that this call serves as an optional hint and camera service may
+ * skip calling this if all buffers are already returned.
+ *
+ */
+ void (*signal_stream_flush)(const struct camera3_device*,
+ uint32_t num_streams,
+ const camera3_stream_t* const* streams);
+
+ /**
+ * is_reconfiguration_required:
+ *
+ * <= CAMERA_DEVICE_API_VERISON_3_5:
+ *
+ * Not defined and must be NULL
+ *
+ * >= CAMERA_DEVICE_API_VERISON_3_6:
+ *
+ * Check whether complete stream reconfiguration is required for possible new session
+ * parameter values.
+ *
+ * This method must be called by the camera framework in case the client changes
+ * the value of any advertised session parameters. Depending on the specific values
+ * the HAL can decide whether a complete stream reconfiguration is required. In case
+ * the HAL returns -ENVAL, the camera framework must skip the internal reconfiguration.
+ * In case Hal returns 0, the framework must reconfigure the streams and pass the
+ * new session parameter values accordingly.
+ * This call may be done by the framework some time before the request with new parameters
+ * is submitted to the HAL, and the request may be cancelled before it ever gets submitted.
+ * Therefore, the HAL must not use this query as an indication to change its behavior in any
+ * way.
+ * ------------------------------------------------------------------------
+ *
+ * Preconditions:
+ *
+ * The framework can call this method at any time after active
+ * session configuration. There must be no impact on the performance of
+ * pending camera requests in any way. In particular there must not be
+ * any glitches or delays during normal camera streaming.
+ *
+ * Performance requirements:
+ * HW and SW camera settings must not be changed and there must not be
+ * a user-visible impact on camera performance.
+ *
+ * @param oldSessionParams The currently applied session parameters.
+ * @param newSessionParams The new session parameters set by client.
+ *
+ * @return Status Status code for the operation, one of:
+ * 0: In case the stream reconfiguration is required
+ *
+ * -EINVAL: In case the stream reconfiguration is not required.
+ *
+ * -ENOSYS: In case the camera device does not support the
+ * reconfiguration query.
+ */
+ int (*is_reconfiguration_required)(const struct camera3_device*,
+ const camera_metadata_t* old_session_params,
+ const camera_metadata_t* new_session_params);
+
+ /* reserved for future use */
+ void *reserved[6];
+} camera3_device_ops_t;
+
+/**********************************************************************
+ *
+ * Camera device definition
+ *
+ */
+typedef struct camera3_device {
+ /**
+ * common.version must equal CAMERA_DEVICE_API_VERSION_3_0 to identify this
+ * device as implementing version 3.0 of the camera device HAL.
+ *
+ * Performance requirements:
+ *
+ * Camera open (common.module->common.methods->open) should return in 200ms, and must return
+ * in 500ms.
+ * Camera close (common.close) should return in 200ms, and must return in 500ms.
+ *
+ */
+ hw_device_t common;
+ camera3_device_ops_t *ops;
+ void *priv;
+} camera3_device_t;
+
+__END_DECLS
+
+#endif /* #ifdef ANDROID_INCLUDE_CAMERA3_H */
diff --git a/chroot/opt/android-master/amd64/usr/include/hardware/camera_common.h b/chroot/opt/android-master/amd64/usr/include/hardware/camera_common.h
new file mode 100644
index 0000000..16651a9
--- /dev/null
+++ b/chroot/opt/android-master/amd64/usr/include/hardware/camera_common.h
@@ -0,0 +1,1218 @@
+/*
+ * Copyright (C) 2012 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.
+ */
+
+// FIXME: add well-defined names for cameras
+
+#ifndef ANDROID_INCLUDE_CAMERA_COMMON_H
+#define ANDROID_INCLUDE_CAMERA_COMMON_H
+
+#include <stdint.h>
+#include <stdbool.h>
+#include <sys/cdefs.h>
+#include <sys/types.h>
+#include <cutils/native_handle.h>
+#include <system/camera.h>
+#include <system/camera_vendor_tags.h>
+#include <hardware/hardware.h>
+#include <hardware/gralloc.h>
+
+__BEGIN_DECLS
+
+/**
+ * The id of this module
+ */
+#define CAMERA_HARDWARE_MODULE_ID "camera"
+
+/**
+ * Module versioning information for the Camera hardware module, based on
+ * camera_module_t.common.module_api_version. The two most significant hex
+ * digits represent the major version, and the two least significant represent
+ * the minor version.
+ *
+ *******************************************************************************
+ * Versions: 0.X - 1.X [CAMERA_MODULE_API_VERSION_1_0]
+ *
+ * Camera modules that report these version numbers implement the initial
+ * camera module HAL interface. All camera devices openable through this
+ * module support only version 1 of the camera device HAL. The device_version
+ * and static_camera_characteristics fields of camera_info are not valid. Only
+ * the android.hardware.Camera API can be supported by this module and its
+ * devices.
+ *
+ *******************************************************************************
+ * Version: 2.0 [CAMERA_MODULE_API_VERSION_2_0]
+ *
+ * Camera modules that report this version number implement the second version
+ * of the camera module HAL interface. Camera devices openable through this
+ * module may support either version 1.0 or version 2.0 of the camera device
+ * HAL interface. The device_version field of camera_info is always valid; the
+ * static_camera_characteristics field of camera_info is valid if the
+ * device_version field is 2.0 or higher.
+ *
+ *******************************************************************************
+ * Version: 2.1 [CAMERA_MODULE_API_VERSION_2_1]
+ *
+ * This camera module version adds support for asynchronous callbacks to the
+ * framework from the camera HAL module, which is used to notify the framework
+ * about changes to the camera module state. Modules that provide a valid
+ * set_callbacks() method must report at least this version number.
+ *
+ *******************************************************************************
+ * Version: 2.2 [CAMERA_MODULE_API_VERSION_2_2]
+ *
+ * This camera module version adds vendor tag support from the module, and
+ * deprecates the old vendor_tag_query_ops that were previously only
+ * accessible with a device open.
+ *
+ *******************************************************************************
+ * Version: 2.3 [CAMERA_MODULE_API_VERSION_2_3]
+ *
+ * This camera module version adds open legacy camera HAL device support.
+ * Framework can use it to open the camera device as lower device HAL version
+ * HAL device if the same device can support multiple device API versions.
+ * The standard hardware module open call (common.methods->open) continues
+ * to open the camera device with the latest supported version, which is
+ * also the version listed in camera_info_t.device_version.
+ *
+ *******************************************************************************
+ * Version: 2.4 [CAMERA_MODULE_API_VERSION_2_4]
+ *
+ * This camera module version adds below API changes:
+ *
+ * 1. Torch mode support. The framework can use it to turn on torch mode for
+ * any camera device that has a flash unit, without opening a camera device. The
+ * camera device has a higher priority accessing the flash unit than the camera
+ * module; opening a camera device will turn off the torch if it had been enabled
+ * through the module interface. When there are any resource conflicts, such as
+ * open() is called to open a camera device, the camera HAL module must notify the
+ * framework through the torch mode status callback that the torch mode has been
+ * turned off.
+ *
+ * 2. External camera (e.g. USB hot-plug camera) support. The API updates specify that
+ * the camera static info is only available when camera is connected and ready to
+ * use for external hot-plug cameras. Calls to get static info will be invalid
+ * calls when camera status is not CAMERA_DEVICE_STATUS_PRESENT. The frameworks
+ * will only count on device status change callbacks to manage the available external
+ * camera list.
+ *
+ * 3. Camera arbitration hints. This module version adds support for explicitly
+ * indicating the number of camera devices that can be simultaneously opened and used.
+ * To specify valid combinations of devices, the resource_cost and conflicting_devices
+ * fields should always be set in the camera_info structure returned by the
+ * get_camera_info call.
+ *
+ * 4. Module initialization method. This will be called by the camera service
+ * right after the HAL module is loaded, to allow for one-time initialization
+ * of the HAL. It is called before any other module methods are invoked.
+ *
+ *******************************************************************************
+ * Version: 2.5 [CAMERA_MODULE_API_VERSION_2_5]
+ *
+ * This camera module version adds below API changes:
+ *
+ * 1. Support to query characteristics of a non-standalone physical camera, which can
+ * only be accessed as part of a logical camera. It also adds camera stream combination
+ * query.
+ *
+ * 2. Ability to query whether a particular camera stream combination is
+ * supported by the camera device.
+ *
+ * 3. Device state change notification. This module version also supports
+ * notification about the overall device state change, such as
+ * folding/unfolding, or covering/uncovering of shutter.
+ */
+
+/**
+ * Predefined macros for currently-defined version numbers
+ */
+
+/**
+ * All module versions <= HARDWARE_MODULE_API_VERSION(1, 0xFF) must be treated
+ * as CAMERA_MODULE_API_VERSION_1_0
+ */
+#define CAMERA_MODULE_API_VERSION_1_0 HARDWARE_MODULE_API_VERSION(1, 0)
+#define CAMERA_MODULE_API_VERSION_2_0 HARDWARE_MODULE_API_VERSION(2, 0)
+#define CAMERA_MODULE_API_VERSION_2_1 HARDWARE_MODULE_API_VERSION(2, 1)
+#define CAMERA_MODULE_API_VERSION_2_2 HARDWARE_MODULE_API_VERSION(2, 2)
+#define CAMERA_MODULE_API_VERSION_2_3 HARDWARE_MODULE_API_VERSION(2, 3)
+#define CAMERA_MODULE_API_VERSION_2_4 HARDWARE_MODULE_API_VERSION(2, 4)
+#define CAMERA_MODULE_API_VERSION_2_5 HARDWARE_MODULE_API_VERSION(2, 5)
+
+#define CAMERA_MODULE_API_VERSION_CURRENT CAMERA_MODULE_API_VERSION_2_5
+
+/**
+ * All device versions <= HARDWARE_DEVICE_API_VERSION(1, 0xFF) must be treated
+ * as CAMERA_DEVICE_API_VERSION_1_0
+ */
+#define CAMERA_DEVICE_API_VERSION_1_0 HARDWARE_DEVICE_API_VERSION(1, 0) // DEPRECATED
+#define CAMERA_DEVICE_API_VERSION_2_0 HARDWARE_DEVICE_API_VERSION(2, 0) // NO LONGER SUPPORTED
+#define CAMERA_DEVICE_API_VERSION_2_1 HARDWARE_DEVICE_API_VERSION(2, 1) // NO LONGER SUPPORTED
+#define CAMERA_DEVICE_API_VERSION_3_0 HARDWARE_DEVICE_API_VERSION(3, 0) // NO LONGER SUPPORTED
+#define CAMERA_DEVICE_API_VERSION_3_1 HARDWARE_DEVICE_API_VERSION(3, 1) // NO LONGER SUPPORTED
+#define CAMERA_DEVICE_API_VERSION_3_2 HARDWARE_DEVICE_API_VERSION(3, 2)
+#define CAMERA_DEVICE_API_VERSION_3_3 HARDWARE_DEVICE_API_VERSION(3, 3)
+#define CAMERA_DEVICE_API_VERSION_3_4 HARDWARE_DEVICE_API_VERSION(3, 4)
+#define CAMERA_DEVICE_API_VERSION_3_5 HARDWARE_DEVICE_API_VERSION(3, 5)
+#define CAMERA_DEVICE_API_VERSION_3_6 HARDWARE_DEVICE_API_VERSION(3, 6)
+
+// Device version 3.5 is current, older HAL camera device versions are not
+// recommended for new devices.
+#define CAMERA_DEVICE_API_VERSION_CURRENT CAMERA_DEVICE_API_VERSION_3_5
+
+/**
+ * Defined in /system/media/camera/include/system/camera_metadata.h
+ */
+typedef struct camera_metadata camera_metadata_t;
+
+typedef struct camera_info {
+ /**
+ * The direction that the camera faces to. See system/core/include/system/camera.h
+ * for camera facing definitions.
+ *
+ * Version information (based on camera_module_t.common.module_api_version):
+ *
+ * CAMERA_MODULE_API_VERSION_2_3 or lower:
+ *
+ * It should be CAMERA_FACING_BACK or CAMERA_FACING_FRONT.
+ *
+ * CAMERA_MODULE_API_VERSION_2_4 or higher:
+ *
+ * It should be CAMERA_FACING_BACK, CAMERA_FACING_FRONT or
+ * CAMERA_FACING_EXTERNAL.
+ */
+ int facing;
+
+ /**
+ * The orientation of the camera image. The value is the angle that the
+ * camera image needs to be rotated clockwise so it shows correctly on the
+ * display in its natural orientation. It should be 0, 90, 180, or 270.
+ *
+ * For example, suppose a device has a naturally tall screen. The
+ * back-facing camera sensor is mounted in landscape. You are looking at the
+ * screen. If the top side of the camera sensor is aligned with the right
+ * edge of the screen in natural orientation, the value should be 90. If the
+ * top side of a front-facing camera sensor is aligned with the right of the
+ * screen, the value should be 270.
+ *
+ * Version information (based on camera_module_t.common.module_api_version):
+ *
+ * CAMERA_MODULE_API_VERSION_2_3 or lower:
+ *
+ * Valid in all camera_module versions.
+ *
+ * CAMERA_MODULE_API_VERSION_2_4 or higher:
+ *
+ * Valid if camera facing is CAMERA_FACING_BACK or CAMERA_FACING_FRONT,
+ * not valid if camera facing is CAMERA_FACING_EXTERNAL.
+ */
+ int orientation;
+
+ /**
+ * The value of camera_device_t.common.version.
+ *
+ * Version information (based on camera_module_t.common.module_api_version):
+ *
+ * CAMERA_MODULE_API_VERSION_1_0:
+ *
+ * Not valid. Can be assumed to be CAMERA_DEVICE_API_VERSION_1_0. Do
+ * not read this field.
+ *
+ * CAMERA_MODULE_API_VERSION_2_0 or higher:
+ *
+ * Always valid
+ *
+ */
+ uint32_t device_version;
+
+ /**
+ * The camera's fixed characteristics, which include all static camera metadata
+ * specified in system/media/camera/docs/docs.html. This should be a sorted metadata
+ * buffer, and may not be modified or freed by the caller. The pointer should remain
+ * valid for the lifetime of the camera module, and values in it may not
+ * change after it is returned by get_camera_info().
+ *
+ * Version information (based on camera_module_t.common.module_api_version):
+ *
+ * CAMERA_MODULE_API_VERSION_1_0:
+ *
+ * Not valid. Extra characteristics are not available. Do not read this
+ * field.
+ *
+ * CAMERA_MODULE_API_VERSION_2_0 or higher:
+ *
+ * Valid if device_version >= CAMERA_DEVICE_API_VERSION_2_0. Do not read
+ * otherwise.
+ *
+ */
+ const camera_metadata_t *static_camera_characteristics;
+
+ /**
+ * The total resource "cost" of using this camera, represented as an integer
+ * value in the range [0, 100] where 100 represents total usage of the shared
+ * resource that is the limiting bottleneck of the camera subsystem. This may
+ * be a very rough estimate, and is used as a hint to the camera service to
+ * determine when to disallow multiple applications from simultaneously
+ * opening different cameras advertised by the camera service.
+ *
+ * The camera service must be able to simultaneously open and use any
+ * combination of camera devices exposed by the HAL where the sum of
+ * the resource costs of these cameras is <= 100. For determining cost,
+ * each camera device must be assumed to be configured and operating at
+ * the maximally resource-consuming framerate and stream size settings
+ * available in the configuration settings exposed for that device through
+ * the camera metadata.
+ *
+ * The camera service may still attempt to simultaneously open combinations
+ * of camera devices with a total resource cost > 100. This may succeed or
+ * fail. If this succeeds, combinations of configurations that are not
+ * supported due to resource constraints from having multiple open devices
+ * should fail during the configure calls. If the total resource cost is
+ * <= 100, open and configure should never fail for any stream configuration
+ * settings or other device capabilities that would normally succeed for a
+ * device when it is the only open camera device.
+ *
+ * This field will be used to determine whether background applications are
+ * allowed to use this camera device while other applications are using other
+ * camera devices. Note: multiple applications will never be allowed by the
+ * camera service to simultaneously open the same camera device.
+ *
+ * Example use cases:
+ *
+ * Ex. 1: Camera Device 0 = Back Camera
+ * Camera Device 1 = Front Camera
+ * - Using both camera devices causes a large framerate slowdown due to
+ * limited ISP bandwidth.
+ *
+ * Configuration:
+ *
+ * Camera Device 0 - resource_cost = 51
+ * conflicting_devices = null
+ * Camera Device 1 - resource_cost = 51
+ * conflicting_devices = null
+ *
+ * Result:
+ *
+ * Since the sum of the resource costs is > 100, if a higher-priority
+ * application has either device open, no lower-priority applications will be
+ * allowed by the camera service to open either device. If a lower-priority
+ * application is using a device that a higher-priority subsequently attempts
+ * to open, the lower-priority application will be forced to disconnect the
+ * the device.
+ *
+ * If the highest-priority application chooses, it may still attempt to open
+ * both devices (since these devices are not listed as conflicting in the
+ * conflicting_devices fields), but usage of these devices may fail in the
+ * open or configure calls.
+ *
+ * Ex. 2: Camera Device 0 = Left Back Camera
+ * Camera Device 1 = Right Back Camera
+ * Camera Device 2 = Combined stereo camera using both right and left
+ * back camera sensors used by devices 0, and 1
+ * Camera Device 3 = Front Camera
+ * - Due to do hardware constraints, up to two cameras may be open at once. The
+ * combined stereo camera may never be used at the same time as either of the
+ * two back camera devices (device 0, 1), and typically requires too much
+ * bandwidth to use at the same time as the front camera (device 3).
+ *
+ * Configuration:
+ *
+ * Camera Device 0 - resource_cost = 50
+ * conflicting_devices = { 2 }
+ * Camera Device 1 - resource_cost = 50
+ * conflicting_devices = { 2 }
+ * Camera Device 2 - resource_cost = 100
+ * conflicting_devices = { 0, 1 }
+ * Camera Device 3 - resource_cost = 50
+ * conflicting_devices = null
+ *
+ * Result:
+ *
+ * Based on the conflicting_devices fields, the camera service guarantees that
+ * the following sets of open devices will never be allowed: { 1, 2 }, { 0, 2 }.
+ *
+ * Based on the resource_cost fields, if a high-priority foreground application
+ * is using camera device 0, a background application would be allowed to open
+ * camera device 1 or 3 (but would be forced to disconnect it again if the
+ * foreground application opened another device).
+ *
+ * The highest priority application may still attempt to simultaneously open
+ * devices 0, 2, and 3, but the HAL may fail in open or configure calls for
+ * this combination.
+ *
+ * Ex. 3: Camera Device 0 = Back Camera
+ * Camera Device 1 = Front Camera
+ * Camera Device 2 = Low-power Front Camera that uses the same
+ * sensor as device 1, but only exposes image stream
+ * resolutions that can be used in low-power mode
+ * - Using both front cameras (device 1, 2) at the same time is impossible due
+ * a shared physical sensor. Using the back and "high-power" front camera
+ * (device 1) may be impossible for some stream configurations due to hardware
+ * limitations, but the "low-power" front camera option may always be used as
+ * it has special dedicated hardware.
+ *
+ * Configuration:
+ *
+ * Camera Device 0 - resource_cost = 100
+ * conflicting_devices = null
+ * Camera Device 1 - resource_cost = 100
+ * conflicting_devices = { 2 }
+ * Camera Device 2 - resource_cost = 0
+ * conflicting_devices = { 1 }
+ * Result:
+ *
+ * Based on the conflicting_devices fields, the camera service guarantees that
+ * the following sets of open devices will never be allowed: { 1, 2 }.
+ *
+ * Based on the resource_cost fields, only the highest priority application
+ * may attempt to open both device 0 and 1 at the same time. If a higher-priority
+ * application is not using device 1 or 2, a low-priority background application
+ * may open device 2 (but will be forced to disconnect it if a higher-priority
+ * application subsequently opens device 1 or 2).
+ *
+ * Version information (based on camera_module_t.common.module_api_version):
+ *
+ * CAMERA_MODULE_API_VERSION_2_3 or lower:
+ *
+ * Not valid. Can be assumed to be 100. Do not read this field.
+ *
+ * CAMERA_MODULE_API_VERSION_2_4 or higher:
+ *
+ * Always valid.
+ */
+ int resource_cost;
+
+ /**
+ * An array of camera device IDs represented as NULL-terminated strings
+ * indicating other devices that cannot be simultaneously opened while this
+ * camera device is in use.
+ *
+ * This field is intended to be used to indicate that this camera device
+ * is a composite of several other camera devices, or otherwise has
+ * hardware dependencies that prohibit simultaneous usage. If there are no
+ * dependencies, a NULL may be returned in this field to indicate this.
+ *
+ * The camera service will never simultaneously open any of the devices
+ * in this list while this camera device is open.
+ *
+ * The strings pointed to in this field will not be cleaned up by the camera
+ * service, and must remain while this device is plugged in.
+ *
+ * Version information (based on camera_module_t.common.module_api_version):
+ *
+ * CAMERA_MODULE_API_VERSION_2_3 or lower:
+ *
+ * Not valid. Can be assumed to be NULL. Do not read this field.
+ *
+ * CAMERA_MODULE_API_VERSION_2_4 or higher:
+ *
+ * Always valid.
+ */
+ char** conflicting_devices;
+
+ /**
+ * The length of the array given in the conflicting_devices field.
+ *
+ * Version information (based on camera_module_t.common.module_api_version):
+ *
+ * CAMERA_MODULE_API_VERSION_2_3 or lower:
+ *
+ * Not valid. Can be assumed to be 0. Do not read this field.
+ *
+ * CAMERA_MODULE_API_VERSION_2_4 or higher:
+ *
+ * Always valid.
+ */
+ size_t conflicting_devices_length;
+
+} camera_info_t;
+
+/**
+ * camera_device_status_t:
+ *
+ * The current status of the camera device, as provided by the HAL through the
+ * camera_module_callbacks.camera_device_status_change() call.
+ *
+ * At module load time, the framework will assume all camera devices are in the
+ * CAMERA_DEVICE_STATUS_PRESENT state. The HAL should invoke
+ * camera_module_callbacks::camera_device_status_change to inform the framework
+ * of any initially NOT_PRESENT devices.
+ *
+ * Allowed transitions:
+ * PRESENT -> NOT_PRESENT
+ * NOT_PRESENT -> ENUMERATING
+ * NOT_PRESENT -> PRESENT
+ * ENUMERATING -> PRESENT
+ * ENUMERATING -> NOT_PRESENT
+ */
+typedef enum camera_device_status {
+ /**
+ * The camera device is not currently connected, and opening it will return
+ * failure.
+ *
+ * Version information (based on camera_module_t.common.module_api_version):
+ *
+ * CAMERA_MODULE_API_VERSION_2_3 or lower:
+ *
+ * Calls to get_camera_info must still succeed, and provide the same information
+ * it would if the camera were connected.
+ *
+ * CAMERA_MODULE_API_VERSION_2_4:
+ *
+ * The camera device at this status must return -EINVAL for get_camera_info call,
+ * as the device is not connected.
+ */
+ CAMERA_DEVICE_STATUS_NOT_PRESENT = 0,
+
+ /**
+ * The camera device is connected, and opening it will succeed.
+ *
+ * CAMERA_MODULE_API_VERSION_2_3 or lower:
+ *
+ * The information returned by get_camera_info cannot change due to this status
+ * change. By default, the framework will assume all devices are in this state.
+ *
+ * CAMERA_MODULE_API_VERSION_2_4:
+ *
+ * The information returned by get_camera_info will become valid after a device's
+ * status changes to this. By default, the framework will assume all devices are in
+ * this state.
+ */
+ CAMERA_DEVICE_STATUS_PRESENT = 1,
+
+ /**
+ * The camera device is connected, but it is undergoing an enumeration and
+ * so opening the device will return -EBUSY.
+ *
+ * CAMERA_MODULE_API_VERSION_2_3 or lower:
+ *
+ * Calls to get_camera_info must still succeed, as if the camera was in the
+ * PRESENT status.
+ *
+ * CAMERA_MODULE_API_VERSION_2_4:
+ *
+ * The camera device at this status must return -EINVAL for get_camera_info for call,
+ * as the device is not ready.
+ */
+ CAMERA_DEVICE_STATUS_ENUMERATING = 2,
+
+} camera_device_status_t;
+
+/**
+ * torch_mode_status_t:
+ *
+ * The current status of the torch mode, as provided by the HAL through the
+ * camera_module_callbacks.torch_mode_status_change() call.
+ *
+ * The torch mode status of a camera device is applicable only when the camera
+ * device is present. The framework will not call set_torch_mode() to turn on
+ * torch mode of a camera device if the camera device is not present. At module
+ * load time, the framework will assume torch modes are in the
+ * TORCH_MODE_STATUS_AVAILABLE_OFF state if the camera device is present and
+ * android.flash.info.available is reported as true via get_camera_info() call.
+ *
+ * The behaviors of the camera HAL module that the framework expects in the
+ * following situations when a camera device's status changes:
+ * 1. A previously-disconnected camera device becomes connected.
+ * After camera_module_callbacks::camera_device_status_change() is invoked
+ * to inform the framework that the camera device is present, the framework
+ * will assume the camera device's torch mode is in
+ * TORCH_MODE_STATUS_AVAILABLE_OFF state. The camera HAL module does not need
+ * to invoke camera_module_callbacks::torch_mode_status_change() unless the
+ * flash unit is unavailable to use by set_torch_mode().
+ *
+ * 2. A previously-connected camera becomes disconnected.
+ * After camera_module_callbacks::camera_device_status_change() is invoked
+ * to inform the framework that the camera device is not present, the
+ * framework will not call set_torch_mode() for the disconnected camera
+ * device until its flash unit becomes available again. The camera HAL
+ * module does not need to invoke
+ * camera_module_callbacks::torch_mode_status_change() separately to inform
+ * that the flash unit has become unavailable.
+ *
+ * 3. open() is called to open a camera device.
+ * The camera HAL module must invoke
+ * camera_module_callbacks::torch_mode_status_change() for all flash units
+ * that have entered TORCH_MODE_STATUS_NOT_AVAILABLE state and can not be
+ * turned on by calling set_torch_mode() anymore due to this open() call.
+ * open() must not trigger TORCH_MODE_STATUS_AVAILABLE_OFF before
+ * TORCH_MODE_STATUS_NOT_AVAILABLE for all flash units that have become
+ * unavailable.
+ *
+ * 4. close() is called to close a camera device.
+ * The camera HAL module must invoke
+ * camera_module_callbacks::torch_mode_status_change() for all flash units
+ * that have entered TORCH_MODE_STATUS_AVAILABLE_OFF state and can be turned
+ * on by calling set_torch_mode() again because of enough resources freed
+ * up by this close() call.
+ *
+ * Note that the framework calling set_torch_mode() successfully must trigger
+ * TORCH_MODE_STATUS_AVAILABLE_OFF or TORCH_MODE_STATUS_AVAILABLE_ON callback
+ * for the given camera device. Additionally it must trigger
+ * TORCH_MODE_STATUS_AVAILABLE_OFF callbacks for other previously-on torch
+ * modes if HAL cannot keep multiple torch modes on simultaneously.
+ */
+typedef enum torch_mode_status {
+
+ /**
+ * The flash unit is no longer available and the torch mode can not be
+ * turned on by calling set_torch_mode(). If the torch mode is on, it
+ * will be turned off by HAL before HAL calls torch_mode_status_change().
+ */
+ TORCH_MODE_STATUS_NOT_AVAILABLE = 0,
+
+ /**
+ * A torch mode has become off and available to be turned on via
+ * set_torch_mode(). This may happen in the following
+ * cases:
+ * 1. After the resources to turn on the torch mode have become available.
+ * 2. After set_torch_mode() is called to turn off the torch mode.
+ * 3. After the framework turned on the torch mode of some other camera
+ * device and HAL had to turn off the torch modes of any camera devices
+ * that were previously on.
+ */
+ TORCH_MODE_STATUS_AVAILABLE_OFF = 1,
+
+ /**
+ * A torch mode has become on and available to be turned off via
+ * set_torch_mode(). This can happen only after set_torch_mode() is called
+ * to turn on the torch mode.
+ */
+ TORCH_MODE_STATUS_AVAILABLE_ON = 2,
+
+} torch_mode_status_t;
+
+/**
+ * Callback functions for the camera HAL module to use to inform the framework
+ * of changes to the camera subsystem.
+ *
+ * Version information (based on camera_module_t.common.module_api_version):
+ *
+ * Each callback is called only by HAL modules implementing the indicated
+ * version or higher of the HAL module API interface.
+ *
+ * CAMERA_MODULE_API_VERSION_2_1:
+ * camera_device_status_change()
+ *
+ * CAMERA_MODULE_API_VERSION_2_4:
+ * torch_mode_status_change()
+
+ */
+typedef struct camera_module_callbacks {
+
+ /**
+ * camera_device_status_change:
+ *
+ * Callback to the framework to indicate that the state of a specific camera
+ * device has changed. At module load time, the framework will assume all
+ * camera devices are in the CAMERA_DEVICE_STATUS_PRESENT state. The HAL
+ * must call this method to inform the framework of any initially
+ * NOT_PRESENT devices.
+ *
+ * This callback is added for CAMERA_MODULE_API_VERSION_2_1.
+ *
+ * camera_module_callbacks: The instance of camera_module_callbacks_t passed
+ * to the module with set_callbacks.
+ *
+ * camera_id: The ID of the camera device that has a new status.
+ *
+ * new_status: The new status code, one of the camera_device_status_t enums,
+ * or a platform-specific status.
+ *
+ */
+ void (*camera_device_status_change)(const struct camera_module_callbacks*,
+ int camera_id,
+ int new_status);
+
+ /**
+ * torch_mode_status_change:
+ *
+ * Callback to the framework to indicate that the state of the torch mode
+ * of the flash unit associated with a specific camera device has changed.
+ * At module load time, the framework will assume the torch modes are in
+ * the TORCH_MODE_STATUS_AVAILABLE_OFF state if android.flash.info.available
+ * is reported as true via get_camera_info() call.
+ *
+ * This callback is added for CAMERA_MODULE_API_VERSION_2_4.
+ *
+ * camera_module_callbacks: The instance of camera_module_callbacks_t
+ * passed to the module with set_callbacks.
+ *
+ * camera_id: The ID of camera device whose flash unit has a new torch mode
+ * status.
+ *
+ * new_status: The new status code, one of the torch_mode_status_t enums.
+ */
+ void (*torch_mode_status_change)(const struct camera_module_callbacks*,
+ const char* camera_id,
+ int new_status);
+
+
+} camera_module_callbacks_t;
+
+/**
+ * camera_stream_t:
+ *
+ * A handle to a single camera input or output stream. A stream is defined by
+ * the framework by its buffer resolution and format and gralloc usage flags.
+ *
+ * The stream structures are owned by the framework and pointers to a
+ * camera_stream passed into the HAL by is_stream_combination_supported() are
+ * only valid within the scope of the call.
+ *
+ * All camera_stream members are immutable.
+ */
+typedef struct camera_stream {
+ /**
+ * The type of the stream, one of the camera3_stream_type_t values.
+ */
+ int stream_type;
+
+ /**
+ * The width in pixels of the buffers in this stream
+ */
+ uint32_t width;
+
+ /**
+ * The height in pixels of the buffers in this stream
+ */
+ uint32_t height;
+
+ /**
+ * The pixel format for the buffers in this stream. Format is a value from
+ * the HAL_PIXEL_FORMAT_* list in system/core/include/system/graphics.h, or
+ * from device-specific headers.
+ *
+ * If HAL_PIXEL_FORMAT_IMPLEMENTATION_DEFINED is used, then the platform
+ * gralloc module will select a format based on the usage flags provided by
+ * the camera device and the other endpoint of the stream.
+ *
+ */
+ int format;
+
+ /**
+ * The gralloc usage flags for this stream, as needed by the HAL. The usage
+ * flags are defined in gralloc.h (GRALLOC_USAGE_*), or in device-specific
+ * headers.
+ *
+ * For output streams, these are the HAL's producer usage flags. For input
+ * streams, these are the HAL's consumer usage flags. The usage flags from
+ * the producer and the consumer will be combined together and then passed
+ * to the platform gralloc HAL module for allocating the gralloc buffers for
+ * each stream.
+ *
+ * The usage flag for an output stream may be bitwise
+ * combination of usage flags for multiple consumers, for the purpose of
+ * sharing one camera stream between those consumers. The HAL must fail
+ * the stream combination query call with -EINVAL if the combined flags cannot be
+ * supported due to imcompatible buffer format, dataSpace, or other hardware
+ * limitations.
+ */
+ uint32_t usage;
+
+ /**
+ * A field that describes the contents of the buffer. The format and buffer
+ * dimensions define the memory layout and structure of the stream buffers,
+ * while dataSpace defines the meaning of the data within the buffer.
+ *
+ * For most formats, dataSpace defines the color space of the image data.
+ * In addition, for some formats, dataSpace indicates whether image- or
+ * depth-based data is requested. See system/core/include/system/graphics.h
+ * for details of formats and valid dataSpace values for each format.
+ *
+ * Always set by the camera service. The dataspace values are set
+ * using the V0 dataspace definitions in graphics.h
+ */
+ android_dataspace_t data_space;
+
+ /**
+ * The required output rotation of the stream, one of
+ * the camera3_stream_rotation_t values. This must be inspected by HAL along
+ * with stream width and height. For example, if the rotation is 90 degree
+ * and the stream width and height is 720 and 1280 respectively, camera service
+ * will supply buffers of size 720x1280, and HAL should capture a 1280x720 image
+ * and rotate the image by 90 degree counterclockwise. The rotation field is
+ * no-op when the stream type is input. Camera HAL must ignore the rotation
+ * field for an input stream.
+ *
+ * Always set by camera service. HAL must inspect this field during stream
+ * combination query and return -EINVAL if it cannot perform such rotation.
+ * HAL must always support CAMERA3_STREAM_ROTATION_0, so a
+ * is_stream_combination_supported() call must not fail for unsupported rotation if
+ * rotation field of all streams is CAMERA3_STREAM_ROTATION_0.
+ *
+ */
+ int rotation;
+
+ /**
+ * The physical camera id this stream belongs to.
+ * Always set by camera service. If the camera device is not a logical
+ * multi camera, or if the camera is a logical multi camera but the stream
+ * is not a physical output stream, this field will point to a 0-length
+ * string.
+ *
+ * A logical multi camera is a camera device backed by multiple physical
+ * cameras that are also exposed to the application. And for a logical
+ * multi camera, a physical output stream is an output stream specifically
+ * requested on an underlying physical camera.
+ *
+ * For an input stream, this field is guaranteed to be a 0-length string.
+ */
+ const char* physical_camera_id;
+
+} camera_stream_t;
+
+/**
+ * camera_stream_combination_t:
+ *
+ * A structure of stream definitions, used by is_stream_combination_supported(). This
+ * structure defines all the input & output streams for specific camera use case.
+ */
+typedef struct camera_stream_combination {
+ /**
+ * The total number of streams by the framework. This includes
+ * both input and output streams. The number of streams will be at least 1,
+ * and there will be at least one output-capable stream.
+ */
+ uint32_t num_streams;
+
+ /**
+ * An array of camera streams, defining the input/output
+ * stream combination for the camera HAL device.
+ *
+ * At most one input-capable stream may be defined.
+ *
+ * At least one output-capable stream must be defined.
+ */
+ camera_stream_t *streams;
+
+ /**
+ * The operation mode of streams in this stream combination, one of the value
+ * defined in camera3_stream_configuration_mode_t.
+ *
+ */
+ uint32_t operation_mode;
+
+} camera_stream_combination_t;
+
+/**
+ * device_state_t:
+ *
+ * Possible physical states of the overall device, for use with
+ * notify_device_state_change.
+ */
+typedef enum device_state {
+ /**
+ * The device is in its normal physical configuration. This is the default if the
+ * device does not support multiple different states.
+ */
+ NORMAL = 0,
+
+ /**
+ * Camera device(s) facing backward are covered.
+ */
+ BACK_COVERED = 1 << 0,
+
+ /**
+ * Camera device(s) facing foward are covered.
+ */
+ FRONT_COVERED = 1 << 1,
+
+ /**
+ * The device is folded. If not set, the device is unfolded or does not
+ * support folding.
+ *
+ * The exact point when this status change happens during the folding
+ * operation is device-specific.
+ */
+ FOLDED = 1 << 2,
+
+ /**
+ * First vendor-specific device state. All bits above and including this one
+ * are for vendor state values. Values below this one must only be used
+ * for framework-defined states.
+ */
+ VENDOR_STATE_START = 1LL << 32
+
+} device_state_t;
+
+typedef struct camera_module {
+ /**
+ * Common methods of the camera module. This *must* be the first member of
+ * camera_module as users of this structure will cast a hw_module_t to
+ * camera_module pointer in contexts where it's known the hw_module_t
+ * references a camera_module.
+ *
+ * The return values for common.methods->open for camera_module are:
+ *
+ * 0: On a successful open of the camera device.
+ *
+ * -ENODEV: The camera device cannot be opened due to an internal
+ * error.
+ *
+ * -EINVAL: The input arguments are invalid, i.e. the id is invalid,
+ * and/or the module is invalid.
+ *
+ * -EBUSY: The camera device was already opened for this camera id
+ * (by using this method or open_legacy),
+ * regardless of the device HAL version it was opened as.
+ *
+ * -EUSERS: The maximal number of camera devices that can be
+ * opened concurrently were opened already, either by
+ * this method or the open_legacy method.
+ *
+ * All other return values from common.methods->open will be treated as
+ * -ENODEV.
+ */
+ hw_module_t common;
+
+ /**
+ * get_number_of_cameras:
+ *
+ * Returns the number of camera devices accessible through the camera
+ * module. The camera devices are numbered 0 through N-1, where N is the
+ * value returned by this call. The name of the camera device for open() is
+ * simply the number converted to a string. That is, "0" for camera ID 0,
+ * "1" for camera ID 1.
+ *
+ * Version information (based on camera_module_t.common.module_api_version):
+ *
+ * CAMERA_MODULE_API_VERSION_2_3 or lower:
+ *
+ * The value here must be static, and cannot change after the first call
+ * to this method.
+ *
+ * CAMERA_MODULE_API_VERSION_2_4 or higher:
+ *
+ * The value here must be static, and must count only built-in cameras,
+ * which have CAMERA_FACING_BACK or CAMERA_FACING_FRONT camera facing values
+ * (camera_info.facing). The HAL must not include the external cameras
+ * (camera_info.facing == CAMERA_FACING_EXTERNAL) into the return value
+ * of this call. Frameworks will use camera_device_status_change callback
+ * to manage number of external cameras.
+ */
+ int (*get_number_of_cameras)(void);
+
+ /**
+ * get_camera_info:
+ *
+ * Return the static camera information for a given camera device. This
+ * information may not change for a camera device.
+ *
+ * Return values:
+ *
+ * 0: On a successful operation
+ *
+ * -ENODEV: The information cannot be provided due to an internal
+ * error.
+ *
+ * -EINVAL: The input arguments are invalid, i.e. the id is invalid,
+ * and/or the module is invalid.
+ *
+ * Version information (based on camera_module_t.common.module_api_version):
+ *
+ * CAMERA_MODULE_API_VERSION_2_4 or higher:
+ *
+ * When a camera is disconnected, its camera id becomes invalid. Calling this
+ * this method with this invalid camera id will get -EINVAL and NULL camera
+ * static metadata (camera_info.static_camera_characteristics).
+ */
+ int (*get_camera_info)(int camera_id, struct camera_info *info);
+
+ /**
+ * set_callbacks:
+ *
+ * Provide callback function pointers to the HAL module to inform framework
+ * of asynchronous camera module events. The framework will call this
+ * function once after initial camera HAL module load, after the
+ * get_number_of_cameras() method is called for the first time, and before
+ * any other calls to the module.
+ *
+ * Version information (based on camera_module_t.common.module_api_version):
+ *
+ * CAMERA_MODULE_API_VERSION_1_0, CAMERA_MODULE_API_VERSION_2_0:
+ *
+ * Not provided by HAL module. Framework may not call this function.
+ *
+ * CAMERA_MODULE_API_VERSION_2_1:
+ *
+ * Valid to be called by the framework.
+ *
+ * Return values:
+ *
+ * 0: On a successful operation
+ *
+ * -ENODEV: The operation cannot be completed due to an internal
+ * error.
+ *
+ * -EINVAL: The input arguments are invalid, i.e. the callbacks are
+ * null
+ */
+ int (*set_callbacks)(const camera_module_callbacks_t *callbacks);
+
+ /**
+ * get_vendor_tag_ops:
+ *
+ * Get methods to query for vendor extension metadata tag information. The
+ * HAL should fill in all the vendor tag operation methods, or leave ops
+ * unchanged if no vendor tags are defined.
+ *
+ * The vendor_tag_ops structure used here is defined in:
+ * system/media/camera/include/system/vendor_tags.h
+ *
+ * Version information (based on camera_module_t.common.module_api_version):
+ *
+ * CAMERA_MODULE_API_VERSION_1_x/2_0/2_1:
+ * Not provided by HAL module. Framework may not call this function.
+ *
+ * CAMERA_MODULE_API_VERSION_2_2:
+ * Valid to be called by the framework.
+ */
+ void (*get_vendor_tag_ops)(vendor_tag_ops_t* ops);
+
+ /**
+ * open_legacy:
+ *
+ * Open a specific legacy camera HAL device if multiple device HAL API
+ * versions are supported by this camera HAL module. For example, if the
+ * camera module supports both CAMERA_DEVICE_API_VERSION_1_0 and
+ * CAMERA_DEVICE_API_VERSION_3_2 device API for the same camera id,
+ * framework can call this function to open the camera device as
+ * CAMERA_DEVICE_API_VERSION_1_0 device.
+ *
+ * This is an optional method. A Camera HAL module does not need to support
+ * more than one device HAL version per device, and such modules may return
+ * -ENOSYS for all calls to this method. For all older HAL device API
+ * versions that are not supported, it may return -EOPNOTSUPP. When above
+ * cases occur, The normal open() method (common.methods->open) will be
+ * used by the framework instead.
+ *
+ * Version information (based on camera_module_t.common.module_api_version):
+ *
+ * CAMERA_MODULE_API_VERSION_1_x/2_0/2_1/2_2:
+ * Not provided by HAL module. Framework will not call this function.
+ *
+ * CAMERA_MODULE_API_VERSION_2_3:
+ * Valid to be called by the framework.
+ *
+ * Return values:
+ *
+ * 0: On a successful open of the camera device.
+ *
+ * -ENOSYS This method is not supported.
+ *
+ * -EOPNOTSUPP: The requested HAL version is not supported by this method.
+ *
+ * -EINVAL: The input arguments are invalid, i.e. the id is invalid,
+ * and/or the module is invalid.
+ *
+ * -EBUSY: The camera device was already opened for this camera id
+ * (by using this method or common.methods->open method),
+ * regardless of the device HAL version it was opened as.
+ *
+ * -EUSERS: The maximal number of camera devices that can be
+ * opened concurrently were opened already, either by
+ * this method or common.methods->open method.
+ */
+ int (*open_legacy)(const struct hw_module_t* module, const char* id,
+ uint32_t halVersion, struct hw_device_t** device);
+
+ /**
+ * set_torch_mode:
+ *
+ * Turn on or off the torch mode of the flash unit associated with a given
+ * camera ID. If the operation is successful, HAL must notify the framework
+ * torch state by invoking
+ * camera_module_callbacks.torch_mode_status_change() with the new state.
+ *
+ * The camera device has a higher priority accessing the flash unit. When
+ * there are any resource conflicts, such as open() is called to open a
+ * camera device, HAL module must notify the framework through
+ * camera_module_callbacks.torch_mode_status_change() that the
+ * torch mode has been turned off and the torch mode state has become
+ * TORCH_MODE_STATUS_NOT_AVAILABLE. When resources to turn on torch mode
+ * become available again, HAL module must notify the framework through
+ * camera_module_callbacks.torch_mode_status_change() that the torch mode
+ * state has become TORCH_MODE_STATUS_AVAILABLE_OFF for set_torch_mode() to
+ * be called.
+ *
+ * When the framework calls set_torch_mode() to turn on the torch mode of a
+ * flash unit, if HAL cannot keep multiple torch modes on simultaneously,
+ * HAL should turn off the torch mode that was turned on by
+ * a previous set_torch_mode() call and notify the framework that the torch
+ * mode state of that flash unit has become TORCH_MODE_STATUS_AVAILABLE_OFF.
+ *
+ * Version information (based on camera_module_t.common.module_api_version):
+ *
+ * CAMERA_MODULE_API_VERSION_1_x/2_0/2_1/2_2/2_3:
+ * Not provided by HAL module. Framework will not call this function.
+ *
+ * CAMERA_MODULE_API_VERSION_2_4:
+ * Valid to be called by the framework.
+ *
+ * Return values:
+ *
+ * 0: On a successful operation.
+ *
+ * -ENOSYS: The camera device does not support this operation. It is
+ * returned if and only if android.flash.info.available is
+ * false.
+ *
+ * -EBUSY: The camera device is already in use.
+ *
+ * -EUSERS: The resources needed to turn on the torch mode are not
+ * available, typically because other camera devices are
+ * holding the resources to make using the flash unit not
+ * possible.
+ *
+ * -EINVAL: camera_id is invalid.
+ *
+ */
+ int (*set_torch_mode)(const char* camera_id, bool enabled);
+
+ /**
+ * init:
+ *
+ * This method is called by the camera service before any other methods
+ * are invoked, right after the camera HAL library has been successfully
+ * loaded. It may be left as NULL by the HAL module, if no initialization
+ * in needed.
+ *
+ * It can be used by HAL implementations to perform initialization and
+ * other one-time operations.
+ *
+ * Version information (based on camera_module_t.common.module_api_version):
+ *
+ * CAMERA_MODULE_API_VERSION_1_x/2_0/2_1/2_2/2_3:
+ * Not provided by HAL module. Framework will not call this function.
+ *
+ * CAMERA_MODULE_API_VERSION_2_4:
+ * If not NULL, will always be called by the framework once after the HAL
+ * module is loaded, before any other HAL module method is called.
+ *
+ * Return values:
+ *
+ * 0: On a successful operation.
+ *
+ * -ENODEV: Initialization cannot be completed due to an internal
+ * error. The HAL must be assumed to be in a nonfunctional
+ * state.
+ *
+ */
+ int (*init)();
+
+ /**
+ * get_physical_camera_info:
+ *
+ * Return the static metadata for a physical camera as a part of a logical
+ * camera device. This function is only called for those physical camera
+ * ID(s) that are not exposed independently. In other words, camera_id will
+ * be greater or equal to the return value of get_number_of_cameras().
+ *
+ * Return values:
+ *
+ * 0: On a successful operation
+ *
+ * -ENODEV: The information cannot be provided due to an internal
+ * error.
+ *
+ * -EINVAL: The input arguments are invalid, i.e. the id is invalid,
+ * and/or the module is invalid.
+ *
+ * Version information (based on camera_module_t.common.module_api_version):
+ *
+ * CAMERA_MODULE_API_VERSION_1_x/2_0/2_1/2_2/2_3/2_4:
+ * Not provided by HAL module. Framework will not call this function.
+ *
+ * CAMERA_MODULE_API_VERSION_2_5 or higher:
+ * If any of the camera devices accessible through this camera module is
+ * a logical multi-camera, and at least one of the physical cameras isn't
+ * a stand-alone camera device, this function will be called by the camera
+ * framework. Calling this function with invalid physical_camera_id will
+ * get -EINVAL, and NULL static_metadata.
+ */
+ int (*get_physical_camera_info)(int physical_camera_id,
+ camera_metadata_t **static_metadata);
+
+ /**
+ * is_stream_combination_supported:
+ *
+ * Check for device support of specific camera stream combination.
+ *
+ * Return values:
+ *
+ * 0: In case the stream combination is supported.
+ *
+ * -EINVAL: In case the stream combination is not supported.
+ *
+ * -ENOSYS: In case stream combination query is not supported.
+ *
+ * Version information (based on camera_module_t.common.module_api_version):
+ *
+ * CAMERA_MODULE_API_VERSION_1_x/2_0/2_1/2_2/2_3/2_4:
+ * Not provided by HAL module. Framework will not call this function.
+ *
+ * CAMERA_MODULE_API_VERSION_2_5 or higher:
+ * Valid to be called by the framework.
+ */
+ int (*is_stream_combination_supported)(int camera_id,
+ const camera_stream_combination_t *streams);
+
+ /**
+ * notify_device_state_change:
+ *
+ * Notify the camera module that the state of the overall device has
+ * changed in some way that the HAL may want to know about.
+ *
+ * For example, a physical shutter may have been uncovered or covered,
+ * or a camera may have been covered or uncovered by an add-on keyboard
+ * or other accessory.
+ *
+ * The state is a bitfield of potential states, and some physical configurations
+ * could plausibly correspond to multiple different combinations of state bits.
+ * The HAL must ignore any state bits it is not actively using to determine
+ * the appropriate camera configuration.
+ *
+ * For example, on some devices the FOLDED state could mean that
+ * backward-facing cameras are covered by the fold, so FOLDED by itself implies
+ * BACK_COVERED. But other devices may support folding but not cover any cameras
+ * when folded, so for those FOLDED would not imply any of the other flags.
+ * Since these relationships are very device-specific, it is difficult to specify
+ * a comprehensive policy. But as a recommendation, it is suggested that if a flag
+ * necessarily implies other flags are set as well, then those flags should be set.
+ * So even though FOLDED would be enough to infer BACK_COVERED on some devices, the
+ * BACK_COVERED flag should also be set for clarity.
+ *
+ * This method may be invoked by the HAL client at any time. It must not
+ * cause any active camera device sessions to be closed, but may dynamically
+ * change which physical camera a logical multi-camera is using for its
+ * active and future output.
+ *
+ * The method must be invoked by the HAL client at least once before the
+ * client calls ICameraDevice::open on any camera device interfaces listed
+ * by this provider, to establish the initial device state.
+ *
+ * Note that the deviceState is 64-bit bitmask, with system defined states in
+ * lower 32-bit and vendor defined states in upper 32-bit.
+ */
+ void (*notify_device_state_change)(uint64_t deviceState);
+
+ /* reserved for future use */
+ void* reserved[2];
+} camera_module_t;
+
+__END_DECLS
+
+#endif /* ANDROID_INCLUDE_CAMERA_COMMON_H */
diff --git a/chroot/opt/android-master/amd64/usr/include/hardware/fb.h b/chroot/opt/android-master/amd64/usr/include/hardware/fb.h
new file mode 100644
index 0000000..65720a3
--- /dev/null
+++ b/chroot/opt/android-master/amd64/usr/include/hardware/fb.h
@@ -0,0 +1,173 @@
+/*
+ * Copyright (C) 2008 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.
+ */
+
+
+#ifndef ANDROID_FB_INTERFACE_H
+#define ANDROID_FB_INTERFACE_H
+
+#include <stdint.h>
+#include <sys/cdefs.h>
+#include <sys/types.h>
+
+#include <cutils/native_handle.h>
+
+#include <hardware/hardware.h>
+
+__BEGIN_DECLS
+
+#define GRALLOC_HARDWARE_FB0 "fb0"
+
+/*****************************************************************************/
+
+
+/*****************************************************************************/
+
+typedef struct framebuffer_device_t {
+ /**
+ * Common methods of the framebuffer device. This *must* be the first member of
+ * framebuffer_device_t as users of this structure will cast a hw_device_t to
+ * framebuffer_device_t pointer in contexts where it's known the hw_device_t references a
+ * framebuffer_device_t.
+ */
+ struct hw_device_t common;
+
+ /* flags describing some attributes of the framebuffer */
+ const uint32_t flags;
+
+ /* dimensions of the framebuffer in pixels */
+ const uint32_t width;
+ const uint32_t height;
+
+ /* frambuffer stride in pixels */
+ const int stride;
+
+ /* framebuffer pixel format */
+ const int format;
+
+ /* resolution of the framebuffer's display panel in pixel per inch*/
+ const float xdpi;
+ const float ydpi;
+
+ /* framebuffer's display panel refresh rate in frames per second */
+ const float fps;
+
+ /* min swap interval supported by this framebuffer */
+ const int minSwapInterval;
+
+ /* max swap interval supported by this framebuffer */
+ const int maxSwapInterval;
+
+ /* Number of framebuffers supported*/
+ const int numFramebuffers;
+
+ int reserved[7];
+
+ /*
+ * requests a specific swap-interval (same definition than EGL)
+ *
+ * Returns 0 on success or -errno on error.
+ */
+ int (*setSwapInterval)(struct framebuffer_device_t* window,
+ int interval);
+
+ /*
+ * This hook is OPTIONAL.
+ *
+ * It is non NULL If the framebuffer driver supports "update-on-demand"
+ * and the given rectangle is the area of the screen that gets
+ * updated during (*post)().
+ *
+ * This is useful on devices that are able to DMA only a portion of
+ * the screen to the display panel, upon demand -- as opposed to
+ * constantly refreshing the panel 60 times per second, for instance.
+ *
+ * Only the area defined by this rectangle is guaranteed to be valid, that
+ * is, the driver is not allowed to post anything outside of this
+ * rectangle.
+ *
+ * The rectangle evaluated during (*post)() and specifies which area
+ * of the buffer passed in (*post)() shall to be posted.
+ *
+ * return -EINVAL if width or height <=0, or if left or top < 0
+ */
+ int (*setUpdateRect)(struct framebuffer_device_t* window,
+ int left, int top, int width, int height);
+
+ /*
+ * Post <buffer> to the display (display it on the screen)
+ * The buffer must have been allocated with the
+ * GRALLOC_USAGE_HW_FB usage flag.
+ * buffer must be the same width and height as the display and must NOT
+ * be locked.
+ *
+ * The buffer is shown during the next VSYNC.
+ *
+ * If the same buffer is posted again (possibly after some other buffer),
+ * post() will block until the the first post is completed.
+ *
+ * Internally, post() is expected to lock the buffer so that a
+ * subsequent call to gralloc_module_t::(*lock)() with USAGE_RENDER or
+ * USAGE_*_WRITE will block until it is safe; that is typically once this
+ * buffer is shown and another buffer has been posted.
+ *
+ * Returns 0 on success or -errno on error.
+ */
+ int (*post)(struct framebuffer_device_t* dev, buffer_handle_t buffer);
+
+
+ /*
+ * The (*compositionComplete)() method must be called after the
+ * compositor has finished issuing GL commands for client buffers.
+ */
+
+ int (*compositionComplete)(struct framebuffer_device_t* dev);
+
+ /*
+ * This hook is OPTIONAL.
+ *
+ * If non NULL it will be caused by SurfaceFlinger on dumpsys
+ */
+ void (*dump)(struct framebuffer_device_t* dev, char *buff, int buff_len);
+
+ /*
+ * (*enableScreen)() is used to either blank (enable=0) or
+ * unblank (enable=1) the screen this framebuffer is attached to.
+ *
+ * Returns 0 on success or -errno on error.
+ */
+ int (*enableScreen)(struct framebuffer_device_t* dev, int enable);
+
+ void* reserved_proc[6];
+
+} framebuffer_device_t;
+
+
+/** convenience API for opening and closing a supported device */
+
+static inline int framebuffer_open(const struct hw_module_t* module,
+ struct framebuffer_device_t** device) {
+ return module->methods->open(module,
+ GRALLOC_HARDWARE_FB0, TO_HW_DEVICE_T_OPEN(device));
+}
+
+static inline int framebuffer_close(struct framebuffer_device_t* device) {
+ return device->common.close(&device->common);
+}
+
+
+__END_DECLS
+
+#endif // ANDROID_FB_INTERFACE_H
diff --git a/chroot/opt/android-master/amd64/usr/include/hardware/gralloc.h b/chroot/opt/android-master/amd64/usr/include/hardware/gralloc.h
new file mode 100644
index 0000000..10a153c0
--- /dev/null
+++ b/chroot/opt/android-master/amd64/usr/include/hardware/gralloc.h
@@ -0,0 +1,448 @@
+/*
+ * Copyright (C) 2008 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.
+ */
+
+
+#ifndef ANDROID_GRALLOC_INTERFACE_H
+#define ANDROID_GRALLOC_INTERFACE_H
+
+#include <system/graphics.h>
+#include <hardware/hardware.h>
+
+#include <stdint.h>
+#include <sys/cdefs.h>
+#include <sys/types.h>
+
+#include <cutils/native_handle.h>
+
+#include <hardware/hardware.h>
+#include <hardware/fb.h>
+
+__BEGIN_DECLS
+
+/**
+ * Module versioning information for the Gralloc hardware module, based on
+ * gralloc_module_t.common.module_api_version.
+ *
+ * Version History:
+ *
+ * GRALLOC_MODULE_API_VERSION_0_1:
+ * Initial Gralloc hardware module API.
+ *
+ * GRALLOC_MODULE_API_VERSION_0_2:
+ * Add support for flexible YCbCr format with (*lock_ycbcr)() method.
+ *
+ * GRALLOC_MODULE_API_VERSION_0_3:
+ * Add support for fence passing to/from lock/unlock.
+ */
+
+#define GRALLOC_MODULE_API_VERSION_0_1 HARDWARE_MODULE_API_VERSION(0, 1)
+#define GRALLOC_MODULE_API_VERSION_0_2 HARDWARE_MODULE_API_VERSION(0, 2)
+#define GRALLOC_MODULE_API_VERSION_0_3 HARDWARE_MODULE_API_VERSION(0, 3)
+
+#define GRALLOC_DEVICE_API_VERSION_0_1 HARDWARE_DEVICE_API_VERSION(0, 1)
+
+/**
+ * The id of this module
+ */
+#define GRALLOC_HARDWARE_MODULE_ID "gralloc"
+
+/**
+ * Name of the graphics device to open
+ */
+
+#define GRALLOC_HARDWARE_GPU0 "gpu0"
+
+enum {
+ /* buffer is never read in software */
+ GRALLOC_USAGE_SW_READ_NEVER = 0x00000000U,
+ /* buffer is rarely read in software */
+ GRALLOC_USAGE_SW_READ_RARELY = 0x00000002U,
+ /* buffer is often read in software */
+ GRALLOC_USAGE_SW_READ_OFTEN = 0x00000003U,
+ /* mask for the software read values */
+ GRALLOC_USAGE_SW_READ_MASK = 0x0000000FU,
+
+ /* buffer is never written in software */
+ GRALLOC_USAGE_SW_WRITE_NEVER = 0x00000000U,
+ /* buffer is rarely written in software */
+ GRALLOC_USAGE_SW_WRITE_RARELY = 0x00000020U,
+ /* buffer is often written in software */
+ GRALLOC_USAGE_SW_WRITE_OFTEN = 0x00000030U,
+ /* mask for the software write values */
+ GRALLOC_USAGE_SW_WRITE_MASK = 0x000000F0U,
+
+ /* buffer will be used as an OpenGL ES texture */
+ GRALLOC_USAGE_HW_TEXTURE = 0x00000100U,
+ /* buffer will be used as an OpenGL ES render target */
+ GRALLOC_USAGE_HW_RENDER = 0x00000200U,
+ /* buffer will be used by the 2D hardware blitter */
+ GRALLOC_USAGE_HW_2D = 0x00000400U,
+ /* buffer will be used by the HWComposer HAL module */
+ GRALLOC_USAGE_HW_COMPOSER = 0x00000800U,
+ /* buffer will be used with the framebuffer device */
+ GRALLOC_USAGE_HW_FB = 0x00001000U,
+
+ /* buffer should be displayed full-screen on an external display when
+ * possible */
+ GRALLOC_USAGE_EXTERNAL_DISP = 0x00002000U,
+
+ /* Must have a hardware-protected path to external display sink for
+ * this buffer. If a hardware-protected path is not available, then
+ * either don't composite only this buffer (preferred) to the
+ * external sink, or (less desirable) do not route the entire
+ * composition to the external sink. */
+ GRALLOC_USAGE_PROTECTED = 0x00004000U,
+
+ /* buffer may be used as a cursor */
+ GRALLOC_USAGE_CURSOR = 0x00008000U,
+
+ /* buffer will be used with the HW video encoder */
+ GRALLOC_USAGE_HW_VIDEO_ENCODER = 0x00010000U,
+ /* buffer will be written by the HW camera pipeline */
+ GRALLOC_USAGE_HW_CAMERA_WRITE = 0x00020000U,
+ /* buffer will be read by the HW camera pipeline */
+ GRALLOC_USAGE_HW_CAMERA_READ = 0x00040000U,
+ /* buffer will be used as part of zero-shutter-lag queue */
+ GRALLOC_USAGE_HW_CAMERA_ZSL = 0x00060000U,
+ /* mask for the camera access values */
+ GRALLOC_USAGE_HW_CAMERA_MASK = 0x00060000U,
+ /* mask for the software usage bit-mask */
+ GRALLOC_USAGE_HW_MASK = 0x00071F00U,
+
+ /* buffer will be used as a RenderScript Allocation */
+ GRALLOC_USAGE_RENDERSCRIPT = 0x00100000U,
+
+ /* Set by the consumer to indicate to the producer that they may attach a
+ * buffer that they did not detach from the BufferQueue. Will be filtered
+ * out by GRALLOC_USAGE_ALLOC_MASK, so gralloc modules will not need to
+ * handle this flag. */
+ GRALLOC_USAGE_FOREIGN_BUFFERS = 0x00200000U,
+
+ /* buffer will be used as input to HW HEIC image encoder */
+ GRALLOC_USAGE_HW_IMAGE_ENCODER = 0x08000000U,
+
+ /* Mask of all flags which could be passed to a gralloc module for buffer
+ * allocation. Any flags not in this mask do not need to be handled by
+ * gralloc modules. */
+ GRALLOC_USAGE_ALLOC_MASK = ~(GRALLOC_USAGE_FOREIGN_BUFFERS),
+
+ /* implementation-specific private usage flags */
+ GRALLOC_USAGE_PRIVATE_0 = 0x10000000U,
+ GRALLOC_USAGE_PRIVATE_1 = 0x20000000U,
+ GRALLOC_USAGE_PRIVATE_2 = 0x40000000U,
+ GRALLOC_USAGE_PRIVATE_3 = 0x80000000U,
+ GRALLOC_USAGE_PRIVATE_MASK = 0xF0000000U,
+};
+
+/*****************************************************************************/
+
+/**
+ * Every hardware module must have a data structure named HAL_MODULE_INFO_SYM
+ * and the fields of this data structure must begin with hw_module_t
+ * followed by module specific information.
+ */
+typedef struct gralloc_module_t {
+ struct hw_module_t common;
+
+ /*
+ * (*registerBuffer)() must be called before a buffer_handle_t that has not
+ * been created with (*alloc_device_t::alloc)() can be used.
+ *
+ * This is intended to be used with buffer_handle_t's that have been
+ * received in this process through IPC.
+ *
+ * This function checks that the handle is indeed a valid one and prepares
+ * it for use with (*lock)() and (*unlock)().
+ *
+ * It is not necessary to call (*registerBuffer)() on a handle created
+ * with (*alloc_device_t::alloc)().
+ *
+ * returns an error if this buffer_handle_t is not valid.
+ */
+ int (*registerBuffer)(struct gralloc_module_t const* module,
+ buffer_handle_t handle);
+
+ /*
+ * (*unregisterBuffer)() is called once this handle is no longer needed in
+ * this process. After this call, it is an error to call (*lock)(),
+ * (*unlock)(), or (*registerBuffer)().
+ *
+ * This function doesn't close or free the handle itself; this is done
+ * by other means, usually through libcutils's native_handle_close() and
+ * native_handle_free().
+ *
+ * It is an error to call (*unregisterBuffer)() on a buffer that wasn't
+ * explicitly registered first.
+ */
+ int (*unregisterBuffer)(struct gralloc_module_t const* module,
+ buffer_handle_t handle);
+
+ /*
+ * The (*lock)() method is called before a buffer is accessed for the
+ * specified usage. This call may block, for instance if the h/w needs
+ * to finish rendering or if CPU caches need to be synchronized.
+ *
+ * The caller promises to modify only pixels in the area specified
+ * by (l,t,w,h).
+ *
+ * The content of the buffer outside of the specified area is NOT modified
+ * by this call.
+ *
+ * If usage specifies GRALLOC_USAGE_SW_*, vaddr is filled with the address
+ * of the buffer in virtual memory.
+ *
+ * Note calling (*lock)() on HAL_PIXEL_FORMAT_YCbCr_*_888 buffers will fail
+ * and return -EINVAL. These buffers must be locked with (*lock_ycbcr)()
+ * instead.
+ *
+ * THREADING CONSIDERATIONS:
+ *
+ * It is legal for several different threads to lock a buffer from
+ * read access, none of the threads are blocked.
+ *
+ * However, locking a buffer simultaneously for write or read/write is
+ * undefined, but:
+ * - shall not result in termination of the process
+ * - shall not block the caller
+ * It is acceptable to return an error or to leave the buffer's content
+ * into an indeterminate state.
+ *
+ * If the buffer was created with a usage mask incompatible with the
+ * requested usage flags here, -EINVAL is returned.
+ *
+ */
+
+ int (*lock)(struct gralloc_module_t const* module,
+ buffer_handle_t handle, int usage,
+ int l, int t, int w, int h,
+ void** vaddr);
+
+
+ /*
+ * The (*unlock)() method must be called after all changes to the buffer
+ * are completed.
+ */
+
+ int (*unlock)(struct gralloc_module_t const* module,
+ buffer_handle_t handle);
+
+
+ /* reserved for future use */
+ int (*perform)(struct gralloc_module_t const* module,
+ int operation, ... );
+
+ /*
+ * The (*lock_ycbcr)() method is like the (*lock)() method, with the
+ * difference that it fills a struct ycbcr with a description of the buffer
+ * layout, and zeroes out the reserved fields.
+ *
+ * If the buffer format is not compatible with a flexible YUV format (e.g.
+ * the buffer layout cannot be represented with the ycbcr struct), it
+ * will return -EINVAL.
+ *
+ * This method must work on buffers with HAL_PIXEL_FORMAT_YCbCr_*_888
+ * if supported by the device, as well as with any other format that is
+ * requested by the multimedia codecs when they are configured with a
+ * flexible-YUV-compatible color-format with android native buffers.
+ *
+ * Note that this method may also be called on buffers of other formats,
+ * including non-YUV formats.
+ *
+ * Added in GRALLOC_MODULE_API_VERSION_0_2.
+ */
+
+ int (*lock_ycbcr)(struct gralloc_module_t const* module,
+ buffer_handle_t handle, int usage,
+ int l, int t, int w, int h,
+ struct android_ycbcr *ycbcr);
+
+ /*
+ * The (*lockAsync)() method is like the (*lock)() method except
+ * that the buffer's sync fence object is passed into the lock
+ * call instead of requiring the caller to wait for completion.
+ *
+ * The gralloc implementation takes ownership of the fenceFd and
+ * is responsible for closing it when no longer needed.
+ *
+ * Added in GRALLOC_MODULE_API_VERSION_0_3.
+ */
+ int (*lockAsync)(struct gralloc_module_t const* module,
+ buffer_handle_t handle, int usage,
+ int l, int t, int w, int h,
+ void** vaddr, int fenceFd);
+
+ /*
+ * The (*unlockAsync)() method is like the (*unlock)() method
+ * except that a buffer sync fence object is returned from the
+ * lock call, representing the completion of any pending work
+ * performed by the gralloc implementation.
+ *
+ * The caller takes ownership of the fenceFd and is responsible
+ * for closing it when no longer needed.
+ *
+ * Added in GRALLOC_MODULE_API_VERSION_0_3.
+ */
+ int (*unlockAsync)(struct gralloc_module_t const* module,
+ buffer_handle_t handle, int* fenceFd);
+
+ /*
+ * The (*lockAsync_ycbcr)() method is like the (*lock_ycbcr)()
+ * method except that the buffer's sync fence object is passed
+ * into the lock call instead of requiring the caller to wait for
+ * completion.
+ *
+ * The gralloc implementation takes ownership of the fenceFd and
+ * is responsible for closing it when no longer needed.
+ *
+ * Added in GRALLOC_MODULE_API_VERSION_0_3.
+ */
+ int (*lockAsync_ycbcr)(struct gralloc_module_t const* module,
+ buffer_handle_t handle, int usage,
+ int l, int t, int w, int h,
+ struct android_ycbcr *ycbcr, int fenceFd);
+
+ /* getTransportSize(..., outNumFds, outNumInts)
+ * This function is mandatory on devices running IMapper2.1 or higher.
+ *
+ * Get the transport size of a buffer. An imported buffer handle is a raw
+ * buffer handle with the process-local runtime data appended. This
+ * function, for example, allows a caller to omit the process-local
+ * runtime data at the tail when serializing the imported buffer handle.
+ *
+ * Note that a client might or might not omit the process-local runtime
+ * data when sending an imported buffer handle. The mapper must support
+ * both cases on the receiving end.
+ */
+ int32_t (*getTransportSize)(
+ struct gralloc_module_t const* module, buffer_handle_t handle, uint32_t *outNumFds,
+ uint32_t *outNumInts);
+
+ /* validateBufferSize(..., w, h, format, usage, stride)
+ * This function is mandatory on devices running IMapper2.1 or higher.
+ *
+ * Validate that the buffer can be safely accessed by a caller who assumes
+ * the specified width, height, format, usage, and stride. This must at least validate
+ * that the buffer size is large enough. Validating the buffer against
+ * individual buffer attributes is optional.
+ */
+ int32_t (*validateBufferSize)(
+ struct gralloc_module_t const* device, buffer_handle_t handle,
+ uint32_t w, uint32_t h, int32_t format, int usage,
+ uint32_t stride);
+
+ /* reserved for future use */
+ void* reserved_proc[1];
+
+} gralloc_module_t;
+
+/*****************************************************************************/
+
+/**
+ * Every device data structure must begin with hw_device_t
+ * followed by module specific public methods and attributes.
+ */
+
+typedef struct alloc_device_t {
+ struct hw_device_t common;
+
+ /*
+ * (*alloc)() Allocates a buffer in graphic memory with the requested
+ * parameters and returns a buffer_handle_t and the stride in pixels to
+ * allow the implementation to satisfy hardware constraints on the width
+ * of a pixmap (eg: it may have to be multiple of 8 pixels).
+ * The CALLER TAKES OWNERSHIP of the buffer_handle_t.
+ *
+ * If format is HAL_PIXEL_FORMAT_YCbCr_420_888, the returned stride must be
+ * 0, since the actual strides are available from the android_ycbcr
+ * structure.
+ *
+ * Returns 0 on success or -errno on error.
+ */
+
+ int (*alloc)(struct alloc_device_t* dev,
+ int w, int h, int format, int usage,
+ buffer_handle_t* handle, int* stride);
+
+ /*
+ * (*free)() Frees a previously allocated buffer.
+ * Behavior is undefined if the buffer is still mapped in any process,
+ * but shall not result in termination of the program or security breaches
+ * (allowing a process to get access to another process' buffers).
+ * THIS FUNCTION TAKES OWNERSHIP of the buffer_handle_t which becomes
+ * invalid after the call.
+ *
+ * Returns 0 on success or -errno on error.
+ */
+ int (*free)(struct alloc_device_t* dev,
+ buffer_handle_t handle);
+
+ /* This hook is OPTIONAL.
+ *
+ * If non NULL it will be caused by SurfaceFlinger on dumpsys
+ */
+ void (*dump)(struct alloc_device_t *dev, char *buff, int buff_len);
+
+ void* reserved_proc[7];
+} alloc_device_t;
+
+
+/** convenience API for opening and closing a supported device */
+
+static inline int gralloc_open(const struct hw_module_t* module,
+ struct alloc_device_t** device) {
+ return module->methods->open(module,
+ GRALLOC_HARDWARE_GPU0, TO_HW_DEVICE_T_OPEN(device));
+}
+
+static inline int gralloc_close(struct alloc_device_t* device) {
+ return device->common.close(&device->common);
+}
+
+/**
+ * map_usage_to_memtrack should be called after allocating a gralloc buffer.
+ *
+ * @param usage - it is the flag used when alloc function is called.
+ *
+ * This function maps the gralloc usage flags to appropriate memtrack bucket.
+ * GrallocHAL implementers and users should make an additional ION_IOCTL_TAG
+ * call using the memtrack tag returned by this function. This will help the
+ * in-kernel memtack to categorize the memory allocated by different processes
+ * according to their usage.
+ *
+ */
+static inline const char* map_usage_to_memtrack(uint32_t usage) {
+ usage &= GRALLOC_USAGE_ALLOC_MASK;
+
+ if ((usage & GRALLOC_USAGE_HW_CAMERA_WRITE) != 0) {
+ return "camera";
+ } else if ((usage & GRALLOC_USAGE_HW_VIDEO_ENCODER) != 0 ||
+ (usage & GRALLOC_USAGE_EXTERNAL_DISP) != 0) {
+ return "video";
+ } else if ((usage & GRALLOC_USAGE_HW_RENDER) != 0 ||
+ (usage & GRALLOC_USAGE_HW_TEXTURE) != 0) {
+ return "gl";
+ } else if ((usage & GRALLOC_USAGE_HW_CAMERA_READ) != 0) {
+ return "camera";
+ } else if ((usage & GRALLOC_USAGE_SW_READ_MASK) != 0 ||
+ (usage & GRALLOC_USAGE_SW_WRITE_MASK) != 0) {
+ return "cpu";
+ }
+ return "graphics";
+}
+
+__END_DECLS
+
+#endif // ANDROID_GRALLOC_INTERFACE_H
diff --git a/chroot/opt/android-master/amd64/usr/include/hardware/hardware.h b/chroot/opt/android-master/amd64/usr/include/hardware/hardware.h
new file mode 100644
index 0000000..bf076f6
--- /dev/null
+++ b/chroot/opt/android-master/amd64/usr/include/hardware/hardware.h
@@ -0,0 +1,244 @@
+/*
+ * Copyright (C) 2008 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.
+ */
+
+#ifndef ANDROID_INCLUDE_HARDWARE_HARDWARE_H
+#define ANDROID_INCLUDE_HARDWARE_HARDWARE_H
+
+#include <stdint.h>
+#include <sys/cdefs.h>
+
+#include <cutils/native_handle.h>
+#include <system/graphics.h>
+
+__BEGIN_DECLS
+
+/*
+ * Value for the hw_module_t.tag field
+ */
+
+#define MAKE_TAG_CONSTANT(A,B,C,D) (((A) << 24) | ((B) << 16) | ((C) << 8) | (D))
+
+#define HARDWARE_MODULE_TAG MAKE_TAG_CONSTANT('H', 'W', 'M', 'T')
+#define HARDWARE_DEVICE_TAG MAKE_TAG_CONSTANT('H', 'W', 'D', 'T')
+
+#define HARDWARE_MAKE_API_VERSION(maj,min) \
+ ((((maj) & 0xff) << 8) | ((min) & 0xff))
+
+#define HARDWARE_MAKE_API_VERSION_2(maj,min,hdr) \
+ ((((maj) & 0xff) << 24) | (((min) & 0xff) << 16) | ((hdr) & 0xffff))
+#define HARDWARE_API_VERSION_2_MAJ_MIN_MASK 0xffff0000
+#define HARDWARE_API_VERSION_2_HEADER_MASK 0x0000ffff
+
+
+/*
+ * The current HAL API version.
+ *
+ * All module implementations must set the hw_module_t.hal_api_version field
+ * to this value when declaring the module with HAL_MODULE_INFO_SYM.
+ *
+ * Note that previous implementations have always set this field to 0.
+ * Therefore, libhardware HAL API will always consider versions 0.0 and 1.0
+ * to be 100% binary compatible.
+ *
+ */
+#define HARDWARE_HAL_API_VERSION HARDWARE_MAKE_API_VERSION(1, 0)
+
+/*
+ * Helper macros for module implementors.
+ *
+ * The derived modules should provide convenience macros for supported
+ * versions so that implementations can explicitly specify module/device
+ * versions at definition time.
+ *
+ * Use this macro to set the hw_module_t.module_api_version field.
+ */
+#define HARDWARE_MODULE_API_VERSION(maj,min) HARDWARE_MAKE_API_VERSION(maj,min)
+#define HARDWARE_MODULE_API_VERSION_2(maj,min,hdr) HARDWARE_MAKE_API_VERSION_2(maj,min,hdr)
+
+/*
+ * Use this macro to set the hw_device_t.version field
+ */
+#define HARDWARE_DEVICE_API_VERSION(maj,min) HARDWARE_MAKE_API_VERSION(maj,min)
+#define HARDWARE_DEVICE_API_VERSION_2(maj,min,hdr) HARDWARE_MAKE_API_VERSION_2(maj,min,hdr)
+
+struct hw_module_t;
+struct hw_module_methods_t;
+struct hw_device_t;
+
+/**
+ * Every hardware module must have a data structure named HAL_MODULE_INFO_SYM
+ * and the fields of this data structure must begin with hw_module_t
+ * followed by module specific information.
+ */
+typedef struct hw_module_t {
+ /** tag must be initialized to HARDWARE_MODULE_TAG */
+ uint32_t tag;
+
+ /**
+ * The API version of the implemented module. The module owner is
+ * responsible for updating the version when a module interface has
+ * changed.
+ *
+ * The derived modules such as gralloc and audio own and manage this field.
+ * The module user must interpret the version field to decide whether or
+ * not to inter-operate with the supplied module implementation.
+ * For example, SurfaceFlinger is responsible for making sure that
+ * it knows how to manage different versions of the gralloc-module API,
+ * and AudioFlinger must know how to do the same for audio-module API.
+ *
+ * The module API version should include a major and a minor component.
+ * For example, version 1.0 could be represented as 0x0100. This format
+ * implies that versions 0x0100-0x01ff are all API-compatible.
+ *
+ * In the future, libhardware will expose a hw_get_module_version()
+ * (or equivalent) function that will take minimum/maximum supported
+ * versions as arguments and would be able to reject modules with
+ * versions outside of the supplied range.
+ */
+ uint16_t module_api_version;
+#define version_major module_api_version
+ /**
+ * version_major/version_minor defines are supplied here for temporary
+ * source code compatibility. They will be removed in the next version.
+ * ALL clients must convert to the new version format.
+ */
+
+ /**
+ * The API version of the HAL module interface. This is meant to
+ * version the hw_module_t, hw_module_methods_t, and hw_device_t
+ * structures and definitions.
+ *
+ * The HAL interface owns this field. Module users/implementations
+ * must NOT rely on this value for version information.
+ *
+ * Presently, 0 is the only valid value.
+ */
+ uint16_t hal_api_version;
+#define version_minor hal_api_version
+
+ /** Identifier of module */
+ const char *id;
+
+ /** Name of this module */
+ const char *name;
+
+ /** Author/owner/implementor of the module */
+ const char *author;
+
+ /** Modules methods */
+ struct hw_module_methods_t* methods;
+
+ /** module's dso */
+ void* dso;
+
+#ifdef __LP64__
+ uint64_t reserved[32-7];
+#else
+ /** padding to 128 bytes, reserved for future use */
+ uint32_t reserved[32-7];
+#endif
+
+} hw_module_t;
+
+typedef struct hw_module_methods_t {
+ /** Open a specific device */
+ int (*open)(const struct hw_module_t* module, const char* id,
+ struct hw_device_t** device);
+
+} hw_module_methods_t;
+
+/**
+ * Every device data structure must begin with hw_device_t
+ * followed by module specific public methods and attributes.
+ */
+typedef struct hw_device_t {
+ /** tag must be initialized to HARDWARE_DEVICE_TAG */
+ uint32_t tag;
+
+ /**
+ * Version of the module-specific device API. This value is used by
+ * the derived-module user to manage different device implementations.
+ *
+ * The module user is responsible for checking the module_api_version
+ * and device version fields to ensure that the user is capable of
+ * communicating with the specific module implementation.
+ *
+ * One module can support multiple devices with different versions. This
+ * can be useful when a device interface changes in an incompatible way
+ * but it is still necessary to support older implementations at the same
+ * time. One such example is the Camera 2.0 API.
+ *
+ * This field is interpreted by the module user and is ignored by the
+ * HAL interface itself.
+ */
+ uint32_t version;
+
+ /** reference to the module this device belongs to */
+ struct hw_module_t* module;
+
+ /** padding reserved for future use */
+#ifdef __LP64__
+ uint64_t reserved[12];
+#else
+ uint32_t reserved[12];
+#endif
+
+ /** Close this device */
+ int (*close)(struct hw_device_t* device);
+
+} hw_device_t;
+
+#ifdef __cplusplus
+#define TO_HW_DEVICE_T_OPEN(x) reinterpret_cast<struct hw_device_t**>(x)
+#else
+#define TO_HW_DEVICE_T_OPEN(x) (struct hw_device_t**)(x)
+#endif
+
+/**
+ * Name of the hal_module_info
+ */
+#define HAL_MODULE_INFO_SYM HMI
+
+/**
+ * Name of the hal_module_info as a string
+ */
+#define HAL_MODULE_INFO_SYM_AS_STR "HMI"
+
+/**
+ * Get the module info associated with a module by id.
+ *
+ * @return: 0 == success, <0 == error and *module == NULL
+ */
+int hw_get_module(const char *id, const struct hw_module_t **module);
+
+/**
+ * Get the module info associated with a module instance by class 'class_id'
+ * and instance 'inst'.
+ *
+ * Some modules types necessitate multiple instances. For example audio supports
+ * multiple concurrent interfaces and thus 'audio' is the module class
+ * and 'primary' or 'a2dp' are module interfaces. This implies that the files
+ * providing these modules would be named audio.primary.<variant>.so and
+ * audio.a2dp.<variant>.so
+ *
+ * @return: 0 == success, <0 == error and *module == NULL
+ */
+int hw_get_module_by_class(const char *class_id, const char *inst,
+ const struct hw_module_t **module);
+
+__END_DECLS
+
+#endif /* ANDROID_INCLUDE_HARDWARE_HARDWARE_H */
diff --git a/chroot/opt/android-master/amd64/usr/include/ifaddrs.h b/chroot/opt/android-master/amd64/usr/include/ifaddrs.h
new file mode 100644
index 0000000..9eaabbd
--- /dev/null
+++ b/chroot/opt/android-master/amd64/usr/include/ifaddrs.h
@@ -0,0 +1,93 @@
+/*
+ * Copyright (C) 2015 The Android Open Source Project
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ * * Redistributions of source code must retain the above copyright
+ * notice, this list of conditions and the following disclaimer.
+ * * 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.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+ * "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
+ * COPYRIGHT OWNER OR CONTRIBUTORS 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.
+ */
+
+#pragma once
+
+/**
+ * @file ifaddrs.h
+ * @brief Access to network interface addresses.
+ */
+
+#include <sys/cdefs.h>
+#include <netinet/in.h>
+#include <sys/socket.h>
+
+__BEGIN_DECLS
+
+/**
+ * Returned by getifaddrs() and freed by freeifaddrs().
+ */
+struct ifaddrs {
+ /** Pointer to the next element in the linked list. */
+ struct ifaddrs* ifa_next;
+
+ /** Interface name. */
+ char* ifa_name;
+ /** Interface flags (like `SIOCGIFFLAGS`). */
+ unsigned int ifa_flags;
+ /** Interface address. */
+ struct sockaddr* ifa_addr;
+ /** Interface netmask. */
+ struct sockaddr* ifa_netmask;
+
+ union {
+ /** Interface broadcast address (if IFF_BROADCAST is set). */
+ struct sockaddr* ifu_broadaddr;
+ /** Interface destination address (if IFF_POINTOPOINT is set). */
+ struct sockaddr* ifu_dstaddr;
+ } ifa_ifu;
+
+ /** Unused. */
+ void* ifa_data;
+};
+
+/** Synonym for `ifa_ifu.ifu_broadaddr` in `struct ifaddrs`. */
+#define ifa_broadaddr ifa_ifu.ifu_broadaddr
+/** Synonym for `ifa_ifu.ifu_dstaddr` in `struct ifaddrs`. */
+#define ifa_dstaddr ifa_ifu.ifu_dstaddr
+
+/**
+ * [getifaddrs(3)](http://man7.org/linux/man-pages/man3/getifaddrs.3.html) creates a linked list
+ * of `struct ifaddrs`. The list must be freed by freeifaddrs().
+ *
+ * Returns 0 and stores the list in `*__list_ptr` on success,
+ * and returns -1 and sets `errno` on failure.
+ *
+ * Available since API level 24.
+ */
+int getifaddrs(struct ifaddrs** __list_ptr) __INTRODUCED_IN(24);
+
+/**
+ * [freeifaddrs(3)](http://man7.org/linux/man-pages/man3/freeifaddrs.3.html) frees a linked list
+ * of `struct ifaddrs` returned by getifaddrs().
+ *
+ * Available since API level 24.
+ */
+void freeifaddrs(struct ifaddrs* __ptr) __INTRODUCED_IN(24);
+
+__END_DECLS
diff --git a/chroot/opt/android-master/amd64/usr/include/link.h b/chroot/opt/android-master/amd64/usr/include/link.h
new file mode 100644
index 0000000..bd430f5
--- /dev/null
+++ b/chroot/opt/android-master/amd64/usr/include/link.h
@@ -0,0 +1,93 @@
+/*
+ * Copyright (C) 2012 The Android Open Source Project
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ * * Redistributions of source code must retain the above copyright
+ * notice, this list of conditions and the following disclaimer.
+ * * 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.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+ * "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
+ * COPYRIGHT OWNER OR CONTRIBUTORS 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.
+ */
+#ifndef _LINK_H_
+#define _LINK_H_
+
+#include <stdint.h>
+#include <sys/cdefs.h>
+#include <sys/types.h>
+
+#include <elf.h>
+
+__BEGIN_DECLS
+
+#if defined(__LP64__)
+#define ElfW(type) Elf64_ ## type
+#else
+#define ElfW(type) Elf32_ ## type
+#endif
+
+struct dl_phdr_info {
+ ElfW(Addr) dlpi_addr;
+ const char* dlpi_name;
+ const ElfW(Phdr)* dlpi_phdr;
+ ElfW(Half) dlpi_phnum;
+
+ // These fields were added in Android R.
+ unsigned long long dlpi_adds;
+ unsigned long long dlpi_subs;
+ size_t dlpi_tls_modid;
+ void* dlpi_tls_data;
+};
+
+#if defined(__arm__)
+int dl_iterate_phdr(int (*__callback)(struct dl_phdr_info*, size_t, void*), void* __data) __INTRODUCED_IN(21);
+#else
+int dl_iterate_phdr(int (*__callback)(struct dl_phdr_info*, size_t, void*), void* __data);
+#endif
+
+#ifdef __arm__
+typedef uintptr_t _Unwind_Ptr;
+_Unwind_Ptr dl_unwind_find_exidx(_Unwind_Ptr, int*);
+#endif
+
+/* Used by the dynamic linker to communicate with the debugger. */
+struct link_map {
+ ElfW(Addr) l_addr;
+ char* l_name;
+ ElfW(Dyn)* l_ld;
+ struct link_map* l_next;
+ struct link_map* l_prev;
+};
+
+/* Used by the dynamic linker to communicate with the debugger. */
+struct r_debug {
+ int32_t r_version;
+ struct link_map* r_map;
+ ElfW(Addr) r_brk;
+ enum {
+ RT_CONSISTENT,
+ RT_ADD,
+ RT_DELETE
+ } r_state;
+ ElfW(Addr) r_ldbase;
+};
+
+__END_DECLS
+
+#endif
diff --git a/chroot/opt/android-master/amd64/usr/include/linux/atm.h b/chroot/opt/android-master/amd64/usr/include/linux/atm.h
new file mode 100644
index 0000000..488fa05
--- /dev/null
+++ b/chroot/opt/android-master/amd64/usr/include/linux/atm.h
@@ -0,0 +1,146 @@
+/****************************************************************************
+ ****************************************************************************
+ ***
+ *** This header was automatically generated from a Linux kernel header
+ *** of the same name, to make information necessary for userspace to
+ *** call into the kernel available to libc. It contains only constants,
+ *** structures, and macros generated from the original header, and thus,
+ *** contains no copyrightable information.
+ ***
+ *** To edit the content of this header, modify the corresponding
+ *** source file (e.g. under external/kernel-headers/original/) then
+ *** run bionic/libc/kernel/tools/update_all.py
+ ***
+ *** Any manual change here will be lost the next time this script will
+ *** be run. You've been warned!
+ ***
+ ****************************************************************************
+ ****************************************************************************/
+#ifndef _UAPI_LINUX_ATM_H
+#define _UAPI_LINUX_ATM_H
+#include <linux/compiler.h>
+#include <linux/atmapi.h>
+#include <linux/atmsap.h>
+#include <linux/atmioc.h>
+#include <linux/types.h>
+#define ATM_CELL_SIZE 53
+#define ATM_CELL_PAYLOAD 48
+#define ATM_AAL0_SDU 52
+#define ATM_MAX_AAL34_PDU 65535
+#define ATM_AAL5_TRAILER 8
+#define ATM_MAX_AAL5_PDU 65535
+#define ATM_MAX_CDV 9999
+#define ATM_NOT_RSV_VCI 32
+#define ATM_MAX_VPI 255
+#define ATM_MAX_VPI_NNI 4096
+#define ATM_MAX_VCI 65535
+#define ATM_NO_AAL 0
+#define ATM_AAL0 13
+#define ATM_AAL1 1
+#define ATM_AAL2 2
+#define ATM_AAL34 3
+#define ATM_AAL5 5
+#define __SO_ENCODE(l,n,t) ((((l) & 0x1FF) << 22) | ((n) << 16) | sizeof(t))
+#define __SO_LEVEL_MATCH(c,m) (((c) >> 22) == ((m) & 0x1FF))
+#define __SO_NUMBER(c) (((c) >> 16) & 0x3f)
+#define __SO_SIZE(c) ((c) & 0x3fff)
+#define SO_SETCLP __SO_ENCODE(SOL_ATM, 0, int)
+#define SO_CIRANGE __SO_ENCODE(SOL_ATM, 1, struct atm_cirange)
+#define SO_ATMQOS __SO_ENCODE(SOL_ATM, 2, struct atm_qos)
+#define SO_ATMSAP __SO_ENCODE(SOL_ATM, 3, struct atm_sap)
+#define SO_ATMPVC __SO_ENCODE(SOL_ATM, 4, struct sockaddr_atmpvc)
+#define SO_MULTIPOINT __SO_ENCODE(SOL_ATM, 5, int)
+#define ATM_HDR_GFC_MASK 0xf0000000
+#define ATM_HDR_GFC_SHIFT 28
+#define ATM_HDR_VPI_MASK 0x0ff00000
+#define ATM_HDR_VPI_SHIFT 20
+#define ATM_HDR_VCI_MASK 0x000ffff0
+#define ATM_HDR_VCI_SHIFT 4
+#define ATM_HDR_PTI_MASK 0x0000000e
+#define ATM_HDR_PTI_SHIFT 1
+#define ATM_HDR_CLP 0x00000001
+#define ATM_PTI_US0 0
+#define ATM_PTI_US1 1
+#define ATM_PTI_UCES0 2
+#define ATM_PTI_UCES1 3
+#define ATM_PTI_SEGF5 4
+#define ATM_PTI_E2EF5 5
+#define ATM_PTI_RSV_RM 6
+#define ATM_PTI_RSV 7
+#define ATM_NONE 0
+#define ATM_UBR 1
+#define ATM_CBR 2
+#define ATM_VBR 3
+#define ATM_ABR 4
+#define ATM_ANYCLASS 5
+#define ATM_MAX_PCR - 1
+struct atm_trafprm {
+ unsigned char traffic_class;
+ int max_pcr;
+ int pcr;
+ int min_pcr;
+ int max_cdv;
+ int max_sdu;
+ unsigned int icr;
+ unsigned int tbe;
+ unsigned int frtt : 24;
+ unsigned int rif : 4;
+ unsigned int rdf : 4;
+ unsigned int nrm_pres : 1;
+ unsigned int trm_pres : 1;
+ unsigned int adtf_pres : 1;
+ unsigned int cdf_pres : 1;
+ unsigned int nrm : 3;
+ unsigned int trm : 3;
+ unsigned int adtf : 10;
+ unsigned int cdf : 3;
+ unsigned int spare : 9;
+};
+struct atm_qos {
+ struct atm_trafprm txtp;
+ struct atm_trafprm rxtp __ATM_API_ALIGN;
+ unsigned char aal __ATM_API_ALIGN;
+};
+#define ATM_ITF_ANY - 1
+#define ATM_VPI_ANY - 1
+#define ATM_VCI_ANY - 1
+#define ATM_VPI_UNSPEC - 2
+#define ATM_VCI_UNSPEC - 2
+struct sockaddr_atmpvc {
+ unsigned short sap_family;
+ struct {
+ short itf;
+ short vpi;
+ int vci;
+ } sap_addr __ATM_API_ALIGN;
+};
+#define ATM_ESA_LEN 20
+#define ATM_E164_LEN 12
+#define ATM_AFI_DCC 0x39
+#define ATM_AFI_ICD 0x47
+#define ATM_AFI_E164 0x45
+#define ATM_AFI_LOCAL 0x49
+#define ATM_AFI_DCC_GROUP 0xBD
+#define ATM_AFI_ICD_GROUP 0xC5
+#define ATM_AFI_E164_GROUP 0xC3
+#define ATM_AFI_LOCAL_GROUP 0xC7
+#define ATM_LIJ_NONE 0
+#define ATM_LIJ 1
+#define ATM_LIJ_RPJ 2
+#define ATM_LIJ_NJ 3
+struct sockaddr_atmsvc {
+ unsigned short sas_family;
+ struct {
+ unsigned char prv[ATM_ESA_LEN];
+ char pub[ATM_E164_LEN + 1];
+ char lij_type;
+ __u32 lij_id;
+ } sas_addr __ATM_API_ALIGN;
+};
+struct atmif_sioc {
+ int number;
+ int length;
+ void __user * arg;
+};
+typedef unsigned short atm_backend_t;
+#endif
diff --git a/chroot/opt/android-master/amd64/usr/include/linux/can/netlink.h b/chroot/opt/android-master/amd64/usr/include/linux/can/netlink.h
new file mode 100644
index 0000000..ddf9058
--- /dev/null
+++ b/chroot/opt/android-master/amd64/usr/include/linux/can/netlink.h
@@ -0,0 +1,100 @@
+/****************************************************************************
+ ****************************************************************************
+ ***
+ *** This header was automatically generated from a Linux kernel header
+ *** of the same name, to make information necessary for userspace to
+ *** call into the kernel available to libc. It contains only constants,
+ *** structures, and macros generated from the original header, and thus,
+ *** contains no copyrightable information.
+ ***
+ *** To edit the content of this header, modify the corresponding
+ *** source file (e.g. under external/kernel-headers/original/) then
+ *** run bionic/libc/kernel/tools/update_all.py
+ ***
+ *** Any manual change here will be lost the next time this script will
+ *** be run. You've been warned!
+ ***
+ ****************************************************************************
+ ****************************************************************************/
+#ifndef _UAPI_CAN_NETLINK_H
+#define _UAPI_CAN_NETLINK_H
+#include <linux/types.h>
+struct can_bittiming {
+ __u32 bitrate;
+ __u32 sample_point;
+ __u32 tq;
+ __u32 prop_seg;
+ __u32 phase_seg1;
+ __u32 phase_seg2;
+ __u32 sjw;
+ __u32 brp;
+};
+struct can_bittiming_const {
+ char name[16];
+ __u32 tseg1_min;
+ __u32 tseg1_max;
+ __u32 tseg2_min;
+ __u32 tseg2_max;
+ __u32 sjw_max;
+ __u32 brp_min;
+ __u32 brp_max;
+ __u32 brp_inc;
+};
+struct can_clock {
+ __u32 freq;
+};
+enum can_state {
+ CAN_STATE_ERROR_ACTIVE = 0,
+ CAN_STATE_ERROR_WARNING,
+ CAN_STATE_ERROR_PASSIVE,
+ CAN_STATE_BUS_OFF,
+ CAN_STATE_STOPPED,
+ CAN_STATE_SLEEPING,
+ CAN_STATE_MAX
+};
+struct can_berr_counter {
+ __u16 txerr;
+ __u16 rxerr;
+};
+struct can_ctrlmode {
+ __u32 mask;
+ __u32 flags;
+};
+#define CAN_CTRLMODE_LOOPBACK 0x01
+#define CAN_CTRLMODE_LISTENONLY 0x02
+#define CAN_CTRLMODE_3_SAMPLES 0x04
+#define CAN_CTRLMODE_ONE_SHOT 0x08
+#define CAN_CTRLMODE_BERR_REPORTING 0x10
+#define CAN_CTRLMODE_FD 0x20
+#define CAN_CTRLMODE_PRESUME_ACK 0x40
+#define CAN_CTRLMODE_FD_NON_ISO 0x80
+struct can_device_stats {
+ __u32 bus_error;
+ __u32 error_warning;
+ __u32 error_passive;
+ __u32 bus_off;
+ __u32 arbitration_lost;
+ __u32 restarts;
+};
+enum {
+ IFLA_CAN_UNSPEC,
+ IFLA_CAN_BITTIMING,
+ IFLA_CAN_BITTIMING_CONST,
+ IFLA_CAN_CLOCK,
+ IFLA_CAN_STATE,
+ IFLA_CAN_CTRLMODE,
+ IFLA_CAN_RESTART_MS,
+ IFLA_CAN_RESTART,
+ IFLA_CAN_BERR_COUNTER,
+ IFLA_CAN_DATA_BITTIMING,
+ IFLA_CAN_DATA_BITTIMING_CONST,
+ IFLA_CAN_TERMINATION,
+ IFLA_CAN_TERMINATION_CONST,
+ IFLA_CAN_BITRATE_CONST,
+ IFLA_CAN_DATA_BITRATE_CONST,
+ IFLA_CAN_BITRATE_MAX,
+ __IFLA_CAN_MAX
+};
+#define IFLA_CAN_MAX (__IFLA_CAN_MAX - 1)
+#define CAN_TERMINATION_DISABLED 0
+#endif
diff --git a/chroot/opt/android-master/amd64/usr/include/linux/compiler.h b/chroot/opt/android-master/amd64/usr/include/linux/compiler.h
new file mode 100644
index 0000000..8e89655
--- /dev/null
+++ b/chroot/opt/android-master/amd64/usr/include/linux/compiler.h
@@ -0,0 +1,18 @@
+#ifndef _UAPI_LINUX_COMPILER_H
+#define _UAPI_LINUX_COMPILER_H
+
+/*
+ * This file is not currently in the Linux kernel tree.
+ * Upstream uapi headers refer to <linux/compiler.h> but there is
+ * no such uapi file. We've sent this upstream, and are optimistically
+ * adding it to bionic in the meantime. This should be replaced by
+ * a scrubbed header from external/kernel-headers when possible.
+ *
+ * An alternative to this file is to check in a symbolic link to the
+ * non-uapi <linux/compiler.h>. That's fine for building bionic too.
+ */
+
+#define __user
+#define __force
+
+#endif /* _UAPI_LINUX_COMPILER_H */
diff --git a/chroot/opt/android-master/amd64/usr/include/linux/elf.h b/chroot/opt/android-master/amd64/usr/include/linux/elf.h
new file mode 100644
index 0000000..8f2e668
--- /dev/null
+++ b/chroot/opt/android-master/amd64/usr/include/linux/elf.h
@@ -0,0 +1,376 @@
+/****************************************************************************
+ ****************************************************************************
+ ***
+ *** This header was automatically generated from a Linux kernel header
+ *** of the same name, to make information necessary for userspace to
+ *** call into the kernel available to libc. It contains only constants,
+ *** structures, and macros generated from the original header, and thus,
+ *** contains no copyrightable information.
+ ***
+ *** To edit the content of this header, modify the corresponding
+ *** source file (e.g. under external/kernel-headers/original/) then
+ *** run bionic/libc/kernel/tools/update_all.py
+ ***
+ *** Any manual change here will be lost the next time this script will
+ *** be run. You've been warned!
+ ***
+ ****************************************************************************
+ ****************************************************************************/
+#ifndef _UAPI_LINUX_ELF_H
+#define _UAPI_LINUX_ELF_H
+#include <linux/types.h>
+#include <linux/elf-em.h>
+typedef __u32 Elf32_Addr;
+typedef __u16 Elf32_Half;
+typedef __u32 Elf32_Off;
+typedef __s32 Elf32_Sword;
+typedef __u32 Elf32_Word;
+typedef __u64 Elf64_Addr;
+typedef __u16 Elf64_Half;
+typedef __s16 Elf64_SHalf;
+typedef __u64 Elf64_Off;
+typedef __s32 Elf64_Sword;
+typedef __u32 Elf64_Word;
+typedef __u64 Elf64_Xword;
+typedef __s64 Elf64_Sxword;
+#define PT_NULL 0
+#define PT_LOAD 1
+#define PT_DYNAMIC 2
+#define PT_INTERP 3
+#define PT_NOTE 4
+#define PT_SHLIB 5
+#define PT_PHDR 6
+#define PT_TLS 7
+#define PT_LOOS 0x60000000
+#define PT_HIOS 0x6fffffff
+#define PT_LOPROC 0x70000000
+#define PT_HIPROC 0x7fffffff
+#define PT_GNU_EH_FRAME 0x6474e550
+#define PT_GNU_STACK (PT_LOOS + 0x474e551)
+#define PN_XNUM 0xffff
+#define ET_NONE 0
+#define ET_REL 1
+#define ET_EXEC 2
+#define ET_DYN 3
+#define ET_CORE 4
+#define ET_LOPROC 0xff00
+#define ET_HIPROC 0xffff
+#define DT_NULL 0
+#define DT_NEEDED 1
+#define DT_PLTRELSZ 2
+#define DT_PLTGOT 3
+#define DT_HASH 4
+#define DT_STRTAB 5
+#define DT_SYMTAB 6
+#define DT_RELA 7
+#define DT_RELASZ 8
+#define DT_RELAENT 9
+#define DT_STRSZ 10
+#define DT_SYMENT 11
+#define DT_INIT 12
+#define DT_FINI 13
+#define DT_SONAME 14
+#define DT_RPATH 15
+#define DT_SYMBOLIC 16
+#define DT_REL 17
+#define DT_RELSZ 18
+#define DT_RELENT 19
+#define DT_PLTREL 20
+#define DT_DEBUG 21
+#define DT_TEXTREL 22
+#define DT_JMPREL 23
+#define DT_ENCODING 32
+#define OLD_DT_LOOS 0x60000000
+#define DT_LOOS 0x6000000d
+#define DT_HIOS 0x6ffff000
+#define DT_VALRNGLO 0x6ffffd00
+#define DT_VALRNGHI 0x6ffffdff
+#define DT_ADDRRNGLO 0x6ffffe00
+#define DT_ADDRRNGHI 0x6ffffeff
+#define DT_VERSYM 0x6ffffff0
+#define DT_RELACOUNT 0x6ffffff9
+#define DT_RELCOUNT 0x6ffffffa
+#define DT_FLAGS_1 0x6ffffffb
+#define DT_VERDEF 0x6ffffffc
+#define DT_VERDEFNUM 0x6ffffffd
+#define DT_VERNEED 0x6ffffffe
+#define DT_VERNEEDNUM 0x6fffffff
+#define OLD_DT_HIOS 0x6fffffff
+#define DT_LOPROC 0x70000000
+#define DT_HIPROC 0x7fffffff
+#define STB_LOCAL 0
+#define STB_GLOBAL 1
+#define STB_WEAK 2
+#define STT_NOTYPE 0
+#define STT_OBJECT 1
+#define STT_FUNC 2
+#define STT_SECTION 3
+#define STT_FILE 4
+#define STT_COMMON 5
+#define STT_TLS 6
+#define ELF_ST_BIND(x) ((x) >> 4)
+#define ELF_ST_TYPE(x) (((unsigned int) x) & 0xf)
+#define ELF32_ST_BIND(x) ELF_ST_BIND(x)
+#define ELF32_ST_TYPE(x) ELF_ST_TYPE(x)
+#define ELF64_ST_BIND(x) ELF_ST_BIND(x)
+#define ELF64_ST_TYPE(x) ELF_ST_TYPE(x)
+typedef struct dynamic {
+ Elf32_Sword d_tag;
+ union {
+ Elf32_Sword d_val;
+ Elf32_Addr d_ptr;
+ } d_un;
+} Elf32_Dyn;
+typedef struct {
+ Elf64_Sxword d_tag;
+ union {
+ Elf64_Xword d_val;
+ Elf64_Addr d_ptr;
+ } d_un;
+} Elf64_Dyn;
+#define ELF32_R_SYM(x) ((x) >> 8)
+#define ELF32_R_TYPE(x) ((x) & 0xff)
+#define ELF64_R_SYM(i) ((i) >> 32)
+#define ELF64_R_TYPE(i) ((i) & 0xffffffff)
+typedef struct elf32_rel {
+ Elf32_Addr r_offset;
+ Elf32_Word r_info;
+} Elf32_Rel;
+typedef struct elf64_rel {
+ Elf64_Addr r_offset;
+ Elf64_Xword r_info;
+} Elf64_Rel;
+typedef struct elf32_rela {
+ Elf32_Addr r_offset;
+ Elf32_Word r_info;
+ Elf32_Sword r_addend;
+} Elf32_Rela;
+typedef struct elf64_rela {
+ Elf64_Addr r_offset;
+ Elf64_Xword r_info;
+ Elf64_Sxword r_addend;
+} Elf64_Rela;
+typedef struct elf32_sym {
+ Elf32_Word st_name;
+ Elf32_Addr st_value;
+ Elf32_Word st_size;
+ unsigned char st_info;
+ unsigned char st_other;
+ Elf32_Half st_shndx;
+} Elf32_Sym;
+typedef struct elf64_sym {
+ Elf64_Word st_name;
+ unsigned char st_info;
+ unsigned char st_other;
+ Elf64_Half st_shndx;
+ Elf64_Addr st_value;
+ Elf64_Xword st_size;
+} Elf64_Sym;
+#define EI_NIDENT 16
+typedef struct elf32_hdr {
+ unsigned char e_ident[EI_NIDENT];
+ Elf32_Half e_type;
+ Elf32_Half e_machine;
+ Elf32_Word e_version;
+ Elf32_Addr e_entry;
+ Elf32_Off e_phoff;
+ Elf32_Off e_shoff;
+ Elf32_Word e_flags;
+ Elf32_Half e_ehsize;
+ Elf32_Half e_phentsize;
+ Elf32_Half e_phnum;
+ Elf32_Half e_shentsize;
+ Elf32_Half e_shnum;
+ Elf32_Half e_shstrndx;
+} Elf32_Ehdr;
+typedef struct elf64_hdr {
+ unsigned char e_ident[EI_NIDENT];
+ Elf64_Half e_type;
+ Elf64_Half e_machine;
+ Elf64_Word e_version;
+ Elf64_Addr e_entry;
+ Elf64_Off e_phoff;
+ Elf64_Off e_shoff;
+ Elf64_Word e_flags;
+ Elf64_Half e_ehsize;
+ Elf64_Half e_phentsize;
+ Elf64_Half e_phnum;
+ Elf64_Half e_shentsize;
+ Elf64_Half e_shnum;
+ Elf64_Half e_shstrndx;
+} Elf64_Ehdr;
+#define PF_R 0x4
+#define PF_W 0x2
+#define PF_X 0x1
+typedef struct elf32_phdr {
+ Elf32_Word p_type;
+ Elf32_Off p_offset;
+ Elf32_Addr p_vaddr;
+ Elf32_Addr p_paddr;
+ Elf32_Word p_filesz;
+ Elf32_Word p_memsz;
+ Elf32_Word p_flags;
+ Elf32_Word p_align;
+} Elf32_Phdr;
+typedef struct elf64_phdr {
+ Elf64_Word p_type;
+ Elf64_Word p_flags;
+ Elf64_Off p_offset;
+ Elf64_Addr p_vaddr;
+ Elf64_Addr p_paddr;
+ Elf64_Xword p_filesz;
+ Elf64_Xword p_memsz;
+ Elf64_Xword p_align;
+} Elf64_Phdr;
+#define SHT_NULL 0
+#define SHT_PROGBITS 1
+#define SHT_SYMTAB 2
+#define SHT_STRTAB 3
+#define SHT_RELA 4
+#define SHT_HASH 5
+#define SHT_DYNAMIC 6
+#define SHT_NOTE 7
+#define SHT_NOBITS 8
+#define SHT_REL 9
+#define SHT_SHLIB 10
+#define SHT_DYNSYM 11
+#define SHT_NUM 12
+#define SHT_LOPROC 0x70000000
+#define SHT_HIPROC 0x7fffffff
+#define SHT_LOUSER 0x80000000
+#define SHT_HIUSER 0xffffffff
+#define SHF_WRITE 0x1
+#define SHF_ALLOC 0x2
+#define SHF_EXECINSTR 0x4
+#define SHF_RELA_LIVEPATCH 0x00100000
+#define SHF_RO_AFTER_INIT 0x00200000
+#define SHF_MASKPROC 0xf0000000
+#define SHN_UNDEF 0
+#define SHN_LORESERVE 0xff00
+#define SHN_LOPROC 0xff00
+#define SHN_HIPROC 0xff1f
+#define SHN_LIVEPATCH 0xff20
+#define SHN_ABS 0xfff1
+#define SHN_COMMON 0xfff2
+#define SHN_HIRESERVE 0xffff
+typedef struct elf32_shdr {
+ Elf32_Word sh_name;
+ Elf32_Word sh_type;
+ Elf32_Word sh_flags;
+ Elf32_Addr sh_addr;
+ Elf32_Off sh_offset;
+ Elf32_Word sh_size;
+ Elf32_Word sh_link;
+ Elf32_Word sh_info;
+ Elf32_Word sh_addralign;
+ Elf32_Word sh_entsize;
+} Elf32_Shdr;
+typedef struct elf64_shdr {
+ Elf64_Word sh_name;
+ Elf64_Word sh_type;
+ Elf64_Xword sh_flags;
+ Elf64_Addr sh_addr;
+ Elf64_Off sh_offset;
+ Elf64_Xword sh_size;
+ Elf64_Word sh_link;
+ Elf64_Word sh_info;
+ Elf64_Xword sh_addralign;
+ Elf64_Xword sh_entsize;
+} Elf64_Shdr;
+#define EI_MAG0 0
+#define EI_MAG1 1
+#define EI_MAG2 2
+#define EI_MAG3 3
+#define EI_CLASS 4
+#define EI_DATA 5
+#define EI_VERSION 6
+#define EI_OSABI 7
+#define EI_PAD 8
+#define ELFMAG0 0x7f
+#define ELFMAG1 'E'
+#define ELFMAG2 'L'
+#define ELFMAG3 'F'
+#define ELFMAG "\177ELF"
+#define SELFMAG 4
+#define ELFCLASSNONE 0
+#define ELFCLASS32 1
+#define ELFCLASS64 2
+#define ELFCLASSNUM 3
+#define ELFDATANONE 0
+#define ELFDATA2LSB 1
+#define ELFDATA2MSB 2
+#define EV_NONE 0
+#define EV_CURRENT 1
+#define EV_NUM 2
+#define ELFOSABI_NONE 0
+#define ELFOSABI_LINUX 3
+#ifndef ELF_OSABI
+#define ELF_OSABI ELFOSABI_NONE
+#endif
+#define NT_PRSTATUS 1
+#define NT_PRFPREG 2
+#define NT_PRPSINFO 3
+#define NT_TASKSTRUCT 4
+#define NT_AUXV 6
+#define NT_SIGINFO 0x53494749
+#define NT_FILE 0x46494c45
+#define NT_PRXFPREG 0x46e62b7f
+#define NT_PPC_VMX 0x100
+#define NT_PPC_SPE 0x101
+#define NT_PPC_VSX 0x102
+#define NT_PPC_TAR 0x103
+#define NT_PPC_PPR 0x104
+#define NT_PPC_DSCR 0x105
+#define NT_PPC_EBB 0x106
+#define NT_PPC_PMU 0x107
+#define NT_PPC_TM_CGPR 0x108
+#define NT_PPC_TM_CFPR 0x109
+#define NT_PPC_TM_CVMX 0x10a
+#define NT_PPC_TM_CVSX 0x10b
+#define NT_PPC_TM_SPR 0x10c
+#define NT_PPC_TM_CTAR 0x10d
+#define NT_PPC_TM_CPPR 0x10e
+#define NT_PPC_TM_CDSCR 0x10f
+#define NT_PPC_PKEY 0x110
+#define NT_386_TLS 0x200
+#define NT_386_IOPERM 0x201
+#define NT_X86_XSTATE 0x202
+#define NT_S390_HIGH_GPRS 0x300
+#define NT_S390_TIMER 0x301
+#define NT_S390_TODCMP 0x302
+#define NT_S390_TODPREG 0x303
+#define NT_S390_CTRS 0x304
+#define NT_S390_PREFIX 0x305
+#define NT_S390_LAST_BREAK 0x306
+#define NT_S390_SYSTEM_CALL 0x307
+#define NT_S390_TDB 0x308
+#define NT_S390_VXRS_LOW 0x309
+#define NT_S390_VXRS_HIGH 0x30a
+#define NT_S390_GS_CB 0x30b
+#define NT_S390_GS_BC 0x30c
+#define NT_S390_RI_CB 0x30d
+#define NT_ARM_VFP 0x400
+#define NT_ARM_TLS 0x401
+#define NT_ARM_HW_BREAK 0x402
+#define NT_ARM_HW_WATCH 0x403
+#define NT_ARM_SYSTEM_CALL 0x404
+#define NT_ARM_SVE 0x405
+#define NT_ARM_PAC_MASK 0x406
+#define NT_ARM_PACA_KEYS 0x407
+#define NT_ARM_PACG_KEYS 0x408
+#define NT_ARC_V2 0x600
+#define NT_VMCOREDD 0x700
+#define NT_MIPS_DSP 0x800
+#define NT_MIPS_FP_MODE 0x801
+#define NT_MIPS_MSA 0x802
+typedef struct elf32_note {
+ Elf32_Word n_namesz;
+ Elf32_Word n_descsz;
+ Elf32_Word n_type;
+} Elf32_Nhdr;
+typedef struct elf64_note {
+ Elf64_Word n_namesz;
+ Elf64_Word n_descsz;
+ Elf64_Word n_type;
+} Elf64_Nhdr;
+#endif
diff --git a/chroot/opt/android-master/amd64/usr/include/linux/fanotify.h b/chroot/opt/android-master/amd64/usr/include/linux/fanotify.h
new file mode 100644
index 0000000..8b4494f
--- /dev/null
+++ b/chroot/opt/android-master/amd64/usr/include/linux/fanotify.h
@@ -0,0 +1,101 @@
+/****************************************************************************
+ ****************************************************************************
+ ***
+ *** This header was automatically generated from a Linux kernel header
+ *** of the same name, to make information necessary for userspace to
+ *** call into the kernel available to libc. It contains only constants,
+ *** structures, and macros generated from the original header, and thus,
+ *** contains no copyrightable information.
+ ***
+ *** To edit the content of this header, modify the corresponding
+ *** source file (e.g. under external/kernel-headers/original/) then
+ *** run bionic/libc/kernel/tools/update_all.py
+ ***
+ *** Any manual change here will be lost the next time this script will
+ *** be run. You've been warned!
+ ***
+ ****************************************************************************
+ ****************************************************************************/
+#ifndef _UAPI_LINUX_FANOTIFY_H
+#define _UAPI_LINUX_FANOTIFY_H
+#include <linux/types.h>
+#define FAN_ACCESS 0x00000001
+#define FAN_MODIFY 0x00000002
+#define FAN_ATTRIB 0x00000004
+#define FAN_CLOSE_WRITE 0x00000008
+#define FAN_CLOSE_NOWRITE 0x00000010
+#define FAN_OPEN 0x00000020
+#define FAN_MOVED_FROM 0x00000040
+#define FAN_MOVED_TO 0x00000080
+#define FAN_CREATE 0x00000100
+#define FAN_DELETE 0x00000200
+#define FAN_DELETE_SELF 0x00000400
+#define FAN_MOVE_SELF 0x00000800
+#define FAN_OPEN_EXEC 0x00001000
+#define FAN_Q_OVERFLOW 0x00004000
+#define FAN_OPEN_PERM 0x00010000
+#define FAN_ACCESS_PERM 0x00020000
+#define FAN_OPEN_EXEC_PERM 0x00040000
+#define FAN_ONDIR 0x40000000
+#define FAN_EVENT_ON_CHILD 0x08000000
+#define FAN_CLOSE (FAN_CLOSE_WRITE | FAN_CLOSE_NOWRITE)
+#define FAN_MOVE (FAN_MOVED_FROM | FAN_MOVED_TO)
+#define FAN_CLOEXEC 0x00000001
+#define FAN_NONBLOCK 0x00000002
+#define FAN_CLASS_NOTIF 0x00000000
+#define FAN_CLASS_CONTENT 0x00000004
+#define FAN_CLASS_PRE_CONTENT 0x00000008
+#define FAN_ALL_CLASS_BITS (FAN_CLASS_NOTIF | FAN_CLASS_CONTENT | FAN_CLASS_PRE_CONTENT)
+#define FAN_UNLIMITED_QUEUE 0x00000010
+#define FAN_UNLIMITED_MARKS 0x00000020
+#define FAN_ENABLE_AUDIT 0x00000040
+#define FAN_REPORT_TID 0x00000100
+#define FAN_REPORT_FID 0x00000200
+#define FAN_ALL_INIT_FLAGS (FAN_CLOEXEC | FAN_NONBLOCK | FAN_ALL_CLASS_BITS | FAN_UNLIMITED_QUEUE | FAN_UNLIMITED_MARKS)
+#define FAN_MARK_ADD 0x00000001
+#define FAN_MARK_REMOVE 0x00000002
+#define FAN_MARK_DONT_FOLLOW 0x00000004
+#define FAN_MARK_ONLYDIR 0x00000008
+#define FAN_MARK_IGNORED_MASK 0x00000020
+#define FAN_MARK_IGNORED_SURV_MODIFY 0x00000040
+#define FAN_MARK_FLUSH 0x00000080
+#define FAN_MARK_INODE 0x00000000
+#define FAN_MARK_MOUNT 0x00000010
+#define FAN_MARK_FILESYSTEM 0x00000100
+#define FAN_ALL_MARK_FLAGS (FAN_MARK_ADD | FAN_MARK_REMOVE | FAN_MARK_DONT_FOLLOW | FAN_MARK_ONLYDIR | FAN_MARK_MOUNT | FAN_MARK_IGNORED_MASK | FAN_MARK_IGNORED_SURV_MODIFY | FAN_MARK_FLUSH)
+#define FAN_ALL_EVENTS (FAN_ACCESS | FAN_MODIFY | FAN_CLOSE | FAN_OPEN)
+#define FAN_ALL_PERM_EVENTS (FAN_OPEN_PERM | FAN_ACCESS_PERM)
+#define FAN_ALL_OUTGOING_EVENTS (FAN_ALL_EVENTS | FAN_ALL_PERM_EVENTS | FAN_Q_OVERFLOW)
+#define FANOTIFY_METADATA_VERSION 3
+struct fanotify_event_metadata {
+ __u32 event_len;
+ __u8 vers;
+ __u8 reserved;
+ __u16 metadata_len;
+ __aligned_u64 mask;
+ __s32 fd;
+ __s32 pid;
+};
+#define FAN_EVENT_INFO_TYPE_FID 1
+struct fanotify_event_info_header {
+ __u8 info_type;
+ __u8 pad;
+ __u16 len;
+};
+struct fanotify_event_info_fid {
+ struct fanotify_event_info_header hdr;
+ __kernel_fsid_t fsid;
+ unsigned char handle[0];
+};
+struct fanotify_response {
+ __s32 fd;
+ __u32 response;
+};
+#define FAN_ALLOW 0x01
+#define FAN_DENY 0x02
+#define FAN_AUDIT 0x10
+#define FAN_NOFD - 1
+#define FAN_EVENT_METADATA_LEN (sizeof(struct fanotify_event_metadata))
+#define FAN_EVENT_NEXT(meta,len) ((len) -= (meta)->event_len, (struct fanotify_event_metadata *) (((char *) (meta)) + (meta)->event_len))
+#define FAN_EVENT_OK(meta,len) ((long) (len) >= (long) FAN_EVENT_METADATA_LEN && (long) (meta)->event_len >= (long) FAN_EVENT_METADATA_LEN && (long) (meta)->event_len <= (long) (len))
+#endif
diff --git a/chroot/opt/android-master/amd64/usr/include/linux/fb.h b/chroot/opt/android-master/amd64/usr/include/linux/fb.h
new file mode 100644
index 0000000..38da042
--- /dev/null
+++ b/chroot/opt/android-master/amd64/usr/include/linux/fb.h
@@ -0,0 +1,325 @@
+/****************************************************************************
+ ****************************************************************************
+ ***
+ *** This header was automatically generated from a Linux kernel header
+ *** of the same name, to make information necessary for userspace to
+ *** call into the kernel available to libc. It contains only constants,
+ *** structures, and macros generated from the original header, and thus,
+ *** contains no copyrightable information.
+ ***
+ *** To edit the content of this header, modify the corresponding
+ *** source file (e.g. under external/kernel-headers/original/) then
+ *** run bionic/libc/kernel/tools/update_all.py
+ ***
+ *** Any manual change here will be lost the next time this script will
+ *** be run. You've been warned!
+ ***
+ ****************************************************************************
+ ****************************************************************************/
+#ifndef _UAPI_LINUX_FB_H
+#define _UAPI_LINUX_FB_H
+#include <linux/types.h>
+#include <linux/i2c.h>
+#define FB_MAX 32
+#define FBIOGET_VSCREENINFO 0x4600
+#define FBIOPUT_VSCREENINFO 0x4601
+#define FBIOGET_FSCREENINFO 0x4602
+#define FBIOGETCMAP 0x4604
+#define FBIOPUTCMAP 0x4605
+#define FBIOPAN_DISPLAY 0x4606
+#define FBIO_CURSOR _IOWR('F', 0x08, struct fb_cursor)
+#define FBIOGET_CON2FBMAP 0x460F
+#define FBIOPUT_CON2FBMAP 0x4610
+#define FBIOBLANK 0x4611
+#define FBIOGET_VBLANK _IOR('F', 0x12, struct fb_vblank)
+#define FBIO_ALLOC 0x4613
+#define FBIO_FREE 0x4614
+#define FBIOGET_GLYPH 0x4615
+#define FBIOGET_HWCINFO 0x4616
+#define FBIOPUT_MODEINFO 0x4617
+#define FBIOGET_DISPINFO 0x4618
+#define FBIO_WAITFORVSYNC _IOW('F', 0x20, __u32)
+#define FB_TYPE_PACKED_PIXELS 0
+#define FB_TYPE_PLANES 1
+#define FB_TYPE_INTERLEAVED_PLANES 2
+#define FB_TYPE_TEXT 3
+#define FB_TYPE_VGA_PLANES 4
+#define FB_TYPE_FOURCC 5
+#define FB_AUX_TEXT_MDA 0
+#define FB_AUX_TEXT_CGA 1
+#define FB_AUX_TEXT_S3_MMIO 2
+#define FB_AUX_TEXT_MGA_STEP16 3
+#define FB_AUX_TEXT_MGA_STEP8 4
+#define FB_AUX_TEXT_SVGA_GROUP 8
+#define FB_AUX_TEXT_SVGA_MASK 7
+#define FB_AUX_TEXT_SVGA_STEP2 8
+#define FB_AUX_TEXT_SVGA_STEP4 9
+#define FB_AUX_TEXT_SVGA_STEP8 10
+#define FB_AUX_TEXT_SVGA_STEP16 11
+#define FB_AUX_TEXT_SVGA_LAST 15
+#define FB_AUX_VGA_PLANES_VGA4 0
+#define FB_AUX_VGA_PLANES_CFB4 1
+#define FB_AUX_VGA_PLANES_CFB8 2
+#define FB_VISUAL_MONO01 0
+#define FB_VISUAL_MONO10 1
+#define FB_VISUAL_TRUECOLOR 2
+#define FB_VISUAL_PSEUDOCOLOR 3
+#define FB_VISUAL_DIRECTCOLOR 4
+#define FB_VISUAL_STATIC_PSEUDOCOLOR 5
+#define FB_VISUAL_FOURCC 6
+#define FB_ACCEL_NONE 0
+#define FB_ACCEL_ATARIBLITT 1
+#define FB_ACCEL_AMIGABLITT 2
+#define FB_ACCEL_S3_TRIO64 3
+#define FB_ACCEL_NCR_77C32BLT 4
+#define FB_ACCEL_S3_VIRGE 5
+#define FB_ACCEL_ATI_MACH64GX 6
+#define FB_ACCEL_DEC_TGA 7
+#define FB_ACCEL_ATI_MACH64CT 8
+#define FB_ACCEL_ATI_MACH64VT 9
+#define FB_ACCEL_ATI_MACH64GT 10
+#define FB_ACCEL_SUN_CREATOR 11
+#define FB_ACCEL_SUN_CGSIX 12
+#define FB_ACCEL_SUN_LEO 13
+#define FB_ACCEL_IMS_TWINTURBO 14
+#define FB_ACCEL_3DLABS_PERMEDIA2 15
+#define FB_ACCEL_MATROX_MGA2064W 16
+#define FB_ACCEL_MATROX_MGA1064SG 17
+#define FB_ACCEL_MATROX_MGA2164W 18
+#define FB_ACCEL_MATROX_MGA2164W_AGP 19
+#define FB_ACCEL_MATROX_MGAG100 20
+#define FB_ACCEL_MATROX_MGAG200 21
+#define FB_ACCEL_SUN_CG14 22
+#define FB_ACCEL_SUN_BWTWO 23
+#define FB_ACCEL_SUN_CGTHREE 24
+#define FB_ACCEL_SUN_TCX 25
+#define FB_ACCEL_MATROX_MGAG400 26
+#define FB_ACCEL_NV3 27
+#define FB_ACCEL_NV4 28
+#define FB_ACCEL_NV5 29
+#define FB_ACCEL_CT_6555x 30
+#define FB_ACCEL_3DFX_BANSHEE 31
+#define FB_ACCEL_ATI_RAGE128 32
+#define FB_ACCEL_IGS_CYBER2000 33
+#define FB_ACCEL_IGS_CYBER2010 34
+#define FB_ACCEL_IGS_CYBER5000 35
+#define FB_ACCEL_SIS_GLAMOUR 36
+#define FB_ACCEL_3DLABS_PERMEDIA3 37
+#define FB_ACCEL_ATI_RADEON 38
+#define FB_ACCEL_I810 39
+#define FB_ACCEL_SIS_GLAMOUR_2 40
+#define FB_ACCEL_SIS_XABRE 41
+#define FB_ACCEL_I830 42
+#define FB_ACCEL_NV_10 43
+#define FB_ACCEL_NV_20 44
+#define FB_ACCEL_NV_30 45
+#define FB_ACCEL_NV_40 46
+#define FB_ACCEL_XGI_VOLARI_V 47
+#define FB_ACCEL_XGI_VOLARI_Z 48
+#define FB_ACCEL_OMAP1610 49
+#define FB_ACCEL_TRIDENT_TGUI 50
+#define FB_ACCEL_TRIDENT_3DIMAGE 51
+#define FB_ACCEL_TRIDENT_BLADE3D 52
+#define FB_ACCEL_TRIDENT_BLADEXP 53
+#define FB_ACCEL_CIRRUS_ALPINE 53
+#define FB_ACCEL_NEOMAGIC_NM2070 90
+#define FB_ACCEL_NEOMAGIC_NM2090 91
+#define FB_ACCEL_NEOMAGIC_NM2093 92
+#define FB_ACCEL_NEOMAGIC_NM2097 93
+#define FB_ACCEL_NEOMAGIC_NM2160 94
+#define FB_ACCEL_NEOMAGIC_NM2200 95
+#define FB_ACCEL_NEOMAGIC_NM2230 96
+#define FB_ACCEL_NEOMAGIC_NM2360 97
+#define FB_ACCEL_NEOMAGIC_NM2380 98
+#define FB_ACCEL_PXA3XX 99
+#define FB_ACCEL_SAVAGE4 0x80
+#define FB_ACCEL_SAVAGE3D 0x81
+#define FB_ACCEL_SAVAGE3D_MV 0x82
+#define FB_ACCEL_SAVAGE2000 0x83
+#define FB_ACCEL_SAVAGE_MX_MV 0x84
+#define FB_ACCEL_SAVAGE_MX 0x85
+#define FB_ACCEL_SAVAGE_IX_MV 0x86
+#define FB_ACCEL_SAVAGE_IX 0x87
+#define FB_ACCEL_PROSAVAGE_PM 0x88
+#define FB_ACCEL_PROSAVAGE_KM 0x89
+#define FB_ACCEL_S3TWISTER_P 0x8a
+#define FB_ACCEL_S3TWISTER_K 0x8b
+#define FB_ACCEL_SUPERSAVAGE 0x8c
+#define FB_ACCEL_PROSAVAGE_DDR 0x8d
+#define FB_ACCEL_PROSAVAGE_DDRK 0x8e
+#define FB_ACCEL_PUV3_UNIGFX 0xa0
+#define FB_CAP_FOURCC 1
+struct fb_fix_screeninfo {
+ char id[16];
+ unsigned long smem_start;
+ __u32 smem_len;
+ __u32 type;
+ __u32 type_aux;
+ __u32 visual;
+ __u16 xpanstep;
+ __u16 ypanstep;
+ __u16 ywrapstep;
+ __u32 line_length;
+ unsigned long mmio_start;
+ __u32 mmio_len;
+ __u32 accel;
+ __u16 capabilities;
+ __u16 reserved[2];
+};
+struct fb_bitfield {
+ __u32 offset;
+ __u32 length;
+ __u32 msb_right;
+};
+#define FB_NONSTD_HAM 1
+#define FB_NONSTD_REV_PIX_IN_B 2
+#define FB_ACTIVATE_NOW 0
+#define FB_ACTIVATE_NXTOPEN 1
+#define FB_ACTIVATE_TEST 2
+#define FB_ACTIVATE_MASK 15
+#define FB_ACTIVATE_VBL 16
+#define FB_CHANGE_CMAP_VBL 32
+#define FB_ACTIVATE_ALL 64
+#define FB_ACTIVATE_FORCE 128
+#define FB_ACTIVATE_INV_MODE 256
+#define FB_ACCELF_TEXT 1
+#define FB_SYNC_HOR_HIGH_ACT 1
+#define FB_SYNC_VERT_HIGH_ACT 2
+#define FB_SYNC_EXT 4
+#define FB_SYNC_COMP_HIGH_ACT 8
+#define FB_SYNC_BROADCAST 16
+#define FB_SYNC_ON_GREEN 32
+#define FB_VMODE_NONINTERLACED 0
+#define FB_VMODE_INTERLACED 1
+#define FB_VMODE_DOUBLE 2
+#define FB_VMODE_ODD_FLD_FIRST 4
+#define FB_VMODE_MASK 255
+#define FB_VMODE_YWRAP 256
+#define FB_VMODE_SMOOTH_XPAN 512
+#define FB_VMODE_CONUPDATE 512
+#define FB_ROTATE_UR 0
+#define FB_ROTATE_CW 1
+#define FB_ROTATE_UD 2
+#define FB_ROTATE_CCW 3
+#define PICOS2KHZ(a) (1000000000UL / (a))
+#define KHZ2PICOS(a) (1000000000UL / (a))
+struct fb_var_screeninfo {
+ __u32 xres;
+ __u32 yres;
+ __u32 xres_virtual;
+ __u32 yres_virtual;
+ __u32 xoffset;
+ __u32 yoffset;
+ __u32 bits_per_pixel;
+ __u32 grayscale;
+ struct fb_bitfield red;
+ struct fb_bitfield green;
+ struct fb_bitfield blue;
+ struct fb_bitfield transp;
+ __u32 nonstd;
+ __u32 activate;
+ __u32 height;
+ __u32 width;
+ __u32 accel_flags;
+ __u32 pixclock;
+ __u32 left_margin;
+ __u32 right_margin;
+ __u32 upper_margin;
+ __u32 lower_margin;
+ __u32 hsync_len;
+ __u32 vsync_len;
+ __u32 sync;
+ __u32 vmode;
+ __u32 rotate;
+ __u32 colorspace;
+ __u32 reserved[4];
+};
+struct fb_cmap {
+ __u32 start;
+ __u32 len;
+ __u16 * red;
+ __u16 * green;
+ __u16 * blue;
+ __u16 * transp;
+};
+struct fb_con2fbmap {
+ __u32 console;
+ __u32 framebuffer;
+};
+#define VESA_NO_BLANKING 0
+#define VESA_VSYNC_SUSPEND 1
+#define VESA_HSYNC_SUSPEND 2
+#define VESA_POWERDOWN 3
+enum {
+ FB_BLANK_UNBLANK = VESA_NO_BLANKING,
+ FB_BLANK_NORMAL = VESA_NO_BLANKING + 1,
+ FB_BLANK_VSYNC_SUSPEND = VESA_VSYNC_SUSPEND + 1,
+ FB_BLANK_HSYNC_SUSPEND = VESA_HSYNC_SUSPEND + 1,
+ FB_BLANK_POWERDOWN = VESA_POWERDOWN + 1
+};
+#define FB_VBLANK_VBLANKING 0x001
+#define FB_VBLANK_HBLANKING 0x002
+#define FB_VBLANK_HAVE_VBLANK 0x004
+#define FB_VBLANK_HAVE_HBLANK 0x008
+#define FB_VBLANK_HAVE_COUNT 0x010
+#define FB_VBLANK_HAVE_VCOUNT 0x020
+#define FB_VBLANK_HAVE_HCOUNT 0x040
+#define FB_VBLANK_VSYNCING 0x080
+#define FB_VBLANK_HAVE_VSYNC 0x100
+struct fb_vblank {
+ __u32 flags;
+ __u32 count;
+ __u32 vcount;
+ __u32 hcount;
+ __u32 reserved[4];
+};
+#define ROP_COPY 0
+#define ROP_XOR 1
+struct fb_copyarea {
+ __u32 dx;
+ __u32 dy;
+ __u32 width;
+ __u32 height;
+ __u32 sx;
+ __u32 sy;
+};
+struct fb_fillrect {
+ __u32 dx;
+ __u32 dy;
+ __u32 width;
+ __u32 height;
+ __u32 color;
+ __u32 rop;
+};
+struct fb_image {
+ __u32 dx;
+ __u32 dy;
+ __u32 width;
+ __u32 height;
+ __u32 fg_color;
+ __u32 bg_color;
+ __u8 depth;
+ const char * data;
+ struct fb_cmap cmap;
+};
+#define FB_CUR_SETIMAGE 0x01
+#define FB_CUR_SETPOS 0x02
+#define FB_CUR_SETHOT 0x04
+#define FB_CUR_SETCMAP 0x08
+#define FB_CUR_SETSHAPE 0x10
+#define FB_CUR_SETSIZE 0x20
+#define FB_CUR_SETALL 0xFF
+struct fbcurpos {
+ __u16 x, y;
+};
+struct fb_cursor {
+ __u16 set;
+ __u16 enable;
+ __u16 rop;
+ const char * mask;
+ struct fbcurpos hot;
+ struct fb_image image;
+};
+#define FB_BACKLIGHT_LEVELS 128
+#define FB_BACKLIGHT_MAX 0xFF
+#endif
diff --git a/chroot/opt/android-master/amd64/usr/include/linux/filter.h b/chroot/opt/android-master/amd64/usr/include/linux/filter.h
new file mode 100644
index 0000000..d13c59d
--- /dev/null
+++ b/chroot/opt/android-master/amd64/usr/include/linux/filter.h
@@ -0,0 +1,70 @@
+/****************************************************************************
+ ****************************************************************************
+ ***
+ *** This header was automatically generated from a Linux kernel header
+ *** of the same name, to make information necessary for userspace to
+ *** call into the kernel available to libc. It contains only constants,
+ *** structures, and macros generated from the original header, and thus,
+ *** contains no copyrightable information.
+ ***
+ *** To edit the content of this header, modify the corresponding
+ *** source file (e.g. under external/kernel-headers/original/) then
+ *** run bionic/libc/kernel/tools/update_all.py
+ ***
+ *** Any manual change here will be lost the next time this script will
+ *** be run. You've been warned!
+ ***
+ ****************************************************************************
+ ****************************************************************************/
+#ifndef _UAPI__LINUX_FILTER_H__
+#define _UAPI__LINUX_FILTER_H__
+#include <linux/compiler.h>
+#include <linux/types.h>
+#include <linux/bpf_common.h>
+#define BPF_MAJOR_VERSION 1
+#define BPF_MINOR_VERSION 1
+struct sock_filter {
+ __u16 code;
+ __u8 jt;
+ __u8 jf;
+ __u32 k;
+};
+struct sock_fprog {
+ unsigned short len;
+ struct sock_filter __user * filter;
+};
+#define BPF_RVAL(code) ((code) & 0x18)
+#define BPF_A 0x10
+#define BPF_MISCOP(code) ((code) & 0xf8)
+#define BPF_TAX 0x00
+#define BPF_TXA 0x80
+#ifndef BPF_STMT
+#define BPF_STMT(code,k) { (unsigned short) (code), 0, 0, k }
+#endif
+#ifndef BPF_JUMP
+#define BPF_JUMP(code,k,jt,jf) { (unsigned short) (code), jt, jf, k }
+#endif
+#define BPF_MEMWORDS 16
+#define SKF_AD_OFF (- 0x1000)
+#define SKF_AD_PROTOCOL 0
+#define SKF_AD_PKTTYPE 4
+#define SKF_AD_IFINDEX 8
+#define SKF_AD_NLATTR 12
+#define SKF_AD_NLATTR_NEST 16
+#define SKF_AD_MARK 20
+#define SKF_AD_QUEUE 24
+#define SKF_AD_HATYPE 28
+#define SKF_AD_RXHASH 32
+#define SKF_AD_CPU 36
+#define SKF_AD_ALU_XOR_X 40
+#define SKF_AD_VLAN_TAG 44
+#define SKF_AD_VLAN_TAG_PRESENT 48
+#define SKF_AD_PAY_OFFSET 52
+#define SKF_AD_RANDOM 56
+#define SKF_AD_VLAN_TPID 60
+#define SKF_AD_MAX 64
+#define SKF_NET_OFF (- 0x100000)
+#define SKF_LL_OFF (- 0x200000)
+#define BPF_NET_OFF SKF_NET_OFF
+#define BPF_LL_OFF SKF_LL_OFF
+#endif
diff --git a/chroot/opt/android-master/amd64/usr/include/linux/hid.h b/chroot/opt/android-master/amd64/usr/include/linux/hid.h
new file mode 100644
index 0000000..ce93cd7
--- /dev/null
+++ b/chroot/opt/android-master/amd64/usr/include/linux/hid.h
@@ -0,0 +1,35 @@
+/****************************************************************************
+ ****************************************************************************
+ ***
+ *** This header was automatically generated from a Linux kernel header
+ *** of the same name, to make information necessary for userspace to
+ *** call into the kernel available to libc. It contains only constants,
+ *** structures, and macros generated from the original header, and thus,
+ *** contains no copyrightable information.
+ ***
+ *** To edit the content of this header, modify the corresponding
+ *** source file (e.g. under external/kernel-headers/original/) then
+ *** run bionic/libc/kernel/tools/update_all.py
+ ***
+ *** Any manual change here will be lost the next time this script will
+ *** be run. You've been warned!
+ ***
+ ****************************************************************************
+ ****************************************************************************/
+#ifndef _UAPI__HID_H
+#define _UAPI__HID_H
+#define USB_INTERFACE_CLASS_HID 3
+#define USB_INTERFACE_SUBCLASS_BOOT 1
+#define USB_INTERFACE_PROTOCOL_KEYBOARD 1
+#define USB_INTERFACE_PROTOCOL_MOUSE 2
+#define HID_REQ_GET_REPORT 0x01
+#define HID_REQ_GET_IDLE 0x02
+#define HID_REQ_GET_PROTOCOL 0x03
+#define HID_REQ_SET_REPORT 0x09
+#define HID_REQ_SET_IDLE 0x0A
+#define HID_REQ_SET_PROTOCOL 0x0B
+#define HID_DT_HID (USB_TYPE_CLASS | 0x01)
+#define HID_DT_REPORT (USB_TYPE_CLASS | 0x02)
+#define HID_DT_PHYSICAL (USB_TYPE_CLASS | 0x03)
+#define HID_MAX_DESCRIPTOR_SIZE 4096
+#endif
diff --git a/chroot/opt/android-master/amd64/usr/include/linux/if_addr.h b/chroot/opt/android-master/amd64/usr/include/linux/if_addr.h
new file mode 100644
index 0000000..6a6b640
--- /dev/null
+++ b/chroot/opt/android-master/amd64/usr/include/linux/if_addr.h
@@ -0,0 +1,66 @@
+/****************************************************************************
+ ****************************************************************************
+ ***
+ *** This header was automatically generated from a Linux kernel header
+ *** of the same name, to make information necessary for userspace to
+ *** call into the kernel available to libc. It contains only constants,
+ *** structures, and macros generated from the original header, and thus,
+ *** contains no copyrightable information.
+ ***
+ *** To edit the content of this header, modify the corresponding
+ *** source file (e.g. under external/kernel-headers/original/) then
+ *** run bionic/libc/kernel/tools/update_all.py
+ ***
+ *** Any manual change here will be lost the next time this script will
+ *** be run. You've been warned!
+ ***
+ ****************************************************************************
+ ****************************************************************************/
+#ifndef __LINUX_IF_ADDR_H
+#define __LINUX_IF_ADDR_H
+#include <linux/types.h>
+#include <linux/netlink.h>
+struct ifaddrmsg {
+ __u8 ifa_family;
+ __u8 ifa_prefixlen;
+ __u8 ifa_flags;
+ __u8 ifa_scope;
+ __u32 ifa_index;
+};
+enum {
+ IFA_UNSPEC,
+ IFA_ADDRESS,
+ IFA_LOCAL,
+ IFA_LABEL,
+ IFA_BROADCAST,
+ IFA_ANYCAST,
+ IFA_CACHEINFO,
+ IFA_MULTICAST,
+ IFA_FLAGS,
+ IFA_RT_PRIORITY,
+ IFA_TARGET_NETNSID,
+ __IFA_MAX,
+};
+#define IFA_MAX (__IFA_MAX - 1)
+#define IFA_F_SECONDARY 0x01
+#define IFA_F_TEMPORARY IFA_F_SECONDARY
+#define IFA_F_NODAD 0x02
+#define IFA_F_OPTIMISTIC 0x04
+#define IFA_F_DADFAILED 0x08
+#define IFA_F_HOMEADDRESS 0x10
+#define IFA_F_DEPRECATED 0x20
+#define IFA_F_TENTATIVE 0x40
+#define IFA_F_PERMANENT 0x80
+#define IFA_F_MANAGETEMPADDR 0x100
+#define IFA_F_NOPREFIXROUTE 0x200
+#define IFA_F_MCAUTOJOIN 0x400
+#define IFA_F_STABLE_PRIVACY 0x800
+struct ifa_cacheinfo {
+ __u32 ifa_prefered;
+ __u32 ifa_valid;
+ __u32 cstamp;
+ __u32 tstamp;
+};
+#define IFA_RTA(r) ((struct rtattr *) (((char *) (r)) + NLMSG_ALIGN(sizeof(struct ifaddrmsg))))
+#define IFA_PAYLOAD(n) NLMSG_PAYLOAD(n, sizeof(struct ifaddrmsg))
+#endif
diff --git a/chroot/opt/android-master/amd64/usr/include/linux/if_ether.h b/chroot/opt/android-master/amd64/usr/include/linux/if_ether.h
new file mode 100644
index 0000000..dd2dedb
--- /dev/null
+++ b/chroot/opt/android-master/amd64/usr/include/linux/if_ether.h
@@ -0,0 +1,134 @@
+/****************************************************************************
+ ****************************************************************************
+ ***
+ *** This header was automatically generated from a Linux kernel header
+ *** of the same name, to make information necessary for userspace to
+ *** call into the kernel available to libc. It contains only constants,
+ *** structures, and macros generated from the original header, and thus,
+ *** contains no copyrightable information.
+ ***
+ *** To edit the content of this header, modify the corresponding
+ *** source file (e.g. under external/kernel-headers/original/) then
+ *** run bionic/libc/kernel/tools/update_all.py
+ ***
+ *** Any manual change here will be lost the next time this script will
+ *** be run. You've been warned!
+ ***
+ ****************************************************************************
+ ****************************************************************************/
+#ifndef _UAPI_LINUX_IF_ETHER_H
+#define _UAPI_LINUX_IF_ETHER_H
+#include <linux/types.h>
+#define ETH_ALEN 6
+#define ETH_TLEN 2
+#define ETH_HLEN 14
+#define ETH_ZLEN 60
+#define ETH_DATA_LEN 1500
+#define ETH_FRAME_LEN 1514
+#define ETH_FCS_LEN 4
+#define ETH_MIN_MTU 68
+#define ETH_MAX_MTU 0xFFFFU
+#define ETH_P_LOOP 0x0060
+#define ETH_P_PUP 0x0200
+#define ETH_P_PUPAT 0x0201
+#define ETH_P_TSN 0x22F0
+#define ETH_P_ERSPAN2 0x22EB
+#define ETH_P_IP 0x0800
+#define ETH_P_X25 0x0805
+#define ETH_P_ARP 0x0806
+#define ETH_P_BPQ 0x08FF
+#define ETH_P_IEEEPUP 0x0a00
+#define ETH_P_IEEEPUPAT 0x0a01
+#define ETH_P_BATMAN 0x4305
+#define ETH_P_DEC 0x6000
+#define ETH_P_DNA_DL 0x6001
+#define ETH_P_DNA_RC 0x6002
+#define ETH_P_DNA_RT 0x6003
+#define ETH_P_LAT 0x6004
+#define ETH_P_DIAG 0x6005
+#define ETH_P_CUST 0x6006
+#define ETH_P_SCA 0x6007
+#define ETH_P_TEB 0x6558
+#define ETH_P_RARP 0x8035
+#define ETH_P_ATALK 0x809B
+#define ETH_P_AARP 0x80F3
+#define ETH_P_8021Q 0x8100
+#define ETH_P_ERSPAN 0x88BE
+#define ETH_P_IPX 0x8137
+#define ETH_P_IPV6 0x86DD
+#define ETH_P_PAUSE 0x8808
+#define ETH_P_SLOW 0x8809
+#define ETH_P_WCCP 0x883E
+#define ETH_P_MPLS_UC 0x8847
+#define ETH_P_MPLS_MC 0x8848
+#define ETH_P_ATMMPOA 0x884c
+#define ETH_P_PPP_DISC 0x8863
+#define ETH_P_PPP_SES 0x8864
+#define ETH_P_LINK_CTL 0x886c
+#define ETH_P_ATMFATE 0x8884
+#define ETH_P_PAE 0x888E
+#define ETH_P_AOE 0x88A2
+#define ETH_P_8021AD 0x88A8
+#define ETH_P_802_EX1 0x88B5
+#define ETH_P_PREAUTH 0x88C7
+#define ETH_P_TIPC 0x88CA
+#define ETH_P_LLDP 0x88CC
+#define ETH_P_MACSEC 0x88E5
+#define ETH_P_8021AH 0x88E7
+#define ETH_P_MVRP 0x88F5
+#define ETH_P_1588 0x88F7
+#define ETH_P_NCSI 0x88F8
+#define ETH_P_PRP 0x88FB
+#define ETH_P_FCOE 0x8906
+#define ETH_P_IBOE 0x8915
+#define ETH_P_TDLS 0x890D
+#define ETH_P_FIP 0x8914
+#define ETH_P_80221 0x8917
+#define ETH_P_HSR 0x892F
+#define ETH_P_NSH 0x894F
+#define ETH_P_LOOPBACK 0x9000
+#define ETH_P_QINQ1 0x9100
+#define ETH_P_QINQ2 0x9200
+#define ETH_P_QINQ3 0x9300
+#define ETH_P_EDSA 0xDADA
+#define ETH_P_DSA_8021Q 0xDADB
+#define ETH_P_IFE 0xED3E
+#define ETH_P_AF_IUCV 0xFBFB
+#define ETH_P_802_3_MIN 0x0600
+#define ETH_P_802_3 0x0001
+#define ETH_P_AX25 0x0002
+#define ETH_P_ALL 0x0003
+#define ETH_P_802_2 0x0004
+#define ETH_P_SNAP 0x0005
+#define ETH_P_DDCMP 0x0006
+#define ETH_P_WAN_PPP 0x0007
+#define ETH_P_PPP_MP 0x0008
+#define ETH_P_LOCALTALK 0x0009
+#define ETH_P_CAN 0x000C
+#define ETH_P_CANFD 0x000D
+#define ETH_P_PPPTALK 0x0010
+#define ETH_P_TR_802_2 0x0011
+#define ETH_P_MOBITEX 0x0015
+#define ETH_P_CONTROL 0x0016
+#define ETH_P_IRDA 0x0017
+#define ETH_P_ECONET 0x0018
+#define ETH_P_HDLC 0x0019
+#define ETH_P_ARCNET 0x001A
+#define ETH_P_DSA 0x001B
+#define ETH_P_TRAILER 0x001C
+#define ETH_P_PHONET 0x00F5
+#define ETH_P_IEEE802154 0x00F6
+#define ETH_P_CAIF 0x00F7
+#define ETH_P_XDSA 0x00F8
+#define ETH_P_MAP 0x00F9
+#ifndef __UAPI_DEF_ETHHDR
+#define __UAPI_DEF_ETHHDR 1
+#endif
+#if __UAPI_DEF_ETHHDR
+struct ethhdr {
+ unsigned char h_dest[ETH_ALEN];
+ unsigned char h_source[ETH_ALEN];
+ __be16 h_proto;
+} __attribute__((packed));
+#endif
+#endif
diff --git a/chroot/opt/android-master/amd64/usr/include/linux/if_link.h b/chroot/opt/android-master/amd64/usr/include/linux/if_link.h
new file mode 100644
index 0000000..7843fb5
--- /dev/null
+++ b/chroot/opt/android-master/amd64/usr/include/linux/if_link.h
@@ -0,0 +1,809 @@
+/****************************************************************************
+ ****************************************************************************
+ ***
+ *** This header was automatically generated from a Linux kernel header
+ *** of the same name, to make information necessary for userspace to
+ *** call into the kernel available to libc. It contains only constants,
+ *** structures, and macros generated from the original header, and thus,
+ *** contains no copyrightable information.
+ ***
+ *** To edit the content of this header, modify the corresponding
+ *** source file (e.g. under external/kernel-headers/original/) then
+ *** run bionic/libc/kernel/tools/update_all.py
+ ***
+ *** Any manual change here will be lost the next time this script will
+ *** be run. You've been warned!
+ ***
+ ****************************************************************************
+ ****************************************************************************/
+#ifndef _UAPI_LINUX_IF_LINK_H
+#define _UAPI_LINUX_IF_LINK_H
+#include <linux/types.h>
+#include <linux/netlink.h>
+struct rtnl_link_stats {
+ __u32 rx_packets;
+ __u32 tx_packets;
+ __u32 rx_bytes;
+ __u32 tx_bytes;
+ __u32 rx_errors;
+ __u32 tx_errors;
+ __u32 rx_dropped;
+ __u32 tx_dropped;
+ __u32 multicast;
+ __u32 collisions;
+ __u32 rx_length_errors;
+ __u32 rx_over_errors;
+ __u32 rx_crc_errors;
+ __u32 rx_frame_errors;
+ __u32 rx_fifo_errors;
+ __u32 rx_missed_errors;
+ __u32 tx_aborted_errors;
+ __u32 tx_carrier_errors;
+ __u32 tx_fifo_errors;
+ __u32 tx_heartbeat_errors;
+ __u32 tx_window_errors;
+ __u32 rx_compressed;
+ __u32 tx_compressed;
+ __u32 rx_nohandler;
+};
+struct rtnl_link_stats64 {
+ __u64 rx_packets;
+ __u64 tx_packets;
+ __u64 rx_bytes;
+ __u64 tx_bytes;
+ __u64 rx_errors;
+ __u64 tx_errors;
+ __u64 rx_dropped;
+ __u64 tx_dropped;
+ __u64 multicast;
+ __u64 collisions;
+ __u64 rx_length_errors;
+ __u64 rx_over_errors;
+ __u64 rx_crc_errors;
+ __u64 rx_frame_errors;
+ __u64 rx_fifo_errors;
+ __u64 rx_missed_errors;
+ __u64 tx_aborted_errors;
+ __u64 tx_carrier_errors;
+ __u64 tx_fifo_errors;
+ __u64 tx_heartbeat_errors;
+ __u64 tx_window_errors;
+ __u64 rx_compressed;
+ __u64 tx_compressed;
+ __u64 rx_nohandler;
+};
+struct rtnl_link_ifmap {
+ __u64 mem_start;
+ __u64 mem_end;
+ __u64 base_addr;
+ __u16 irq;
+ __u8 dma;
+ __u8 port;
+};
+enum {
+ IFLA_UNSPEC,
+ IFLA_ADDRESS,
+ IFLA_BROADCAST,
+ IFLA_IFNAME,
+ IFLA_MTU,
+ IFLA_LINK,
+ IFLA_QDISC,
+ IFLA_STATS,
+ IFLA_COST,
+#define IFLA_COST IFLA_COST
+ IFLA_PRIORITY,
+#define IFLA_PRIORITY IFLA_PRIORITY
+ IFLA_MASTER,
+#define IFLA_MASTER IFLA_MASTER
+ IFLA_WIRELESS,
+#define IFLA_WIRELESS IFLA_WIRELESS
+ IFLA_PROTINFO,
+#define IFLA_PROTINFO IFLA_PROTINFO
+ IFLA_TXQLEN,
+#define IFLA_TXQLEN IFLA_TXQLEN
+ IFLA_MAP,
+#define IFLA_MAP IFLA_MAP
+ IFLA_WEIGHT,
+#define IFLA_WEIGHT IFLA_WEIGHT
+ IFLA_OPERSTATE,
+ IFLA_LINKMODE,
+ IFLA_LINKINFO,
+#define IFLA_LINKINFO IFLA_LINKINFO
+ IFLA_NET_NS_PID,
+ IFLA_IFALIAS,
+ IFLA_NUM_VF,
+ IFLA_VFINFO_LIST,
+ IFLA_STATS64,
+ IFLA_VF_PORTS,
+ IFLA_PORT_SELF,
+ IFLA_AF_SPEC,
+ IFLA_GROUP,
+ IFLA_NET_NS_FD,
+ IFLA_EXT_MASK,
+ IFLA_PROMISCUITY,
+#define IFLA_PROMISCUITY IFLA_PROMISCUITY
+ IFLA_NUM_TX_QUEUES,
+ IFLA_NUM_RX_QUEUES,
+ IFLA_CARRIER,
+ IFLA_PHYS_PORT_ID,
+ IFLA_CARRIER_CHANGES,
+ IFLA_PHYS_SWITCH_ID,
+ IFLA_LINK_NETNSID,
+ IFLA_PHYS_PORT_NAME,
+ IFLA_PROTO_DOWN,
+ IFLA_GSO_MAX_SEGS,
+ IFLA_GSO_MAX_SIZE,
+ IFLA_PAD,
+ IFLA_XDP,
+ IFLA_EVENT,
+ IFLA_NEW_NETNSID,
+ IFLA_IF_NETNSID,
+ IFLA_TARGET_NETNSID = IFLA_IF_NETNSID,
+ IFLA_CARRIER_UP_COUNT,
+ IFLA_CARRIER_DOWN_COUNT,
+ IFLA_NEW_IFINDEX,
+ IFLA_MIN_MTU,
+ IFLA_MAX_MTU,
+ IFLA_PROP_LIST,
+ IFLA_ALT_IFNAME,
+ __IFLA_MAX
+};
+#define IFLA_MAX (__IFLA_MAX - 1)
+#define IFLA_RTA(r) ((struct rtattr *) (((char *) (r)) + NLMSG_ALIGN(sizeof(struct ifinfomsg))))
+#define IFLA_PAYLOAD(n) NLMSG_PAYLOAD(n, sizeof(struct ifinfomsg))
+enum {
+ IFLA_INET_UNSPEC,
+ IFLA_INET_CONF,
+ __IFLA_INET_MAX,
+};
+#define IFLA_INET_MAX (__IFLA_INET_MAX - 1)
+enum {
+ IFLA_INET6_UNSPEC,
+ IFLA_INET6_FLAGS,
+ IFLA_INET6_CONF,
+ IFLA_INET6_STATS,
+ IFLA_INET6_MCAST,
+ IFLA_INET6_CACHEINFO,
+ IFLA_INET6_ICMP6STATS,
+ IFLA_INET6_TOKEN,
+ IFLA_INET6_ADDR_GEN_MODE,
+ __IFLA_INET6_MAX
+};
+#define IFLA_INET6_MAX (__IFLA_INET6_MAX - 1)
+enum in6_addr_gen_mode {
+ IN6_ADDR_GEN_MODE_EUI64,
+ IN6_ADDR_GEN_MODE_NONE,
+ IN6_ADDR_GEN_MODE_STABLE_PRIVACY,
+ IN6_ADDR_GEN_MODE_RANDOM,
+};
+enum {
+ IFLA_BR_UNSPEC,
+ IFLA_BR_FORWARD_DELAY,
+ IFLA_BR_HELLO_TIME,
+ IFLA_BR_MAX_AGE,
+ IFLA_BR_AGEING_TIME,
+ IFLA_BR_STP_STATE,
+ IFLA_BR_PRIORITY,
+ IFLA_BR_VLAN_FILTERING,
+ IFLA_BR_VLAN_PROTOCOL,
+ IFLA_BR_GROUP_FWD_MASK,
+ IFLA_BR_ROOT_ID,
+ IFLA_BR_BRIDGE_ID,
+ IFLA_BR_ROOT_PORT,
+ IFLA_BR_ROOT_PATH_COST,
+ IFLA_BR_TOPOLOGY_CHANGE,
+ IFLA_BR_TOPOLOGY_CHANGE_DETECTED,
+ IFLA_BR_HELLO_TIMER,
+ IFLA_BR_TCN_TIMER,
+ IFLA_BR_TOPOLOGY_CHANGE_TIMER,
+ IFLA_BR_GC_TIMER,
+ IFLA_BR_GROUP_ADDR,
+ IFLA_BR_FDB_FLUSH,
+ IFLA_BR_MCAST_ROUTER,
+ IFLA_BR_MCAST_SNOOPING,
+ IFLA_BR_MCAST_QUERY_USE_IFADDR,
+ IFLA_BR_MCAST_QUERIER,
+ IFLA_BR_MCAST_HASH_ELASTICITY,
+ IFLA_BR_MCAST_HASH_MAX,
+ IFLA_BR_MCAST_LAST_MEMBER_CNT,
+ IFLA_BR_MCAST_STARTUP_QUERY_CNT,
+ IFLA_BR_MCAST_LAST_MEMBER_INTVL,
+ IFLA_BR_MCAST_MEMBERSHIP_INTVL,
+ IFLA_BR_MCAST_QUERIER_INTVL,
+ IFLA_BR_MCAST_QUERY_INTVL,
+ IFLA_BR_MCAST_QUERY_RESPONSE_INTVL,
+ IFLA_BR_MCAST_STARTUP_QUERY_INTVL,
+ IFLA_BR_NF_CALL_IPTABLES,
+ IFLA_BR_NF_CALL_IP6TABLES,
+ IFLA_BR_NF_CALL_ARPTABLES,
+ IFLA_BR_VLAN_DEFAULT_PVID,
+ IFLA_BR_PAD,
+ IFLA_BR_VLAN_STATS_ENABLED,
+ IFLA_BR_MCAST_STATS_ENABLED,
+ IFLA_BR_MCAST_IGMP_VERSION,
+ IFLA_BR_MCAST_MLD_VERSION,
+ IFLA_BR_VLAN_STATS_PER_PORT,
+ IFLA_BR_MULTI_BOOLOPT,
+ __IFLA_BR_MAX,
+};
+#define IFLA_BR_MAX (__IFLA_BR_MAX - 1)
+struct ifla_bridge_id {
+ __u8 prio[2];
+ __u8 addr[6];
+};
+enum {
+ BRIDGE_MODE_UNSPEC,
+ BRIDGE_MODE_HAIRPIN,
+};
+enum {
+ IFLA_BRPORT_UNSPEC,
+ IFLA_BRPORT_STATE,
+ IFLA_BRPORT_PRIORITY,
+ IFLA_BRPORT_COST,
+ IFLA_BRPORT_MODE,
+ IFLA_BRPORT_GUARD,
+ IFLA_BRPORT_PROTECT,
+ IFLA_BRPORT_FAST_LEAVE,
+ IFLA_BRPORT_LEARNING,
+ IFLA_BRPORT_UNICAST_FLOOD,
+ IFLA_BRPORT_PROXYARP,
+ IFLA_BRPORT_LEARNING_SYNC,
+ IFLA_BRPORT_PROXYARP_WIFI,
+ IFLA_BRPORT_ROOT_ID,
+ IFLA_BRPORT_BRIDGE_ID,
+ IFLA_BRPORT_DESIGNATED_PORT,
+ IFLA_BRPORT_DESIGNATED_COST,
+ IFLA_BRPORT_ID,
+ IFLA_BRPORT_NO,
+ IFLA_BRPORT_TOPOLOGY_CHANGE_ACK,
+ IFLA_BRPORT_CONFIG_PENDING,
+ IFLA_BRPORT_MESSAGE_AGE_TIMER,
+ IFLA_BRPORT_FORWARD_DELAY_TIMER,
+ IFLA_BRPORT_HOLD_TIMER,
+ IFLA_BRPORT_FLUSH,
+ IFLA_BRPORT_MULTICAST_ROUTER,
+ IFLA_BRPORT_PAD,
+ IFLA_BRPORT_MCAST_FLOOD,
+ IFLA_BRPORT_MCAST_TO_UCAST,
+ IFLA_BRPORT_VLAN_TUNNEL,
+ IFLA_BRPORT_BCAST_FLOOD,
+ IFLA_BRPORT_GROUP_FWD_MASK,
+ IFLA_BRPORT_NEIGH_SUPPRESS,
+ IFLA_BRPORT_ISOLATED,
+ IFLA_BRPORT_BACKUP_PORT,
+ __IFLA_BRPORT_MAX
+};
+#define IFLA_BRPORT_MAX (__IFLA_BRPORT_MAX - 1)
+struct ifla_cacheinfo {
+ __u32 max_reasm_len;
+ __u32 tstamp;
+ __u32 reachable_time;
+ __u32 retrans_time;
+};
+enum {
+ IFLA_INFO_UNSPEC,
+ IFLA_INFO_KIND,
+ IFLA_INFO_DATA,
+ IFLA_INFO_XSTATS,
+ IFLA_INFO_SLAVE_KIND,
+ IFLA_INFO_SLAVE_DATA,
+ __IFLA_INFO_MAX,
+};
+#define IFLA_INFO_MAX (__IFLA_INFO_MAX - 1)
+enum {
+ IFLA_VLAN_UNSPEC,
+ IFLA_VLAN_ID,
+ IFLA_VLAN_FLAGS,
+ IFLA_VLAN_EGRESS_QOS,
+ IFLA_VLAN_INGRESS_QOS,
+ IFLA_VLAN_PROTOCOL,
+ __IFLA_VLAN_MAX,
+};
+#define IFLA_VLAN_MAX (__IFLA_VLAN_MAX - 1)
+struct ifla_vlan_flags {
+ __u32 flags;
+ __u32 mask;
+};
+enum {
+ IFLA_VLAN_QOS_UNSPEC,
+ IFLA_VLAN_QOS_MAPPING,
+ __IFLA_VLAN_QOS_MAX
+};
+#define IFLA_VLAN_QOS_MAX (__IFLA_VLAN_QOS_MAX - 1)
+struct ifla_vlan_qos_mapping {
+ __u32 from;
+ __u32 to;
+};
+enum {
+ IFLA_MACVLAN_UNSPEC,
+ IFLA_MACVLAN_MODE,
+ IFLA_MACVLAN_FLAGS,
+ IFLA_MACVLAN_MACADDR_MODE,
+ IFLA_MACVLAN_MACADDR,
+ IFLA_MACVLAN_MACADDR_DATA,
+ IFLA_MACVLAN_MACADDR_COUNT,
+ __IFLA_MACVLAN_MAX,
+};
+#define IFLA_MACVLAN_MAX (__IFLA_MACVLAN_MAX - 1)
+enum macvlan_mode {
+ MACVLAN_MODE_PRIVATE = 1,
+ MACVLAN_MODE_VEPA = 2,
+ MACVLAN_MODE_BRIDGE = 4,
+ MACVLAN_MODE_PASSTHRU = 8,
+ MACVLAN_MODE_SOURCE = 16,
+};
+enum macvlan_macaddr_mode {
+ MACVLAN_MACADDR_ADD,
+ MACVLAN_MACADDR_DEL,
+ MACVLAN_MACADDR_FLUSH,
+ MACVLAN_MACADDR_SET,
+};
+#define MACVLAN_FLAG_NOPROMISC 1
+enum {
+ IFLA_VRF_UNSPEC,
+ IFLA_VRF_TABLE,
+ __IFLA_VRF_MAX
+};
+#define IFLA_VRF_MAX (__IFLA_VRF_MAX - 1)
+enum {
+ IFLA_VRF_PORT_UNSPEC,
+ IFLA_VRF_PORT_TABLE,
+ __IFLA_VRF_PORT_MAX
+};
+#define IFLA_VRF_PORT_MAX (__IFLA_VRF_PORT_MAX - 1)
+enum {
+ IFLA_MACSEC_UNSPEC,
+ IFLA_MACSEC_SCI,
+ IFLA_MACSEC_PORT,
+ IFLA_MACSEC_ICV_LEN,
+ IFLA_MACSEC_CIPHER_SUITE,
+ IFLA_MACSEC_WINDOW,
+ IFLA_MACSEC_ENCODING_SA,
+ IFLA_MACSEC_ENCRYPT,
+ IFLA_MACSEC_PROTECT,
+ IFLA_MACSEC_INC_SCI,
+ IFLA_MACSEC_ES,
+ IFLA_MACSEC_SCB,
+ IFLA_MACSEC_REPLAY_PROTECT,
+ IFLA_MACSEC_VALIDATION,
+ IFLA_MACSEC_PAD,
+ __IFLA_MACSEC_MAX,
+};
+#define IFLA_MACSEC_MAX (__IFLA_MACSEC_MAX - 1)
+enum {
+ IFLA_XFRM_UNSPEC,
+ IFLA_XFRM_LINK,
+ IFLA_XFRM_IF_ID,
+ __IFLA_XFRM_MAX
+};
+#define IFLA_XFRM_MAX (__IFLA_XFRM_MAX - 1)
+enum macsec_validation_type {
+ MACSEC_VALIDATE_DISABLED = 0,
+ MACSEC_VALIDATE_CHECK = 1,
+ MACSEC_VALIDATE_STRICT = 2,
+ __MACSEC_VALIDATE_END,
+ MACSEC_VALIDATE_MAX = __MACSEC_VALIDATE_END - 1,
+};
+enum {
+ IFLA_IPVLAN_UNSPEC,
+ IFLA_IPVLAN_MODE,
+ IFLA_IPVLAN_FLAGS,
+ __IFLA_IPVLAN_MAX
+};
+#define IFLA_IPVLAN_MAX (__IFLA_IPVLAN_MAX - 1)
+enum ipvlan_mode {
+ IPVLAN_MODE_L2 = 0,
+ IPVLAN_MODE_L3,
+ IPVLAN_MODE_L3S,
+ IPVLAN_MODE_MAX
+};
+#define IPVLAN_F_PRIVATE 0x01
+#define IPVLAN_F_VEPA 0x02
+enum {
+ IFLA_VXLAN_UNSPEC,
+ IFLA_VXLAN_ID,
+ IFLA_VXLAN_GROUP,
+ IFLA_VXLAN_LINK,
+ IFLA_VXLAN_LOCAL,
+ IFLA_VXLAN_TTL,
+ IFLA_VXLAN_TOS,
+ IFLA_VXLAN_LEARNING,
+ IFLA_VXLAN_AGEING,
+ IFLA_VXLAN_LIMIT,
+ IFLA_VXLAN_PORT_RANGE,
+ IFLA_VXLAN_PROXY,
+ IFLA_VXLAN_RSC,
+ IFLA_VXLAN_L2MISS,
+ IFLA_VXLAN_L3MISS,
+ IFLA_VXLAN_PORT,
+ IFLA_VXLAN_GROUP6,
+ IFLA_VXLAN_LOCAL6,
+ IFLA_VXLAN_UDP_CSUM,
+ IFLA_VXLAN_UDP_ZERO_CSUM6_TX,
+ IFLA_VXLAN_UDP_ZERO_CSUM6_RX,
+ IFLA_VXLAN_REMCSUM_TX,
+ IFLA_VXLAN_REMCSUM_RX,
+ IFLA_VXLAN_GBP,
+ IFLA_VXLAN_REMCSUM_NOPARTIAL,
+ IFLA_VXLAN_COLLECT_METADATA,
+ IFLA_VXLAN_LABEL,
+ IFLA_VXLAN_GPE,
+ IFLA_VXLAN_TTL_INHERIT,
+ IFLA_VXLAN_DF,
+ __IFLA_VXLAN_MAX
+};
+#define IFLA_VXLAN_MAX (__IFLA_VXLAN_MAX - 1)
+struct ifla_vxlan_port_range {
+ __be16 low;
+ __be16 high;
+};
+enum ifla_vxlan_df {
+ VXLAN_DF_UNSET = 0,
+ VXLAN_DF_SET,
+ VXLAN_DF_INHERIT,
+ __VXLAN_DF_END,
+ VXLAN_DF_MAX = __VXLAN_DF_END - 1,
+};
+enum {
+ IFLA_GENEVE_UNSPEC,
+ IFLA_GENEVE_ID,
+ IFLA_GENEVE_REMOTE,
+ IFLA_GENEVE_TTL,
+ IFLA_GENEVE_TOS,
+ IFLA_GENEVE_PORT,
+ IFLA_GENEVE_COLLECT_METADATA,
+ IFLA_GENEVE_REMOTE6,
+ IFLA_GENEVE_UDP_CSUM,
+ IFLA_GENEVE_UDP_ZERO_CSUM6_TX,
+ IFLA_GENEVE_UDP_ZERO_CSUM6_RX,
+ IFLA_GENEVE_LABEL,
+ IFLA_GENEVE_TTL_INHERIT,
+ IFLA_GENEVE_DF,
+ __IFLA_GENEVE_MAX
+};
+#define IFLA_GENEVE_MAX (__IFLA_GENEVE_MAX - 1)
+enum ifla_geneve_df {
+ GENEVE_DF_UNSET = 0,
+ GENEVE_DF_SET,
+ GENEVE_DF_INHERIT,
+ __GENEVE_DF_END,
+ GENEVE_DF_MAX = __GENEVE_DF_END - 1,
+};
+enum {
+ IFLA_PPP_UNSPEC,
+ IFLA_PPP_DEV_FD,
+ __IFLA_PPP_MAX
+};
+#define IFLA_PPP_MAX (__IFLA_PPP_MAX - 1)
+enum ifla_gtp_role {
+ GTP_ROLE_GGSN = 0,
+ GTP_ROLE_SGSN,
+};
+enum {
+ IFLA_GTP_UNSPEC,
+ IFLA_GTP_FD0,
+ IFLA_GTP_FD1,
+ IFLA_GTP_PDP_HASHSIZE,
+ IFLA_GTP_ROLE,
+ __IFLA_GTP_MAX,
+};
+#define IFLA_GTP_MAX (__IFLA_GTP_MAX - 1)
+enum {
+ IFLA_BOND_UNSPEC,
+ IFLA_BOND_MODE,
+ IFLA_BOND_ACTIVE_SLAVE,
+ IFLA_BOND_MIIMON,
+ IFLA_BOND_UPDELAY,
+ IFLA_BOND_DOWNDELAY,
+ IFLA_BOND_USE_CARRIER,
+ IFLA_BOND_ARP_INTERVAL,
+ IFLA_BOND_ARP_IP_TARGET,
+ IFLA_BOND_ARP_VALIDATE,
+ IFLA_BOND_ARP_ALL_TARGETS,
+ IFLA_BOND_PRIMARY,
+ IFLA_BOND_PRIMARY_RESELECT,
+ IFLA_BOND_FAIL_OVER_MAC,
+ IFLA_BOND_XMIT_HASH_POLICY,
+ IFLA_BOND_RESEND_IGMP,
+ IFLA_BOND_NUM_PEER_NOTIF,
+ IFLA_BOND_ALL_SLAVES_ACTIVE,
+ IFLA_BOND_MIN_LINKS,
+ IFLA_BOND_LP_INTERVAL,
+ IFLA_BOND_PACKETS_PER_SLAVE,
+ IFLA_BOND_AD_LACP_RATE,
+ IFLA_BOND_AD_SELECT,
+ IFLA_BOND_AD_INFO,
+ IFLA_BOND_AD_ACTOR_SYS_PRIO,
+ IFLA_BOND_AD_USER_PORT_KEY,
+ IFLA_BOND_AD_ACTOR_SYSTEM,
+ IFLA_BOND_TLB_DYNAMIC_LB,
+ IFLA_BOND_PEER_NOTIF_DELAY,
+ __IFLA_BOND_MAX,
+};
+#define IFLA_BOND_MAX (__IFLA_BOND_MAX - 1)
+enum {
+ IFLA_BOND_AD_INFO_UNSPEC,
+ IFLA_BOND_AD_INFO_AGGREGATOR,
+ IFLA_BOND_AD_INFO_NUM_PORTS,
+ IFLA_BOND_AD_INFO_ACTOR_KEY,
+ IFLA_BOND_AD_INFO_PARTNER_KEY,
+ IFLA_BOND_AD_INFO_PARTNER_MAC,
+ __IFLA_BOND_AD_INFO_MAX,
+};
+#define IFLA_BOND_AD_INFO_MAX (__IFLA_BOND_AD_INFO_MAX - 1)
+enum {
+ IFLA_BOND_SLAVE_UNSPEC,
+ IFLA_BOND_SLAVE_STATE,
+ IFLA_BOND_SLAVE_MII_STATUS,
+ IFLA_BOND_SLAVE_LINK_FAILURE_COUNT,
+ IFLA_BOND_SLAVE_PERM_HWADDR,
+ IFLA_BOND_SLAVE_QUEUE_ID,
+ IFLA_BOND_SLAVE_AD_AGGREGATOR_ID,
+ IFLA_BOND_SLAVE_AD_ACTOR_OPER_PORT_STATE,
+ IFLA_BOND_SLAVE_AD_PARTNER_OPER_PORT_STATE,
+ __IFLA_BOND_SLAVE_MAX,
+};
+#define IFLA_BOND_SLAVE_MAX (__IFLA_BOND_SLAVE_MAX - 1)
+enum {
+ IFLA_VF_INFO_UNSPEC,
+ IFLA_VF_INFO,
+ __IFLA_VF_INFO_MAX,
+};
+#define IFLA_VF_INFO_MAX (__IFLA_VF_INFO_MAX - 1)
+enum {
+ IFLA_VF_UNSPEC,
+ IFLA_VF_MAC,
+ IFLA_VF_VLAN,
+ IFLA_VF_TX_RATE,
+ IFLA_VF_SPOOFCHK,
+ IFLA_VF_LINK_STATE,
+ IFLA_VF_RATE,
+ IFLA_VF_RSS_QUERY_EN,
+ IFLA_VF_STATS,
+ IFLA_VF_TRUST,
+ IFLA_VF_IB_NODE_GUID,
+ IFLA_VF_IB_PORT_GUID,
+ IFLA_VF_VLAN_LIST,
+ IFLA_VF_BROADCAST,
+ __IFLA_VF_MAX,
+};
+#define IFLA_VF_MAX (__IFLA_VF_MAX - 1)
+struct ifla_vf_mac {
+ __u32 vf;
+ __u8 mac[32];
+};
+struct ifla_vf_broadcast {
+ __u8 broadcast[32];
+};
+struct ifla_vf_vlan {
+ __u32 vf;
+ __u32 vlan;
+ __u32 qos;
+};
+enum {
+ IFLA_VF_VLAN_INFO_UNSPEC,
+ IFLA_VF_VLAN_INFO,
+ __IFLA_VF_VLAN_INFO_MAX,
+};
+#define IFLA_VF_VLAN_INFO_MAX (__IFLA_VF_VLAN_INFO_MAX - 1)
+#define MAX_VLAN_LIST_LEN 1
+struct ifla_vf_vlan_info {
+ __u32 vf;
+ __u32 vlan;
+ __u32 qos;
+ __be16 vlan_proto;
+};
+struct ifla_vf_tx_rate {
+ __u32 vf;
+ __u32 rate;
+};
+struct ifla_vf_rate {
+ __u32 vf;
+ __u32 min_tx_rate;
+ __u32 max_tx_rate;
+};
+struct ifla_vf_spoofchk {
+ __u32 vf;
+ __u32 setting;
+};
+struct ifla_vf_guid {
+ __u32 vf;
+ __u64 guid;
+};
+enum {
+ IFLA_VF_LINK_STATE_AUTO,
+ IFLA_VF_LINK_STATE_ENABLE,
+ IFLA_VF_LINK_STATE_DISABLE,
+ __IFLA_VF_LINK_STATE_MAX,
+};
+struct ifla_vf_link_state {
+ __u32 vf;
+ __u32 link_state;
+};
+struct ifla_vf_rss_query_en {
+ __u32 vf;
+ __u32 setting;
+};
+enum {
+ IFLA_VF_STATS_RX_PACKETS,
+ IFLA_VF_STATS_TX_PACKETS,
+ IFLA_VF_STATS_RX_BYTES,
+ IFLA_VF_STATS_TX_BYTES,
+ IFLA_VF_STATS_BROADCAST,
+ IFLA_VF_STATS_MULTICAST,
+ IFLA_VF_STATS_PAD,
+ IFLA_VF_STATS_RX_DROPPED,
+ IFLA_VF_STATS_TX_DROPPED,
+ __IFLA_VF_STATS_MAX,
+};
+#define IFLA_VF_STATS_MAX (__IFLA_VF_STATS_MAX - 1)
+struct ifla_vf_trust {
+ __u32 vf;
+ __u32 setting;
+};
+enum {
+ IFLA_VF_PORT_UNSPEC,
+ IFLA_VF_PORT,
+ __IFLA_VF_PORT_MAX,
+};
+#define IFLA_VF_PORT_MAX (__IFLA_VF_PORT_MAX - 1)
+enum {
+ IFLA_PORT_UNSPEC,
+ IFLA_PORT_VF,
+ IFLA_PORT_PROFILE,
+ IFLA_PORT_VSI_TYPE,
+ IFLA_PORT_INSTANCE_UUID,
+ IFLA_PORT_HOST_UUID,
+ IFLA_PORT_REQUEST,
+ IFLA_PORT_RESPONSE,
+ __IFLA_PORT_MAX,
+};
+#define IFLA_PORT_MAX (__IFLA_PORT_MAX - 1)
+#define PORT_PROFILE_MAX 40
+#define PORT_UUID_MAX 16
+#define PORT_SELF_VF - 1
+enum {
+ PORT_REQUEST_PREASSOCIATE = 0,
+ PORT_REQUEST_PREASSOCIATE_RR,
+ PORT_REQUEST_ASSOCIATE,
+ PORT_REQUEST_DISASSOCIATE,
+};
+enum {
+ PORT_VDP_RESPONSE_SUCCESS = 0,
+ PORT_VDP_RESPONSE_INVALID_FORMAT,
+ PORT_VDP_RESPONSE_INSUFFICIENT_RESOURCES,
+ PORT_VDP_RESPONSE_UNUSED_VTID,
+ PORT_VDP_RESPONSE_VTID_VIOLATION,
+ PORT_VDP_RESPONSE_VTID_VERSION_VIOALTION,
+ PORT_VDP_RESPONSE_OUT_OF_SYNC,
+ PORT_PROFILE_RESPONSE_SUCCESS = 0x100,
+ PORT_PROFILE_RESPONSE_INPROGRESS,
+ PORT_PROFILE_RESPONSE_INVALID,
+ PORT_PROFILE_RESPONSE_BADSTATE,
+ PORT_PROFILE_RESPONSE_INSUFFICIENT_RESOURCES,
+ PORT_PROFILE_RESPONSE_ERROR,
+};
+struct ifla_port_vsi {
+ __u8 vsi_mgr_id;
+ __u8 vsi_type_id[3];
+ __u8 vsi_type_version;
+ __u8 pad[3];
+};
+enum {
+ IFLA_IPOIB_UNSPEC,
+ IFLA_IPOIB_PKEY,
+ IFLA_IPOIB_MODE,
+ IFLA_IPOIB_UMCAST,
+ __IFLA_IPOIB_MAX
+};
+enum {
+ IPOIB_MODE_DATAGRAM = 0,
+ IPOIB_MODE_CONNECTED = 1,
+};
+#define IFLA_IPOIB_MAX (__IFLA_IPOIB_MAX - 1)
+enum {
+ IFLA_HSR_UNSPEC,
+ IFLA_HSR_SLAVE1,
+ IFLA_HSR_SLAVE2,
+ IFLA_HSR_MULTICAST_SPEC,
+ IFLA_HSR_SUPERVISION_ADDR,
+ IFLA_HSR_SEQ_NR,
+ IFLA_HSR_VERSION,
+ __IFLA_HSR_MAX,
+};
+#define IFLA_HSR_MAX (__IFLA_HSR_MAX - 1)
+struct if_stats_msg {
+ __u8 family;
+ __u8 pad1;
+ __u16 pad2;
+ __u32 ifindex;
+ __u32 filter_mask;
+};
+enum {
+ IFLA_STATS_UNSPEC,
+ IFLA_STATS_LINK_64,
+ IFLA_STATS_LINK_XSTATS,
+ IFLA_STATS_LINK_XSTATS_SLAVE,
+ IFLA_STATS_LINK_OFFLOAD_XSTATS,
+ IFLA_STATS_AF_SPEC,
+ __IFLA_STATS_MAX,
+};
+#define IFLA_STATS_MAX (__IFLA_STATS_MAX - 1)
+#define IFLA_STATS_FILTER_BIT(ATTR) (1 << (ATTR - 1))
+enum {
+ LINK_XSTATS_TYPE_UNSPEC,
+ LINK_XSTATS_TYPE_BRIDGE,
+ LINK_XSTATS_TYPE_BOND,
+ __LINK_XSTATS_TYPE_MAX
+};
+#define LINK_XSTATS_TYPE_MAX (__LINK_XSTATS_TYPE_MAX - 1)
+enum {
+ IFLA_OFFLOAD_XSTATS_UNSPEC,
+ IFLA_OFFLOAD_XSTATS_CPU_HIT,
+ __IFLA_OFFLOAD_XSTATS_MAX
+};
+#define IFLA_OFFLOAD_XSTATS_MAX (__IFLA_OFFLOAD_XSTATS_MAX - 1)
+#define XDP_FLAGS_UPDATE_IF_NOEXIST (1U << 0)
+#define XDP_FLAGS_SKB_MODE (1U << 1)
+#define XDP_FLAGS_DRV_MODE (1U << 2)
+#define XDP_FLAGS_HW_MODE (1U << 3)
+#define XDP_FLAGS_MODES (XDP_FLAGS_SKB_MODE | XDP_FLAGS_DRV_MODE | XDP_FLAGS_HW_MODE)
+#define XDP_FLAGS_MASK (XDP_FLAGS_UPDATE_IF_NOEXIST | XDP_FLAGS_MODES)
+enum {
+ XDP_ATTACHED_NONE = 0,
+ XDP_ATTACHED_DRV,
+ XDP_ATTACHED_SKB,
+ XDP_ATTACHED_HW,
+ XDP_ATTACHED_MULTI,
+};
+enum {
+ IFLA_XDP_UNSPEC,
+ IFLA_XDP_FD,
+ IFLA_XDP_ATTACHED,
+ IFLA_XDP_FLAGS,
+ IFLA_XDP_PROG_ID,
+ IFLA_XDP_DRV_PROG_ID,
+ IFLA_XDP_SKB_PROG_ID,
+ IFLA_XDP_HW_PROG_ID,
+ __IFLA_XDP_MAX,
+};
+#define IFLA_XDP_MAX (__IFLA_XDP_MAX - 1)
+enum {
+ IFLA_EVENT_NONE,
+ IFLA_EVENT_REBOOT,
+ IFLA_EVENT_FEATURES,
+ IFLA_EVENT_BONDING_FAILOVER,
+ IFLA_EVENT_NOTIFY_PEERS,
+ IFLA_EVENT_IGMP_RESEND,
+ IFLA_EVENT_BONDING_OPTIONS,
+};
+enum {
+ IFLA_TUN_UNSPEC,
+ IFLA_TUN_OWNER,
+ IFLA_TUN_GROUP,
+ IFLA_TUN_TYPE,
+ IFLA_TUN_PI,
+ IFLA_TUN_VNET_HDR,
+ IFLA_TUN_PERSIST,
+ IFLA_TUN_MULTI_QUEUE,
+ IFLA_TUN_NUM_QUEUES,
+ IFLA_TUN_NUM_DISABLED_QUEUES,
+ __IFLA_TUN_MAX,
+};
+#define IFLA_TUN_MAX (__IFLA_TUN_MAX - 1)
+#define RMNET_FLAGS_INGRESS_DEAGGREGATION (1U << 0)
+#define RMNET_FLAGS_INGRESS_MAP_COMMANDS (1U << 1)
+#define RMNET_FLAGS_INGRESS_MAP_CKSUMV4 (1U << 2)
+#define RMNET_FLAGS_EGRESS_MAP_CKSUMV4 (1U << 3)
+enum {
+ IFLA_RMNET_UNSPEC,
+ IFLA_RMNET_MUX_ID,
+ IFLA_RMNET_FLAGS,
+ __IFLA_RMNET_MAX,
+};
+#define IFLA_RMNET_MAX (__IFLA_RMNET_MAX - 1)
+struct ifla_rmnet_flags {
+ __u32 flags;
+ __u32 mask;
+};
+#endif
diff --git a/chroot/opt/android-master/amd64/usr/include/linux/if_packet.h b/chroot/opt/android-master/amd64/usr/include/linux/if_packet.h
new file mode 100644
index 0000000..db24bbe
--- /dev/null
+++ b/chroot/opt/android-master/amd64/usr/include/linux/if_packet.h
@@ -0,0 +1,225 @@
+/****************************************************************************
+ ****************************************************************************
+ ***
+ *** This header was automatically generated from a Linux kernel header
+ *** of the same name, to make information necessary for userspace to
+ *** call into the kernel available to libc. It contains only constants,
+ *** structures, and macros generated from the original header, and thus,
+ *** contains no copyrightable information.
+ ***
+ *** To edit the content of this header, modify the corresponding
+ *** source file (e.g. under external/kernel-headers/original/) then
+ *** run bionic/libc/kernel/tools/update_all.py
+ ***
+ *** Any manual change here will be lost the next time this script will
+ *** be run. You've been warned!
+ ***
+ ****************************************************************************
+ ****************************************************************************/
+#ifndef __LINUX_IF_PACKET_H
+#define __LINUX_IF_PACKET_H
+#include <linux/types.h>
+struct sockaddr_pkt {
+ unsigned short spkt_family;
+ unsigned char spkt_device[14];
+ __be16 spkt_protocol;
+};
+struct sockaddr_ll {
+ unsigned short sll_family;
+ __be16 sll_protocol;
+ int sll_ifindex;
+ unsigned short sll_hatype;
+ unsigned char sll_pkttype;
+ unsigned char sll_halen;
+ unsigned char sll_addr[8];
+};
+#define PACKET_HOST 0
+#define PACKET_BROADCAST 1
+#define PACKET_MULTICAST 2
+#define PACKET_OTHERHOST 3
+#define PACKET_OUTGOING 4
+#define PACKET_LOOPBACK 5
+#define PACKET_USER 6
+#define PACKET_KERNEL 7
+#define PACKET_FASTROUTE 6
+#define PACKET_ADD_MEMBERSHIP 1
+#define PACKET_DROP_MEMBERSHIP 2
+#define PACKET_RECV_OUTPUT 3
+#define PACKET_RX_RING 5
+#define PACKET_STATISTICS 6
+#define PACKET_COPY_THRESH 7
+#define PACKET_AUXDATA 8
+#define PACKET_ORIGDEV 9
+#define PACKET_VERSION 10
+#define PACKET_HDRLEN 11
+#define PACKET_RESERVE 12
+#define PACKET_TX_RING 13
+#define PACKET_LOSS 14
+#define PACKET_VNET_HDR 15
+#define PACKET_TX_TIMESTAMP 16
+#define PACKET_TIMESTAMP 17
+#define PACKET_FANOUT 18
+#define PACKET_TX_HAS_OFF 19
+#define PACKET_QDISC_BYPASS 20
+#define PACKET_ROLLOVER_STATS 21
+#define PACKET_FANOUT_DATA 22
+#define PACKET_IGNORE_OUTGOING 23
+#define PACKET_FANOUT_HASH 0
+#define PACKET_FANOUT_LB 1
+#define PACKET_FANOUT_CPU 2
+#define PACKET_FANOUT_ROLLOVER 3
+#define PACKET_FANOUT_RND 4
+#define PACKET_FANOUT_QM 5
+#define PACKET_FANOUT_CBPF 6
+#define PACKET_FANOUT_EBPF 7
+#define PACKET_FANOUT_FLAG_ROLLOVER 0x1000
+#define PACKET_FANOUT_FLAG_UNIQUEID 0x2000
+#define PACKET_FANOUT_FLAG_DEFRAG 0x8000
+struct tpacket_stats {
+ unsigned int tp_packets;
+ unsigned int tp_drops;
+};
+struct tpacket_stats_v3 {
+ unsigned int tp_packets;
+ unsigned int tp_drops;
+ unsigned int tp_freeze_q_cnt;
+};
+struct tpacket_rollover_stats {
+ __aligned_u64 tp_all;
+ __aligned_u64 tp_huge;
+ __aligned_u64 tp_failed;
+};
+union tpacket_stats_u {
+ struct tpacket_stats stats1;
+ struct tpacket_stats_v3 stats3;
+};
+struct tpacket_auxdata {
+ __u32 tp_status;
+ __u32 tp_len;
+ __u32 tp_snaplen;
+ __u16 tp_mac;
+ __u16 tp_net;
+ __u16 tp_vlan_tci;
+ __u16 tp_vlan_tpid;
+};
+#define TP_STATUS_KERNEL 0
+#define TP_STATUS_USER (1 << 0)
+#define TP_STATUS_COPY (1 << 1)
+#define TP_STATUS_LOSING (1 << 2)
+#define TP_STATUS_CSUMNOTREADY (1 << 3)
+#define TP_STATUS_VLAN_VALID (1 << 4)
+#define TP_STATUS_BLK_TMO (1 << 5)
+#define TP_STATUS_VLAN_TPID_VALID (1 << 6)
+#define TP_STATUS_CSUM_VALID (1 << 7)
+#define TP_STATUS_AVAILABLE 0
+#define TP_STATUS_SEND_REQUEST (1 << 0)
+#define TP_STATUS_SENDING (1 << 1)
+#define TP_STATUS_WRONG_FORMAT (1 << 2)
+#define TP_STATUS_TS_SOFTWARE (1 << 29)
+#define TP_STATUS_TS_SYS_HARDWARE (1 << 30)
+#define TP_STATUS_TS_RAW_HARDWARE (1U << 31)
+#define TP_FT_REQ_FILL_RXHASH 0x1
+struct tpacket_hdr {
+ unsigned long tp_status;
+ unsigned int tp_len;
+ unsigned int tp_snaplen;
+ unsigned short tp_mac;
+ unsigned short tp_net;
+ unsigned int tp_sec;
+ unsigned int tp_usec;
+};
+#define TPACKET_ALIGNMENT 16
+#define TPACKET_ALIGN(x) (((x) + TPACKET_ALIGNMENT - 1) & ~(TPACKET_ALIGNMENT - 1))
+#define TPACKET_HDRLEN (TPACKET_ALIGN(sizeof(struct tpacket_hdr)) + sizeof(struct sockaddr_ll))
+struct tpacket2_hdr {
+ __u32 tp_status;
+ __u32 tp_len;
+ __u32 tp_snaplen;
+ __u16 tp_mac;
+ __u16 tp_net;
+ __u32 tp_sec;
+ __u32 tp_nsec;
+ __u16 tp_vlan_tci;
+ __u16 tp_vlan_tpid;
+ __u8 tp_padding[4];
+};
+struct tpacket_hdr_variant1 {
+ __u32 tp_rxhash;
+ __u32 tp_vlan_tci;
+ __u16 tp_vlan_tpid;
+ __u16 tp_padding;
+};
+struct tpacket3_hdr {
+ __u32 tp_next_offset;
+ __u32 tp_sec;
+ __u32 tp_nsec;
+ __u32 tp_snaplen;
+ __u32 tp_len;
+ __u32 tp_status;
+ __u16 tp_mac;
+ __u16 tp_net;
+ union {
+ struct tpacket_hdr_variant1 hv1;
+ };
+ __u8 tp_padding[8];
+};
+struct tpacket_bd_ts {
+ unsigned int ts_sec;
+ union {
+ unsigned int ts_usec;
+ unsigned int ts_nsec;
+ };
+};
+struct tpacket_hdr_v1 {
+ __u32 block_status;
+ __u32 num_pkts;
+ __u32 offset_to_first_pkt;
+ __u32 blk_len;
+ __aligned_u64 seq_num;
+ struct tpacket_bd_ts ts_first_pkt, ts_last_pkt;
+};
+union tpacket_bd_header_u {
+ struct tpacket_hdr_v1 bh1;
+};
+struct tpacket_block_desc {
+ __u32 version;
+ __u32 offset_to_priv;
+ union tpacket_bd_header_u hdr;
+};
+#define TPACKET2_HDRLEN (TPACKET_ALIGN(sizeof(struct tpacket2_hdr)) + sizeof(struct sockaddr_ll))
+#define TPACKET3_HDRLEN (TPACKET_ALIGN(sizeof(struct tpacket3_hdr)) + sizeof(struct sockaddr_ll))
+enum tpacket_versions {
+ TPACKET_V1,
+ TPACKET_V2,
+ TPACKET_V3
+};
+struct tpacket_req {
+ unsigned int tp_block_size;
+ unsigned int tp_block_nr;
+ unsigned int tp_frame_size;
+ unsigned int tp_frame_nr;
+};
+struct tpacket_req3 {
+ unsigned int tp_block_size;
+ unsigned int tp_block_nr;
+ unsigned int tp_frame_size;
+ unsigned int tp_frame_nr;
+ unsigned int tp_retire_blk_tov;
+ unsigned int tp_sizeof_priv;
+ unsigned int tp_feature_req_word;
+};
+union tpacket_req_u {
+ struct tpacket_req req;
+ struct tpacket_req3 req3;
+};
+struct packet_mreq {
+ int mr_ifindex;
+ unsigned short mr_type;
+ unsigned short mr_alen;
+ unsigned char mr_address[8];
+};
+#define PACKET_MR_MULTICAST 0
+#define PACKET_MR_PROMISC 1
+#define PACKET_MR_ALLMULTI 2
+#define PACKET_MR_UNICAST 3
+#endif
diff --git a/chroot/opt/android-master/amd64/usr/include/linux/in6.h b/chroot/opt/android-master/amd64/usr/include/linux/in6.h
new file mode 100644
index 0000000..2eb64d0
--- /dev/null
+++ b/chroot/opt/android-master/amd64/usr/include/linux/in6.h
@@ -0,0 +1,181 @@
+/****************************************************************************
+ ****************************************************************************
+ ***
+ *** This header was automatically generated from a Linux kernel header
+ *** of the same name, to make information necessary for userspace to
+ *** call into the kernel available to libc. It contains only constants,
+ *** structures, and macros generated from the original header, and thus,
+ *** contains no copyrightable information.
+ ***
+ *** To edit the content of this header, modify the corresponding
+ *** source file (e.g. under external/kernel-headers/original/) then
+ *** run bionic/libc/kernel/tools/update_all.py
+ ***
+ *** Any manual change here will be lost the next time this script will
+ *** be run. You've been warned!
+ ***
+ ****************************************************************************
+ ****************************************************************************/
+#ifndef _UAPI_LINUX_IN6_H
+#define _UAPI_LINUX_IN6_H
+#include <linux/types.h>
+#include <linux/libc-compat.h>
+#if __UAPI_DEF_IN6_ADDR
+struct in6_addr {
+ union {
+ __u8 u6_addr8[16];
+#if __UAPI_DEF_IN6_ADDR_ALT
+ __be16 u6_addr16[8];
+ __be32 u6_addr32[4];
+#endif
+ } in6_u;
+#define s6_addr in6_u.u6_addr8
+#if __UAPI_DEF_IN6_ADDR_ALT
+#define s6_addr16 in6_u.u6_addr16
+#define s6_addr32 in6_u.u6_addr32
+#endif
+};
+#endif
+#if __UAPI_DEF_SOCKADDR_IN6
+struct sockaddr_in6 {
+ unsigned short int sin6_family;
+ __be16 sin6_port;
+ __be32 sin6_flowinfo;
+ struct in6_addr sin6_addr;
+ __u32 sin6_scope_id;
+};
+#endif
+#if __UAPI_DEF_IPV6_MREQ
+struct ipv6_mreq {
+ struct in6_addr ipv6mr_multiaddr;
+ int ipv6mr_ifindex;
+};
+#endif
+#define ipv6mr_acaddr ipv6mr_multiaddr
+struct in6_flowlabel_req {
+ struct in6_addr flr_dst;
+ __be32 flr_label;
+ __u8 flr_action;
+ __u8 flr_share;
+ __u16 flr_flags;
+ __u16 flr_expires;
+ __u16 flr_linger;
+ __u32 __flr_pad;
+};
+#define IPV6_FL_A_GET 0
+#define IPV6_FL_A_PUT 1
+#define IPV6_FL_A_RENEW 2
+#define IPV6_FL_F_CREATE 1
+#define IPV6_FL_F_EXCL 2
+#define IPV6_FL_F_REFLECT 4
+#define IPV6_FL_F_REMOTE 8
+#define IPV6_FL_S_NONE 0
+#define IPV6_FL_S_EXCL 1
+#define IPV6_FL_S_PROCESS 2
+#define IPV6_FL_S_USER 3
+#define IPV6_FL_S_ANY 255
+#define IPV6_FLOWINFO_FLOWLABEL 0x000fffff
+#define IPV6_FLOWINFO_PRIORITY 0x0ff00000
+#define IPV6_PRIORITY_UNCHARACTERIZED 0x0000
+#define IPV6_PRIORITY_FILLER 0x0100
+#define IPV6_PRIORITY_UNATTENDED 0x0200
+#define IPV6_PRIORITY_RESERVED1 0x0300
+#define IPV6_PRIORITY_BULK 0x0400
+#define IPV6_PRIORITY_RESERVED2 0x0500
+#define IPV6_PRIORITY_INTERACTIVE 0x0600
+#define IPV6_PRIORITY_CONTROL 0x0700
+#define IPV6_PRIORITY_8 0x0800
+#define IPV6_PRIORITY_9 0x0900
+#define IPV6_PRIORITY_10 0x0a00
+#define IPV6_PRIORITY_11 0x0b00
+#define IPV6_PRIORITY_12 0x0c00
+#define IPV6_PRIORITY_13 0x0d00
+#define IPV6_PRIORITY_14 0x0e00
+#define IPV6_PRIORITY_15 0x0f00
+#if __UAPI_DEF_IPPROTO_V6
+#define IPPROTO_HOPOPTS 0
+#define IPPROTO_ROUTING 43
+#define IPPROTO_FRAGMENT 44
+#define IPPROTO_ICMPV6 58
+#define IPPROTO_NONE 59
+#define IPPROTO_DSTOPTS 60
+#define IPPROTO_MH 135
+#endif
+#define IPV6_TLV_PAD1 0
+#define IPV6_TLV_PADN 1
+#define IPV6_TLV_ROUTERALERT 5
+#define IPV6_TLV_CALIPSO 7
+#define IPV6_TLV_JUMBO 194
+#define IPV6_TLV_HAO 201
+#if __UAPI_DEF_IPV6_OPTIONS
+#define IPV6_ADDRFORM 1
+#define IPV6_2292PKTINFO 2
+#define IPV6_2292HOPOPTS 3
+#define IPV6_2292DSTOPTS 4
+#define IPV6_2292RTHDR 5
+#define IPV6_2292PKTOPTIONS 6
+#define IPV6_CHECKSUM 7
+#define IPV6_2292HOPLIMIT 8
+#define IPV6_NEXTHOP 9
+#define IPV6_AUTHHDR 10
+#define IPV6_FLOWINFO 11
+#define IPV6_UNICAST_HOPS 16
+#define IPV6_MULTICAST_IF 17
+#define IPV6_MULTICAST_HOPS 18
+#define IPV6_MULTICAST_LOOP 19
+#define IPV6_ADD_MEMBERSHIP 20
+#define IPV6_DROP_MEMBERSHIP 21
+#define IPV6_ROUTER_ALERT 22
+#define IPV6_MTU_DISCOVER 23
+#define IPV6_MTU 24
+#define IPV6_RECVERR 25
+#define IPV6_V6ONLY 26
+#define IPV6_JOIN_ANYCAST 27
+#define IPV6_LEAVE_ANYCAST 28
+#define IPV6_MULTICAST_ALL 29
+#define IPV6_ROUTER_ALERT_ISOLATE 30
+#define IPV6_PMTUDISC_DONT 0
+#define IPV6_PMTUDISC_WANT 1
+#define IPV6_PMTUDISC_DO 2
+#define IPV6_PMTUDISC_PROBE 3
+#define IPV6_PMTUDISC_INTERFACE 4
+#define IPV6_PMTUDISC_OMIT 5
+#define IPV6_FLOWLABEL_MGR 32
+#define IPV6_FLOWINFO_SEND 33
+#define IPV6_IPSEC_POLICY 34
+#define IPV6_XFRM_POLICY 35
+#define IPV6_HDRINCL 36
+#endif
+#define IPV6_RECVPKTINFO 49
+#define IPV6_PKTINFO 50
+#define IPV6_RECVHOPLIMIT 51
+#define IPV6_HOPLIMIT 52
+#define IPV6_RECVHOPOPTS 53
+#define IPV6_HOPOPTS 54
+#define IPV6_RTHDRDSTOPTS 55
+#define IPV6_RECVRTHDR 56
+#define IPV6_RTHDR 57
+#define IPV6_RECVDSTOPTS 58
+#define IPV6_DSTOPTS 59
+#define IPV6_RECVPATHMTU 60
+#define IPV6_PATHMTU 61
+#define IPV6_DONTFRAG 62
+#define IPV6_RECVTCLASS 66
+#define IPV6_TCLASS 67
+#define IPV6_AUTOFLOWLABEL 70
+#define IPV6_ADDR_PREFERENCES 72
+#define IPV6_PREFER_SRC_TMP 0x0001
+#define IPV6_PREFER_SRC_PUBLIC 0x0002
+#define IPV6_PREFER_SRC_PUBTMP_DEFAULT 0x0100
+#define IPV6_PREFER_SRC_COA 0x0004
+#define IPV6_PREFER_SRC_HOME 0x0400
+#define IPV6_PREFER_SRC_CGA 0x0008
+#define IPV6_PREFER_SRC_NONCGA 0x0800
+#define IPV6_MINHOPCOUNT 73
+#define IPV6_ORIGDSTADDR 74
+#define IPV6_RECVORIGDSTADDR IPV6_ORIGDSTADDR
+#define IPV6_TRANSPARENT 75
+#define IPV6_UNICAST_IF 76
+#define IPV6_RECVFRAGSIZE 77
+#define IPV6_FREEBIND 78
+#endif
diff --git a/chroot/opt/android-master/amd64/usr/include/linux/inotify.h b/chroot/opt/android-master/amd64/usr/include/linux/inotify.h
new file mode 100644
index 0000000..eb9ac3c
--- /dev/null
+++ b/chroot/opt/android-master/amd64/usr/include/linux/inotify.h
@@ -0,0 +1,58 @@
+/****************************************************************************
+ ****************************************************************************
+ ***
+ *** This header was automatically generated from a Linux kernel header
+ *** of the same name, to make information necessary for userspace to
+ *** call into the kernel available to libc. It contains only constants,
+ *** structures, and macros generated from the original header, and thus,
+ *** contains no copyrightable information.
+ ***
+ *** To edit the content of this header, modify the corresponding
+ *** source file (e.g. under external/kernel-headers/original/) then
+ *** run bionic/libc/kernel/tools/update_all.py
+ ***
+ *** Any manual change here will be lost the next time this script will
+ *** be run. You've been warned!
+ ***
+ ****************************************************************************
+ ****************************************************************************/
+#ifndef _UAPI_LINUX_INOTIFY_H
+#define _UAPI_LINUX_INOTIFY_H
+#include <linux/fcntl.h>
+#include <linux/types.h>
+struct inotify_event {
+ __s32 wd;
+ __u32 mask;
+ __u32 cookie;
+ __u32 len;
+ char name[0];
+};
+#define IN_ACCESS 0x00000001
+#define IN_MODIFY 0x00000002
+#define IN_ATTRIB 0x00000004
+#define IN_CLOSE_WRITE 0x00000008
+#define IN_CLOSE_NOWRITE 0x00000010
+#define IN_OPEN 0x00000020
+#define IN_MOVED_FROM 0x00000040
+#define IN_MOVED_TO 0x00000080
+#define IN_CREATE 0x00000100
+#define IN_DELETE 0x00000200
+#define IN_DELETE_SELF 0x00000400
+#define IN_MOVE_SELF 0x00000800
+#define IN_UNMOUNT 0x00002000
+#define IN_Q_OVERFLOW 0x00004000
+#define IN_IGNORED 0x00008000
+#define IN_CLOSE (IN_CLOSE_WRITE | IN_CLOSE_NOWRITE)
+#define IN_MOVE (IN_MOVED_FROM | IN_MOVED_TO)
+#define IN_ONLYDIR 0x01000000
+#define IN_DONT_FOLLOW 0x02000000
+#define IN_EXCL_UNLINK 0x04000000
+#define IN_MASK_CREATE 0x10000000
+#define IN_MASK_ADD 0x20000000
+#define IN_ISDIR 0x40000000
+#define IN_ONESHOT 0x80000000
+#define IN_ALL_EVENTS (IN_ACCESS | IN_MODIFY | IN_ATTRIB | IN_CLOSE_WRITE | IN_CLOSE_NOWRITE | IN_OPEN | IN_MOVED_FROM | IN_MOVED_TO | IN_DELETE | IN_CREATE | IN_DELETE_SELF | IN_MOVE_SELF)
+#define IN_CLOEXEC O_CLOEXEC
+#define IN_NONBLOCK O_NONBLOCK
+#define INOTIFY_IOC_SETNEXTWD _IOW('I', 0, __s32)
+#endif
diff --git a/chroot/opt/android-master/amd64/usr/include/linux/ip.h b/chroot/opt/android-master/amd64/usr/include/linux/ip.h
new file mode 100644
index 0000000..564fd8d
--- /dev/null
+++ b/chroot/opt/android-master/amd64/usr/include/linux/ip.h
@@ -0,0 +1,152 @@
+/****************************************************************************
+ ****************************************************************************
+ ***
+ *** This header was automatically generated from a Linux kernel header
+ *** of the same name, to make information necessary for userspace to
+ *** call into the kernel available to libc. It contains only constants,
+ *** structures, and macros generated from the original header, and thus,
+ *** contains no copyrightable information.
+ ***
+ *** To edit the content of this header, modify the corresponding
+ *** source file (e.g. under external/kernel-headers/original/) then
+ *** run bionic/libc/kernel/tools/update_all.py
+ ***
+ *** Any manual change here will be lost the next time this script will
+ *** be run. You've been warned!
+ ***
+ ****************************************************************************
+ ****************************************************************************/
+#ifndef _UAPI_LINUX_IP_H
+#define _UAPI_LINUX_IP_H
+#include <linux/types.h>
+#include <asm/byteorder.h>
+#define IPTOS_TOS_MASK 0x1E
+#define IPTOS_TOS(tos) ((tos) & IPTOS_TOS_MASK)
+#define IPTOS_LOWDELAY 0x10
+#define IPTOS_THROUGHPUT 0x08
+#define IPTOS_RELIABILITY 0x04
+#define IPTOS_MINCOST 0x02
+#define IPTOS_PREC_MASK 0xE0
+#define IPTOS_PREC(tos) ((tos) & IPTOS_PREC_MASK)
+#define IPTOS_PREC_NETCONTROL 0xe0
+#define IPTOS_PREC_INTERNETCONTROL 0xc0
+#define IPTOS_PREC_CRITIC_ECP 0xa0
+#define IPTOS_PREC_FLASHOVERRIDE 0x80
+#define IPTOS_PREC_FLASH 0x60
+#define IPTOS_PREC_IMMEDIATE 0x40
+#define IPTOS_PREC_PRIORITY 0x20
+#define IPTOS_PREC_ROUTINE 0x00
+#define IPOPT_COPY 0x80
+#define IPOPT_CLASS_MASK 0x60
+#define IPOPT_NUMBER_MASK 0x1f
+#define IPOPT_COPIED(o) ((o) & IPOPT_COPY)
+#define IPOPT_CLASS(o) ((o) & IPOPT_CLASS_MASK)
+#define IPOPT_NUMBER(o) ((o) & IPOPT_NUMBER_MASK)
+#define IPOPT_CONTROL 0x00
+#define IPOPT_RESERVED1 0x20
+#define IPOPT_MEASUREMENT 0x40
+#define IPOPT_RESERVED2 0x60
+#define IPOPT_END (0 | IPOPT_CONTROL)
+#define IPOPT_NOOP (1 | IPOPT_CONTROL)
+#define IPOPT_SEC (2 | IPOPT_CONTROL | IPOPT_COPY)
+#define IPOPT_LSRR (3 | IPOPT_CONTROL | IPOPT_COPY)
+#define IPOPT_TIMESTAMP (4 | IPOPT_MEASUREMENT)
+#define IPOPT_CIPSO (6 | IPOPT_CONTROL | IPOPT_COPY)
+#define IPOPT_RR (7 | IPOPT_CONTROL)
+#define IPOPT_SID (8 | IPOPT_CONTROL | IPOPT_COPY)
+#define IPOPT_SSRR (9 | IPOPT_CONTROL | IPOPT_COPY)
+#define IPOPT_RA (20 | IPOPT_CONTROL | IPOPT_COPY)
+#define IPVERSION 4
+#define MAXTTL 255
+#define IPDEFTTL 64
+#define IPOPT_OPTVAL 0
+#define IPOPT_OLEN 1
+#define IPOPT_OFFSET 2
+#define IPOPT_MINOFF 4
+#define MAX_IPOPTLEN 40
+#define IPOPT_NOP IPOPT_NOOP
+#define IPOPT_EOL IPOPT_END
+#define IPOPT_TS IPOPT_TIMESTAMP
+#define IPOPT_TS_TSONLY 0
+#define IPOPT_TS_TSANDADDR 1
+#define IPOPT_TS_PRESPEC 3
+#define IPV4_BEET_PHMAXLEN 8
+struct iphdr {
+#ifdef __LITTLE_ENDIAN_BITFIELD
+ __u8 ihl : 4, version : 4;
+#elif defined(__BIG_ENDIAN_BITFIELD)
+ __u8 version : 4, ihl : 4;
+#else
+#error "Please fix <asm/byteorder.h>"
+#endif
+ __u8 tos;
+ __be16 tot_len;
+ __be16 id;
+ __be16 frag_off;
+ __u8 ttl;
+ __u8 protocol;
+ __sum16 check;
+ __be32 saddr;
+ __be32 daddr;
+};
+struct ip_auth_hdr {
+ __u8 nexthdr;
+ __u8 hdrlen;
+ __be16 reserved;
+ __be32 spi;
+ __be32 seq_no;
+ __u8 auth_data[0];
+};
+struct ip_esp_hdr {
+ __be32 spi;
+ __be32 seq_no;
+ __u8 enc_data[0];
+};
+struct ip_comp_hdr {
+ __u8 nexthdr;
+ __u8 flags;
+ __be16 cpi;
+};
+struct ip_beet_phdr {
+ __u8 nexthdr;
+ __u8 hdrlen;
+ __u8 padlen;
+ __u8 reserved;
+};
+enum {
+ IPV4_DEVCONF_FORWARDING = 1,
+ IPV4_DEVCONF_MC_FORWARDING,
+ IPV4_DEVCONF_PROXY_ARP,
+ IPV4_DEVCONF_ACCEPT_REDIRECTS,
+ IPV4_DEVCONF_SECURE_REDIRECTS,
+ IPV4_DEVCONF_SEND_REDIRECTS,
+ IPV4_DEVCONF_SHARED_MEDIA,
+ IPV4_DEVCONF_RP_FILTER,
+ IPV4_DEVCONF_ACCEPT_SOURCE_ROUTE,
+ IPV4_DEVCONF_BOOTP_RELAY,
+ IPV4_DEVCONF_LOG_MARTIANS,
+ IPV4_DEVCONF_TAG,
+ IPV4_DEVCONF_ARPFILTER,
+ IPV4_DEVCONF_MEDIUM_ID,
+ IPV4_DEVCONF_NOXFRM,
+ IPV4_DEVCONF_NOPOLICY,
+ IPV4_DEVCONF_FORCE_IGMP_VERSION,
+ IPV4_DEVCONF_ARP_ANNOUNCE,
+ IPV4_DEVCONF_ARP_IGNORE,
+ IPV4_DEVCONF_PROMOTE_SECONDARIES,
+ IPV4_DEVCONF_ARP_ACCEPT,
+ IPV4_DEVCONF_ARP_NOTIFY,
+ IPV4_DEVCONF_ACCEPT_LOCAL,
+ IPV4_DEVCONF_SRC_VMARK,
+ IPV4_DEVCONF_PROXY_ARP_PVLAN,
+ IPV4_DEVCONF_ROUTE_LOCALNET,
+ IPV4_DEVCONF_IGMPV2_UNSOLICITED_REPORT_INTERVAL,
+ IPV4_DEVCONF_IGMPV3_UNSOLICITED_REPORT_INTERVAL,
+ IPV4_DEVCONF_IGNORE_ROUTES_WITH_LINKDOWN,
+ IPV4_DEVCONF_DROP_UNICAST_IN_L2_MULTICAST,
+ IPV4_DEVCONF_DROP_GRATUITOUS_ARP,
+ IPV4_DEVCONF_BC_FORWARDING,
+ __IPV4_DEVCONF_MAX
+};
+#define IPV4_DEVCONF_MAX (__IPV4_DEVCONF_MAX - 1)
+#endif
diff --git a/chroot/opt/android-master/amd64/usr/include/linux/kernel.h b/chroot/opt/android-master/amd64/usr/include/linux/kernel.h
new file mode 100644
index 0000000..000cd30
--- /dev/null
+++ b/chroot/opt/android-master/amd64/usr/include/linux/kernel.h
@@ -0,0 +1,25 @@
+/****************************************************************************
+ ****************************************************************************
+ ***
+ *** This header was automatically generated from a Linux kernel header
+ *** of the same name, to make information necessary for userspace to
+ *** call into the kernel available to libc. It contains only constants,
+ *** structures, and macros generated from the original header, and thus,
+ *** contains no copyrightable information.
+ ***
+ *** To edit the content of this header, modify the corresponding
+ *** source file (e.g. under external/kernel-headers/original/) then
+ *** run bionic/libc/kernel/tools/update_all.py
+ ***
+ *** Any manual change here will be lost the next time this script will
+ *** be run. You've been warned!
+ ***
+ ****************************************************************************
+ ****************************************************************************/
+#ifndef _UAPI_LINUX_KERNEL_H
+#define _UAPI_LINUX_KERNEL_H
+#include <linux/sysinfo.h>
+#define __ALIGN_KERNEL(x,a) __ALIGN_KERNEL_MASK(x, (typeof(x)) (a) - 1)
+#define __ALIGN_KERNEL_MASK(x,mask) (((x) + (mask)) & ~(mask))
+#define __KERNEL_DIV_ROUND_UP(n,d) (((n) + (d) - 1) / (d))
+#endif
diff --git a/chroot/opt/android-master/amd64/usr/include/linux/libc-compat.h b/chroot/opt/android-master/amd64/usr/include/linux/libc-compat.h
new file mode 100644
index 0000000..447a46a
--- /dev/null
+++ b/chroot/opt/android-master/amd64/usr/include/linux/libc-compat.h
@@ -0,0 +1,172 @@
+/****************************************************************************
+ ****************************************************************************
+ ***
+ *** This header was automatically generated from a Linux kernel header
+ *** of the same name, to make information necessary for userspace to
+ *** call into the kernel available to libc. It contains only constants,
+ *** structures, and macros generated from the original header, and thus,
+ *** contains no copyrightable information.
+ ***
+ *** To edit the content of this header, modify the corresponding
+ *** source file (e.g. under external/kernel-headers/original/) then
+ *** run bionic/libc/kernel/tools/update_all.py
+ ***
+ *** Any manual change here will be lost the next time this script will
+ *** be run. You've been warned!
+ ***
+ ****************************************************************************
+ ****************************************************************************/
+#ifndef _UAPI_LIBC_COMPAT_H
+#define _UAPI_LIBC_COMPAT_H
+#ifdef __GLIBC__
+#if defined(_NET_IF_H) && defined(__USE_MISC)
+#define __UAPI_DEF_IF_IFCONF 0
+#define __UAPI_DEF_IF_IFMAP 0
+#define __UAPI_DEF_IF_IFNAMSIZ 0
+#define __UAPI_DEF_IF_IFREQ 0
+#define __UAPI_DEF_IF_NET_DEVICE_FLAGS 0
+#ifndef __UAPI_DEF_IF_NET_DEVICE_FLAGS_LOWER_UP_DORMANT_ECHO
+#define __UAPI_DEF_IF_NET_DEVICE_FLAGS_LOWER_UP_DORMANT_ECHO 1
+#endif
+#else
+#define __UAPI_DEF_IF_IFCONF 1
+#define __UAPI_DEF_IF_IFMAP 1
+#define __UAPI_DEF_IF_IFNAMSIZ 1
+#define __UAPI_DEF_IF_IFREQ 1
+#define __UAPI_DEF_IF_NET_DEVICE_FLAGS 1
+#define __UAPI_DEF_IF_NET_DEVICE_FLAGS_LOWER_UP_DORMANT_ECHO 1
+#endif
+#ifdef _NETINET_IN_H
+#define __UAPI_DEF_IN_ADDR 0
+#define __UAPI_DEF_IN_IPPROTO 0
+#define __UAPI_DEF_IN_PKTINFO 0
+#define __UAPI_DEF_IP_MREQ 0
+#define __UAPI_DEF_SOCKADDR_IN 0
+#define __UAPI_DEF_IN_CLASS 0
+#define __UAPI_DEF_IN6_ADDR 0
+#if defined(__USE_MISC) || defined(__USE_GNU)
+#define __UAPI_DEF_IN6_ADDR_ALT 0
+#else
+#define __UAPI_DEF_IN6_ADDR_ALT 1
+#endif
+#define __UAPI_DEF_SOCKADDR_IN6 0
+#define __UAPI_DEF_IPV6_MREQ 0
+#define __UAPI_DEF_IPPROTO_V6 0
+#define __UAPI_DEF_IPV6_OPTIONS 0
+#define __UAPI_DEF_IN6_PKTINFO 0
+#define __UAPI_DEF_IP6_MTUINFO 0
+#else
+#define __UAPI_DEF_IN_ADDR 1
+#define __UAPI_DEF_IN_IPPROTO 1
+#define __UAPI_DEF_IN_PKTINFO 1
+#define __UAPI_DEF_IP_MREQ 1
+#define __UAPI_DEF_SOCKADDR_IN 1
+#define __UAPI_DEF_IN_CLASS 1
+#define __UAPI_DEF_IN6_ADDR 1
+#define __UAPI_DEF_IN6_ADDR_ALT 1
+#define __UAPI_DEF_SOCKADDR_IN6 1
+#define __UAPI_DEF_IPV6_MREQ 1
+#define __UAPI_DEF_IPPROTO_V6 1
+#define __UAPI_DEF_IPV6_OPTIONS 1
+#define __UAPI_DEF_IN6_PKTINFO 1
+#define __UAPI_DEF_IP6_MTUINFO 1
+#endif
+#ifdef __NETIPX_IPX_H
+#define __UAPI_DEF_SOCKADDR_IPX 0
+#define __UAPI_DEF_IPX_ROUTE_DEFINITION 0
+#define __UAPI_DEF_IPX_INTERFACE_DEFINITION 0
+#define __UAPI_DEF_IPX_CONFIG_DATA 0
+#define __UAPI_DEF_IPX_ROUTE_DEF 0
+#else
+#define __UAPI_DEF_SOCKADDR_IPX 1
+#define __UAPI_DEF_IPX_ROUTE_DEFINITION 1
+#define __UAPI_DEF_IPX_INTERFACE_DEFINITION 1
+#define __UAPI_DEF_IPX_CONFIG_DATA 1
+#define __UAPI_DEF_IPX_ROUTE_DEF 1
+#endif
+#ifdef _SYS_XATTR_H
+#define __UAPI_DEF_XATTR 0
+#else
+#define __UAPI_DEF_XATTR 1
+#endif
+#else
+#ifndef __UAPI_DEF_IF_IFCONF
+#define __UAPI_DEF_IF_IFCONF 1
+#endif
+#ifndef __UAPI_DEF_IF_IFMAP
+#define __UAPI_DEF_IF_IFMAP 1
+#endif
+#ifndef __UAPI_DEF_IF_IFNAMSIZ
+#define __UAPI_DEF_IF_IFNAMSIZ 1
+#endif
+#ifndef __UAPI_DEF_IF_IFREQ
+#define __UAPI_DEF_IF_IFREQ 1
+#endif
+#ifndef __UAPI_DEF_IF_NET_DEVICE_FLAGS
+#define __UAPI_DEF_IF_NET_DEVICE_FLAGS 1
+#endif
+#ifndef __UAPI_DEF_IF_NET_DEVICE_FLAGS_LOWER_UP_DORMANT_ECHO
+#define __UAPI_DEF_IF_NET_DEVICE_FLAGS_LOWER_UP_DORMANT_ECHO 1
+#endif
+#ifndef __UAPI_DEF_IN_ADDR
+#define __UAPI_DEF_IN_ADDR 1
+#endif
+#ifndef __UAPI_DEF_IN_IPPROTO
+#define __UAPI_DEF_IN_IPPROTO 1
+#endif
+#ifndef __UAPI_DEF_IN_PKTINFO
+#define __UAPI_DEF_IN_PKTINFO 1
+#endif
+#ifndef __UAPI_DEF_IP_MREQ
+#define __UAPI_DEF_IP_MREQ 1
+#endif
+#ifndef __UAPI_DEF_SOCKADDR_IN
+#define __UAPI_DEF_SOCKADDR_IN 1
+#endif
+#ifndef __UAPI_DEF_IN_CLASS
+#define __UAPI_DEF_IN_CLASS 1
+#endif
+#ifndef __UAPI_DEF_IN6_ADDR
+#define __UAPI_DEF_IN6_ADDR 1
+#endif
+#ifndef __UAPI_DEF_IN6_ADDR_ALT
+#define __UAPI_DEF_IN6_ADDR_ALT 1
+#endif
+#ifndef __UAPI_DEF_SOCKADDR_IN6
+#define __UAPI_DEF_SOCKADDR_IN6 1
+#endif
+#ifndef __UAPI_DEF_IPV6_MREQ
+#define __UAPI_DEF_IPV6_MREQ 1
+#endif
+#ifndef __UAPI_DEF_IPPROTO_V6
+#define __UAPI_DEF_IPPROTO_V6 1
+#endif
+#ifndef __UAPI_DEF_IPV6_OPTIONS
+#define __UAPI_DEF_IPV6_OPTIONS 1
+#endif
+#ifndef __UAPI_DEF_IN6_PKTINFO
+#define __UAPI_DEF_IN6_PKTINFO 1
+#endif
+#ifndef __UAPI_DEF_IP6_MTUINFO
+#define __UAPI_DEF_IP6_MTUINFO 1
+#endif
+#ifndef __UAPI_DEF_SOCKADDR_IPX
+#define __UAPI_DEF_SOCKADDR_IPX 1
+#endif
+#ifndef __UAPI_DEF_IPX_ROUTE_DEFINITION
+#define __UAPI_DEF_IPX_ROUTE_DEFINITION 1
+#endif
+#ifndef __UAPI_DEF_IPX_INTERFACE_DEFINITION
+#define __UAPI_DEF_IPX_INTERFACE_DEFINITION 1
+#endif
+#ifndef __UAPI_DEF_IPX_CONFIG_DATA
+#define __UAPI_DEF_IPX_CONFIG_DATA 1
+#endif
+#ifndef __UAPI_DEF_IPX_ROUTE_DEF
+#define __UAPI_DEF_IPX_ROUTE_DEF 1
+#endif
+#ifndef __UAPI_DEF_XATTR
+#define __UAPI_DEF_XATTR 1
+#endif
+#endif
+#endif
diff --git a/chroot/opt/android-master/amd64/usr/include/linux/media-bus-format.h b/chroot/opt/android-master/amd64/usr/include/linux/media-bus-format.h
new file mode 100644
index 0000000..f0d81d0
--- /dev/null
+++ b/chroot/opt/android-master/amd64/usr/include/linux/media-bus-format.h
@@ -0,0 +1,129 @@
+/****************************************************************************
+ ****************************************************************************
+ ***
+ *** This header was automatically generated from a Linux kernel header
+ *** of the same name, to make information necessary for userspace to
+ *** call into the kernel available to libc. It contains only constants,
+ *** structures, and macros generated from the original header, and thus,
+ *** contains no copyrightable information.
+ ***
+ *** To edit the content of this header, modify the corresponding
+ *** source file (e.g. under external/kernel-headers/original/) then
+ *** run bionic/libc/kernel/tools/update_all.py
+ ***
+ *** Any manual change here will be lost the next time this script will
+ *** be run. You've been warned!
+ ***
+ ****************************************************************************
+ ****************************************************************************/
+#ifndef __LINUX_MEDIA_BUS_FORMAT_H
+#define __LINUX_MEDIA_BUS_FORMAT_H
+#define MEDIA_BUS_FMT_FIXED 0x0001
+#define MEDIA_BUS_FMT_RGB444_1X12 0x1016
+#define MEDIA_BUS_FMT_RGB444_2X8_PADHI_BE 0x1001
+#define MEDIA_BUS_FMT_RGB444_2X8_PADHI_LE 0x1002
+#define MEDIA_BUS_FMT_RGB555_2X8_PADHI_BE 0x1003
+#define MEDIA_BUS_FMT_RGB555_2X8_PADHI_LE 0x1004
+#define MEDIA_BUS_FMT_RGB565_1X16 0x1017
+#define MEDIA_BUS_FMT_BGR565_2X8_BE 0x1005
+#define MEDIA_BUS_FMT_BGR565_2X8_LE 0x1006
+#define MEDIA_BUS_FMT_RGB565_2X8_BE 0x1007
+#define MEDIA_BUS_FMT_RGB565_2X8_LE 0x1008
+#define MEDIA_BUS_FMT_RGB666_1X18 0x1009
+#define MEDIA_BUS_FMT_RBG888_1X24 0x100e
+#define MEDIA_BUS_FMT_RGB666_1X24_CPADHI 0x1015
+#define MEDIA_BUS_FMT_RGB666_1X7X3_SPWG 0x1010
+#define MEDIA_BUS_FMT_BGR888_1X24 0x1013
+#define MEDIA_BUS_FMT_BGR888_3X8 0x101b
+#define MEDIA_BUS_FMT_GBR888_1X24 0x1014
+#define MEDIA_BUS_FMT_RGB888_1X24 0x100a
+#define MEDIA_BUS_FMT_RGB888_2X12_BE 0x100b
+#define MEDIA_BUS_FMT_RGB888_2X12_LE 0x100c
+#define MEDIA_BUS_FMT_RGB888_3X8 0x101c
+#define MEDIA_BUS_FMT_RGB888_1X7X4_SPWG 0x1011
+#define MEDIA_BUS_FMT_RGB888_1X7X4_JEIDA 0x1012
+#define MEDIA_BUS_FMT_ARGB8888_1X32 0x100d
+#define MEDIA_BUS_FMT_RGB888_1X32_PADHI 0x100f
+#define MEDIA_BUS_FMT_RGB101010_1X30 0x1018
+#define MEDIA_BUS_FMT_RGB121212_1X36 0x1019
+#define MEDIA_BUS_FMT_RGB161616_1X48 0x101a
+#define MEDIA_BUS_FMT_Y8_1X8 0x2001
+#define MEDIA_BUS_FMT_UV8_1X8 0x2015
+#define MEDIA_BUS_FMT_UYVY8_1_5X8 0x2002
+#define MEDIA_BUS_FMT_VYUY8_1_5X8 0x2003
+#define MEDIA_BUS_FMT_YUYV8_1_5X8 0x2004
+#define MEDIA_BUS_FMT_YVYU8_1_5X8 0x2005
+#define MEDIA_BUS_FMT_UYVY8_2X8 0x2006
+#define MEDIA_BUS_FMT_VYUY8_2X8 0x2007
+#define MEDIA_BUS_FMT_YUYV8_2X8 0x2008
+#define MEDIA_BUS_FMT_YVYU8_2X8 0x2009
+#define MEDIA_BUS_FMT_Y10_1X10 0x200a
+#define MEDIA_BUS_FMT_Y10_2X8_PADHI_LE 0x202c
+#define MEDIA_BUS_FMT_UYVY10_2X10 0x2018
+#define MEDIA_BUS_FMT_VYUY10_2X10 0x2019
+#define MEDIA_BUS_FMT_YUYV10_2X10 0x200b
+#define MEDIA_BUS_FMT_YVYU10_2X10 0x200c
+#define MEDIA_BUS_FMT_Y12_1X12 0x2013
+#define MEDIA_BUS_FMT_UYVY12_2X12 0x201c
+#define MEDIA_BUS_FMT_VYUY12_2X12 0x201d
+#define MEDIA_BUS_FMT_YUYV12_2X12 0x201e
+#define MEDIA_BUS_FMT_YVYU12_2X12 0x201f
+#define MEDIA_BUS_FMT_UYVY8_1X16 0x200f
+#define MEDIA_BUS_FMT_VYUY8_1X16 0x2010
+#define MEDIA_BUS_FMT_YUYV8_1X16 0x2011
+#define MEDIA_BUS_FMT_YVYU8_1X16 0x2012
+#define MEDIA_BUS_FMT_YDYUYDYV8_1X16 0x2014
+#define MEDIA_BUS_FMT_UYVY10_1X20 0x201a
+#define MEDIA_BUS_FMT_VYUY10_1X20 0x201b
+#define MEDIA_BUS_FMT_YUYV10_1X20 0x200d
+#define MEDIA_BUS_FMT_YVYU10_1X20 0x200e
+#define MEDIA_BUS_FMT_VUY8_1X24 0x2024
+#define MEDIA_BUS_FMT_YUV8_1X24 0x2025
+#define MEDIA_BUS_FMT_UYYVYY8_0_5X24 0x2026
+#define MEDIA_BUS_FMT_UYVY12_1X24 0x2020
+#define MEDIA_BUS_FMT_VYUY12_1X24 0x2021
+#define MEDIA_BUS_FMT_YUYV12_1X24 0x2022
+#define MEDIA_BUS_FMT_YVYU12_1X24 0x2023
+#define MEDIA_BUS_FMT_YUV10_1X30 0x2016
+#define MEDIA_BUS_FMT_UYYVYY10_0_5X30 0x2027
+#define MEDIA_BUS_FMT_AYUV8_1X32 0x2017
+#define MEDIA_BUS_FMT_UYYVYY12_0_5X36 0x2028
+#define MEDIA_BUS_FMT_YUV12_1X36 0x2029
+#define MEDIA_BUS_FMT_YUV16_1X48 0x202a
+#define MEDIA_BUS_FMT_UYYVYY16_0_5X48 0x202b
+#define MEDIA_BUS_FMT_SBGGR8_1X8 0x3001
+#define MEDIA_BUS_FMT_SGBRG8_1X8 0x3013
+#define MEDIA_BUS_FMT_SGRBG8_1X8 0x3002
+#define MEDIA_BUS_FMT_SRGGB8_1X8 0x3014
+#define MEDIA_BUS_FMT_SBGGR10_ALAW8_1X8 0x3015
+#define MEDIA_BUS_FMT_SGBRG10_ALAW8_1X8 0x3016
+#define MEDIA_BUS_FMT_SGRBG10_ALAW8_1X8 0x3017
+#define MEDIA_BUS_FMT_SRGGB10_ALAW8_1X8 0x3018
+#define MEDIA_BUS_FMT_SBGGR10_DPCM8_1X8 0x300b
+#define MEDIA_BUS_FMT_SGBRG10_DPCM8_1X8 0x300c
+#define MEDIA_BUS_FMT_SGRBG10_DPCM8_1X8 0x3009
+#define MEDIA_BUS_FMT_SRGGB10_DPCM8_1X8 0x300d
+#define MEDIA_BUS_FMT_SBGGR10_2X8_PADHI_BE 0x3003
+#define MEDIA_BUS_FMT_SBGGR10_2X8_PADHI_LE 0x3004
+#define MEDIA_BUS_FMT_SBGGR10_2X8_PADLO_BE 0x3005
+#define MEDIA_BUS_FMT_SBGGR10_2X8_PADLO_LE 0x3006
+#define MEDIA_BUS_FMT_SBGGR10_1X10 0x3007
+#define MEDIA_BUS_FMT_SGBRG10_1X10 0x300e
+#define MEDIA_BUS_FMT_SGRBG10_1X10 0x300a
+#define MEDIA_BUS_FMT_SRGGB10_1X10 0x300f
+#define MEDIA_BUS_FMT_SBGGR12_1X12 0x3008
+#define MEDIA_BUS_FMT_SGBRG12_1X12 0x3010
+#define MEDIA_BUS_FMT_SGRBG12_1X12 0x3011
+#define MEDIA_BUS_FMT_SRGGB12_1X12 0x3012
+#define MEDIA_BUS_FMT_SBGGR14_1X14 0x3019
+#define MEDIA_BUS_FMT_SGBRG14_1X14 0x301a
+#define MEDIA_BUS_FMT_SGRBG14_1X14 0x301b
+#define MEDIA_BUS_FMT_SRGGB14_1X14 0x301c
+#define MEDIA_BUS_FMT_SBGGR16_1X16 0x301d
+#define MEDIA_BUS_FMT_SGBRG16_1X16 0x301e
+#define MEDIA_BUS_FMT_SGRBG16_1X16 0x301f
+#define MEDIA_BUS_FMT_SRGGB16_1X16 0x3020
+#define MEDIA_BUS_FMT_JPEG_1X8 0x4001
+#define MEDIA_BUS_FMT_S5C_UYVY_JPEG_1X8 0x5001
+#define MEDIA_BUS_FMT_AHSV8888_1X32 0x6001
+#endif
diff --git a/chroot/opt/android-master/amd64/usr/include/linux/media.h b/chroot/opt/android-master/amd64/usr/include/linux/media.h
new file mode 100644
index 0000000..fe29568
--- /dev/null
+++ b/chroot/opt/android-master/amd64/usr/include/linux/media.h
@@ -0,0 +1,232 @@
+/****************************************************************************
+ ****************************************************************************
+ ***
+ *** This header was automatically generated from a Linux kernel header
+ *** of the same name, to make information necessary for userspace to
+ *** call into the kernel available to libc. It contains only constants,
+ *** structures, and macros generated from the original header, and thus,
+ *** contains no copyrightable information.
+ ***
+ *** To edit the content of this header, modify the corresponding
+ *** source file (e.g. under external/kernel-headers/original/) then
+ *** run bionic/libc/kernel/tools/update_all.py
+ ***
+ *** Any manual change here will be lost the next time this script will
+ *** be run. You've been warned!
+ ***
+ ****************************************************************************
+ ****************************************************************************/
+#ifndef __LINUX_MEDIA_H
+#define __LINUX_MEDIA_H
+#include <stdint.h>
+#include <linux/ioctl.h>
+#include <linux/types.h>
+struct media_device_info {
+ char driver[16];
+ char model[32];
+ char serial[40];
+ char bus_info[32];
+ __u32 media_version;
+ __u32 hw_revision;
+ __u32 driver_version;
+ __u32 reserved[31];
+};
+#define MEDIA_ENT_F_BASE 0x00000000
+#define MEDIA_ENT_F_OLD_BASE 0x00010000
+#define MEDIA_ENT_F_OLD_SUBDEV_BASE 0x00020000
+#define MEDIA_ENT_F_UNKNOWN MEDIA_ENT_F_BASE
+#define MEDIA_ENT_F_V4L2_SUBDEV_UNKNOWN MEDIA_ENT_F_OLD_SUBDEV_BASE
+#define MEDIA_ENT_F_DTV_DEMOD (MEDIA_ENT_F_BASE + 0x00001)
+#define MEDIA_ENT_F_TS_DEMUX (MEDIA_ENT_F_BASE + 0x00002)
+#define MEDIA_ENT_F_DTV_CA (MEDIA_ENT_F_BASE + 0x00003)
+#define MEDIA_ENT_F_DTV_NET_DECAP (MEDIA_ENT_F_BASE + 0x00004)
+#define MEDIA_ENT_F_IO_V4L (MEDIA_ENT_F_OLD_BASE + 1)
+#define MEDIA_ENT_F_IO_DTV (MEDIA_ENT_F_BASE + 0x01001)
+#define MEDIA_ENT_F_IO_VBI (MEDIA_ENT_F_BASE + 0x01002)
+#define MEDIA_ENT_F_IO_SWRADIO (MEDIA_ENT_F_BASE + 0x01003)
+#define MEDIA_ENT_F_CAM_SENSOR (MEDIA_ENT_F_OLD_SUBDEV_BASE + 1)
+#define MEDIA_ENT_F_FLASH (MEDIA_ENT_F_OLD_SUBDEV_BASE + 2)
+#define MEDIA_ENT_F_LENS (MEDIA_ENT_F_OLD_SUBDEV_BASE + 3)
+#define MEDIA_ENT_F_TUNER (MEDIA_ENT_F_OLD_SUBDEV_BASE + 5)
+#define MEDIA_ENT_F_IF_VID_DECODER (MEDIA_ENT_F_BASE + 0x02001)
+#define MEDIA_ENT_F_IF_AUD_DECODER (MEDIA_ENT_F_BASE + 0x02002)
+#define MEDIA_ENT_F_AUDIO_CAPTURE (MEDIA_ENT_F_BASE + 0x03001)
+#define MEDIA_ENT_F_AUDIO_PLAYBACK (MEDIA_ENT_F_BASE + 0x03002)
+#define MEDIA_ENT_F_AUDIO_MIXER (MEDIA_ENT_F_BASE + 0x03003)
+#define MEDIA_ENT_F_PROC_VIDEO_COMPOSER (MEDIA_ENT_F_BASE + 0x4001)
+#define MEDIA_ENT_F_PROC_VIDEO_PIXEL_FORMATTER (MEDIA_ENT_F_BASE + 0x4002)
+#define MEDIA_ENT_F_PROC_VIDEO_PIXEL_ENC_CONV (MEDIA_ENT_F_BASE + 0x4003)
+#define MEDIA_ENT_F_PROC_VIDEO_LUT (MEDIA_ENT_F_BASE + 0x4004)
+#define MEDIA_ENT_F_PROC_VIDEO_SCALER (MEDIA_ENT_F_BASE + 0x4005)
+#define MEDIA_ENT_F_PROC_VIDEO_STATISTICS (MEDIA_ENT_F_BASE + 0x4006)
+#define MEDIA_ENT_F_PROC_VIDEO_ENCODER (MEDIA_ENT_F_BASE + 0x4007)
+#define MEDIA_ENT_F_PROC_VIDEO_DECODER (MEDIA_ENT_F_BASE + 0x4008)
+#define MEDIA_ENT_F_VID_MUX (MEDIA_ENT_F_BASE + 0x5001)
+#define MEDIA_ENT_F_VID_IF_BRIDGE (MEDIA_ENT_F_BASE + 0x5002)