summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorJesse Hall2017-02-13 17:19:24 -0600
committerJesse Hall2017-02-23 20:44:50 -0600
commit41129a2526d4a8bc3510bc65c0e39e1e9d4700d2 (patch)
tree2e0ffa0c4c47072e77e8214c53d223078907ce64 /libsync
parentb7fdb2a1284143b8cee11483646b8753262ad165 (diff)
downloadplatform-system-core-41129a2526d4a8bc3510bc65c0e39e1e9d4700d2.tar.gz
platform-system-core-41129a2526d4a8bc3510bc65c0e39e1e9d4700d2.tar.xz
platform-system-core-41129a2526d4a8bc3510bc65c0e39e1e9d4700d2.zip
sync: rename sync/sync.h to android/sync.h
Leave a temporary symlink from the old name to avoid having to change all dependencies simultaneously. Bug: 1901466 Test: m Change-Id: Id210f0091457e52e1a6e048d241a723bdbe8779b
Diffstat (limited to 'libsync')
-rw-r--r--libsync/include/android/sync.h69
l---------[-rw-r--r--]libsync/include/sync/sync.h63
-rw-r--r--libsync/sync.c2
-rw-r--r--libsync/sync_test.c2
-rw-r--r--libsync/tests/sync_test.cpp2
5 files changed, 73 insertions, 65 deletions
diff --git a/libsync/include/android/sync.h b/libsync/include/android/sync.h
new file mode 100644
index 000000000..68f74a0b2
--- /dev/null
+++ b/libsync/include/android/sync.h
@@ -0,0 +1,69 @@
1/*
2 * sync.h
3 *
4 * Copyright 2012 Google, Inc
5 *
6 * Licensed under the Apache License, Version 2.0 (the "License");
7 * you may not use this file except in compliance with the License.
8 * You may obtain a copy of the License at
9 *
10 * http://www.apache.org/licenses/LICENSE-2.0
11 *
12 * Unless required by applicable law or agreed to in writing, software
13 * distributed under the License is distributed on an "AS IS" BASIS,
14 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
15 * See the License for the specific language governing permissions and
16 * limitations under the License.
17 */
18
19#ifndef __SYS_CORE_SYNC_H
20#define __SYS_CORE_SYNC_H
21
22/* This file contains the legacy sync interface used by Android platform and
23 * device code. The direct contents will be removed over time as code
24 * transitions to using the updated interface in ndk/sync.h. When this file is
25 * empty other than the ndk/sync.h include, that file will be renamed to
26 * replace this one.
27 *
28 * New code should continue to include this file (#include <android/sync.h>)
29 * instead of ndk/sync.h so the eventual rename is seamless, but should only
30 * use the things declared in ndk/sync.h.
31 *
32 * This file used to be called sync/sync.h, but we renamed to that both the
33 * platform and NDK call it android/sync.h. A symlink from the old name to this
34 * one exists temporarily to avoid having to change all sync clients
35 * simultaneously. It will be removed when they've been updated, and probably
36 * after this change has been delivered to AOSP so that integrations don't
37 * break builds.
38 */
39
40#include "../ndk/sync.h"
41
42__BEGIN_DECLS
43
44struct sync_fence_info_data {
45 uint32_t len;
46 char name[32];
47 int32_t status;
48 uint8_t pt_info[0];
49};
50
51struct sync_pt_info {
52 uint32_t len;
53 char obj_name[32];
54 char driver_name[32];
55 int32_t status;
56 uint64_t timestamp_ns;
57 uint8_t driver_data[0];
58};
59
60/* timeout in msecs */
61int sync_wait(int fd, int timeout);
62struct sync_fence_info_data *sync_fence_info(int fd);
63struct sync_pt_info *sync_pt_info(struct sync_fence_info_data *info,
64 struct sync_pt_info *itr);
65void sync_fence_info_free(struct sync_fence_info_data *info);
66
67__END_DECLS
68
69#endif /* __SYS_CORE_SYNC_H */
diff --git a/libsync/include/sync/sync.h b/libsync/include/sync/sync.h
index d29ed8541..3b17e480a 100644..120000
--- a/libsync/include/sync/sync.h
+++ b/libsync/include/sync/sync.h
@@ -1,62 +1 @@
1/* ../android/sync.h \ No newline at end of file
2 * sync.h
3 *
4 * Copyright 2012 Google, Inc
5 *
6 * Licensed under the Apache License, Version 2.0 (the "License");
7 * you may not use this file except in compliance with the License.
8 * You may obtain a copy of the License at
9 *
10 * http://www.apache.org/licenses/LICENSE-2.0
11 *
12 * Unless required by applicable law or agreed to in writing, software
13 * distributed under the License is distributed on an "AS IS" BASIS,
14 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
15 * See the License for the specific language governing permissions and
16 * limitations under the License.
17 */
18
19#ifndef __SYS_CORE_SYNC_H
20#define __SYS_CORE_SYNC_H
21
22/* This file contains the legacy sync interface used by Android platform and
23 * device code. The direct contents will be removed over time as code
24 * transitions to using the updated interface in ndk/sync.h. When this file is
25 * empty other than the ndk/sync.h include, that file will be renamed to
26 * replace this one.
27 *
28 * New code should continue to include this file (#include <sync/sync.h>)
29 * instead of ndk/sync.h so the eventual rename is seamless, but should only
30 * use the things declared in ndk/sync.h.
31 */
32
33#include "../ndk/sync.h"
34
35__BEGIN_DECLS
36
37struct sync_fence_info_data {
38 uint32_t len;
39 char name[32];
40 int32_t status;
41 uint8_t pt_info[0];
42};
43
44struct sync_pt_info {
45 uint32_t len;
46 char obj_name[32];
47 char driver_name[32];
48 int32_t status;
49 uint64_t timestamp_ns;
50 uint8_t driver_data[0];
51};
52
53/* timeout in msecs */
54int sync_wait(int fd, int timeout);
55struct sync_fence_info_data *sync_fence_info(int fd);
56struct sync_pt_info *sync_pt_info(struct sync_fence_info_data *info,
57 struct sync_pt_info *itr);
58void sync_fence_info_free(struct sync_fence_info_data *info);
59
60__END_DECLS
61
62#endif /* __SYS_CORE_SYNC_H */
diff --git a/libsync/sync.c b/libsync/sync.c
index e68cc899d..27dab832f 100644
--- a/libsync/sync.c
+++ b/libsync/sync.c
@@ -27,7 +27,7 @@
27#include <sys/stat.h> 27#include <sys/stat.h>
28#include <sys/types.h> 28#include <sys/types.h>
29 29
30#include <sync/sync.h> 30#include <android/sync.h>
31 31
32/* Legacy Sync API */ 32/* Legacy Sync API */
33 33
diff --git a/libsync/sync_test.c b/libsync/sync_test.c
index 9a5f7d858..f1ffdcf9e 100644
--- a/libsync/sync_test.c
+++ b/libsync/sync_test.c
@@ -22,7 +22,7 @@
22#include <string.h> 22#include <string.h>
23#include <unistd.h> 23#include <unistd.h>
24 24
25#include <sync/sync.h> 25#include <android/sync.h>
26#include "sw_sync.h" 26#include "sw_sync.h"
27 27
28pthread_mutex_t printf_mutex = PTHREAD_MUTEX_INITIALIZER; 28pthread_mutex_t printf_mutex = PTHREAD_MUTEX_INITIALIZER;
diff --git a/libsync/tests/sync_test.cpp b/libsync/tests/sync_test.cpp
index 7770fcb3a..f08e97e2c 100644
--- a/libsync/tests/sync_test.cpp
+++ b/libsync/tests/sync_test.cpp
@@ -1,5 +1,5 @@
1#include <gtest/gtest.h> 1#include <gtest/gtest.h>
2#include <sync/sync.h> 2#include <android/sync.h>
3#include <sw_sync.h> 3#include <sw_sync.h>
4#include <fcntl.h> 4#include <fcntl.h>
5#include <vector> 5#include <vector>