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