8c3d541c7ee7442f570b22eca3d82808b35b0385vboxsync/*
8c3d541c7ee7442f570b22eca3d82808b35b0385vboxsync * Copyright © 2010 NVIDIA Corporation
8c3d541c7ee7442f570b22eca3d82808b35b0385vboxsync *
8c3d541c7ee7442f570b22eca3d82808b35b0385vboxsync * Permission is hereby granted, free of charge, to any person obtaining a
8c3d541c7ee7442f570b22eca3d82808b35b0385vboxsync * copy of this software and associated documentation files (the "Software"),
8c3d541c7ee7442f570b22eca3d82808b35b0385vboxsync * to deal in the Software without restriction, including without limitation
8c3d541c7ee7442f570b22eca3d82808b35b0385vboxsync * the rights to use, copy, modify, merge, publish, distribute, sublicense,
8c3d541c7ee7442f570b22eca3d82808b35b0385vboxsync * and/or sell copies of the Software, and to permit persons to whom the
8c3d541c7ee7442f570b22eca3d82808b35b0385vboxsync * Software is furnished to do so, subject to the following conditions:
8c3d541c7ee7442f570b22eca3d82808b35b0385vboxsync *
8c3d541c7ee7442f570b22eca3d82808b35b0385vboxsync * The above copyright notice and this permission notice (including the next
8c3d541c7ee7442f570b22eca3d82808b35b0385vboxsync * paragraph) shall be included in all copies or substantial portions of the
8c3d541c7ee7442f570b22eca3d82808b35b0385vboxsync * Software.
8c3d541c7ee7442f570b22eca3d82808b35b0385vboxsync *
8c3d541c7ee7442f570b22eca3d82808b35b0385vboxsync * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
8c3d541c7ee7442f570b22eca3d82808b35b0385vboxsync * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
8c3d541c7ee7442f570b22eca3d82808b35b0385vboxsync * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL
8c3d541c7ee7442f570b22eca3d82808b35b0385vboxsync * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
8c3d541c7ee7442f570b22eca3d82808b35b0385vboxsync * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
8c3d541c7ee7442f570b22eca3d82808b35b0385vboxsync * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
8c3d541c7ee7442f570b22eca3d82808b35b0385vboxsync * DEALINGS IN THE SOFTWARE.
8c3d541c7ee7442f570b22eca3d82808b35b0385vboxsync */
8c3d541c7ee7442f570b22eca3d82808b35b0385vboxsync
8c3d541c7ee7442f570b22eca3d82808b35b0385vboxsync#ifndef _SYNCSDK_H_
8c3d541c7ee7442f570b22eca3d82808b35b0385vboxsync#define _SYNCSDK_H_
8c3d541c7ee7442f570b22eca3d82808b35b0385vboxsync
8c3d541c7ee7442f570b22eca3d82808b35b0385vboxsync#include "misync.h"
8c3d541c7ee7442f570b22eca3d82808b35b0385vboxsync
8c3d541c7ee7442f570b22eca3d82808b35b0385vboxsyncextern _X_EXPORT int
8c3d541c7ee7442f570b22eca3d82808b35b0385vboxsyncSyncVerifyFence(SyncFence **ppFence, XID fid, ClientPtr client, Mask mode);
8c3d541c7ee7442f570b22eca3d82808b35b0385vboxsync
8c3d541c7ee7442f570b22eca3d82808b35b0385vboxsync#define VERIFY_SYNC_FENCE(pFence, fid, client, mode) \
8c3d541c7ee7442f570b22eca3d82808b35b0385vboxsync do { \
8c3d541c7ee7442f570b22eca3d82808b35b0385vboxsync int rc; \
8c3d541c7ee7442f570b22eca3d82808b35b0385vboxsync rc = SyncVerifyFence(&(pFence), (fid), (client), (mode)); \
8c3d541c7ee7442f570b22eca3d82808b35b0385vboxsync if (Success != rc) return rc; \
8c3d541c7ee7442f570b22eca3d82808b35b0385vboxsync } while (0)
8c3d541c7ee7442f570b22eca3d82808b35b0385vboxsync
8c3d541c7ee7442f570b22eca3d82808b35b0385vboxsync#define VERIFY_SYNC_FENCE_OR_NONE(pFence, fid, client, mode) \
8c3d541c7ee7442f570b22eca3d82808b35b0385vboxsync do { \
8c3d541c7ee7442f570b22eca3d82808b35b0385vboxsync pFence = 0; \
8c3d541c7ee7442f570b22eca3d82808b35b0385vboxsync if (None != fid) \
8c3d541c7ee7442f570b22eca3d82808b35b0385vboxsync VERIFY_SYNC_FENCE((pFence), (fid), (client), (mode)); \
8c3d541c7ee7442f570b22eca3d82808b35b0385vboxsync } while (0)
8c3d541c7ee7442f570b22eca3d82808b35b0385vboxsync
8c3d541c7ee7442f570b22eca3d82808b35b0385vboxsync#endif /* _SYNCSDK_H_ */
8c3d541c7ee7442f570b22eca3d82808b35b0385vboxsync