\hypertarget{vmci__qpair_8c_source}{}\doxysection{vmci\+\_\+qpair.\+c}
\label{vmci__qpair_8c_source}\index{dev/vmware/vmci/vmci\_qpair.c@{dev/vmware/vmci/vmci\_qpair.c}}
\mbox{\hyperlink{vmci__qpair_8c}{Go to the documentation of this file.}}
\begin{DoxyCode}{0}
\DoxyCodeLine{\Hypertarget{vmci__qpair_8c_source_l00001}00001 \textcolor{comment}{/*-\/}}
\DoxyCodeLine{\Hypertarget{vmci__qpair_8c_source_l00002}00002 \textcolor{comment}{ * Copyright (c) 2018 VMware, Inc.}}
\DoxyCodeLine{\Hypertarget{vmci__qpair_8c_source_l00003}00003 \textcolor{comment}{ *}}
\DoxyCodeLine{\Hypertarget{vmci__qpair_8c_source_l00004}00004 \textcolor{comment}{ * SPDX-\/License-\/Identifier: (BSD-\/2-\/Clause OR GPL-\/2.0)}}
\DoxyCodeLine{\Hypertarget{vmci__qpair_8c_source_l00005}00005 \textcolor{comment}{ */}}
\DoxyCodeLine{\Hypertarget{vmci__qpair_8c_source_l00006}00006 }
\DoxyCodeLine{\Hypertarget{vmci__qpair_8c_source_l00007}00007 \textcolor{comment}{/* This file implements Queue accessor methods. */}}
\DoxyCodeLine{\Hypertarget{vmci__qpair_8c_source_l00008}00008 }
\DoxyCodeLine{\Hypertarget{vmci__qpair_8c_source_l00009}00009 \textcolor{comment}{/*}}
\DoxyCodeLine{\Hypertarget{vmci__qpair_8c_source_l00010}00010 \textcolor{comment}{ * vmci\_qpair is an interface that hides the queue pair internals. Rather than}}
\DoxyCodeLine{\Hypertarget{vmci__qpair_8c_source_l00011}00011 \textcolor{comment}{ * access each queue in a pair directly, operations are performed on the queue}}
\DoxyCodeLine{\Hypertarget{vmci__qpair_8c_source_l00012}00012 \textcolor{comment}{ * as a whole. This is simpler and less error-\/prone, and allows for future}}
\DoxyCodeLine{\Hypertarget{vmci__qpair_8c_source_l00013}00013 \textcolor{comment}{ * queue pair features to be added under the hood with no change to the client}}
\DoxyCodeLine{\Hypertarget{vmci__qpair_8c_source_l00014}00014 \textcolor{comment}{ * code.}}
\DoxyCodeLine{\Hypertarget{vmci__qpair_8c_source_l00015}00015 \textcolor{comment}{ */}}
\DoxyCodeLine{\Hypertarget{vmci__qpair_8c_source_l00016}00016 }
\DoxyCodeLine{\Hypertarget{vmci__qpair_8c_source_l00017}00017 \textcolor{preprocessor}{\#include <sys/cdefs.h>}}
\DoxyCodeLine{\Hypertarget{vmci__qpair_8c_source_l00018}\mbox{\hyperlink{vmci__qpair_8c_a8c3ef283470a68cd30afe9b8a72cb60f}{00018}} \mbox{\hyperlink{vmci__qpair_8c_a8c3ef283470a68cd30afe9b8a72cb60f}{\_\_FBSDID}}(\textcolor{stringliteral}{"{}\$FreeBSD\$"{}});}
\DoxyCodeLine{\Hypertarget{vmci__qpair_8c_source_l00019}00019 }
\DoxyCodeLine{\Hypertarget{vmci__qpair_8c_source_l00020}00020 \textcolor{preprocessor}{\#include "{}\mbox{\hyperlink{vmci__kernel__api_8h}{vmci\_kernel\_api.h}}"{}}}
\DoxyCodeLine{\Hypertarget{vmci__qpair_8c_source_l00021}00021 \textcolor{preprocessor}{\#include "{}\mbox{\hyperlink{vmci__kernel__defs_8h}{vmci\_kernel\_defs.h}}"{}}}
\DoxyCodeLine{\Hypertarget{vmci__qpair_8c_source_l00022}00022 \textcolor{preprocessor}{\#include "{}\mbox{\hyperlink{vmci__kernel__if_8h}{vmci\_kernel\_if.h}}"{}}}
\DoxyCodeLine{\Hypertarget{vmci__qpair_8c_source_l00023}00023 \textcolor{preprocessor}{\#include "{}\mbox{\hyperlink{vmci__queue_8h}{vmci\_queue.h}}"{}}}
\DoxyCodeLine{\Hypertarget{vmci__qpair_8c_source_l00024}00024 \textcolor{preprocessor}{\#include "{}\mbox{\hyperlink{vmci__queue__pair_8h}{vmci\_queue\_pair.h}}"{}}}
\DoxyCodeLine{\Hypertarget{vmci__qpair_8c_source_l00025}00025 }
\DoxyCodeLine{\Hypertarget{vmci__qpair_8c_source_l00026}00026 \textcolor{comment}{/* This structure is opaque to the clients. */}}
\DoxyCodeLine{\Hypertarget{vmci__qpair_8c_source_l00027}\mbox{\hyperlink{structvmci__qpair}{00027}} \textcolor{keyword}{struct }\mbox{\hyperlink{structvmci__qpair}{vmci\_qpair}} \{}
\DoxyCodeLine{\Hypertarget{vmci__qpair_8c_source_l00028}\mbox{\hyperlink{structvmci__qpair_a8bc22cffc49e8abf2897cf7f926cf3a9}{00028}}         \textcolor{keyword}{struct }\mbox{\hyperlink{structvmci__handle}{vmci\_handle}}   \mbox{\hyperlink{structvmci__qpair_a8bc22cffc49e8abf2897cf7f926cf3a9}{handle}};}
\DoxyCodeLine{\Hypertarget{vmci__qpair_8c_source_l00029}\mbox{\hyperlink{structvmci__qpair_a82277f8239335f69bf1b1c53aa044520}{00029}}         \textcolor{keyword}{struct }\mbox{\hyperlink{structvmci__queue}{vmci\_queue}}     *\mbox{\hyperlink{structvmci__qpair_a82277f8239335f69bf1b1c53aa044520}{produce\_q}};}
\DoxyCodeLine{\Hypertarget{vmci__qpair_8c_source_l00030}\mbox{\hyperlink{structvmci__qpair_afe732d3bdaebbe6419d4c74cf9e62fe8}{00030}}         \textcolor{keyword}{struct }\mbox{\hyperlink{structvmci__queue}{vmci\_queue}}     *\mbox{\hyperlink{structvmci__qpair_afe732d3bdaebbe6419d4c74cf9e62fe8}{consume\_q}};}
\DoxyCodeLine{\Hypertarget{vmci__qpair_8c_source_l00031}\mbox{\hyperlink{structvmci__qpair_a95ae83459b248c68fedf40b01db29606}{00031}}         uint64\_t                \mbox{\hyperlink{structvmci__qpair_a95ae83459b248c68fedf40b01db29606}{produce\_q\_size}};}
\DoxyCodeLine{\Hypertarget{vmci__qpair_8c_source_l00032}\mbox{\hyperlink{structvmci__qpair_a56142b46ce41d691cb33f2861ffff963}{00032}}         uint64\_t                \mbox{\hyperlink{structvmci__qpair_a56142b46ce41d691cb33f2861ffff963}{consume\_q\_size}};}
\DoxyCodeLine{\Hypertarget{vmci__qpair_8c_source_l00033}\mbox{\hyperlink{structvmci__qpair_a1cc068f9375ca7c6208bc1a25b6a15a9}{00033}}         \mbox{\hyperlink{vmci__defs_8h_a63484c65c5ff339faa3914980d181327}{vmci\_id}}                  \mbox{\hyperlink{structvmci__qpair_a1cc068f9375ca7c6208bc1a25b6a15a9}{peer}};}
\DoxyCodeLine{\Hypertarget{vmci__qpair_8c_source_l00034}\mbox{\hyperlink{structvmci__qpair_a3d3cb556674e0bde8fe0eab5bf44aed1}{00034}}         uint32\_t                \mbox{\hyperlink{structvmci__qpair_a3d3cb556674e0bde8fe0eab5bf44aed1}{flags}};}
\DoxyCodeLine{\Hypertarget{vmci__qpair_8c_source_l00035}\mbox{\hyperlink{structvmci__qpair_a6774b73b428a76126f4f07f0fd83eb19}{00035}}         \mbox{\hyperlink{vmci__defs_8h_a02f4f53a27013938bd155c00dcce95da}{vmci\_privilege\_flags}}        \mbox{\hyperlink{structvmci__qpair_a6774b73b428a76126f4f07f0fd83eb19}{priv\_flags}};}
\DoxyCodeLine{\Hypertarget{vmci__qpair_8c_source_l00036}\mbox{\hyperlink{structvmci__qpair_a9546a3a3e9810e9df0067ab3e3a65005}{00036}}         uint32\_t                \mbox{\hyperlink{structvmci__qpair_a9546a3a3e9810e9df0067ab3e3a65005}{blocked}};}
\DoxyCodeLine{\Hypertarget{vmci__qpair_8c_source_l00037}\mbox{\hyperlink{structvmci__qpair_a0a212271251e02a2d111be643f003c14}{00037}}         \mbox{\hyperlink{vmci__kernel__if_8h_a83da0804e9ec81471cc6a32975882471}{vmci\_event}}            \mbox{\hyperlink{structvmci__qpair_a0a212271251e02a2d111be643f003c14}{event}};}
\DoxyCodeLine{\Hypertarget{vmci__qpair_8c_source_l00038}00038 \};}
\DoxyCodeLine{\Hypertarget{vmci__qpair_8c_source_l00039}00039 }
\DoxyCodeLine{\Hypertarget{vmci__qpair_8c_source_l00040}00040 \textcolor{keyword}{static} \textcolor{keywordtype}{void}     \mbox{\hyperlink{vmci__qpair_8c_aefa3196a67fd9fa0bf175a742e798ff3}{vmci\_qpair\_get\_queue\_headers}}(\textcolor{keyword}{const} \textcolor{keyword}{struct} \mbox{\hyperlink{structvmci__qpair}{vmci\_qpair}} *qpair,}
\DoxyCodeLine{\Hypertarget{vmci__qpair_8c_source_l00041}00041                     \textcolor{keyword}{struct} \mbox{\hyperlink{structvmci__queue__header}{vmci\_queue\_header}} **produce\_q\_header,}
\DoxyCodeLine{\Hypertarget{vmci__qpair_8c_source_l00042}00042                     \textcolor{keyword}{struct} \mbox{\hyperlink{structvmci__queue__header}{vmci\_queue\_header}} **consume\_q\_header);}
\DoxyCodeLine{\Hypertarget{vmci__qpair_8c_source_l00043}00043 }
\DoxyCodeLine{\Hypertarget{vmci__qpair_8c_source_l00044}00044 \textcolor{comment}{/*}}
\DoxyCodeLine{\Hypertarget{vmci__qpair_8c_source_l00045}00045 \textcolor{comment}{ *-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/}}
\DoxyCodeLine{\Hypertarget{vmci__qpair_8c_source_l00046}00046 \textcolor{comment}{ *}}
\DoxyCodeLine{\Hypertarget{vmci__qpair_8c_source_l00047}00047 \textcolor{comment}{ * vmci\_queue\_add\_producer\_tail -\/-\/}}
\DoxyCodeLine{\Hypertarget{vmci__qpair_8c_source_l00048}00048 \textcolor{comment}{ *}}
\DoxyCodeLine{\Hypertarget{vmci__qpair_8c_source_l00049}00049 \textcolor{comment}{ *     Helper routine to increment the Producer Tail.}}
\DoxyCodeLine{\Hypertarget{vmci__qpair_8c_source_l00050}00050 \textcolor{comment}{ *}}
\DoxyCodeLine{\Hypertarget{vmci__qpair_8c_source_l00051}00051 \textcolor{comment}{ * Results:}}
\DoxyCodeLine{\Hypertarget{vmci__qpair_8c_source_l00052}00052 \textcolor{comment}{ *     VMCI\_ERROR\_NOT\_FOUND if the vmm\_world registered with the queue cannot}}
\DoxyCodeLine{\Hypertarget{vmci__qpair_8c_source_l00053}00053 \textcolor{comment}{ *     be found. Otherwise VMCI\_SUCCESS.}}
\DoxyCodeLine{\Hypertarget{vmci__qpair_8c_source_l00054}00054 \textcolor{comment}{ *}}
\DoxyCodeLine{\Hypertarget{vmci__qpair_8c_source_l00055}00055 \textcolor{comment}{ * Side effects:}}
\DoxyCodeLine{\Hypertarget{vmci__qpair_8c_source_l00056}00056 \textcolor{comment}{ *     None.}}
\DoxyCodeLine{\Hypertarget{vmci__qpair_8c_source_l00057}00057 \textcolor{comment}{ *}}
\DoxyCodeLine{\Hypertarget{vmci__qpair_8c_source_l00058}00058 \textcolor{comment}{ *-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/}}
\DoxyCodeLine{\Hypertarget{vmci__qpair_8c_source_l00059}00059 \textcolor{comment}{ */}}
\DoxyCodeLine{\Hypertarget{vmci__qpair_8c_source_l00060}00060 }
\DoxyCodeLine{\Hypertarget{vmci__qpair_8c_source_l00061}00061 \textcolor{keyword}{static} \textcolor{keyword}{inline} \textcolor{keywordtype}{int}}
\DoxyCodeLine{\Hypertarget{vmci__qpair_8c_source_l00062}\mbox{\hyperlink{vmci__qpair_8c_ac3485221df318cd1bdc92eeadf235228}{00062}} \mbox{\hyperlink{vmci__qpair_8c_ac3485221df318cd1bdc92eeadf235228}{vmci\_queue\_add\_producer\_tail}}(\textcolor{keyword}{struct} \mbox{\hyperlink{structvmci__queue}{vmci\_queue}} *queue,}
\DoxyCodeLine{\Hypertarget{vmci__qpair_8c_source_l00063}00063     \textcolor{keywordtype}{size\_t} add, uint64\_t queue\_size)}
\DoxyCodeLine{\Hypertarget{vmci__qpair_8c_source_l00064}00064 \{}
\DoxyCodeLine{\Hypertarget{vmci__qpair_8c_source_l00065}00065 }
\DoxyCodeLine{\Hypertarget{vmci__qpair_8c_source_l00066}00066         \mbox{\hyperlink{vmci__defs_8h_a475605309144d0e722af1af9e7598028}{vmci\_queue\_header\_add\_producer\_tail}}(queue-\/>\mbox{\hyperlink{structvmci__queue_ad126179a724d9bfcb3eb2deac84d4576}{q\_header}}, add, queue\_size);}
\DoxyCodeLine{\Hypertarget{vmci__qpair_8c_source_l00067}00067         \textcolor{keywordflow}{return} (\mbox{\hyperlink{vmci__defs_8h_ab286f495fff827d2718453f2968a6899}{VMCI\_SUCCESS}});}
\DoxyCodeLine{\Hypertarget{vmci__qpair_8c_source_l00068}00068 \}}
\DoxyCodeLine{\Hypertarget{vmci__qpair_8c_source_l00069}00069 }
\DoxyCodeLine{\Hypertarget{vmci__qpair_8c_source_l00070}00070 \textcolor{comment}{/*}}
\DoxyCodeLine{\Hypertarget{vmci__qpair_8c_source_l00071}00071 \textcolor{comment}{ *-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/}}
\DoxyCodeLine{\Hypertarget{vmci__qpair_8c_source_l00072}00072 \textcolor{comment}{ *}}
\DoxyCodeLine{\Hypertarget{vmci__qpair_8c_source_l00073}00073 \textcolor{comment}{ * vmci\_queue\_add\_consumer\_head -\/-\/}}
\DoxyCodeLine{\Hypertarget{vmci__qpair_8c_source_l00074}00074 \textcolor{comment}{ *}}
\DoxyCodeLine{\Hypertarget{vmci__qpair_8c_source_l00075}00075 \textcolor{comment}{ *     Helper routine to increment the Consumer Head.}}
\DoxyCodeLine{\Hypertarget{vmci__qpair_8c_source_l00076}00076 \textcolor{comment}{ *}}
\DoxyCodeLine{\Hypertarget{vmci__qpair_8c_source_l00077}00077 \textcolor{comment}{ * Results:}}
\DoxyCodeLine{\Hypertarget{vmci__qpair_8c_source_l00078}00078 \textcolor{comment}{ *     VMCI\_ERROR\_NOT\_FOUND if the vmm\_world registered with the queue cannot}}
\DoxyCodeLine{\Hypertarget{vmci__qpair_8c_source_l00079}00079 \textcolor{comment}{ *     be found. Otherwise VMCI\_SUCCESS.}}
\DoxyCodeLine{\Hypertarget{vmci__qpair_8c_source_l00080}00080 \textcolor{comment}{ *}}
\DoxyCodeLine{\Hypertarget{vmci__qpair_8c_source_l00081}00081 \textcolor{comment}{ * Side effects:}}
\DoxyCodeLine{\Hypertarget{vmci__qpair_8c_source_l00082}00082 \textcolor{comment}{ *     None.}}
\DoxyCodeLine{\Hypertarget{vmci__qpair_8c_source_l00083}00083 \textcolor{comment}{ *}}
\DoxyCodeLine{\Hypertarget{vmci__qpair_8c_source_l00084}00084 \textcolor{comment}{ *-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/}}
\DoxyCodeLine{\Hypertarget{vmci__qpair_8c_source_l00085}00085 \textcolor{comment}{ */}}
\DoxyCodeLine{\Hypertarget{vmci__qpair_8c_source_l00086}00086 }
\DoxyCodeLine{\Hypertarget{vmci__qpair_8c_source_l00087}00087 \textcolor{keyword}{static} \textcolor{keyword}{inline} \textcolor{keywordtype}{int}}
\DoxyCodeLine{\Hypertarget{vmci__qpair_8c_source_l00088}\mbox{\hyperlink{vmci__qpair_8c_a541c23d387333936942abf1f0f5d1717}{00088}} \mbox{\hyperlink{vmci__qpair_8c_a541c23d387333936942abf1f0f5d1717}{vmci\_queue\_add\_consumer\_head}}(\textcolor{keyword}{struct} \mbox{\hyperlink{structvmci__queue}{vmci\_queue}} *queue,}
\DoxyCodeLine{\Hypertarget{vmci__qpair_8c_source_l00089}00089     \textcolor{keywordtype}{size\_t} add, uint64\_t queue\_size)}
\DoxyCodeLine{\Hypertarget{vmci__qpair_8c_source_l00090}00090 \{}
\DoxyCodeLine{\Hypertarget{vmci__qpair_8c_source_l00091}00091 }
\DoxyCodeLine{\Hypertarget{vmci__qpair_8c_source_l00092}00092         \mbox{\hyperlink{vmci__defs_8h_a6ae28d1122658bbd68718bf7097cda1d}{vmci\_queue\_header\_add\_consumer\_head}}(queue-\/>\mbox{\hyperlink{structvmci__queue_ad126179a724d9bfcb3eb2deac84d4576}{q\_header}}, add, queue\_size);}
\DoxyCodeLine{\Hypertarget{vmci__qpair_8c_source_l00093}00093         \textcolor{keywordflow}{return} (\mbox{\hyperlink{vmci__defs_8h_ab286f495fff827d2718453f2968a6899}{VMCI\_SUCCESS}});}
\DoxyCodeLine{\Hypertarget{vmci__qpair_8c_source_l00094}00094 \}}
\DoxyCodeLine{\Hypertarget{vmci__qpair_8c_source_l00095}00095 }
\DoxyCodeLine{\Hypertarget{vmci__qpair_8c_source_l00096}00096 \textcolor{comment}{/*}}
\DoxyCodeLine{\Hypertarget{vmci__qpair_8c_source_l00097}00097 \textcolor{comment}{ *-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/}}
\DoxyCodeLine{\Hypertarget{vmci__qpair_8c_source_l00098}00098 \textcolor{comment}{ *}}
\DoxyCodeLine{\Hypertarget{vmci__qpair_8c_source_l00099}00099 \textcolor{comment}{ * vmci\_qpair\_get\_queue\_headers -\/-\/}}
\DoxyCodeLine{\Hypertarget{vmci__qpair_8c_source_l00100}00100 \textcolor{comment}{ *}}
\DoxyCodeLine{\Hypertarget{vmci__qpair_8c_source_l00101}00101 \textcolor{comment}{ *     Helper routine that will retrieve the produce and consume headers of a}}
\DoxyCodeLine{\Hypertarget{vmci__qpair_8c_source_l00102}00102 \textcolor{comment}{ *     given queue pair.}}
\DoxyCodeLine{\Hypertarget{vmci__qpair_8c_source_l00103}00103 \textcolor{comment}{ *}}
\DoxyCodeLine{\Hypertarget{vmci__qpair_8c_source_l00104}00104 \textcolor{comment}{ * Results:}}
\DoxyCodeLine{\Hypertarget{vmci__qpair_8c_source_l00105}00105 \textcolor{comment}{ *     VMCI\_SUCCESS if either current or saved queue headers are found.}}
\DoxyCodeLine{\Hypertarget{vmci__qpair_8c_source_l00106}00106 \textcolor{comment}{ *     Appropriate error code otherwise.}}
\DoxyCodeLine{\Hypertarget{vmci__qpair_8c_source_l00107}00107 \textcolor{comment}{ *}}
\DoxyCodeLine{\Hypertarget{vmci__qpair_8c_source_l00108}00108 \textcolor{comment}{ * Side effects:}}
\DoxyCodeLine{\Hypertarget{vmci__qpair_8c_source_l00109}00109 \textcolor{comment}{ *     None.}}
\DoxyCodeLine{\Hypertarget{vmci__qpair_8c_source_l00110}00110 \textcolor{comment}{ *}}
\DoxyCodeLine{\Hypertarget{vmci__qpair_8c_source_l00111}00111 \textcolor{comment}{ *-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/}}
\DoxyCodeLine{\Hypertarget{vmci__qpair_8c_source_l00112}00112 \textcolor{comment}{ */}}
\DoxyCodeLine{\Hypertarget{vmci__qpair_8c_source_l00113}00113 }
\DoxyCodeLine{\Hypertarget{vmci__qpair_8c_source_l00114}00114 \textcolor{keyword}{static} \textcolor{keywordtype}{void}}
\DoxyCodeLine{\Hypertarget{vmci__qpair_8c_source_l00115}\mbox{\hyperlink{vmci__qpair_8c_aefa3196a67fd9fa0bf175a742e798ff3}{00115}} \mbox{\hyperlink{vmci__qpair_8c_aefa3196a67fd9fa0bf175a742e798ff3}{vmci\_qpair\_get\_queue\_headers}}(\textcolor{keyword}{const} \textcolor{keyword}{struct} \mbox{\hyperlink{structvmci__qpair}{vmci\_qpair}} *qpair,}
\DoxyCodeLine{\Hypertarget{vmci__qpair_8c_source_l00116}00116     \textcolor{keyword}{struct} \mbox{\hyperlink{structvmci__queue__header}{vmci\_queue\_header}} **produce\_q\_header,}
\DoxyCodeLine{\Hypertarget{vmci__qpair_8c_source_l00117}00117     \textcolor{keyword}{struct} \mbox{\hyperlink{structvmci__queue__header}{vmci\_queue\_header}} **consume\_q\_header)}
\DoxyCodeLine{\Hypertarget{vmci__qpair_8c_source_l00118}00118 \{}
\DoxyCodeLine{\Hypertarget{vmci__qpair_8c_source_l00119}00119 }
\DoxyCodeLine{\Hypertarget{vmci__qpair_8c_source_l00120}00120         \mbox{\hyperlink{vmci__kernel__defs_8h_a0966b817b229d48e5ffc7feab19a0be6}{ASSERT}}((qpair-\/>\mbox{\hyperlink{structvmci__qpair_a82277f8239335f69bf1b1c53aa044520}{produce\_q}} != NULL) \&\& (qpair-\/>\mbox{\hyperlink{structvmci__qpair_afe732d3bdaebbe6419d4c74cf9e62fe8}{consume\_q}} != NULL));}
\DoxyCodeLine{\Hypertarget{vmci__qpair_8c_source_l00121}00121         *produce\_q\_header = qpair-\/>\mbox{\hyperlink{structvmci__qpair_a82277f8239335f69bf1b1c53aa044520}{produce\_q}}-\/>\mbox{\hyperlink{structvmci__queue_ad126179a724d9bfcb3eb2deac84d4576}{q\_header}};}
\DoxyCodeLine{\Hypertarget{vmci__qpair_8c_source_l00122}00122         *consume\_q\_header = qpair-\/>\mbox{\hyperlink{structvmci__qpair_afe732d3bdaebbe6419d4c74cf9e62fe8}{consume\_q}}-\/>\mbox{\hyperlink{structvmci__queue_ad126179a724d9bfcb3eb2deac84d4576}{q\_header}};}
\DoxyCodeLine{\Hypertarget{vmci__qpair_8c_source_l00123}00123 \}}
\DoxyCodeLine{\Hypertarget{vmci__qpair_8c_source_l00124}00124 }
\DoxyCodeLine{\Hypertarget{vmci__qpair_8c_source_l00125}00125 \textcolor{comment}{/*}}
\DoxyCodeLine{\Hypertarget{vmci__qpair_8c_source_l00126}00126 \textcolor{comment}{ *-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/}}
\DoxyCodeLine{\Hypertarget{vmci__qpair_8c_source_l00127}00127 \textcolor{comment}{ *}}
\DoxyCodeLine{\Hypertarget{vmci__qpair_8c_source_l00128}00128 \textcolor{comment}{ * vmci\_qpair\_alloc -\/-\/}}
\DoxyCodeLine{\Hypertarget{vmci__qpair_8c_source_l00129}00129 \textcolor{comment}{ *}}
\DoxyCodeLine{\Hypertarget{vmci__qpair_8c_source_l00130}00130 \textcolor{comment}{ *     This is the client interface for allocating the memory for a vmci\_qpair}}
\DoxyCodeLine{\Hypertarget{vmci__qpair_8c_source_l00131}00131 \textcolor{comment}{ *     structure and then attaching to the underlying queue. If an error occurs}}
\DoxyCodeLine{\Hypertarget{vmci__qpair_8c_source_l00132}00132 \textcolor{comment}{ *     allocating the memory for the vmci\_qpair structure, no attempt is made to}}
\DoxyCodeLine{\Hypertarget{vmci__qpair_8c_source_l00133}00133 \textcolor{comment}{ *     attach. If an error occurs attaching, then there's the vmci\_qpair}}
\DoxyCodeLine{\Hypertarget{vmci__qpair_8c_source_l00134}00134 \textcolor{comment}{ *     structure is freed.}}
\DoxyCodeLine{\Hypertarget{vmci__qpair_8c_source_l00135}00135 \textcolor{comment}{ *}}
\DoxyCodeLine{\Hypertarget{vmci__qpair_8c_source_l00136}00136 \textcolor{comment}{ * Results:}}
\DoxyCodeLine{\Hypertarget{vmci__qpair_8c_source_l00137}00137 \textcolor{comment}{ *     An err, if < 0.}}
\DoxyCodeLine{\Hypertarget{vmci__qpair_8c_source_l00138}00138 \textcolor{comment}{ *}}
\DoxyCodeLine{\Hypertarget{vmci__qpair_8c_source_l00139}00139 \textcolor{comment}{ * Side effects:}}
\DoxyCodeLine{\Hypertarget{vmci__qpair_8c_source_l00140}00140 \textcolor{comment}{ *     None.}}
\DoxyCodeLine{\Hypertarget{vmci__qpair_8c_source_l00141}00141 \textcolor{comment}{ *}}
\DoxyCodeLine{\Hypertarget{vmci__qpair_8c_source_l00142}00142 \textcolor{comment}{ *-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/}}
\DoxyCodeLine{\Hypertarget{vmci__qpair_8c_source_l00143}00143 \textcolor{comment}{ */}}
\DoxyCodeLine{\Hypertarget{vmci__qpair_8c_source_l00144}00144 }
\DoxyCodeLine{\Hypertarget{vmci__qpair_8c_source_l00145}00145 \textcolor{keywordtype}{int}}
\DoxyCodeLine{\Hypertarget{vmci__qpair_8c_source_l00146}\mbox{\hyperlink{vmci__kernel__api__1_8h_a804ceb7010abe222070aa175f23848b2}{00146}} \mbox{\hyperlink{vmci__qpair_8c_a804ceb7010abe222070aa175f23848b2}{vmci\_qpair\_alloc}}(\textcolor{keyword}{struct} \mbox{\hyperlink{structvmci__qpair}{vmci\_qpair}} **qpair, \textcolor{keyword}{struct} \mbox{\hyperlink{structvmci__handle}{vmci\_handle}} *handle,}
\DoxyCodeLine{\Hypertarget{vmci__qpair_8c_source_l00147}00147     uint64\_t produce\_q\_size, uint64\_t consume\_q\_size, \mbox{\hyperlink{vmci__defs_8h_a63484c65c5ff339faa3914980d181327}{vmci\_id}} peer,}
\DoxyCodeLine{\Hypertarget{vmci__qpair_8c_source_l00148}00148     uint32\_t flags, \mbox{\hyperlink{vmci__defs_8h_a02f4f53a27013938bd155c00dcce95da}{vmci\_privilege\_flags}} priv\_flags)}
\DoxyCodeLine{\Hypertarget{vmci__qpair_8c_source_l00149}00149 \{}
\DoxyCodeLine{\Hypertarget{vmci__qpair_8c_source_l00150}00150         \textcolor{keyword}{struct }\mbox{\hyperlink{structvmci__qpair}{vmci\_qpair}} *my\_qpair;}
\DoxyCodeLine{\Hypertarget{vmci__qpair_8c_source_l00151}00151         \mbox{\hyperlink{vmci__kernel__if_8h_aec03ced6a6e9044a50d1a5fdf367ae31}{vmci\_event\_release\_cb}} wakeup\_cb;}
\DoxyCodeLine{\Hypertarget{vmci__qpair_8c_source_l00152}00152         \textcolor{keywordtype}{void} *client\_data;}
\DoxyCodeLine{\Hypertarget{vmci__qpair_8c_source_l00153}00153         \textcolor{keywordtype}{int} retval;}
\DoxyCodeLine{\Hypertarget{vmci__qpair_8c_source_l00154}00154 }
\DoxyCodeLine{\Hypertarget{vmci__qpair_8c_source_l00155}00155         \textcolor{comment}{/*}}
\DoxyCodeLine{\Hypertarget{vmci__qpair_8c_source_l00156}00156 \textcolor{comment}{         * Restrict the size of a queuepair. Though the device enforces a limit}}
\DoxyCodeLine{\Hypertarget{vmci__qpair_8c_source_l00157}00157 \textcolor{comment}{         * on the total amount of memory that can be allocated to queuepairs for}}
\DoxyCodeLine{\Hypertarget{vmci__qpair_8c_source_l00158}00158 \textcolor{comment}{         * a guest, we avoid unnecessarily allocating a lot of memory. Also, we}}
\DoxyCodeLine{\Hypertarget{vmci__qpair_8c_source_l00159}00159 \textcolor{comment}{         * try to allocate this memory before we make the queuepair allocation}}
\DoxyCodeLine{\Hypertarget{vmci__qpair_8c_source_l00160}00160 \textcolor{comment}{         * hypercall.}}
\DoxyCodeLine{\Hypertarget{vmci__qpair_8c_source_l00161}00161 \textcolor{comment}{         *}}
\DoxyCodeLine{\Hypertarget{vmci__qpair_8c_source_l00162}00162 \textcolor{comment}{         * (Note that this doesn't prevent all cases; a user with only this much}}
\DoxyCodeLine{\Hypertarget{vmci__qpair_8c_source_l00163}00163 \textcolor{comment}{         * physical memory could still get into trouble.) The error used by the}}
\DoxyCodeLine{\Hypertarget{vmci__qpair_8c_source_l00164}00164 \textcolor{comment}{         * device is NO\_RESOURCES, so use that here too.}}
\DoxyCodeLine{\Hypertarget{vmci__qpair_8c_source_l00165}00165 \textcolor{comment}{         */}}
\DoxyCodeLine{\Hypertarget{vmci__qpair_8c_source_l00166}00166 }
\DoxyCodeLine{\Hypertarget{vmci__qpair_8c_source_l00167}00167         \textcolor{keywordflow}{if} (\mbox{\hyperlink{structvmci__qpair_a95ae83459b248c68fedf40b01db29606}{produce\_q\_size}} + \mbox{\hyperlink{structvmci__qpair_a56142b46ce41d691cb33f2861ffff963}{consume\_q\_size}} <}
\DoxyCodeLine{\Hypertarget{vmci__qpair_8c_source_l00168}00168             MAX(\mbox{\hyperlink{structvmci__qpair_a95ae83459b248c68fedf40b01db29606}{produce\_q\_size}}, \mbox{\hyperlink{structvmci__qpair_a56142b46ce41d691cb33f2861ffff963}{consume\_q\_size}}) ||}
\DoxyCodeLine{\Hypertarget{vmci__qpair_8c_source_l00169}00169             \mbox{\hyperlink{structvmci__qpair_a95ae83459b248c68fedf40b01db29606}{produce\_q\_size}} + \mbox{\hyperlink{structvmci__qpair_a56142b46ce41d691cb33f2861ffff963}{consume\_q\_size}} > \mbox{\hyperlink{vmci__defs_8h_a6aa7f1ea7bccdc5edaad0547e7bd2006}{VMCI\_MAX\_GUEST\_QP\_MEMORY}})}
\DoxyCodeLine{\Hypertarget{vmci__qpair_8c_source_l00170}00170                 \textcolor{keywordflow}{return} (\mbox{\hyperlink{vmci__defs_8h_a4db11226b304e5193643c62a4ff776ca}{VMCI\_ERROR\_NO\_RESOURCES}});}
\DoxyCodeLine{\Hypertarget{vmci__qpair_8c_source_l00171}00171 }
\DoxyCodeLine{\Hypertarget{vmci__qpair_8c_source_l00172}00172         \textcolor{keywordflow}{if} (\mbox{\hyperlink{structvmci__qpair_a3d3cb556674e0bde8fe0eab5bf44aed1}{flags}} \& \mbox{\hyperlink{vmci__call__defs_8h_aca8898eb26ed49d7da0d2ceeef586e37}{VMCI\_QPFLAG\_NONBLOCK}})}
\DoxyCodeLine{\Hypertarget{vmci__qpair_8c_source_l00173}00173                 \textcolor{keywordflow}{return} (\mbox{\hyperlink{vmci__defs_8h_a8ab0ddbd99d8d5d8f1ed882d0f5de1a3}{VMCI\_ERROR\_INVALID\_ARGS}});}
\DoxyCodeLine{\Hypertarget{vmci__qpair_8c_source_l00174}00174 }
\DoxyCodeLine{\Hypertarget{vmci__qpair_8c_source_l00175}00175         my\_qpair = \mbox{\hyperlink{vmci__kernel__if_8c_a9704e99048c2cb66ded146e496decff2}{vmci\_alloc\_kernel\_mem}}(\textcolor{keyword}{sizeof}(*my\_qpair), \mbox{\hyperlink{vmci__kernel__if_8h_ada5b4ff2ed0dfb4b412cdcf78d8632d6}{VMCI\_MEMORY\_NORMAL}});}
\DoxyCodeLine{\Hypertarget{vmci__qpair_8c_source_l00176}00176         \textcolor{keywordflow}{if} (!my\_qpair)}
\DoxyCodeLine{\Hypertarget{vmci__qpair_8c_source_l00177}00177                 \textcolor{keywordflow}{return} (\mbox{\hyperlink{vmci__defs_8h_a66b7fa43b4b851f7457d3d6ec3569a47}{VMCI\_ERROR\_NO\_MEM}});}
\DoxyCodeLine{\Hypertarget{vmci__qpair_8c_source_l00178}00178 }
\DoxyCodeLine{\Hypertarget{vmci__qpair_8c_source_l00179}00179         my\_qpair-\/>\mbox{\hyperlink{structvmci__qpair_a95ae83459b248c68fedf40b01db29606}{produce\_q\_size}} = \mbox{\hyperlink{structvmci__qpair_a95ae83459b248c68fedf40b01db29606}{produce\_q\_size}};}
\DoxyCodeLine{\Hypertarget{vmci__qpair_8c_source_l00180}00180         my\_qpair-\/>\mbox{\hyperlink{structvmci__qpair_a56142b46ce41d691cb33f2861ffff963}{consume\_q\_size}} = \mbox{\hyperlink{structvmci__qpair_a56142b46ce41d691cb33f2861ffff963}{consume\_q\_size}};}
\DoxyCodeLine{\Hypertarget{vmci__qpair_8c_source_l00181}00181         my\_qpair-\/>\mbox{\hyperlink{structvmci__qpair_a1cc068f9375ca7c6208bc1a25b6a15a9}{peer}} = \mbox{\hyperlink{structvmci__qpair_a1cc068f9375ca7c6208bc1a25b6a15a9}{peer}};}
\DoxyCodeLine{\Hypertarget{vmci__qpair_8c_source_l00182}00182         my\_qpair-\/>\mbox{\hyperlink{structvmci__qpair_a3d3cb556674e0bde8fe0eab5bf44aed1}{flags}} = \mbox{\hyperlink{structvmci__qpair_a3d3cb556674e0bde8fe0eab5bf44aed1}{flags}};}
\DoxyCodeLine{\Hypertarget{vmci__qpair_8c_source_l00183}00183         my\_qpair-\/>\mbox{\hyperlink{structvmci__qpair_a6774b73b428a76126f4f07f0fd83eb19}{priv\_flags}} = \mbox{\hyperlink{structvmci__qpair_a6774b73b428a76126f4f07f0fd83eb19}{priv\_flags}};}
\DoxyCodeLine{\Hypertarget{vmci__qpair_8c_source_l00184}00184 }
\DoxyCodeLine{\Hypertarget{vmci__qpair_8c_source_l00185}00185         client\_data = NULL;}
\DoxyCodeLine{\Hypertarget{vmci__qpair_8c_source_l00186}00186         wakeup\_cb = NULL;}
\DoxyCodeLine{\Hypertarget{vmci__qpair_8c_source_l00187}00187 }
\DoxyCodeLine{\Hypertarget{vmci__qpair_8c_source_l00188}00188         retval = \mbox{\hyperlink{vmci__queue__pair_8c_a89da4b6ad7f3dfcd7848c0148a025bf8}{vmci\_queue\_pair\_alloc}}(\mbox{\hyperlink{structvmci__qpair_a8bc22cffc49e8abf2897cf7f926cf3a9}{handle}}, \&my\_qpair-\/>\mbox{\hyperlink{structvmci__qpair_a82277f8239335f69bf1b1c53aa044520}{produce\_q}},}
\DoxyCodeLine{\Hypertarget{vmci__qpair_8c_source_l00189}00189             my\_qpair-\/>\mbox{\hyperlink{structvmci__qpair_a95ae83459b248c68fedf40b01db29606}{produce\_q\_size}}, \&my\_qpair-\/>\mbox{\hyperlink{structvmci__qpair_afe732d3bdaebbe6419d4c74cf9e62fe8}{consume\_q}},}
\DoxyCodeLine{\Hypertarget{vmci__qpair_8c_source_l00190}00190             my\_qpair-\/>\mbox{\hyperlink{structvmci__qpair_a56142b46ce41d691cb33f2861ffff963}{consume\_q\_size}}, my\_qpair-\/>\mbox{\hyperlink{structvmci__qpair_a1cc068f9375ca7c6208bc1a25b6a15a9}{peer}}, my\_qpair-\/>\mbox{\hyperlink{structvmci__qpair_a3d3cb556674e0bde8fe0eab5bf44aed1}{flags}},}
\DoxyCodeLine{\Hypertarget{vmci__qpair_8c_source_l00191}00191             my\_qpair-\/>\mbox{\hyperlink{structvmci__qpair_a6774b73b428a76126f4f07f0fd83eb19}{priv\_flags}});}
\DoxyCodeLine{\Hypertarget{vmci__qpair_8c_source_l00192}00192 }
\DoxyCodeLine{\Hypertarget{vmci__qpair_8c_source_l00193}00193         \textcolor{keywordflow}{if} (retval < \mbox{\hyperlink{vmci__defs_8h_ab286f495fff827d2718453f2968a6899}{VMCI\_SUCCESS}}) \{}
\DoxyCodeLine{\Hypertarget{vmci__qpair_8c_source_l00194}00194                 \mbox{\hyperlink{vmci__kernel__if_8c_ac55ceaf5f269d5ffafd52e332cf8dbc4}{vmci\_free\_kernel\_mem}}(my\_qpair, \textcolor{keyword}{sizeof}(*my\_qpair));}
\DoxyCodeLine{\Hypertarget{vmci__qpair_8c_source_l00195}00195                 \textcolor{keywordflow}{return} (retval);}
\DoxyCodeLine{\Hypertarget{vmci__qpair_8c_source_l00196}00196         \}}
\DoxyCodeLine{\Hypertarget{vmci__qpair_8c_source_l00197}00197 }
\DoxyCodeLine{\Hypertarget{vmci__qpair_8c_source_l00198}00198         *qpair = my\_qpair;}
\DoxyCodeLine{\Hypertarget{vmci__qpair_8c_source_l00199}00199         my\_qpair-\/>\mbox{\hyperlink{structvmci__qpair_a8bc22cffc49e8abf2897cf7f926cf3a9}{handle}} = *\mbox{\hyperlink{structvmci__qpair_a8bc22cffc49e8abf2897cf7f926cf3a9}{handle}};}
\DoxyCodeLine{\Hypertarget{vmci__qpair_8c_source_l00200}00200 }
\DoxyCodeLine{\Hypertarget{vmci__qpair_8c_source_l00201}00201         \textcolor{keywordflow}{return} (retval);}
\DoxyCodeLine{\Hypertarget{vmci__qpair_8c_source_l00202}00202 \}}
\DoxyCodeLine{\Hypertarget{vmci__qpair_8c_source_l00203}00203 }
\DoxyCodeLine{\Hypertarget{vmci__qpair_8c_source_l00204}00204 \textcolor{comment}{/*}}
\DoxyCodeLine{\Hypertarget{vmci__qpair_8c_source_l00205}00205 \textcolor{comment}{ *-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/}}
\DoxyCodeLine{\Hypertarget{vmci__qpair_8c_source_l00206}00206 \textcolor{comment}{ *}}
\DoxyCodeLine{\Hypertarget{vmci__qpair_8c_source_l00207}00207 \textcolor{comment}{ * vmci\_qpair\_detach -\/-\/}}
\DoxyCodeLine{\Hypertarget{vmci__qpair_8c_source_l00208}00208 \textcolor{comment}{ *}}
\DoxyCodeLine{\Hypertarget{vmci__qpair_8c_source_l00209}00209 \textcolor{comment}{ *     This is the client interface for detaching from a vmci\_qpair. Note that}}
\DoxyCodeLine{\Hypertarget{vmci__qpair_8c_source_l00210}00210 \textcolor{comment}{ *     this routine will free the memory allocated for the vmci\_qpair structure,}}
\DoxyCodeLine{\Hypertarget{vmci__qpair_8c_source_l00211}00211 \textcolor{comment}{ *     too.}}
\DoxyCodeLine{\Hypertarget{vmci__qpair_8c_source_l00212}00212 \textcolor{comment}{ *}}
\DoxyCodeLine{\Hypertarget{vmci__qpair_8c_source_l00213}00213 \textcolor{comment}{ * Results:}}
\DoxyCodeLine{\Hypertarget{vmci__qpair_8c_source_l00214}00214 \textcolor{comment}{ *     An error, if < 0.}}
\DoxyCodeLine{\Hypertarget{vmci__qpair_8c_source_l00215}00215 \textcolor{comment}{ *}}
\DoxyCodeLine{\Hypertarget{vmci__qpair_8c_source_l00216}00216 \textcolor{comment}{ * Side effects:}}
\DoxyCodeLine{\Hypertarget{vmci__qpair_8c_source_l00217}00217 \textcolor{comment}{ *     Will clear the caller's pointer to the vmci\_qpair structure.}}
\DoxyCodeLine{\Hypertarget{vmci__qpair_8c_source_l00218}00218 \textcolor{comment}{ *}}
\DoxyCodeLine{\Hypertarget{vmci__qpair_8c_source_l00219}00219 \textcolor{comment}{ *-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/}}
\DoxyCodeLine{\Hypertarget{vmci__qpair_8c_source_l00220}00220 \textcolor{comment}{ */}}
\DoxyCodeLine{\Hypertarget{vmci__qpair_8c_source_l00221}00221 }
\DoxyCodeLine{\Hypertarget{vmci__qpair_8c_source_l00222}00222 \textcolor{keywordtype}{int}}
\DoxyCodeLine{\Hypertarget{vmci__qpair_8c_source_l00223}\mbox{\hyperlink{vmci__kernel__api__1_8h_a174108210cdbb8cf3690dfbb2da1dd12}{00223}} \mbox{\hyperlink{vmci__qpair_8c_a174108210cdbb8cf3690dfbb2da1dd12}{vmci\_qpair\_detach}}(\textcolor{keyword}{struct} \mbox{\hyperlink{structvmci__qpair}{vmci\_qpair}} **qpair)}
\DoxyCodeLine{\Hypertarget{vmci__qpair_8c_source_l00224}00224 \{}
\DoxyCodeLine{\Hypertarget{vmci__qpair_8c_source_l00225}00225         \textcolor{keyword}{struct }\mbox{\hyperlink{structvmci__qpair}{vmci\_qpair}} *old\_qpair;}
\DoxyCodeLine{\Hypertarget{vmci__qpair_8c_source_l00226}00226         \textcolor{keywordtype}{int} result;}
\DoxyCodeLine{\Hypertarget{vmci__qpair_8c_source_l00227}00227 }
\DoxyCodeLine{\Hypertarget{vmci__qpair_8c_source_l00228}00228         \textcolor{keywordflow}{if} (!qpair || !(*qpair))}
\DoxyCodeLine{\Hypertarget{vmci__qpair_8c_source_l00229}00229                 \textcolor{keywordflow}{return} (\mbox{\hyperlink{vmci__defs_8h_a8ab0ddbd99d8d5d8f1ed882d0f5de1a3}{VMCI\_ERROR\_INVALID\_ARGS}});}
\DoxyCodeLine{\Hypertarget{vmci__qpair_8c_source_l00230}00230 }
\DoxyCodeLine{\Hypertarget{vmci__qpair_8c_source_l00231}00231         old\_qpair = *qpair;}
\DoxyCodeLine{\Hypertarget{vmci__qpair_8c_source_l00232}00232         result = \mbox{\hyperlink{vmci__queue__pair_8c_a678674228239ebc65cd13d7843626f34}{vmci\_queue\_pair\_detach}}(old\_qpair-\/>\mbox{\hyperlink{structvmci__qpair_a8bc22cffc49e8abf2897cf7f926cf3a9}{handle}});}
\DoxyCodeLine{\Hypertarget{vmci__qpair_8c_source_l00233}00233 }
\DoxyCodeLine{\Hypertarget{vmci__qpair_8c_source_l00234}00234         \textcolor{comment}{/*}}
\DoxyCodeLine{\Hypertarget{vmci__qpair_8c_source_l00235}00235 \textcolor{comment}{         * The guest can fail to detach for a number of reasons, and if it does}}
\DoxyCodeLine{\Hypertarget{vmci__qpair_8c_source_l00236}00236 \textcolor{comment}{         * so, it will cleanup the entry (if there is one). We need to release}}
\DoxyCodeLine{\Hypertarget{vmci__qpair_8c_source_l00237}00237 \textcolor{comment}{         * the qpair struct here; there isn't much the caller can do, and we}}
\DoxyCodeLine{\Hypertarget{vmci__qpair_8c_source_l00238}00238 \textcolor{comment}{         * don't want to leak.}}
\DoxyCodeLine{\Hypertarget{vmci__qpair_8c_source_l00239}00239 \textcolor{comment}{         */}}
\DoxyCodeLine{\Hypertarget{vmci__qpair_8c_source_l00240}00240 }
\DoxyCodeLine{\Hypertarget{vmci__qpair_8c_source_l00241}00241         \textcolor{keywordflow}{if} (old\_qpair-\/>\mbox{\hyperlink{structvmci__qpair_a3d3cb556674e0bde8fe0eab5bf44aed1}{flags}} \& \mbox{\hyperlink{vmci__call__defs_8h_aab54e7f4a3a42514927699ba50c72096}{VMCI\_QPFLAG\_LOCAL}})}
\DoxyCodeLine{\Hypertarget{vmci__qpair_8c_source_l00242}00242                 \mbox{\hyperlink{vmci__kernel__if_8c_aed39a0a67dbe6968314b31c2e8d53064}{vmci\_destroy\_event}}(\&old\_qpair-\/>\mbox{\hyperlink{structvmci__qpair_a0a212271251e02a2d111be643f003c14}{event}});}
\DoxyCodeLine{\Hypertarget{vmci__qpair_8c_source_l00243}00243 }
\DoxyCodeLine{\Hypertarget{vmci__qpair_8c_source_l00244}00244         \mbox{\hyperlink{vmci__kernel__if_8c_ac55ceaf5f269d5ffafd52e332cf8dbc4}{vmci\_free\_kernel\_mem}}(old\_qpair, \textcolor{keyword}{sizeof}(*old\_qpair));}
\DoxyCodeLine{\Hypertarget{vmci__qpair_8c_source_l00245}00245         *qpair = NULL;}
\DoxyCodeLine{\Hypertarget{vmci__qpair_8c_source_l00246}00246 }
\DoxyCodeLine{\Hypertarget{vmci__qpair_8c_source_l00247}00247         \textcolor{keywordflow}{return} (result);}
\DoxyCodeLine{\Hypertarget{vmci__qpair_8c_source_l00248}00248 \}}
\DoxyCodeLine{\Hypertarget{vmci__qpair_8c_source_l00249}00249 }
\DoxyCodeLine{\Hypertarget{vmci__qpair_8c_source_l00250}00250 \textcolor{comment}{/*}}
\DoxyCodeLine{\Hypertarget{vmci__qpair_8c_source_l00251}00251 \textcolor{comment}{ *-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/}}
\DoxyCodeLine{\Hypertarget{vmci__qpair_8c_source_l00252}00252 \textcolor{comment}{ *}}
\DoxyCodeLine{\Hypertarget{vmci__qpair_8c_source_l00253}00253 \textcolor{comment}{ * vmci\_qpair\_get\_produce\_indexes -\/-\/}}
\DoxyCodeLine{\Hypertarget{vmci__qpair_8c_source_l00254}00254 \textcolor{comment}{ *}}
\DoxyCodeLine{\Hypertarget{vmci__qpair_8c_source_l00255}00255 \textcolor{comment}{ *     This is the client interface for getting the current indexes of the}}
\DoxyCodeLine{\Hypertarget{vmci__qpair_8c_source_l00256}00256 \textcolor{comment}{ *     qpair from the point of the view of the caller as the producer.}}
\DoxyCodeLine{\Hypertarget{vmci__qpair_8c_source_l00257}00257 \textcolor{comment}{ *}}
\DoxyCodeLine{\Hypertarget{vmci__qpair_8c_source_l00258}00258 \textcolor{comment}{ * Results:}}
\DoxyCodeLine{\Hypertarget{vmci__qpair_8c_source_l00259}00259 \textcolor{comment}{ *     err, if < 0}}
\DoxyCodeLine{\Hypertarget{vmci__qpair_8c_source_l00260}00260 \textcolor{comment}{ *     Success otherwise.}}
\DoxyCodeLine{\Hypertarget{vmci__qpair_8c_source_l00261}00261 \textcolor{comment}{ *}}
\DoxyCodeLine{\Hypertarget{vmci__qpair_8c_source_l00262}00262 \textcolor{comment}{ * Side effects:}}
\DoxyCodeLine{\Hypertarget{vmci__qpair_8c_source_l00263}00263 \textcolor{comment}{ *     None.}}
\DoxyCodeLine{\Hypertarget{vmci__qpair_8c_source_l00264}00264 \textcolor{comment}{ *}}
\DoxyCodeLine{\Hypertarget{vmci__qpair_8c_source_l00265}00265 \textcolor{comment}{ *-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/}}
\DoxyCodeLine{\Hypertarget{vmci__qpair_8c_source_l00266}00266 \textcolor{comment}{ */}}
\DoxyCodeLine{\Hypertarget{vmci__qpair_8c_source_l00267}00267 }
\DoxyCodeLine{\Hypertarget{vmci__qpair_8c_source_l00268}00268 \textcolor{keywordtype}{int}}
\DoxyCodeLine{\Hypertarget{vmci__qpair_8c_source_l00269}\mbox{\hyperlink{vmci__kernel__api__1_8h_a6c32f85319732b9e271f65d24ff26df5}{00269}} \mbox{\hyperlink{vmci__qpair_8c_a6c32f85319732b9e271f65d24ff26df5}{vmci\_qpair\_get\_produce\_indexes}}(\textcolor{keyword}{const} \textcolor{keyword}{struct} \mbox{\hyperlink{structvmci__qpair}{vmci\_qpair}} *qpair,}
\DoxyCodeLine{\Hypertarget{vmci__qpair_8c_source_l00270}00270     uint64\_t *producer\_tail, uint64\_t *consumer\_head)}
\DoxyCodeLine{\Hypertarget{vmci__qpair_8c_source_l00271}00271 \{}
\DoxyCodeLine{\Hypertarget{vmci__qpair_8c_source_l00272}00272         \textcolor{keyword}{struct }\mbox{\hyperlink{structvmci__queue__header}{vmci\_queue\_header}} *consume\_q\_header;}
\DoxyCodeLine{\Hypertarget{vmci__qpair_8c_source_l00273}00273         \textcolor{keyword}{struct }\mbox{\hyperlink{structvmci__queue__header}{vmci\_queue\_header}} *produce\_q\_header;}
\DoxyCodeLine{\Hypertarget{vmci__qpair_8c_source_l00274}00274 }
\DoxyCodeLine{\Hypertarget{vmci__qpair_8c_source_l00275}00275         \textcolor{keywordflow}{if} (!qpair)}
\DoxyCodeLine{\Hypertarget{vmci__qpair_8c_source_l00276}00276                 \textcolor{keywordflow}{return} (\mbox{\hyperlink{vmci__defs_8h_a8ab0ddbd99d8d5d8f1ed882d0f5de1a3}{VMCI\_ERROR\_INVALID\_ARGS}});}
\DoxyCodeLine{\Hypertarget{vmci__qpair_8c_source_l00277}00277 }
\DoxyCodeLine{\Hypertarget{vmci__qpair_8c_source_l00278}00278         \mbox{\hyperlink{vmci__qpair_8c_aefa3196a67fd9fa0bf175a742e798ff3}{vmci\_qpair\_get\_queue\_headers}}(qpair, \&produce\_q\_header,}
\DoxyCodeLine{\Hypertarget{vmci__qpair_8c_source_l00279}00279             \&consume\_q\_header);}
\DoxyCodeLine{\Hypertarget{vmci__qpair_8c_source_l00280}00280         \mbox{\hyperlink{vmci__defs_8h_a1082b4a20334849ace234e3e41d6bcaf}{vmci\_queue\_header\_get\_pointers}}(produce\_q\_header, consume\_q\_header,}
\DoxyCodeLine{\Hypertarget{vmci__qpair_8c_source_l00281}00281             \mbox{\hyperlink{structvmci__queue__header_a233f154d616a5bfcf096222951de719e}{producer\_tail}}, \mbox{\hyperlink{structvmci__queue__header_a28f358aee98fca466d98b53a20ab7154}{consumer\_head}});}
\DoxyCodeLine{\Hypertarget{vmci__qpair_8c_source_l00282}00282 }
\DoxyCodeLine{\Hypertarget{vmci__qpair_8c_source_l00283}00283         \textcolor{keywordflow}{if} ((\mbox{\hyperlink{structvmci__queue__header_a233f154d616a5bfcf096222951de719e}{producer\_tail}} \&\& *\mbox{\hyperlink{structvmci__queue__header_a233f154d616a5bfcf096222951de719e}{producer\_tail}} >= qpair-\/>\mbox{\hyperlink{structvmci__qpair_a95ae83459b248c68fedf40b01db29606}{produce\_q\_size}}) ||}
\DoxyCodeLine{\Hypertarget{vmci__qpair_8c_source_l00284}00284             (\mbox{\hyperlink{structvmci__queue__header_a28f358aee98fca466d98b53a20ab7154}{consumer\_head}} \&\& *\mbox{\hyperlink{structvmci__queue__header_a28f358aee98fca466d98b53a20ab7154}{consumer\_head}} >= qpair-\/>\mbox{\hyperlink{structvmci__qpair_a95ae83459b248c68fedf40b01db29606}{produce\_q\_size}}))}
\DoxyCodeLine{\Hypertarget{vmci__qpair_8c_source_l00285}00285                 \textcolor{keywordflow}{return} (\mbox{\hyperlink{vmci__defs_8h_a5aee129bd97ec2ef6552b05a60e0fa92}{VMCI\_ERROR\_INVALID\_SIZE}});}
\DoxyCodeLine{\Hypertarget{vmci__qpair_8c_source_l00286}00286 }
\DoxyCodeLine{\Hypertarget{vmci__qpair_8c_source_l00287}00287         \textcolor{keywordflow}{return} (\mbox{\hyperlink{vmci__defs_8h_ab286f495fff827d2718453f2968a6899}{VMCI\_SUCCESS}});}
\DoxyCodeLine{\Hypertarget{vmci__qpair_8c_source_l00288}00288 \}}
\DoxyCodeLine{\Hypertarget{vmci__qpair_8c_source_l00289}00289 }
\DoxyCodeLine{\Hypertarget{vmci__qpair_8c_source_l00290}00290 \textcolor{comment}{/*}}
\DoxyCodeLine{\Hypertarget{vmci__qpair_8c_source_l00291}00291 \textcolor{comment}{ *-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/}}
\DoxyCodeLine{\Hypertarget{vmci__qpair_8c_source_l00292}00292 \textcolor{comment}{ *}}
\DoxyCodeLine{\Hypertarget{vmci__qpair_8c_source_l00293}00293 \textcolor{comment}{ * vmci\_qpair\_get\_consume\_indexes -\/-\/}}
\DoxyCodeLine{\Hypertarget{vmci__qpair_8c_source_l00294}00294 \textcolor{comment}{ *}}
\DoxyCodeLine{\Hypertarget{vmci__qpair_8c_source_l00295}00295 \textcolor{comment}{ *     This is the client interface for getting the current indexes of the}}
\DoxyCodeLine{\Hypertarget{vmci__qpair_8c_source_l00296}00296 \textcolor{comment}{ *     QPair from the point of the view of the caller as the consumer.}}
\DoxyCodeLine{\Hypertarget{vmci__qpair_8c_source_l00297}00297 \textcolor{comment}{ *}}
\DoxyCodeLine{\Hypertarget{vmci__qpair_8c_source_l00298}00298 \textcolor{comment}{ * Results:}}
\DoxyCodeLine{\Hypertarget{vmci__qpair_8c_source_l00299}00299 \textcolor{comment}{ *     err, if < 0}}
\DoxyCodeLine{\Hypertarget{vmci__qpair_8c_source_l00300}00300 \textcolor{comment}{ *     Success otherwise.}}
\DoxyCodeLine{\Hypertarget{vmci__qpair_8c_source_l00301}00301 \textcolor{comment}{ *}}
\DoxyCodeLine{\Hypertarget{vmci__qpair_8c_source_l00302}00302 \textcolor{comment}{ * Side effects:}}
\DoxyCodeLine{\Hypertarget{vmci__qpair_8c_source_l00303}00303 \textcolor{comment}{ *     None.}}
\DoxyCodeLine{\Hypertarget{vmci__qpair_8c_source_l00304}00304 \textcolor{comment}{ *}}
\DoxyCodeLine{\Hypertarget{vmci__qpair_8c_source_l00305}00305 \textcolor{comment}{ *-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/}}
\DoxyCodeLine{\Hypertarget{vmci__qpair_8c_source_l00306}00306 \textcolor{comment}{ */}}
\DoxyCodeLine{\Hypertarget{vmci__qpair_8c_source_l00307}00307 }
\DoxyCodeLine{\Hypertarget{vmci__qpair_8c_source_l00308}00308 \textcolor{keywordtype}{int}}
\DoxyCodeLine{\Hypertarget{vmci__qpair_8c_source_l00309}\mbox{\hyperlink{vmci__kernel__api__1_8h_a80b261b772b168cda49050f4994864cd}{00309}} \mbox{\hyperlink{vmci__qpair_8c_a80b261b772b168cda49050f4994864cd}{vmci\_qpair\_get\_consume\_indexes}}(\textcolor{keyword}{const} \textcolor{keyword}{struct} \mbox{\hyperlink{structvmci__qpair}{vmci\_qpair}} *qpair,}
\DoxyCodeLine{\Hypertarget{vmci__qpair_8c_source_l00310}00310     uint64\_t *consumer\_tail, uint64\_t *producer\_head)}
\DoxyCodeLine{\Hypertarget{vmci__qpair_8c_source_l00311}00311 \{}
\DoxyCodeLine{\Hypertarget{vmci__qpair_8c_source_l00312}00312         \textcolor{keyword}{struct }\mbox{\hyperlink{structvmci__queue__header}{vmci\_queue\_header}} *consume\_q\_header;}
\DoxyCodeLine{\Hypertarget{vmci__qpair_8c_source_l00313}00313         \textcolor{keyword}{struct }\mbox{\hyperlink{structvmci__queue__header}{vmci\_queue\_header}} *produce\_q\_header;}
\DoxyCodeLine{\Hypertarget{vmci__qpair_8c_source_l00314}00314 }
\DoxyCodeLine{\Hypertarget{vmci__qpair_8c_source_l00315}00315         \textcolor{keywordflow}{if} (!qpair)}
\DoxyCodeLine{\Hypertarget{vmci__qpair_8c_source_l00316}00316                 \textcolor{keywordflow}{return} (\mbox{\hyperlink{vmci__defs_8h_a8ab0ddbd99d8d5d8f1ed882d0f5de1a3}{VMCI\_ERROR\_INVALID\_ARGS}});}
\DoxyCodeLine{\Hypertarget{vmci__qpair_8c_source_l00317}00317 }
\DoxyCodeLine{\Hypertarget{vmci__qpair_8c_source_l00318}00318         \mbox{\hyperlink{vmci__qpair_8c_aefa3196a67fd9fa0bf175a742e798ff3}{vmci\_qpair\_get\_queue\_headers}}(qpair, \&produce\_q\_header,}
\DoxyCodeLine{\Hypertarget{vmci__qpair_8c_source_l00319}00319             \&consume\_q\_header);}
\DoxyCodeLine{\Hypertarget{vmci__qpair_8c_source_l00320}00320         \mbox{\hyperlink{vmci__defs_8h_a1082b4a20334849ace234e3e41d6bcaf}{vmci\_queue\_header\_get\_pointers}}(consume\_q\_header, produce\_q\_header,}
\DoxyCodeLine{\Hypertarget{vmci__qpair_8c_source_l00321}00321             consumer\_tail, producer\_head);}
\DoxyCodeLine{\Hypertarget{vmci__qpair_8c_source_l00322}00322 }
\DoxyCodeLine{\Hypertarget{vmci__qpair_8c_source_l00323}00323         \textcolor{keywordflow}{if} ((consumer\_tail \&\& *consumer\_tail >= qpair-\/>\mbox{\hyperlink{structvmci__qpair_a56142b46ce41d691cb33f2861ffff963}{consume\_q\_size}}) ||}
\DoxyCodeLine{\Hypertarget{vmci__qpair_8c_source_l00324}00324             (producer\_head \&\& *producer\_head >= qpair-\/>\mbox{\hyperlink{structvmci__qpair_a56142b46ce41d691cb33f2861ffff963}{consume\_q\_size}}))}
\DoxyCodeLine{\Hypertarget{vmci__qpair_8c_source_l00325}00325                 \textcolor{keywordflow}{return} (\mbox{\hyperlink{vmci__defs_8h_a5aee129bd97ec2ef6552b05a60e0fa92}{VMCI\_ERROR\_INVALID\_SIZE}});}
\DoxyCodeLine{\Hypertarget{vmci__qpair_8c_source_l00326}00326 }
\DoxyCodeLine{\Hypertarget{vmci__qpair_8c_source_l00327}00327         \textcolor{keywordflow}{return} (\mbox{\hyperlink{vmci__defs_8h_ab286f495fff827d2718453f2968a6899}{VMCI\_SUCCESS}});}
\DoxyCodeLine{\Hypertarget{vmci__qpair_8c_source_l00328}00328 \}}
\DoxyCodeLine{\Hypertarget{vmci__qpair_8c_source_l00329}00329 }
\DoxyCodeLine{\Hypertarget{vmci__qpair_8c_source_l00330}00330 \textcolor{comment}{/*}}
\DoxyCodeLine{\Hypertarget{vmci__qpair_8c_source_l00331}00331 \textcolor{comment}{ *-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/}}
\DoxyCodeLine{\Hypertarget{vmci__qpair_8c_source_l00332}00332 \textcolor{comment}{ *}}
\DoxyCodeLine{\Hypertarget{vmci__qpair_8c_source_l00333}00333 \textcolor{comment}{ * vmci\_qpair\_produce\_free\_space -\/-\/}}
\DoxyCodeLine{\Hypertarget{vmci__qpair_8c_source_l00334}00334 \textcolor{comment}{ *}}
\DoxyCodeLine{\Hypertarget{vmci__qpair_8c_source_l00335}00335 \textcolor{comment}{ *     This is the client interface for getting the amount of free space in the}}
\DoxyCodeLine{\Hypertarget{vmci__qpair_8c_source_l00336}00336 \textcolor{comment}{ *     QPair from the point of the view of the caller as the producer which is}}
\DoxyCodeLine{\Hypertarget{vmci__qpair_8c_source_l00337}00337 \textcolor{comment}{ *     the common case.}}
\DoxyCodeLine{\Hypertarget{vmci__qpair_8c_source_l00338}00338 \textcolor{comment}{ *}}
\DoxyCodeLine{\Hypertarget{vmci__qpair_8c_source_l00339}00339 \textcolor{comment}{ * Results:}}
\DoxyCodeLine{\Hypertarget{vmci__qpair_8c_source_l00340}00340 \textcolor{comment}{ *     Err, if < 0.}}
\DoxyCodeLine{\Hypertarget{vmci__qpair_8c_source_l00341}00341 \textcolor{comment}{ *     Full queue if = 0.}}
\DoxyCodeLine{\Hypertarget{vmci__qpair_8c_source_l00342}00342 \textcolor{comment}{ *     Number of available bytes into which data can be enqueued if > 0.}}
\DoxyCodeLine{\Hypertarget{vmci__qpair_8c_source_l00343}00343 \textcolor{comment}{ *}}
\DoxyCodeLine{\Hypertarget{vmci__qpair_8c_source_l00344}00344 \textcolor{comment}{ * Side effects:}}
\DoxyCodeLine{\Hypertarget{vmci__qpair_8c_source_l00345}00345 \textcolor{comment}{ *     None.}}
\DoxyCodeLine{\Hypertarget{vmci__qpair_8c_source_l00346}00346 \textcolor{comment}{ *}}
\DoxyCodeLine{\Hypertarget{vmci__qpair_8c_source_l00347}00347 \textcolor{comment}{ *-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/}}
\DoxyCodeLine{\Hypertarget{vmci__qpair_8c_source_l00348}00348 \textcolor{comment}{ */}}
\DoxyCodeLine{\Hypertarget{vmci__qpair_8c_source_l00349}00349 }
\DoxyCodeLine{\Hypertarget{vmci__qpair_8c_source_l00350}00350 int64\_t}
\DoxyCodeLine{\Hypertarget{vmci__qpair_8c_source_l00351}\mbox{\hyperlink{vmci__kernel__api__1_8h_aa74d86f88b7cc18b3b01dde5382ca429}{00351}} \mbox{\hyperlink{vmci__qpair_8c_aa74d86f88b7cc18b3b01dde5382ca429}{vmci\_qpair\_produce\_free\_space}}(\textcolor{keyword}{const} \textcolor{keyword}{struct} \mbox{\hyperlink{structvmci__qpair}{vmci\_qpair}} *qpair)}
\DoxyCodeLine{\Hypertarget{vmci__qpair_8c_source_l00352}00352 \{}
\DoxyCodeLine{\Hypertarget{vmci__qpair_8c_source_l00353}00353         \textcolor{keyword}{struct }\mbox{\hyperlink{structvmci__queue__header}{vmci\_queue\_header}} *consume\_q\_header;}
\DoxyCodeLine{\Hypertarget{vmci__qpair_8c_source_l00354}00354         \textcolor{keyword}{struct }\mbox{\hyperlink{structvmci__queue__header}{vmci\_queue\_header}} *produce\_q\_header;}
\DoxyCodeLine{\Hypertarget{vmci__qpair_8c_source_l00355}00355         int64\_t result;}
\DoxyCodeLine{\Hypertarget{vmci__qpair_8c_source_l00356}00356 }
\DoxyCodeLine{\Hypertarget{vmci__qpair_8c_source_l00357}00357         \textcolor{keywordflow}{if} (!qpair)}
\DoxyCodeLine{\Hypertarget{vmci__qpair_8c_source_l00358}00358                 \textcolor{keywordflow}{return} (\mbox{\hyperlink{vmci__defs_8h_a8ab0ddbd99d8d5d8f1ed882d0f5de1a3}{VMCI\_ERROR\_INVALID\_ARGS}});}
\DoxyCodeLine{\Hypertarget{vmci__qpair_8c_source_l00359}00359 }
\DoxyCodeLine{\Hypertarget{vmci__qpair_8c_source_l00360}00360         \mbox{\hyperlink{vmci__qpair_8c_aefa3196a67fd9fa0bf175a742e798ff3}{vmci\_qpair\_get\_queue\_headers}}(qpair, \&produce\_q\_header,}
\DoxyCodeLine{\Hypertarget{vmci__qpair_8c_source_l00361}00361             \&consume\_q\_header);}
\DoxyCodeLine{\Hypertarget{vmci__qpair_8c_source_l00362}00362         result = \mbox{\hyperlink{vmci__defs_8h_ac484e6a1a83f1f30ad28d9fc807b91c2}{vmci\_queue\_header\_free\_space}}(produce\_q\_header, consume\_q\_header,}
\DoxyCodeLine{\Hypertarget{vmci__qpair_8c_source_l00363}00363             qpair-\/>\mbox{\hyperlink{structvmci__qpair_a95ae83459b248c68fedf40b01db29606}{produce\_q\_size}});}
\DoxyCodeLine{\Hypertarget{vmci__qpair_8c_source_l00364}00364 }
\DoxyCodeLine{\Hypertarget{vmci__qpair_8c_source_l00365}00365         \textcolor{keywordflow}{return} (result);}
\DoxyCodeLine{\Hypertarget{vmci__qpair_8c_source_l00366}00366 \}}
\DoxyCodeLine{\Hypertarget{vmci__qpair_8c_source_l00367}00367 }
\DoxyCodeLine{\Hypertarget{vmci__qpair_8c_source_l00368}00368 \textcolor{comment}{/*}}
\DoxyCodeLine{\Hypertarget{vmci__qpair_8c_source_l00369}00369 \textcolor{comment}{ *-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/}}
\DoxyCodeLine{\Hypertarget{vmci__qpair_8c_source_l00370}00370 \textcolor{comment}{ *}}
\DoxyCodeLine{\Hypertarget{vmci__qpair_8c_source_l00371}00371 \textcolor{comment}{ * vmci\_qpair\_consume\_free\_space -\/-\/}}
\DoxyCodeLine{\Hypertarget{vmci__qpair_8c_source_l00372}00372 \textcolor{comment}{ *}}
\DoxyCodeLine{\Hypertarget{vmci__qpair_8c_source_l00373}00373 \textcolor{comment}{ *     This is the client interface for getting the amount of free space in the}}
\DoxyCodeLine{\Hypertarget{vmci__qpair_8c_source_l00374}00374 \textcolor{comment}{ *     QPair from the point of the view of the caller as the consumer which is}}
\DoxyCodeLine{\Hypertarget{vmci__qpair_8c_source_l00375}00375 \textcolor{comment}{ *     not the common case (see vmci\_qpair\_Produce\_free\_space(), above).}}
\DoxyCodeLine{\Hypertarget{vmci__qpair_8c_source_l00376}00376 \textcolor{comment}{ *}}
\DoxyCodeLine{\Hypertarget{vmci__qpair_8c_source_l00377}00377 \textcolor{comment}{ * Results:}}
\DoxyCodeLine{\Hypertarget{vmci__qpair_8c_source_l00378}00378 \textcolor{comment}{ *     Err, if < 0.}}
\DoxyCodeLine{\Hypertarget{vmci__qpair_8c_source_l00379}00379 \textcolor{comment}{ *     Full queue if = 0.}}
\DoxyCodeLine{\Hypertarget{vmci__qpair_8c_source_l00380}00380 \textcolor{comment}{ *     Number of available bytes into which data can be enqueued if > 0.}}
\DoxyCodeLine{\Hypertarget{vmci__qpair_8c_source_l00381}00381 \textcolor{comment}{ *}}
\DoxyCodeLine{\Hypertarget{vmci__qpair_8c_source_l00382}00382 \textcolor{comment}{ * Side effects:}}
\DoxyCodeLine{\Hypertarget{vmci__qpair_8c_source_l00383}00383 \textcolor{comment}{ *     None.}}
\DoxyCodeLine{\Hypertarget{vmci__qpair_8c_source_l00384}00384 \textcolor{comment}{ *}}
\DoxyCodeLine{\Hypertarget{vmci__qpair_8c_source_l00385}00385 \textcolor{comment}{ *-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/}}
\DoxyCodeLine{\Hypertarget{vmci__qpair_8c_source_l00386}00386 \textcolor{comment}{ */}}
\DoxyCodeLine{\Hypertarget{vmci__qpair_8c_source_l00387}00387 }
\DoxyCodeLine{\Hypertarget{vmci__qpair_8c_source_l00388}00388 int64\_t}
\DoxyCodeLine{\Hypertarget{vmci__qpair_8c_source_l00389}\mbox{\hyperlink{vmci__kernel__api__1_8h_a52068453835385172dfde1d0fbdcc4e9}{00389}} \mbox{\hyperlink{vmci__qpair_8c_a52068453835385172dfde1d0fbdcc4e9}{vmci\_qpair\_consume\_free\_space}}(\textcolor{keyword}{const} \textcolor{keyword}{struct} \mbox{\hyperlink{structvmci__qpair}{vmci\_qpair}} *qpair)}
\DoxyCodeLine{\Hypertarget{vmci__qpair_8c_source_l00390}00390 \{}
\DoxyCodeLine{\Hypertarget{vmci__qpair_8c_source_l00391}00391         \textcolor{keyword}{struct }\mbox{\hyperlink{structvmci__queue__header}{vmci\_queue\_header}} *consume\_q\_header;}
\DoxyCodeLine{\Hypertarget{vmci__qpair_8c_source_l00392}00392         \textcolor{keyword}{struct }\mbox{\hyperlink{structvmci__queue__header}{vmci\_queue\_header}} *produce\_q\_header;}
\DoxyCodeLine{\Hypertarget{vmci__qpair_8c_source_l00393}00393         int64\_t result;}
\DoxyCodeLine{\Hypertarget{vmci__qpair_8c_source_l00394}00394 }
\DoxyCodeLine{\Hypertarget{vmci__qpair_8c_source_l00395}00395         \textcolor{keywordflow}{if} (!qpair)}
\DoxyCodeLine{\Hypertarget{vmci__qpair_8c_source_l00396}00396                 \textcolor{keywordflow}{return} (\mbox{\hyperlink{vmci__defs_8h_a8ab0ddbd99d8d5d8f1ed882d0f5de1a3}{VMCI\_ERROR\_INVALID\_ARGS}});}
\DoxyCodeLine{\Hypertarget{vmci__qpair_8c_source_l00397}00397 }
\DoxyCodeLine{\Hypertarget{vmci__qpair_8c_source_l00398}00398         \mbox{\hyperlink{vmci__qpair_8c_aefa3196a67fd9fa0bf175a742e798ff3}{vmci\_qpair\_get\_queue\_headers}}(qpair, \&produce\_q\_header,}
\DoxyCodeLine{\Hypertarget{vmci__qpair_8c_source_l00399}00399             \&consume\_q\_header);}
\DoxyCodeLine{\Hypertarget{vmci__qpair_8c_source_l00400}00400         result = \mbox{\hyperlink{vmci__defs_8h_ac484e6a1a83f1f30ad28d9fc807b91c2}{vmci\_queue\_header\_free\_space}}(consume\_q\_header, produce\_q\_header,}
\DoxyCodeLine{\Hypertarget{vmci__qpair_8c_source_l00401}00401             qpair-\/>\mbox{\hyperlink{structvmci__qpair_a56142b46ce41d691cb33f2861ffff963}{consume\_q\_size}});}
\DoxyCodeLine{\Hypertarget{vmci__qpair_8c_source_l00402}00402 }
\DoxyCodeLine{\Hypertarget{vmci__qpair_8c_source_l00403}00403         \textcolor{keywordflow}{return} (result);}
\DoxyCodeLine{\Hypertarget{vmci__qpair_8c_source_l00404}00404 \}}
\DoxyCodeLine{\Hypertarget{vmci__qpair_8c_source_l00405}00405 }
\DoxyCodeLine{\Hypertarget{vmci__qpair_8c_source_l00406}00406 \textcolor{comment}{/*}}
\DoxyCodeLine{\Hypertarget{vmci__qpair_8c_source_l00407}00407 \textcolor{comment}{ *-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/}}
\DoxyCodeLine{\Hypertarget{vmci__qpair_8c_source_l00408}00408 \textcolor{comment}{ *}}
\DoxyCodeLine{\Hypertarget{vmci__qpair_8c_source_l00409}00409 \textcolor{comment}{ * vmci\_qpair\_produce\_buf\_ready -\/-\/}}
\DoxyCodeLine{\Hypertarget{vmci__qpair_8c_source_l00410}00410 \textcolor{comment}{ *}}
\DoxyCodeLine{\Hypertarget{vmci__qpair_8c_source_l00411}00411 \textcolor{comment}{ *     This is the client interface for getting the amount of enqueued data in}}
\DoxyCodeLine{\Hypertarget{vmci__qpair_8c_source_l00412}00412 \textcolor{comment}{ *     the QPair from the point of the view of the caller as the producer which}}
\DoxyCodeLine{\Hypertarget{vmci__qpair_8c_source_l00413}00413 \textcolor{comment}{ *     is not the common case (see vmci\_qpair\_Consume\_buf\_ready(), above).}}
\DoxyCodeLine{\Hypertarget{vmci__qpair_8c_source_l00414}00414 \textcolor{comment}{ *}}
\DoxyCodeLine{\Hypertarget{vmci__qpair_8c_source_l00415}00415 \textcolor{comment}{ * Results:}}
\DoxyCodeLine{\Hypertarget{vmci__qpair_8c_source_l00416}00416 \textcolor{comment}{ *     Err, if < 0.}}
\DoxyCodeLine{\Hypertarget{vmci__qpair_8c_source_l00417}00417 \textcolor{comment}{ *     Empty queue if = 0.}}
\DoxyCodeLine{\Hypertarget{vmci__qpair_8c_source_l00418}00418 \textcolor{comment}{ *     Number of bytes ready to be dequeued if > 0.}}
\DoxyCodeLine{\Hypertarget{vmci__qpair_8c_source_l00419}00419 \textcolor{comment}{ *}}
\DoxyCodeLine{\Hypertarget{vmci__qpair_8c_source_l00420}00420 \textcolor{comment}{ * Side effects:}}
\DoxyCodeLine{\Hypertarget{vmci__qpair_8c_source_l00421}00421 \textcolor{comment}{ *     None.}}
\DoxyCodeLine{\Hypertarget{vmci__qpair_8c_source_l00422}00422 \textcolor{comment}{ *}}
\DoxyCodeLine{\Hypertarget{vmci__qpair_8c_source_l00423}00423 \textcolor{comment}{ *-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/}}
\DoxyCodeLine{\Hypertarget{vmci__qpair_8c_source_l00424}00424 \textcolor{comment}{ */}}
\DoxyCodeLine{\Hypertarget{vmci__qpair_8c_source_l00425}00425 }
\DoxyCodeLine{\Hypertarget{vmci__qpair_8c_source_l00426}00426 int64\_t}
\DoxyCodeLine{\Hypertarget{vmci__qpair_8c_source_l00427}\mbox{\hyperlink{vmci__kernel__api__1_8h_afd0d1274e0d1f07c525877d41efc7a83}{00427}} \mbox{\hyperlink{vmci__qpair_8c_afd0d1274e0d1f07c525877d41efc7a83}{vmci\_qpair\_produce\_buf\_ready}}(\textcolor{keyword}{const} \textcolor{keyword}{struct} \mbox{\hyperlink{structvmci__qpair}{vmci\_qpair}} *qpair)}
\DoxyCodeLine{\Hypertarget{vmci__qpair_8c_source_l00428}00428 \{}
\DoxyCodeLine{\Hypertarget{vmci__qpair_8c_source_l00429}00429         \textcolor{keyword}{struct }\mbox{\hyperlink{structvmci__queue__header}{vmci\_queue\_header}} *consume\_q\_header;}
\DoxyCodeLine{\Hypertarget{vmci__qpair_8c_source_l00430}00430         \textcolor{keyword}{struct }\mbox{\hyperlink{structvmci__queue__header}{vmci\_queue\_header}} *produce\_q\_header;}
\DoxyCodeLine{\Hypertarget{vmci__qpair_8c_source_l00431}00431         int64\_t result;}
\DoxyCodeLine{\Hypertarget{vmci__qpair_8c_source_l00432}00432 }
\DoxyCodeLine{\Hypertarget{vmci__qpair_8c_source_l00433}00433         \textcolor{keywordflow}{if} (!qpair)}
\DoxyCodeLine{\Hypertarget{vmci__qpair_8c_source_l00434}00434                 \textcolor{keywordflow}{return} (\mbox{\hyperlink{vmci__defs_8h_a8ab0ddbd99d8d5d8f1ed882d0f5de1a3}{VMCI\_ERROR\_INVALID\_ARGS}});}
\DoxyCodeLine{\Hypertarget{vmci__qpair_8c_source_l00435}00435 }
\DoxyCodeLine{\Hypertarget{vmci__qpair_8c_source_l00436}00436         \mbox{\hyperlink{vmci__qpair_8c_aefa3196a67fd9fa0bf175a742e798ff3}{vmci\_qpair\_get\_queue\_headers}}(qpair, \&produce\_q\_header,}
\DoxyCodeLine{\Hypertarget{vmci__qpair_8c_source_l00437}00437             \&consume\_q\_header);}
\DoxyCodeLine{\Hypertarget{vmci__qpair_8c_source_l00438}00438         result = \mbox{\hyperlink{vmci__defs_8h_aa008c4d79b50b91ac92f79e0567f6435}{vmci\_queue\_header\_buf\_ready}}(produce\_q\_header, consume\_q\_header,}
\DoxyCodeLine{\Hypertarget{vmci__qpair_8c_source_l00439}00439             qpair-\/>\mbox{\hyperlink{structvmci__qpair_a95ae83459b248c68fedf40b01db29606}{produce\_q\_size}});}
\DoxyCodeLine{\Hypertarget{vmci__qpair_8c_source_l00440}00440 }
\DoxyCodeLine{\Hypertarget{vmci__qpair_8c_source_l00441}00441         \textcolor{keywordflow}{return} (result);}
\DoxyCodeLine{\Hypertarget{vmci__qpair_8c_source_l00442}00442 \}}
\DoxyCodeLine{\Hypertarget{vmci__qpair_8c_source_l00443}00443 }
\DoxyCodeLine{\Hypertarget{vmci__qpair_8c_source_l00444}00444 \textcolor{comment}{/*}}
\DoxyCodeLine{\Hypertarget{vmci__qpair_8c_source_l00445}00445 \textcolor{comment}{ *-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/}}
\DoxyCodeLine{\Hypertarget{vmci__qpair_8c_source_l00446}00446 \textcolor{comment}{ *}}
\DoxyCodeLine{\Hypertarget{vmci__qpair_8c_source_l00447}00447 \textcolor{comment}{ * vmci\_qpair\_consume\_buf\_ready -\/-\/}}
\DoxyCodeLine{\Hypertarget{vmci__qpair_8c_source_l00448}00448 \textcolor{comment}{ *}}
\DoxyCodeLine{\Hypertarget{vmci__qpair_8c_source_l00449}00449 \textcolor{comment}{ *     This is the client interface for getting the amount of enqueued data in}}
\DoxyCodeLine{\Hypertarget{vmci__qpair_8c_source_l00450}00450 \textcolor{comment}{ *     the QPair from the point of the view of the caller as the consumer which}}
\DoxyCodeLine{\Hypertarget{vmci__qpair_8c_source_l00451}00451 \textcolor{comment}{ *     is the normal case.}}
\DoxyCodeLine{\Hypertarget{vmci__qpair_8c_source_l00452}00452 \textcolor{comment}{ *}}
\DoxyCodeLine{\Hypertarget{vmci__qpair_8c_source_l00453}00453 \textcolor{comment}{ * Results:}}
\DoxyCodeLine{\Hypertarget{vmci__qpair_8c_source_l00454}00454 \textcolor{comment}{ *     Err, if < 0.}}
\DoxyCodeLine{\Hypertarget{vmci__qpair_8c_source_l00455}00455 \textcolor{comment}{ *     Empty queue if = 0.}}
\DoxyCodeLine{\Hypertarget{vmci__qpair_8c_source_l00456}00456 \textcolor{comment}{ *     Number of bytes ready to be dequeued if > 0.}}
\DoxyCodeLine{\Hypertarget{vmci__qpair_8c_source_l00457}00457 \textcolor{comment}{ *}}
\DoxyCodeLine{\Hypertarget{vmci__qpair_8c_source_l00458}00458 \textcolor{comment}{ * Side effects:}}
\DoxyCodeLine{\Hypertarget{vmci__qpair_8c_source_l00459}00459 \textcolor{comment}{ *     None.}}
\DoxyCodeLine{\Hypertarget{vmci__qpair_8c_source_l00460}00460 \textcolor{comment}{ *}}
\DoxyCodeLine{\Hypertarget{vmci__qpair_8c_source_l00461}00461 \textcolor{comment}{ *-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/}}
\DoxyCodeLine{\Hypertarget{vmci__qpair_8c_source_l00462}00462 \textcolor{comment}{ */}}
\DoxyCodeLine{\Hypertarget{vmci__qpair_8c_source_l00463}00463 }
\DoxyCodeLine{\Hypertarget{vmci__qpair_8c_source_l00464}00464 int64\_t}
\DoxyCodeLine{\Hypertarget{vmci__qpair_8c_source_l00465}\mbox{\hyperlink{vmci__kernel__api__1_8h_a498d3ca3942565e78ed8dd8cb95bfc23}{00465}} \mbox{\hyperlink{vmci__qpair_8c_a498d3ca3942565e78ed8dd8cb95bfc23}{vmci\_qpair\_consume\_buf\_ready}}(\textcolor{keyword}{const} \textcolor{keyword}{struct} \mbox{\hyperlink{structvmci__qpair}{vmci\_qpair}} *qpair)}
\DoxyCodeLine{\Hypertarget{vmci__qpair_8c_source_l00466}00466 \{}
\DoxyCodeLine{\Hypertarget{vmci__qpair_8c_source_l00467}00467         \textcolor{keyword}{struct }\mbox{\hyperlink{structvmci__queue__header}{vmci\_queue\_header}} *consume\_q\_header;}
\DoxyCodeLine{\Hypertarget{vmci__qpair_8c_source_l00468}00468         \textcolor{keyword}{struct }\mbox{\hyperlink{structvmci__queue__header}{vmci\_queue\_header}} *produce\_q\_header;}
\DoxyCodeLine{\Hypertarget{vmci__qpair_8c_source_l00469}00469         int64\_t result;}
\DoxyCodeLine{\Hypertarget{vmci__qpair_8c_source_l00470}00470 }
\DoxyCodeLine{\Hypertarget{vmci__qpair_8c_source_l00471}00471         \textcolor{keywordflow}{if} (!qpair)}
\DoxyCodeLine{\Hypertarget{vmci__qpair_8c_source_l00472}00472                 \textcolor{keywordflow}{return} (\mbox{\hyperlink{vmci__defs_8h_a8ab0ddbd99d8d5d8f1ed882d0f5de1a3}{VMCI\_ERROR\_INVALID\_ARGS}});}
\DoxyCodeLine{\Hypertarget{vmci__qpair_8c_source_l00473}00473 }
\DoxyCodeLine{\Hypertarget{vmci__qpair_8c_source_l00474}00474         \mbox{\hyperlink{vmci__qpair_8c_aefa3196a67fd9fa0bf175a742e798ff3}{vmci\_qpair\_get\_queue\_headers}}(qpair, \&produce\_q\_header,}
\DoxyCodeLine{\Hypertarget{vmci__qpair_8c_source_l00475}00475             \&consume\_q\_header);}
\DoxyCodeLine{\Hypertarget{vmci__qpair_8c_source_l00476}00476         result = \mbox{\hyperlink{vmci__defs_8h_aa008c4d79b50b91ac92f79e0567f6435}{vmci\_queue\_header\_buf\_ready}}(consume\_q\_header, produce\_q\_header,}
\DoxyCodeLine{\Hypertarget{vmci__qpair_8c_source_l00477}00477             qpair-\/>\mbox{\hyperlink{structvmci__qpair_a56142b46ce41d691cb33f2861ffff963}{consume\_q\_size}});}
\DoxyCodeLine{\Hypertarget{vmci__qpair_8c_source_l00478}00478 }
\DoxyCodeLine{\Hypertarget{vmci__qpair_8c_source_l00479}00479         \textcolor{keywordflow}{return} (result);}
\DoxyCodeLine{\Hypertarget{vmci__qpair_8c_source_l00480}00480 \}}
\DoxyCodeLine{\Hypertarget{vmci__qpair_8c_source_l00481}00481 }
\DoxyCodeLine{\Hypertarget{vmci__qpair_8c_source_l00482}00482 \textcolor{comment}{/*}}
\DoxyCodeLine{\Hypertarget{vmci__qpair_8c_source_l00483}00483 \textcolor{comment}{ *-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/}}
\DoxyCodeLine{\Hypertarget{vmci__qpair_8c_source_l00484}00484 \textcolor{comment}{ *}}
\DoxyCodeLine{\Hypertarget{vmci__qpair_8c_source_l00485}00485 \textcolor{comment}{ * enqueue -\/-\/}}
\DoxyCodeLine{\Hypertarget{vmci__qpair_8c_source_l00486}00486 \textcolor{comment}{ *}}
\DoxyCodeLine{\Hypertarget{vmci__qpair_8c_source_l00487}00487 \textcolor{comment}{ *     Enqueues a given buffer to the produce queue using the provided function.}}
\DoxyCodeLine{\Hypertarget{vmci__qpair_8c_source_l00488}00488 \textcolor{comment}{ *     As many bytes as possible (space available in the queue) are enqueued.}}
\DoxyCodeLine{\Hypertarget{vmci__qpair_8c_source_l00489}00489 \textcolor{comment}{ *}}
\DoxyCodeLine{\Hypertarget{vmci__qpair_8c_source_l00490}00490 \textcolor{comment}{ * Results:}}
\DoxyCodeLine{\Hypertarget{vmci__qpair_8c_source_l00491}00491 \textcolor{comment}{ *     VMCI\_ERROR\_QUEUEPAIR\_NOSPACE if no space was available to enqueue data.}}
\DoxyCodeLine{\Hypertarget{vmci__qpair_8c_source_l00492}00492 \textcolor{comment}{ *     VMCI\_ERROR\_INVALID\_SIZE, if any queue pointer is outside the queue}}
\DoxyCodeLine{\Hypertarget{vmci__qpair_8c_source_l00493}00493 \textcolor{comment}{ *     (as defined by the queue size).}}
\DoxyCodeLine{\Hypertarget{vmci__qpair_8c_source_l00494}00494 \textcolor{comment}{ *     VMCI\_ERROR\_INVALID\_ARGS, if an error occured when accessing the buffer.}}
\DoxyCodeLine{\Hypertarget{vmci__qpair_8c_source_l00495}00495 \textcolor{comment}{ *     VMCI\_ERROR\_QUEUEPAIR\_NOTATTACHED, if the queue pair pages aren't}}
\DoxyCodeLine{\Hypertarget{vmci__qpair_8c_source_l00496}00496 \textcolor{comment}{ *     available.}}
\DoxyCodeLine{\Hypertarget{vmci__qpair_8c_source_l00497}00497 \textcolor{comment}{ *     Otherwise, the number of bytes written to the queue is returned.}}
\DoxyCodeLine{\Hypertarget{vmci__qpair_8c_source_l00498}00498 \textcolor{comment}{ *}}
\DoxyCodeLine{\Hypertarget{vmci__qpair_8c_source_l00499}00499 \textcolor{comment}{ * Side effects:}}
\DoxyCodeLine{\Hypertarget{vmci__qpair_8c_source_l00500}00500 \textcolor{comment}{ *     Updates the tail pointer of the produce queue.}}
\DoxyCodeLine{\Hypertarget{vmci__qpair_8c_source_l00501}00501 \textcolor{comment}{ *}}
\DoxyCodeLine{\Hypertarget{vmci__qpair_8c_source_l00502}00502 \textcolor{comment}{ *-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/}}
\DoxyCodeLine{\Hypertarget{vmci__qpair_8c_source_l00503}00503 \textcolor{comment}{ */}}
\DoxyCodeLine{\Hypertarget{vmci__qpair_8c_source_l00504}00504 }
\DoxyCodeLine{\Hypertarget{vmci__qpair_8c_source_l00505}00505 \textcolor{keyword}{static} ssize\_t}
\DoxyCodeLine{\Hypertarget{vmci__qpair_8c_source_l00506}\mbox{\hyperlink{vmci__qpair_8c_a0690994eff0ef35e407c2d95b6d82b37}{00506}} \mbox{\hyperlink{vmci__qpair_8c_a0690994eff0ef35e407c2d95b6d82b37}{enqueue}}(\textcolor{keyword}{struct} \mbox{\hyperlink{structvmci__queue}{vmci\_queue}} *produce\_q, \textcolor{keyword}{struct} \mbox{\hyperlink{structvmci__queue}{vmci\_queue}} *consume\_q,}
\DoxyCodeLine{\Hypertarget{vmci__qpair_8c_source_l00507}00507     \textcolor{keyword}{const} uint64\_t produce\_q\_size, \textcolor{keyword}{const} \textcolor{keywordtype}{void} *buf, \textcolor{keywordtype}{size\_t} buf\_size,}
\DoxyCodeLine{\Hypertarget{vmci__qpair_8c_source_l00508}00508     \textcolor{keywordtype}{int} buf\_type, \mbox{\hyperlink{vmci__queue_8h_a6075c81cd1dab6583d5cf1d67334eb87}{vmci\_memcpy\_to\_queue\_func}} memcpy\_to\_queue, \textcolor{keywordtype}{bool} can\_block)}
\DoxyCodeLine{\Hypertarget{vmci__qpair_8c_source_l00509}00509 \{}
\DoxyCodeLine{\Hypertarget{vmci__qpair_8c_source_l00510}00510         ssize\_t result;}
\DoxyCodeLine{\Hypertarget{vmci__qpair_8c_source_l00511}00511         \textcolor{keywordtype}{size\_t} written;}
\DoxyCodeLine{\Hypertarget{vmci__qpair_8c_source_l00512}00512         int64\_t free\_space;}
\DoxyCodeLine{\Hypertarget{vmci__qpair_8c_source_l00513}00513         uint64\_t tail;}
\DoxyCodeLine{\Hypertarget{vmci__qpair_8c_source_l00514}00514 }
\DoxyCodeLine{\Hypertarget{vmci__qpair_8c_source_l00515}00515         \mbox{\hyperlink{vmci__kernel__defs_8h_a0966b817b229d48e5ffc7feab19a0be6}{ASSERT}}((produce\_q != NULL) \&\& (consume\_q != NULL));}
\DoxyCodeLine{\Hypertarget{vmci__qpair_8c_source_l00516}00516 }
\DoxyCodeLine{\Hypertarget{vmci__qpair_8c_source_l00517}00517         free\_space = \mbox{\hyperlink{vmci__defs_8h_ac484e6a1a83f1f30ad28d9fc807b91c2}{vmci\_queue\_header\_free\_space}}(produce\_q-\/>\mbox{\hyperlink{structvmci__queue_ad126179a724d9bfcb3eb2deac84d4576}{q\_header}},}
\DoxyCodeLine{\Hypertarget{vmci__qpair_8c_source_l00518}00518             consume\_q-\/>\mbox{\hyperlink{structvmci__queue_ad126179a724d9bfcb3eb2deac84d4576}{q\_header}},}
\DoxyCodeLine{\Hypertarget{vmci__qpair_8c_source_l00519}00519             produce\_q\_size);}
\DoxyCodeLine{\Hypertarget{vmci__qpair_8c_source_l00520}00520         \textcolor{keywordflow}{if} (free\_space == 0)}
\DoxyCodeLine{\Hypertarget{vmci__qpair_8c_source_l00521}00521                 \textcolor{keywordflow}{return} (\mbox{\hyperlink{vmci__defs_8h_acbaa1eaf39ab8287b8d455a4fafb6453}{VMCI\_ERROR\_QUEUEPAIR\_NOSPACE}});}
\DoxyCodeLine{\Hypertarget{vmci__qpair_8c_source_l00522}00522 }
\DoxyCodeLine{\Hypertarget{vmci__qpair_8c_source_l00523}00523         \textcolor{keywordflow}{if} (free\_space < \mbox{\hyperlink{vmci__defs_8h_ab286f495fff827d2718453f2968a6899}{VMCI\_SUCCESS}})}
\DoxyCodeLine{\Hypertarget{vmci__qpair_8c_source_l00524}00524                 \textcolor{keywordflow}{return} ((ssize\_t)free\_space);}
\DoxyCodeLine{\Hypertarget{vmci__qpair_8c_source_l00525}00525 }
\DoxyCodeLine{\Hypertarget{vmci__qpair_8c_source_l00526}00526         written = (size\_t)(free\_space > buf\_size ? buf\_size : free\_space);}
\DoxyCodeLine{\Hypertarget{vmci__qpair_8c_source_l00527}00527         tail = \mbox{\hyperlink{vmci__defs_8h_a6dbd5e811d334319581eedeedac16fcd}{vmci\_queue\_header\_producer\_tail}}(produce\_q-\/>\mbox{\hyperlink{structvmci__queue_ad126179a724d9bfcb3eb2deac84d4576}{q\_header}});}
\DoxyCodeLine{\Hypertarget{vmci__qpair_8c_source_l00528}00528         \textcolor{keywordflow}{if} (\mbox{\hyperlink{vmci__kernel__defs_8h_a11e3918ed1de5a8a6ff2acd535251eee}{LIKELY}}(tail + written < produce\_q\_size))}
\DoxyCodeLine{\Hypertarget{vmci__qpair_8c_source_l00529}00529                 result = memcpy\_to\_queue(produce\_q, tail, buf, 0, written,}
\DoxyCodeLine{\Hypertarget{vmci__qpair_8c_source_l00530}00530                     buf\_type, can\_block);}
\DoxyCodeLine{\Hypertarget{vmci__qpair_8c_source_l00531}00531         \textcolor{keywordflow}{else} \{}
\DoxyCodeLine{\Hypertarget{vmci__qpair_8c_source_l00532}00532                 \textcolor{comment}{/* Tail pointer wraps around. */}}
\DoxyCodeLine{\Hypertarget{vmci__qpair_8c_source_l00533}00533 }
\DoxyCodeLine{\Hypertarget{vmci__qpair_8c_source_l00534}00534                 \textcolor{keyword}{const} \textcolor{keywordtype}{size\_t} tmp = (size\_t)(produce\_q\_size -\/ tail);}
\DoxyCodeLine{\Hypertarget{vmci__qpair_8c_source_l00535}00535 }
\DoxyCodeLine{\Hypertarget{vmci__qpair_8c_source_l00536}00536                 result = memcpy\_to\_queue(produce\_q, tail, buf, 0, tmp, buf\_type,}
\DoxyCodeLine{\Hypertarget{vmci__qpair_8c_source_l00537}00537                     can\_block);}
\DoxyCodeLine{\Hypertarget{vmci__qpair_8c_source_l00538}00538                 \textcolor{keywordflow}{if} (result >= \mbox{\hyperlink{vmci__defs_8h_ab286f495fff827d2718453f2968a6899}{VMCI\_SUCCESS}})}
\DoxyCodeLine{\Hypertarget{vmci__qpair_8c_source_l00539}00539                         result = memcpy\_to\_queue(produce\_q, 0, buf, tmp,}
\DoxyCodeLine{\Hypertarget{vmci__qpair_8c_source_l00540}00540                             written -\/ tmp, buf\_type, can\_block);}
\DoxyCodeLine{\Hypertarget{vmci__qpair_8c_source_l00541}00541         \}}
\DoxyCodeLine{\Hypertarget{vmci__qpair_8c_source_l00542}00542 }
\DoxyCodeLine{\Hypertarget{vmci__qpair_8c_source_l00543}00543         \textcolor{keywordflow}{if} (result < \mbox{\hyperlink{vmci__defs_8h_ab286f495fff827d2718453f2968a6899}{VMCI\_SUCCESS}})}
\DoxyCodeLine{\Hypertarget{vmci__qpair_8c_source_l00544}00544                 \textcolor{keywordflow}{return} (result);}
\DoxyCodeLine{\Hypertarget{vmci__qpair_8c_source_l00545}00545 }
\DoxyCodeLine{\Hypertarget{vmci__qpair_8c_source_l00546}00546         result = \mbox{\hyperlink{vmci__qpair_8c_ac3485221df318cd1bdc92eeadf235228}{vmci\_queue\_add\_producer\_tail}}(produce\_q, written,}
\DoxyCodeLine{\Hypertarget{vmci__qpair_8c_source_l00547}00547             produce\_q\_size);}
\DoxyCodeLine{\Hypertarget{vmci__qpair_8c_source_l00548}00548         \textcolor{keywordflow}{if} (result < \mbox{\hyperlink{vmci__defs_8h_ab286f495fff827d2718453f2968a6899}{VMCI\_SUCCESS}})}
\DoxyCodeLine{\Hypertarget{vmci__qpair_8c_source_l00549}00549                 \textcolor{keywordflow}{return} (result);}
\DoxyCodeLine{\Hypertarget{vmci__qpair_8c_source_l00550}00550         \textcolor{keywordflow}{return} (written);}
\DoxyCodeLine{\Hypertarget{vmci__qpair_8c_source_l00551}00551 \}}
\DoxyCodeLine{\Hypertarget{vmci__qpair_8c_source_l00552}00552 }
\DoxyCodeLine{\Hypertarget{vmci__qpair_8c_source_l00553}00553 \textcolor{comment}{/*}}
\DoxyCodeLine{\Hypertarget{vmci__qpair_8c_source_l00554}00554 \textcolor{comment}{ *-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/}}
\DoxyCodeLine{\Hypertarget{vmci__qpair_8c_source_l00555}00555 \textcolor{comment}{ *}}
\DoxyCodeLine{\Hypertarget{vmci__qpair_8c_source_l00556}00556 \textcolor{comment}{ * dequeue -\/-\/}}
\DoxyCodeLine{\Hypertarget{vmci__qpair_8c_source_l00557}00557 \textcolor{comment}{ *}}
\DoxyCodeLine{\Hypertarget{vmci__qpair_8c_source_l00558}00558 \textcolor{comment}{ *     Dequeues data (if available) from the given consume queue. Writes data}}
\DoxyCodeLine{\Hypertarget{vmci__qpair_8c_source_l00559}00559 \textcolor{comment}{ *     to the user provided buffer using the provided function.}}
\DoxyCodeLine{\Hypertarget{vmci__qpair_8c_source_l00560}00560 \textcolor{comment}{ *}}
\DoxyCodeLine{\Hypertarget{vmci__qpair_8c_source_l00561}00561 \textcolor{comment}{ * Results:}}
\DoxyCodeLine{\Hypertarget{vmci__qpair_8c_source_l00562}00562 \textcolor{comment}{ *     VMCI\_ERROR\_QUEUEPAIR\_NODATA if no data was available to dequeue.}}
\DoxyCodeLine{\Hypertarget{vmci__qpair_8c_source_l00563}00563 \textcolor{comment}{ *     VMCI\_ERROR\_INVALID\_SIZE, if any queue pointer is outside the queue}}
\DoxyCodeLine{\Hypertarget{vmci__qpair_8c_source_l00564}00564 \textcolor{comment}{ *     (as defined by the queue size).}}
\DoxyCodeLine{\Hypertarget{vmci__qpair_8c_source_l00565}00565 \textcolor{comment}{ *     VMCI\_ERROR\_INVALID\_ARGS, if an error occured when accessing the buffer.}}
\DoxyCodeLine{\Hypertarget{vmci__qpair_8c_source_l00566}00566 \textcolor{comment}{ *     VMCI\_ERROR\_NOT\_FOUND, if the vmm\_world registered with the queue pair}}
\DoxyCodeLine{\Hypertarget{vmci__qpair_8c_source_l00567}00567 \textcolor{comment}{ *     cannot be found.}}
\DoxyCodeLine{\Hypertarget{vmci__qpair_8c_source_l00568}00568 \textcolor{comment}{ *     Otherwise the number of bytes dequeued is returned.}}
\DoxyCodeLine{\Hypertarget{vmci__qpair_8c_source_l00569}00569 \textcolor{comment}{ *}}
\DoxyCodeLine{\Hypertarget{vmci__qpair_8c_source_l00570}00570 \textcolor{comment}{ * Side effects:}}
\DoxyCodeLine{\Hypertarget{vmci__qpair_8c_source_l00571}00571 \textcolor{comment}{ *     Updates the head pointer of the consume queue.}}
\DoxyCodeLine{\Hypertarget{vmci__qpair_8c_source_l00572}00572 \textcolor{comment}{ *}}
\DoxyCodeLine{\Hypertarget{vmci__qpair_8c_source_l00573}00573 \textcolor{comment}{ *-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/}}
\DoxyCodeLine{\Hypertarget{vmci__qpair_8c_source_l00574}00574 \textcolor{comment}{ */}}
\DoxyCodeLine{\Hypertarget{vmci__qpair_8c_source_l00575}00575 }
\DoxyCodeLine{\Hypertarget{vmci__qpair_8c_source_l00576}00576 \textcolor{keyword}{static} ssize\_t}
\DoxyCodeLine{\Hypertarget{vmci__qpair_8c_source_l00577}\mbox{\hyperlink{vmci__qpair_8c_aeafb337c69c3fc520bf6d4bbf5b03c24}{00577}} \mbox{\hyperlink{vmci__qpair_8c_aeafb337c69c3fc520bf6d4bbf5b03c24}{dequeue}}(\textcolor{keyword}{struct} \mbox{\hyperlink{structvmci__queue}{vmci\_queue}} *produce\_q,}
\DoxyCodeLine{\Hypertarget{vmci__qpair_8c_source_l00578}00578     \textcolor{keyword}{struct} \mbox{\hyperlink{structvmci__queue}{vmci\_queue}} *consume\_q, \textcolor{keyword}{const} uint64\_t consume\_q\_size, \textcolor{keywordtype}{void} *buf,}
\DoxyCodeLine{\Hypertarget{vmci__qpair_8c_source_l00579}00579     \textcolor{keywordtype}{size\_t} buf\_size, \textcolor{keywordtype}{int} buf\_type,}
\DoxyCodeLine{\Hypertarget{vmci__qpair_8c_source_l00580}00580     \mbox{\hyperlink{vmci__queue_8h_adf93806d79fe04443d4cfba3a9d032b1}{vmci\_memcpy\_from\_queue\_func}} memcpy\_from\_queue, \textcolor{keywordtype}{bool} update\_consumer,}
\DoxyCodeLine{\Hypertarget{vmci__qpair_8c_source_l00581}00581     \textcolor{keywordtype}{bool} can\_block)}
\DoxyCodeLine{\Hypertarget{vmci__qpair_8c_source_l00582}00582 \{}
\DoxyCodeLine{\Hypertarget{vmci__qpair_8c_source_l00583}00583         ssize\_t result;}
\DoxyCodeLine{\Hypertarget{vmci__qpair_8c_source_l00584}00584         \textcolor{keywordtype}{size\_t} read;}
\DoxyCodeLine{\Hypertarget{vmci__qpair_8c_source_l00585}00585         int64\_t buf\_ready;}
\DoxyCodeLine{\Hypertarget{vmci__qpair_8c_source_l00586}00586         uint64\_t head;}
\DoxyCodeLine{\Hypertarget{vmci__qpair_8c_source_l00587}00587 }
\DoxyCodeLine{\Hypertarget{vmci__qpair_8c_source_l00588}00588         \mbox{\hyperlink{vmci__kernel__defs_8h_a0966b817b229d48e5ffc7feab19a0be6}{ASSERT}}((produce\_q != NULL) \&\& (consume\_q != NULL));}
\DoxyCodeLine{\Hypertarget{vmci__qpair_8c_source_l00589}00589 }
\DoxyCodeLine{\Hypertarget{vmci__qpair_8c_source_l00590}00590         buf\_ready = \mbox{\hyperlink{vmci__defs_8h_aa008c4d79b50b91ac92f79e0567f6435}{vmci\_queue\_header\_buf\_ready}}(consume\_q-\/>\mbox{\hyperlink{structvmci__queue_ad126179a724d9bfcb3eb2deac84d4576}{q\_header}},}
\DoxyCodeLine{\Hypertarget{vmci__qpair_8c_source_l00591}00591             produce\_q-\/>\mbox{\hyperlink{structvmci__queue_ad126179a724d9bfcb3eb2deac84d4576}{q\_header}}, consume\_q\_size);}
\DoxyCodeLine{\Hypertarget{vmci__qpair_8c_source_l00592}00592         \textcolor{keywordflow}{if} (buf\_ready == 0)}
\DoxyCodeLine{\Hypertarget{vmci__qpair_8c_source_l00593}00593                 \textcolor{keywordflow}{return} (\mbox{\hyperlink{vmci__defs_8h_a78c7bebd5c72d15ac6850c5f0aef1117}{VMCI\_ERROR\_QUEUEPAIR\_NODATA}});}
\DoxyCodeLine{\Hypertarget{vmci__qpair_8c_source_l00594}00594         \textcolor{keywordflow}{if} (buf\_ready < \mbox{\hyperlink{vmci__defs_8h_ab286f495fff827d2718453f2968a6899}{VMCI\_SUCCESS}})}
\DoxyCodeLine{\Hypertarget{vmci__qpair_8c_source_l00595}00595                 \textcolor{keywordflow}{return} ((ssize\_t)buf\_ready);}
\DoxyCodeLine{\Hypertarget{vmci__qpair_8c_source_l00596}00596 }
\DoxyCodeLine{\Hypertarget{vmci__qpair_8c_source_l00597}00597         read = (size\_t)(buf\_ready > buf\_size ? buf\_size : buf\_ready);}
\DoxyCodeLine{\Hypertarget{vmci__qpair_8c_source_l00598}00598         head = \mbox{\hyperlink{vmci__defs_8h_a47f3af30f430c7b7e7c007faa3c2b676}{vmci\_queue\_header\_consumer\_head}}(produce\_q-\/>\mbox{\hyperlink{structvmci__queue_ad126179a724d9bfcb3eb2deac84d4576}{q\_header}});}
\DoxyCodeLine{\Hypertarget{vmci__qpair_8c_source_l00599}00599         \textcolor{keywordflow}{if} (\mbox{\hyperlink{vmci__kernel__defs_8h_a11e3918ed1de5a8a6ff2acd535251eee}{LIKELY}}(head + read < consume\_q\_size))}
\DoxyCodeLine{\Hypertarget{vmci__qpair_8c_source_l00600}00600                 result = memcpy\_from\_queue(buf, 0, consume\_q, head, read,}
\DoxyCodeLine{\Hypertarget{vmci__qpair_8c_source_l00601}00601                     buf\_type, can\_block);}
\DoxyCodeLine{\Hypertarget{vmci__qpair_8c_source_l00602}00602         \textcolor{keywordflow}{else} \{}
\DoxyCodeLine{\Hypertarget{vmci__qpair_8c_source_l00603}00603                 \textcolor{comment}{/* Head pointer wraps around. */}}
\DoxyCodeLine{\Hypertarget{vmci__qpair_8c_source_l00604}00604 }
\DoxyCodeLine{\Hypertarget{vmci__qpair_8c_source_l00605}00605                 \textcolor{keyword}{const} \textcolor{keywordtype}{size\_t} tmp = (size\_t)(consume\_q\_size -\/ head);}
\DoxyCodeLine{\Hypertarget{vmci__qpair_8c_source_l00606}00606 }
\DoxyCodeLine{\Hypertarget{vmci__qpair_8c_source_l00607}00607                 result = memcpy\_from\_queue(buf, 0, consume\_q, head, tmp,}
\DoxyCodeLine{\Hypertarget{vmci__qpair_8c_source_l00608}00608                     buf\_type, can\_block);}
\DoxyCodeLine{\Hypertarget{vmci__qpair_8c_source_l00609}00609                 \textcolor{keywordflow}{if} (result >= \mbox{\hyperlink{vmci__defs_8h_ab286f495fff827d2718453f2968a6899}{VMCI\_SUCCESS}})}
\DoxyCodeLine{\Hypertarget{vmci__qpair_8c_source_l00610}00610                         result = memcpy\_from\_queue(buf, tmp, consume\_q, 0,}
\DoxyCodeLine{\Hypertarget{vmci__qpair_8c_source_l00611}00611                             read -\/ tmp, buf\_type, can\_block);}
\DoxyCodeLine{\Hypertarget{vmci__qpair_8c_source_l00612}00612         \}}
\DoxyCodeLine{\Hypertarget{vmci__qpair_8c_source_l00613}00613 }
\DoxyCodeLine{\Hypertarget{vmci__qpair_8c_source_l00614}00614         \textcolor{keywordflow}{if} (result < \mbox{\hyperlink{vmci__defs_8h_ab286f495fff827d2718453f2968a6899}{VMCI\_SUCCESS}})}
\DoxyCodeLine{\Hypertarget{vmci__qpair_8c_source_l00615}00615                 \textcolor{keywordflow}{return} (result);}
\DoxyCodeLine{\Hypertarget{vmci__qpair_8c_source_l00616}00616 }
\DoxyCodeLine{\Hypertarget{vmci__qpair_8c_source_l00617}00617         \textcolor{keywordflow}{if} (update\_consumer) \{}
\DoxyCodeLine{\Hypertarget{vmci__qpair_8c_source_l00618}00618                 result = \mbox{\hyperlink{vmci__qpair_8c_a541c23d387333936942abf1f0f5d1717}{vmci\_queue\_add\_consumer\_head}}(produce\_q, read,}
\DoxyCodeLine{\Hypertarget{vmci__qpair_8c_source_l00619}00619                     consume\_q\_size);}
\DoxyCodeLine{\Hypertarget{vmci__qpair_8c_source_l00620}00620                 \textcolor{keywordflow}{if} (result < \mbox{\hyperlink{vmci__defs_8h_ab286f495fff827d2718453f2968a6899}{VMCI\_SUCCESS}})}
\DoxyCodeLine{\Hypertarget{vmci__qpair_8c_source_l00621}00621                         \textcolor{keywordflow}{return} (result);}
\DoxyCodeLine{\Hypertarget{vmci__qpair_8c_source_l00622}00622         \}}
\DoxyCodeLine{\Hypertarget{vmci__qpair_8c_source_l00623}00623 }
\DoxyCodeLine{\Hypertarget{vmci__qpair_8c_source_l00624}00624         \textcolor{keywordflow}{return} (read);}
\DoxyCodeLine{\Hypertarget{vmci__qpair_8c_source_l00625}00625 \}}
\DoxyCodeLine{\Hypertarget{vmci__qpair_8c_source_l00626}00626 }
\DoxyCodeLine{\Hypertarget{vmci__qpair_8c_source_l00627}00627 \textcolor{comment}{/*}}
\DoxyCodeLine{\Hypertarget{vmci__qpair_8c_source_l00628}00628 \textcolor{comment}{ *-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/}}
\DoxyCodeLine{\Hypertarget{vmci__qpair_8c_source_l00629}00629 \textcolor{comment}{ *}}
\DoxyCodeLine{\Hypertarget{vmci__qpair_8c_source_l00630}00630 \textcolor{comment}{ * vmci\_qpair\_enqueue -\/-\/}}
\DoxyCodeLine{\Hypertarget{vmci__qpair_8c_source_l00631}00631 \textcolor{comment}{ *}}
\DoxyCodeLine{\Hypertarget{vmci__qpair_8c_source_l00632}00632 \textcolor{comment}{ *     This is the client interface for enqueueing data into the queue.}}
\DoxyCodeLine{\Hypertarget{vmci__qpair_8c_source_l00633}00633 \textcolor{comment}{ *}}
\DoxyCodeLine{\Hypertarget{vmci__qpair_8c_source_l00634}00634 \textcolor{comment}{ * Results:}}
\DoxyCodeLine{\Hypertarget{vmci__qpair_8c_source_l00635}00635 \textcolor{comment}{ *     Err, if < 0.}}
\DoxyCodeLine{\Hypertarget{vmci__qpair_8c_source_l00636}00636 \textcolor{comment}{ *     Number of bytes enqueued if >= 0.}}
\DoxyCodeLine{\Hypertarget{vmci__qpair_8c_source_l00637}00637 \textcolor{comment}{ *}}
\DoxyCodeLine{\Hypertarget{vmci__qpair_8c_source_l00638}00638 \textcolor{comment}{ * Side effects:}}
\DoxyCodeLine{\Hypertarget{vmci__qpair_8c_source_l00639}00639 \textcolor{comment}{ *     None.}}
\DoxyCodeLine{\Hypertarget{vmci__qpair_8c_source_l00640}00640 \textcolor{comment}{ *}}
\DoxyCodeLine{\Hypertarget{vmci__qpair_8c_source_l00641}00641 \textcolor{comment}{ *-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/}}
\DoxyCodeLine{\Hypertarget{vmci__qpair_8c_source_l00642}00642 \textcolor{comment}{ */}}
\DoxyCodeLine{\Hypertarget{vmci__qpair_8c_source_l00643}00643 }
\DoxyCodeLine{\Hypertarget{vmci__qpair_8c_source_l00644}00644 ssize\_t}
\DoxyCodeLine{\Hypertarget{vmci__qpair_8c_source_l00645}\mbox{\hyperlink{vmci__kernel__api__1_8h_a4ac92f7aa1b4723c7029872a919499fd}{00645}} \mbox{\hyperlink{vmci__qpair_8c_aad4cf998cc4ac78766ca612d8e345cbd}{vmci\_qpair\_enqueue}}(\textcolor{keyword}{struct} \mbox{\hyperlink{structvmci__qpair}{vmci\_qpair}} *qpair, \textcolor{keyword}{const} \textcolor{keywordtype}{void} *buf, \textcolor{keywordtype}{size\_t} buf\_size,}
\DoxyCodeLine{\Hypertarget{vmci__qpair_8c_source_l00646}00646     \textcolor{keywordtype}{int} buf\_type)}
\DoxyCodeLine{\Hypertarget{vmci__qpair_8c_source_l00647}00647 \{}
\DoxyCodeLine{\Hypertarget{vmci__qpair_8c_source_l00648}00648         ssize\_t result;}
\DoxyCodeLine{\Hypertarget{vmci__qpair_8c_source_l00649}00649 }
\DoxyCodeLine{\Hypertarget{vmci__qpair_8c_source_l00650}00650         \textcolor{keywordflow}{if} (!qpair || !buf)}
\DoxyCodeLine{\Hypertarget{vmci__qpair_8c_source_l00651}00651                 \textcolor{keywordflow}{return} (\mbox{\hyperlink{vmci__defs_8h_a8ab0ddbd99d8d5d8f1ed882d0f5de1a3}{VMCI\_ERROR\_INVALID\_ARGS}});}
\DoxyCodeLine{\Hypertarget{vmci__qpair_8c_source_l00652}00652 }
\DoxyCodeLine{\Hypertarget{vmci__qpair_8c_source_l00653}00653         result = \mbox{\hyperlink{vmci__qpair_8c_a0690994eff0ef35e407c2d95b6d82b37}{enqueue}}(qpair-\/>\mbox{\hyperlink{structvmci__qpair_a82277f8239335f69bf1b1c53aa044520}{produce\_q}}, qpair-\/>\mbox{\hyperlink{structvmci__qpair_afe732d3bdaebbe6419d4c74cf9e62fe8}{consume\_q}},}
\DoxyCodeLine{\Hypertarget{vmci__qpair_8c_source_l00654}00654             qpair-\/>\mbox{\hyperlink{structvmci__qpair_a95ae83459b248c68fedf40b01db29606}{produce\_q\_size}}, buf, buf\_size, buf\_type,}
\DoxyCodeLine{\Hypertarget{vmci__qpair_8c_source_l00655}00655             qpair-\/>\mbox{\hyperlink{structvmci__qpair_a3d3cb556674e0bde8fe0eab5bf44aed1}{flags}} \& \mbox{\hyperlink{vmci__call__defs_8h_aab54e7f4a3a42514927699ba50c72096}{VMCI\_QPFLAG\_LOCAL}}?}
\DoxyCodeLine{\Hypertarget{vmci__qpair_8c_source_l00656}00656             \mbox{\hyperlink{vmci__kernel__if_8c_aa5c633beac9c742882c4670042b82969}{vmci\_memcpy\_to\_queue\_local}} : \mbox{\hyperlink{vmci__kernel__if_8c_afb1b97f257745d3284b08923dfb12490}{vmci\_memcpy\_to\_queue}},}
\DoxyCodeLine{\Hypertarget{vmci__qpair_8c_source_l00657}00657             !(qpair-\/>\mbox{\hyperlink{structvmci__qpair_a3d3cb556674e0bde8fe0eab5bf44aed1}{flags}} \& \mbox{\hyperlink{vmci__call__defs_8h_aca8898eb26ed49d7da0d2ceeef586e37}{VMCI\_QPFLAG\_NONBLOCK}}));}
\DoxyCodeLine{\Hypertarget{vmci__qpair_8c_source_l00658}00658 }
\DoxyCodeLine{\Hypertarget{vmci__qpair_8c_source_l00659}00659         \textcolor{keywordflow}{return} (result);}
\DoxyCodeLine{\Hypertarget{vmci__qpair_8c_source_l00660}00660 \}}
\DoxyCodeLine{\Hypertarget{vmci__qpair_8c_source_l00661}00661 }
\DoxyCodeLine{\Hypertarget{vmci__qpair_8c_source_l00662}00662 \textcolor{comment}{/*}}
\DoxyCodeLine{\Hypertarget{vmci__qpair_8c_source_l00663}00663 \textcolor{comment}{ *-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/}}
\DoxyCodeLine{\Hypertarget{vmci__qpair_8c_source_l00664}00664 \textcolor{comment}{ *}}
\DoxyCodeLine{\Hypertarget{vmci__qpair_8c_source_l00665}00665 \textcolor{comment}{ * vmci\_qpair\_dequeue -\/-\/}}
\DoxyCodeLine{\Hypertarget{vmci__qpair_8c_source_l00666}00666 \textcolor{comment}{ *}}
\DoxyCodeLine{\Hypertarget{vmci__qpair_8c_source_l00667}00667 \textcolor{comment}{ *     This is the client interface for dequeueing data from the queue.}}
\DoxyCodeLine{\Hypertarget{vmci__qpair_8c_source_l00668}00668 \textcolor{comment}{ *}}
\DoxyCodeLine{\Hypertarget{vmci__qpair_8c_source_l00669}00669 \textcolor{comment}{ * Results:}}
\DoxyCodeLine{\Hypertarget{vmci__qpair_8c_source_l00670}00670 \textcolor{comment}{ *     Err, if < 0.}}
\DoxyCodeLine{\Hypertarget{vmci__qpair_8c_source_l00671}00671 \textcolor{comment}{ *     Number of bytes dequeued if >= 0.}}
\DoxyCodeLine{\Hypertarget{vmci__qpair_8c_source_l00672}00672 \textcolor{comment}{ *}}
\DoxyCodeLine{\Hypertarget{vmci__qpair_8c_source_l00673}00673 \textcolor{comment}{ * Side effects:}}
\DoxyCodeLine{\Hypertarget{vmci__qpair_8c_source_l00674}00674 \textcolor{comment}{ *     None.}}
\DoxyCodeLine{\Hypertarget{vmci__qpair_8c_source_l00675}00675 \textcolor{comment}{ *}}
\DoxyCodeLine{\Hypertarget{vmci__qpair_8c_source_l00676}00676 \textcolor{comment}{ *-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/}}
\DoxyCodeLine{\Hypertarget{vmci__qpair_8c_source_l00677}00677 \textcolor{comment}{ */}}
\DoxyCodeLine{\Hypertarget{vmci__qpair_8c_source_l00678}00678 }
\DoxyCodeLine{\Hypertarget{vmci__qpair_8c_source_l00679}00679 ssize\_t}
\DoxyCodeLine{\Hypertarget{vmci__qpair_8c_source_l00680}\mbox{\hyperlink{vmci__kernel__api__1_8h_a643f72fbc246d9f9d6e674c2b1720463}{00680}} \mbox{\hyperlink{vmci__qpair_8c_ada0778b1d827ed4c6dd4fdb399691b72}{vmci\_qpair\_dequeue}}(\textcolor{keyword}{struct} \mbox{\hyperlink{structvmci__qpair}{vmci\_qpair}} *qpair, \textcolor{keywordtype}{void} *buf, \textcolor{keywordtype}{size\_t} buf\_size,}
\DoxyCodeLine{\Hypertarget{vmci__qpair_8c_source_l00681}00681     \textcolor{keywordtype}{int} buf\_type)}
\DoxyCodeLine{\Hypertarget{vmci__qpair_8c_source_l00682}00682 \{}
\DoxyCodeLine{\Hypertarget{vmci__qpair_8c_source_l00683}00683         ssize\_t result;}
\DoxyCodeLine{\Hypertarget{vmci__qpair_8c_source_l00684}00684 }
\DoxyCodeLine{\Hypertarget{vmci__qpair_8c_source_l00685}00685         \textcolor{keywordflow}{if} (!qpair || !buf)}
\DoxyCodeLine{\Hypertarget{vmci__qpair_8c_source_l00686}00686                 \textcolor{keywordflow}{return} (\mbox{\hyperlink{vmci__defs_8h_a8ab0ddbd99d8d5d8f1ed882d0f5de1a3}{VMCI\_ERROR\_INVALID\_ARGS}});}
\DoxyCodeLine{\Hypertarget{vmci__qpair_8c_source_l00687}00687 }
\DoxyCodeLine{\Hypertarget{vmci__qpair_8c_source_l00688}00688         result = \mbox{\hyperlink{vmci__qpair_8c_aeafb337c69c3fc520bf6d4bbf5b03c24}{dequeue}}(qpair-\/>\mbox{\hyperlink{structvmci__qpair_a82277f8239335f69bf1b1c53aa044520}{produce\_q}}, qpair-\/>\mbox{\hyperlink{structvmci__qpair_afe732d3bdaebbe6419d4c74cf9e62fe8}{consume\_q}},}
\DoxyCodeLine{\Hypertarget{vmci__qpair_8c_source_l00689}00689             qpair-\/>\mbox{\hyperlink{structvmci__qpair_a56142b46ce41d691cb33f2861ffff963}{consume\_q\_size}}, buf, buf\_size, buf\_type,}
\DoxyCodeLine{\Hypertarget{vmci__qpair_8c_source_l00690}00690             qpair-\/>\mbox{\hyperlink{structvmci__qpair_a3d3cb556674e0bde8fe0eab5bf44aed1}{flags}} \& \mbox{\hyperlink{vmci__call__defs_8h_aab54e7f4a3a42514927699ba50c72096}{VMCI\_QPFLAG\_LOCAL}}?}
\DoxyCodeLine{\Hypertarget{vmci__qpair_8c_source_l00691}00691             \mbox{\hyperlink{vmci__kernel__if_8c_a3fa81d7322f8a460a8fd3d0b0087c4db}{vmci\_memcpy\_from\_queue\_local}} : \mbox{\hyperlink{vmci__kernel__if_8c_a88a1b518303c37cc3f3140e08d7d0925}{vmci\_memcpy\_from\_queue}}, \textcolor{keyword}{true},}
\DoxyCodeLine{\Hypertarget{vmci__qpair_8c_source_l00692}00692             !(qpair-\/>\mbox{\hyperlink{structvmci__qpair_a3d3cb556674e0bde8fe0eab5bf44aed1}{flags}} \& \mbox{\hyperlink{vmci__call__defs_8h_aca8898eb26ed49d7da0d2ceeef586e37}{VMCI\_QPFLAG\_NONBLOCK}}));}
\DoxyCodeLine{\Hypertarget{vmci__qpair_8c_source_l00693}00693 }
\DoxyCodeLine{\Hypertarget{vmci__qpair_8c_source_l00694}00694         \textcolor{keywordflow}{return} (result);}
\DoxyCodeLine{\Hypertarget{vmci__qpair_8c_source_l00695}00695 \}}
\DoxyCodeLine{\Hypertarget{vmci__qpair_8c_source_l00696}00696 }
\DoxyCodeLine{\Hypertarget{vmci__qpair_8c_source_l00697}00697 \textcolor{comment}{/*}}
\DoxyCodeLine{\Hypertarget{vmci__qpair_8c_source_l00698}00698 \textcolor{comment}{ *-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/}}
\DoxyCodeLine{\Hypertarget{vmci__qpair_8c_source_l00699}00699 \textcolor{comment}{ *}}
\DoxyCodeLine{\Hypertarget{vmci__qpair_8c_source_l00700}00700 \textcolor{comment}{ * vmci\_qpair\_peek -\/-\/}}
\DoxyCodeLine{\Hypertarget{vmci__qpair_8c_source_l00701}00701 \textcolor{comment}{ *}}
\DoxyCodeLine{\Hypertarget{vmci__qpair_8c_source_l00702}00702 \textcolor{comment}{ *     This is the client interface for peeking into a queue.  (I.e., copy}}
\DoxyCodeLine{\Hypertarget{vmci__qpair_8c_source_l00703}00703 \textcolor{comment}{ *     data from the queue without updating the head pointer.)}}
\DoxyCodeLine{\Hypertarget{vmci__qpair_8c_source_l00704}00704 \textcolor{comment}{ *}}
\DoxyCodeLine{\Hypertarget{vmci__qpair_8c_source_l00705}00705 \textcolor{comment}{ * Results:}}
\DoxyCodeLine{\Hypertarget{vmci__qpair_8c_source_l00706}00706 \textcolor{comment}{ *     Err, if < 0.}}
\DoxyCodeLine{\Hypertarget{vmci__qpair_8c_source_l00707}00707 \textcolor{comment}{ *     Number of bytes peeked, if >= 0.}}
\DoxyCodeLine{\Hypertarget{vmci__qpair_8c_source_l00708}00708 \textcolor{comment}{ *}}
\DoxyCodeLine{\Hypertarget{vmci__qpair_8c_source_l00709}00709 \textcolor{comment}{ * Side effects:}}
\DoxyCodeLine{\Hypertarget{vmci__qpair_8c_source_l00710}00710 \textcolor{comment}{ *     None.}}
\DoxyCodeLine{\Hypertarget{vmci__qpair_8c_source_l00711}00711 \textcolor{comment}{ *}}
\DoxyCodeLine{\Hypertarget{vmci__qpair_8c_source_l00712}00712 \textcolor{comment}{ *-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/}}
\DoxyCodeLine{\Hypertarget{vmci__qpair_8c_source_l00713}00713 \textcolor{comment}{ */}}
\DoxyCodeLine{\Hypertarget{vmci__qpair_8c_source_l00714}00714 }
\DoxyCodeLine{\Hypertarget{vmci__qpair_8c_source_l00715}00715 ssize\_t}
\DoxyCodeLine{\Hypertarget{vmci__qpair_8c_source_l00716}\mbox{\hyperlink{vmci__kernel__api__1_8h_a4465fa446a8fe02a2bcc49184677313a}{00716}} \mbox{\hyperlink{vmci__qpair_8c_ace045262200391c358c54cf8c7cf2cf3}{vmci\_qpair\_peek}}(\textcolor{keyword}{struct} \mbox{\hyperlink{structvmci__qpair}{vmci\_qpair}} *qpair, \textcolor{keywordtype}{void} *buf, \textcolor{keywordtype}{size\_t} buf\_size,}
\DoxyCodeLine{\Hypertarget{vmci__qpair_8c_source_l00717}00717     \textcolor{keywordtype}{int} buf\_type)}
\DoxyCodeLine{\Hypertarget{vmci__qpair_8c_source_l00718}00718 \{}
\DoxyCodeLine{\Hypertarget{vmci__qpair_8c_source_l00719}00719         ssize\_t result;}
\DoxyCodeLine{\Hypertarget{vmci__qpair_8c_source_l00720}00720 }
\DoxyCodeLine{\Hypertarget{vmci__qpair_8c_source_l00721}00721         \textcolor{keywordflow}{if} (!qpair || !buf)}
\DoxyCodeLine{\Hypertarget{vmci__qpair_8c_source_l00722}00722                 \textcolor{keywordflow}{return} (\mbox{\hyperlink{vmci__defs_8h_a8ab0ddbd99d8d5d8f1ed882d0f5de1a3}{VMCI\_ERROR\_INVALID\_ARGS}});}
\DoxyCodeLine{\Hypertarget{vmci__qpair_8c_source_l00723}00723 }
\DoxyCodeLine{\Hypertarget{vmci__qpair_8c_source_l00724}00724         result = \mbox{\hyperlink{vmci__qpair_8c_aeafb337c69c3fc520bf6d4bbf5b03c24}{dequeue}}(qpair-\/>\mbox{\hyperlink{structvmci__qpair_a82277f8239335f69bf1b1c53aa044520}{produce\_q}}, qpair-\/>\mbox{\hyperlink{structvmci__qpair_afe732d3bdaebbe6419d4c74cf9e62fe8}{consume\_q}},}
\DoxyCodeLine{\Hypertarget{vmci__qpair_8c_source_l00725}00725             qpair-\/>\mbox{\hyperlink{structvmci__qpair_a56142b46ce41d691cb33f2861ffff963}{consume\_q\_size}}, buf, buf\_size, buf\_type,}
\DoxyCodeLine{\Hypertarget{vmci__qpair_8c_source_l00726}00726             qpair-\/>\mbox{\hyperlink{structvmci__qpair_a3d3cb556674e0bde8fe0eab5bf44aed1}{flags}} \& \mbox{\hyperlink{vmci__call__defs_8h_aab54e7f4a3a42514927699ba50c72096}{VMCI\_QPFLAG\_LOCAL}}?}
\DoxyCodeLine{\Hypertarget{vmci__qpair_8c_source_l00727}00727             \mbox{\hyperlink{vmci__kernel__if_8c_a3fa81d7322f8a460a8fd3d0b0087c4db}{vmci\_memcpy\_from\_queue\_local}} : \mbox{\hyperlink{vmci__kernel__if_8c_a88a1b518303c37cc3f3140e08d7d0925}{vmci\_memcpy\_from\_queue}}, \textcolor{keyword}{false},}
\DoxyCodeLine{\Hypertarget{vmci__qpair_8c_source_l00728}00728             !(qpair-\/>\mbox{\hyperlink{structvmci__qpair_a3d3cb556674e0bde8fe0eab5bf44aed1}{flags}} \& \mbox{\hyperlink{vmci__call__defs_8h_aca8898eb26ed49d7da0d2ceeef586e37}{VMCI\_QPFLAG\_NONBLOCK}}));}
\DoxyCodeLine{\Hypertarget{vmci__qpair_8c_source_l00729}00729 }
\DoxyCodeLine{\Hypertarget{vmci__qpair_8c_source_l00730}00730         \textcolor{keywordflow}{return} (result);}
\DoxyCodeLine{\Hypertarget{vmci__qpair_8c_source_l00731}00731 \}}
\DoxyCodeLine{\Hypertarget{vmci__qpair_8c_source_l00732}00732 }
\DoxyCodeLine{\Hypertarget{vmci__qpair_8c_source_l00733}00733 \textcolor{comment}{/*}}
\DoxyCodeLine{\Hypertarget{vmci__qpair_8c_source_l00734}00734 \textcolor{comment}{ *-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/}}
\DoxyCodeLine{\Hypertarget{vmci__qpair_8c_source_l00735}00735 \textcolor{comment}{ *}}
\DoxyCodeLine{\Hypertarget{vmci__qpair_8c_source_l00736}00736 \textcolor{comment}{ * vmci\_qpair\_enquev -\/-\/}}
\DoxyCodeLine{\Hypertarget{vmci__qpair_8c_source_l00737}00737 \textcolor{comment}{ *}}
\DoxyCodeLine{\Hypertarget{vmci__qpair_8c_source_l00738}00738 \textcolor{comment}{ *     This is the client interface for enqueueing data into the queue.}}
\DoxyCodeLine{\Hypertarget{vmci__qpair_8c_source_l00739}00739 \textcolor{comment}{ *}}
\DoxyCodeLine{\Hypertarget{vmci__qpair_8c_source_l00740}00740 \textcolor{comment}{ * Results:}}
\DoxyCodeLine{\Hypertarget{vmci__qpair_8c_source_l00741}00741 \textcolor{comment}{ *     Err, if < 0.}}
\DoxyCodeLine{\Hypertarget{vmci__qpair_8c_source_l00742}00742 \textcolor{comment}{ *     Number of bytes enqueued if >= 0.}}
\DoxyCodeLine{\Hypertarget{vmci__qpair_8c_source_l00743}00743 \textcolor{comment}{ *}}
\DoxyCodeLine{\Hypertarget{vmci__qpair_8c_source_l00744}00744 \textcolor{comment}{ * Side effects:}}
\DoxyCodeLine{\Hypertarget{vmci__qpair_8c_source_l00745}00745 \textcolor{comment}{ *     None.}}
\DoxyCodeLine{\Hypertarget{vmci__qpair_8c_source_l00746}00746 \textcolor{comment}{ *}}
\DoxyCodeLine{\Hypertarget{vmci__qpair_8c_source_l00747}00747 \textcolor{comment}{ *-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/}}
\DoxyCodeLine{\Hypertarget{vmci__qpair_8c_source_l00748}00748 \textcolor{comment}{ */}}
\DoxyCodeLine{\Hypertarget{vmci__qpair_8c_source_l00749}00749 }
\DoxyCodeLine{\Hypertarget{vmci__qpair_8c_source_l00750}00750 ssize\_t}
\DoxyCodeLine{\Hypertarget{vmci__qpair_8c_source_l00751}\mbox{\hyperlink{vmci__kernel__api__1_8h_a944496176b0ecfc1486e27e42b50d867}{00751}} \mbox{\hyperlink{vmci__qpair_8c_ad01ed4f1c8c26a555d1d6f1a6b3eca68}{vmci\_qpair\_enquev}}(\textcolor{keyword}{struct} \mbox{\hyperlink{structvmci__qpair}{vmci\_qpair}} *qpair, \textcolor{keywordtype}{void} *iov, \textcolor{keywordtype}{size\_t} iov\_size,}
\DoxyCodeLine{\Hypertarget{vmci__qpair_8c_source_l00752}00752     \textcolor{keywordtype}{int} buf\_type)}
\DoxyCodeLine{\Hypertarget{vmci__qpair_8c_source_l00753}00753 \{}
\DoxyCodeLine{\Hypertarget{vmci__qpair_8c_source_l00754}00754         ssize\_t result;}
\DoxyCodeLine{\Hypertarget{vmci__qpair_8c_source_l00755}00755 }
\DoxyCodeLine{\Hypertarget{vmci__qpair_8c_source_l00756}00756         \textcolor{keywordflow}{if} (!qpair || !iov)}
\DoxyCodeLine{\Hypertarget{vmci__qpair_8c_source_l00757}00757                 \textcolor{keywordflow}{return} (\mbox{\hyperlink{vmci__defs_8h_a8ab0ddbd99d8d5d8f1ed882d0f5de1a3}{VMCI\_ERROR\_INVALID\_ARGS}});}
\DoxyCodeLine{\Hypertarget{vmci__qpair_8c_source_l00758}00758 }
\DoxyCodeLine{\Hypertarget{vmci__qpair_8c_source_l00759}00759         result = \mbox{\hyperlink{vmci__qpair_8c_a0690994eff0ef35e407c2d95b6d82b37}{enqueue}}(qpair-\/>\mbox{\hyperlink{structvmci__qpair_a82277f8239335f69bf1b1c53aa044520}{produce\_q}}, qpair-\/>\mbox{\hyperlink{structvmci__qpair_afe732d3bdaebbe6419d4c74cf9e62fe8}{consume\_q}},}
\DoxyCodeLine{\Hypertarget{vmci__qpair_8c_source_l00760}00760             qpair-\/>\mbox{\hyperlink{structvmci__qpair_a95ae83459b248c68fedf40b01db29606}{produce\_q\_size}}, iov, iov\_size, buf\_type,}
\DoxyCodeLine{\Hypertarget{vmci__qpair_8c_source_l00761}00761             qpair-\/>\mbox{\hyperlink{structvmci__qpair_a3d3cb556674e0bde8fe0eab5bf44aed1}{flags}} \& \mbox{\hyperlink{vmci__call__defs_8h_aab54e7f4a3a42514927699ba50c72096}{VMCI\_QPFLAG\_LOCAL}}?}
\DoxyCodeLine{\Hypertarget{vmci__qpair_8c_source_l00762}00762             \mbox{\hyperlink{vmci__queue_8h_a0c239de16506ca85be59aa01392ed197}{vmci\_memcpy\_to\_queue\_v\_local}} : \mbox{\hyperlink{vmci__kernel__if_8c_a56c39cca149042a2152fcfc61e5608a7}{vmci\_memcpy\_to\_queue\_v}},}
\DoxyCodeLine{\Hypertarget{vmci__qpair_8c_source_l00763}00763             !(qpair-\/>\mbox{\hyperlink{structvmci__qpair_a3d3cb556674e0bde8fe0eab5bf44aed1}{flags}} \& \mbox{\hyperlink{vmci__call__defs_8h_aca8898eb26ed49d7da0d2ceeef586e37}{VMCI\_QPFLAG\_NONBLOCK}}));}
\DoxyCodeLine{\Hypertarget{vmci__qpair_8c_source_l00764}00764 }
\DoxyCodeLine{\Hypertarget{vmci__qpair_8c_source_l00765}00765         \textcolor{keywordflow}{return} (result);}
\DoxyCodeLine{\Hypertarget{vmci__qpair_8c_source_l00766}00766 \}}
\DoxyCodeLine{\Hypertarget{vmci__qpair_8c_source_l00767}00767 }
\DoxyCodeLine{\Hypertarget{vmci__qpair_8c_source_l00768}00768 \textcolor{comment}{/*}}
\DoxyCodeLine{\Hypertarget{vmci__qpair_8c_source_l00769}00769 \textcolor{comment}{ *-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/}}
\DoxyCodeLine{\Hypertarget{vmci__qpair_8c_source_l00770}00770 \textcolor{comment}{ *}}
\DoxyCodeLine{\Hypertarget{vmci__qpair_8c_source_l00771}00771 \textcolor{comment}{ * vmci\_qpair\_dequev -\/-\/}}
\DoxyCodeLine{\Hypertarget{vmci__qpair_8c_source_l00772}00772 \textcolor{comment}{ *}}
\DoxyCodeLine{\Hypertarget{vmci__qpair_8c_source_l00773}00773 \textcolor{comment}{ *     This is the client interface for dequeueing data from the queue.}}
\DoxyCodeLine{\Hypertarget{vmci__qpair_8c_source_l00774}00774 \textcolor{comment}{ *}}
\DoxyCodeLine{\Hypertarget{vmci__qpair_8c_source_l00775}00775 \textcolor{comment}{ * Results:}}
\DoxyCodeLine{\Hypertarget{vmci__qpair_8c_source_l00776}00776 \textcolor{comment}{ *     Err, if < 0.}}
\DoxyCodeLine{\Hypertarget{vmci__qpair_8c_source_l00777}00777 \textcolor{comment}{ *     Number of bytes dequeued if >= 0.}}
\DoxyCodeLine{\Hypertarget{vmci__qpair_8c_source_l00778}00778 \textcolor{comment}{ *}}
\DoxyCodeLine{\Hypertarget{vmci__qpair_8c_source_l00779}00779 \textcolor{comment}{ * Side effects:}}
\DoxyCodeLine{\Hypertarget{vmci__qpair_8c_source_l00780}00780 \textcolor{comment}{ *     None.}}
\DoxyCodeLine{\Hypertarget{vmci__qpair_8c_source_l00781}00781 \textcolor{comment}{ *}}
\DoxyCodeLine{\Hypertarget{vmci__qpair_8c_source_l00782}00782 \textcolor{comment}{ *-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/}}
\DoxyCodeLine{\Hypertarget{vmci__qpair_8c_source_l00783}00783 \textcolor{comment}{ */}}
\DoxyCodeLine{\Hypertarget{vmci__qpair_8c_source_l00784}00784 }
\DoxyCodeLine{\Hypertarget{vmci__qpair_8c_source_l00785}00785 ssize\_t}
\DoxyCodeLine{\Hypertarget{vmci__qpair_8c_source_l00786}\mbox{\hyperlink{vmci__kernel__api__1_8h_a759c8a84d33bcd3b27371167320b6efa}{00786}} \mbox{\hyperlink{vmci__qpair_8c_acc843d24415ac5dbba8e9ffe1436a3aa}{vmci\_qpair\_dequev}}(\textcolor{keyword}{struct} \mbox{\hyperlink{structvmci__qpair}{vmci\_qpair}} *qpair, \textcolor{keywordtype}{void} *iov, \textcolor{keywordtype}{size\_t} iov\_size,}
\DoxyCodeLine{\Hypertarget{vmci__qpair_8c_source_l00787}00787     \textcolor{keywordtype}{int} buf\_type)}
\DoxyCodeLine{\Hypertarget{vmci__qpair_8c_source_l00788}00788 \{}
\DoxyCodeLine{\Hypertarget{vmci__qpair_8c_source_l00789}00789         ssize\_t result;}
\DoxyCodeLine{\Hypertarget{vmci__qpair_8c_source_l00790}00790 }
\DoxyCodeLine{\Hypertarget{vmci__qpair_8c_source_l00791}00791         \textcolor{keywordflow}{if} (!qpair || !iov)}
\DoxyCodeLine{\Hypertarget{vmci__qpair_8c_source_l00792}00792                 \textcolor{keywordflow}{return} (\mbox{\hyperlink{vmci__defs_8h_a8ab0ddbd99d8d5d8f1ed882d0f5de1a3}{VMCI\_ERROR\_INVALID\_ARGS}});}
\DoxyCodeLine{\Hypertarget{vmci__qpair_8c_source_l00793}00793 }
\DoxyCodeLine{\Hypertarget{vmci__qpair_8c_source_l00794}00794         result = \mbox{\hyperlink{vmci__qpair_8c_aeafb337c69c3fc520bf6d4bbf5b03c24}{dequeue}}(qpair-\/>\mbox{\hyperlink{structvmci__qpair_a82277f8239335f69bf1b1c53aa044520}{produce\_q}}, qpair-\/>\mbox{\hyperlink{structvmci__qpair_afe732d3bdaebbe6419d4c74cf9e62fe8}{consume\_q}},}
\DoxyCodeLine{\Hypertarget{vmci__qpair_8c_source_l00795}00795             qpair-\/>\mbox{\hyperlink{structvmci__qpair_a56142b46ce41d691cb33f2861ffff963}{consume\_q\_size}}, iov, iov\_size, buf\_type,}
\DoxyCodeLine{\Hypertarget{vmci__qpair_8c_source_l00796}00796             qpair-\/>\mbox{\hyperlink{structvmci__qpair_a3d3cb556674e0bde8fe0eab5bf44aed1}{flags}} \& \mbox{\hyperlink{vmci__call__defs_8h_aab54e7f4a3a42514927699ba50c72096}{VMCI\_QPFLAG\_LOCAL}}?}
\DoxyCodeLine{\Hypertarget{vmci__qpair_8c_source_l00797}00797             \mbox{\hyperlink{vmci__queue_8h_a3e842952b661b4b3da3448367ed96d7a}{vmci\_memcpy\_from\_queue\_v\_local}} : \mbox{\hyperlink{vmci__kernel__if_8c_a34ff5bac551303babfe5980a3e3f899e}{vmci\_memcpy\_from\_queue\_v}}, \textcolor{keyword}{true},}
\DoxyCodeLine{\Hypertarget{vmci__qpair_8c_source_l00798}00798             !(qpair-\/>\mbox{\hyperlink{structvmci__qpair_a3d3cb556674e0bde8fe0eab5bf44aed1}{flags}} \& \mbox{\hyperlink{vmci__call__defs_8h_aca8898eb26ed49d7da0d2ceeef586e37}{VMCI\_QPFLAG\_NONBLOCK}}));}
\DoxyCodeLine{\Hypertarget{vmci__qpair_8c_source_l00799}00799 }
\DoxyCodeLine{\Hypertarget{vmci__qpair_8c_source_l00800}00800         \textcolor{keywordflow}{return} (result);}
\DoxyCodeLine{\Hypertarget{vmci__qpair_8c_source_l00801}00801 \}}
\DoxyCodeLine{\Hypertarget{vmci__qpair_8c_source_l00802}00802 }
\DoxyCodeLine{\Hypertarget{vmci__qpair_8c_source_l00803}00803 \textcolor{comment}{/*}}
\DoxyCodeLine{\Hypertarget{vmci__qpair_8c_source_l00804}00804 \textcolor{comment}{ *-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/}}
\DoxyCodeLine{\Hypertarget{vmci__qpair_8c_source_l00805}00805 \textcolor{comment}{ *}}
\DoxyCodeLine{\Hypertarget{vmci__qpair_8c_source_l00806}00806 \textcolor{comment}{ * vmci\_qpair\_peekv -\/-\/}}
\DoxyCodeLine{\Hypertarget{vmci__qpair_8c_source_l00807}00807 \textcolor{comment}{ *}}
\DoxyCodeLine{\Hypertarget{vmci__qpair_8c_source_l00808}00808 \textcolor{comment}{ *     This is the client interface for peeking into a queue.  (I.e., copy}}
\DoxyCodeLine{\Hypertarget{vmci__qpair_8c_source_l00809}00809 \textcolor{comment}{ *     data from the queue without updating the head pointer.)}}
\DoxyCodeLine{\Hypertarget{vmci__qpair_8c_source_l00810}00810 \textcolor{comment}{ *}}
\DoxyCodeLine{\Hypertarget{vmci__qpair_8c_source_l00811}00811 \textcolor{comment}{ * Results:}}
\DoxyCodeLine{\Hypertarget{vmci__qpair_8c_source_l00812}00812 \textcolor{comment}{ *     Err, if < 0.}}
\DoxyCodeLine{\Hypertarget{vmci__qpair_8c_source_l00813}00813 \textcolor{comment}{ *     Number of bytes peeked, if >= 0.}}
\DoxyCodeLine{\Hypertarget{vmci__qpair_8c_source_l00814}00814 \textcolor{comment}{ *}}
\DoxyCodeLine{\Hypertarget{vmci__qpair_8c_source_l00815}00815 \textcolor{comment}{ * Side effects:}}
\DoxyCodeLine{\Hypertarget{vmci__qpair_8c_source_l00816}00816 \textcolor{comment}{ *     None.}}
\DoxyCodeLine{\Hypertarget{vmci__qpair_8c_source_l00817}00817 \textcolor{comment}{ *}}
\DoxyCodeLine{\Hypertarget{vmci__qpair_8c_source_l00818}00818 \textcolor{comment}{ *-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/}}
\DoxyCodeLine{\Hypertarget{vmci__qpair_8c_source_l00819}00819 \textcolor{comment}{ */}}
\DoxyCodeLine{\Hypertarget{vmci__qpair_8c_source_l00820}00820 }
\DoxyCodeLine{\Hypertarget{vmci__qpair_8c_source_l00821}00821 ssize\_t}
\DoxyCodeLine{\Hypertarget{vmci__qpair_8c_source_l00822}\mbox{\hyperlink{vmci__kernel__api__1_8h_acf78111eb99091efb6f6990b365c3213}{00822}} \mbox{\hyperlink{vmci__qpair_8c_af566dfa44a0a6059f2a13eebfe5aedb2}{vmci\_qpair\_peekv}}(\textcolor{keyword}{struct} \mbox{\hyperlink{structvmci__qpair}{vmci\_qpair}} *qpair, \textcolor{keywordtype}{void} *iov, \textcolor{keywordtype}{size\_t} iov\_size,}
\DoxyCodeLine{\Hypertarget{vmci__qpair_8c_source_l00823}00823     \textcolor{keywordtype}{int} buf\_type)}
\DoxyCodeLine{\Hypertarget{vmci__qpair_8c_source_l00824}00824 \{}
\DoxyCodeLine{\Hypertarget{vmci__qpair_8c_source_l00825}00825         ssize\_t result;}
\DoxyCodeLine{\Hypertarget{vmci__qpair_8c_source_l00826}00826 }
\DoxyCodeLine{\Hypertarget{vmci__qpair_8c_source_l00827}00827         \textcolor{keywordflow}{if} (!qpair || !iov)}
\DoxyCodeLine{\Hypertarget{vmci__qpair_8c_source_l00828}00828                 \textcolor{keywordflow}{return} (\mbox{\hyperlink{vmci__defs_8h_a8ab0ddbd99d8d5d8f1ed882d0f5de1a3}{VMCI\_ERROR\_INVALID\_ARGS}});}
\DoxyCodeLine{\Hypertarget{vmci__qpair_8c_source_l00829}00829 }
\DoxyCodeLine{\Hypertarget{vmci__qpair_8c_source_l00830}00830         result = \mbox{\hyperlink{vmci__qpair_8c_aeafb337c69c3fc520bf6d4bbf5b03c24}{dequeue}}(qpair-\/>\mbox{\hyperlink{structvmci__qpair_a82277f8239335f69bf1b1c53aa044520}{produce\_q}}, qpair-\/>\mbox{\hyperlink{structvmci__qpair_afe732d3bdaebbe6419d4c74cf9e62fe8}{consume\_q}},}
\DoxyCodeLine{\Hypertarget{vmci__qpair_8c_source_l00831}00831             qpair-\/>\mbox{\hyperlink{structvmci__qpair_a56142b46ce41d691cb33f2861ffff963}{consume\_q\_size}}, iov, iov\_size, buf\_type,}
\DoxyCodeLine{\Hypertarget{vmci__qpair_8c_source_l00832}00832             qpair-\/>\mbox{\hyperlink{structvmci__qpair_a3d3cb556674e0bde8fe0eab5bf44aed1}{flags}} \& \mbox{\hyperlink{vmci__call__defs_8h_aab54e7f4a3a42514927699ba50c72096}{VMCI\_QPFLAG\_LOCAL}}?}
\DoxyCodeLine{\Hypertarget{vmci__qpair_8c_source_l00833}00833             \mbox{\hyperlink{vmci__queue_8h_a3e842952b661b4b3da3448367ed96d7a}{vmci\_memcpy\_from\_queue\_v\_local}} : \mbox{\hyperlink{vmci__kernel__if_8c_a34ff5bac551303babfe5980a3e3f899e}{vmci\_memcpy\_from\_queue\_v}}, \textcolor{keyword}{false},}
\DoxyCodeLine{\Hypertarget{vmci__qpair_8c_source_l00834}00834             !(qpair-\/>\mbox{\hyperlink{structvmci__qpair_a3d3cb556674e0bde8fe0eab5bf44aed1}{flags}} \& \mbox{\hyperlink{vmci__call__defs_8h_aca8898eb26ed49d7da0d2ceeef586e37}{VMCI\_QPFLAG\_NONBLOCK}}));}
\DoxyCodeLine{\Hypertarget{vmci__qpair_8c_source_l00835}00835 }
\DoxyCodeLine{\Hypertarget{vmci__qpair_8c_source_l00836}00836         \textcolor{keywordflow}{return} (result);}
\DoxyCodeLine{\Hypertarget{vmci__qpair_8c_source_l00837}00837 \}}

\end{DoxyCode}
