Home | History | Annotate | Download | only in sync
      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 
     44 struct sync_fence_info_data {
     45  uint32_t len;
     46  char name[32];
     47  int32_t status;
     48  uint8_t pt_info[0];
     49 };
     50 
     51 struct 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 */
     61 int sync_wait(int fd, int timeout);
     62 struct sync_fence_info_data *sync_fence_info(int fd);
     63 struct sync_pt_info *sync_pt_info(struct sync_fence_info_data *info,
     64                                   struct sync_pt_info *itr);
     65 void sync_fence_info_free(struct sync_fence_info_data *info);
     66 
     67 __END_DECLS
     68 
     69 #endif /* __SYS_CORE_SYNC_H */
     70