\hypertarget{cam__queue_8h_source}{}\doxysection{cam\+\_\+queue.\+h}
\label{cam__queue_8h_source}\index{cam/cam\_queue.h@{cam/cam\_queue.h}}
\mbox{\hyperlink{cam__queue_8h}{Go to the documentation of this file.}}
\begin{DoxyCode}{0}
\DoxyCodeLine{\Hypertarget{cam__queue_8h_source_l00001}00001 \textcolor{comment}{/*-\/}}
\DoxyCodeLine{\Hypertarget{cam__queue_8h_source_l00002}00002 \textcolor{comment}{ * CAM request queue management definitions.}}
\DoxyCodeLine{\Hypertarget{cam__queue_8h_source_l00003}00003 \textcolor{comment}{ *}}
\DoxyCodeLine{\Hypertarget{cam__queue_8h_source_l00004}00004 \textcolor{comment}{ * SPDX-\/License-\/Identifier: BSD-\/2-\/Clause-\/FreeBSD}}
\DoxyCodeLine{\Hypertarget{cam__queue_8h_source_l00005}00005 \textcolor{comment}{ *}}
\DoxyCodeLine{\Hypertarget{cam__queue_8h_source_l00006}00006 \textcolor{comment}{ * Copyright (c) 1997 Justin T. Gibbs.}}
\DoxyCodeLine{\Hypertarget{cam__queue_8h_source_l00007}00007 \textcolor{comment}{ * All rights reserved.}}
\DoxyCodeLine{\Hypertarget{cam__queue_8h_source_l00008}00008 \textcolor{comment}{ *}}
\DoxyCodeLine{\Hypertarget{cam__queue_8h_source_l00009}00009 \textcolor{comment}{ * Redistribution and use in source and binary forms, with or without}}
\DoxyCodeLine{\Hypertarget{cam__queue_8h_source_l00010}00010 \textcolor{comment}{ * modification, are permitted provided that the following conditions}}
\DoxyCodeLine{\Hypertarget{cam__queue_8h_source_l00011}00011 \textcolor{comment}{ * are met:}}
\DoxyCodeLine{\Hypertarget{cam__queue_8h_source_l00012}00012 \textcolor{comment}{ * 1. Redistributions of source code must retain the above copyright}}
\DoxyCodeLine{\Hypertarget{cam__queue_8h_source_l00013}00013 \textcolor{comment}{ *    notice, this list of conditions, and the following disclaimer,}}
\DoxyCodeLine{\Hypertarget{cam__queue_8h_source_l00014}00014 \textcolor{comment}{ *    without modification, immediately at the beginning of the file.}}
\DoxyCodeLine{\Hypertarget{cam__queue_8h_source_l00015}00015 \textcolor{comment}{ * 2. The name of the author may not be used to endorse or promote products}}
\DoxyCodeLine{\Hypertarget{cam__queue_8h_source_l00016}00016 \textcolor{comment}{ *    derived from this software without specific prior written permission.}}
\DoxyCodeLine{\Hypertarget{cam__queue_8h_source_l00017}00017 \textcolor{comment}{ *}}
\DoxyCodeLine{\Hypertarget{cam__queue_8h_source_l00018}00018 \textcolor{comment}{ * THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND}}
\DoxyCodeLine{\Hypertarget{cam__queue_8h_source_l00019}00019 \textcolor{comment}{ * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE}}
\DoxyCodeLine{\Hypertarget{cam__queue_8h_source_l00020}00020 \textcolor{comment}{ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE}}
\DoxyCodeLine{\Hypertarget{cam__queue_8h_source_l00021}00021 \textcolor{comment}{ * ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE FOR}}
\DoxyCodeLine{\Hypertarget{cam__queue_8h_source_l00022}00022 \textcolor{comment}{ * ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL}}
\DoxyCodeLine{\Hypertarget{cam__queue_8h_source_l00023}00023 \textcolor{comment}{ * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS}}
\DoxyCodeLine{\Hypertarget{cam__queue_8h_source_l00024}00024 \textcolor{comment}{ * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)}}
\DoxyCodeLine{\Hypertarget{cam__queue_8h_source_l00025}00025 \textcolor{comment}{ * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT}}
\DoxyCodeLine{\Hypertarget{cam__queue_8h_source_l00026}00026 \textcolor{comment}{ * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY}}
\DoxyCodeLine{\Hypertarget{cam__queue_8h_source_l00027}00027 \textcolor{comment}{ * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF}}
\DoxyCodeLine{\Hypertarget{cam__queue_8h_source_l00028}00028 \textcolor{comment}{ * SUCH DAMAGE.}}
\DoxyCodeLine{\Hypertarget{cam__queue_8h_source_l00029}00029 \textcolor{comment}{ *}}
\DoxyCodeLine{\Hypertarget{cam__queue_8h_source_l00030}00030 \textcolor{comment}{ * \$FreeBSD\$}}
\DoxyCodeLine{\Hypertarget{cam__queue_8h_source_l00031}00031 \textcolor{comment}{ */}}
\DoxyCodeLine{\Hypertarget{cam__queue_8h_source_l00032}00032 }
\DoxyCodeLine{\Hypertarget{cam__queue_8h_source_l00033}00033 \textcolor{preprocessor}{\#ifndef \_CAM\_CAM\_QUEUE\_H}}
\DoxyCodeLine{\Hypertarget{cam__queue_8h_source_l00034}00034 \textcolor{preprocessor}{\#define \_CAM\_CAM\_QUEUE\_H 1}}
\DoxyCodeLine{\Hypertarget{cam__queue_8h_source_l00035}00035 }
\DoxyCodeLine{\Hypertarget{cam__queue_8h_source_l00036}00036 \textcolor{preprocessor}{\#ifdef \_KERNEL}}
\DoxyCodeLine{\Hypertarget{cam__queue_8h_source_l00037}00037 }
\DoxyCodeLine{\Hypertarget{cam__queue_8h_source_l00038}00038 \textcolor{preprocessor}{\#include <sys/lock.h>}}
\DoxyCodeLine{\Hypertarget{cam__queue_8h_source_l00039}00039 \textcolor{preprocessor}{\#include <sys/mutex.h>}}
\DoxyCodeLine{\Hypertarget{cam__queue_8h_source_l00040}00040 \textcolor{preprocessor}{\#include <sys/queue.h>}}
\DoxyCodeLine{\Hypertarget{cam__queue_8h_source_l00041}00041 \textcolor{preprocessor}{\#include <\mbox{\hyperlink{cam_8h}{cam/cam.h}}>}}
\DoxyCodeLine{\Hypertarget{cam__queue_8h_source_l00042}00042 }
\DoxyCodeLine{\Hypertarget{cam__queue_8h_source_l00043}00043 \textcolor{comment}{/*}}
\DoxyCodeLine{\Hypertarget{cam__queue_8h_source_l00044}00044 \textcolor{comment}{ * This structure implements a heap based priority queue.  The queue}}
\DoxyCodeLine{\Hypertarget{cam__queue_8h_source_l00045}00045 \textcolor{comment}{ * assumes that the objects stored in it begin with a cam\_qentry}}
\DoxyCodeLine{\Hypertarget{cam__queue_8h_source_l00046}00046 \textcolor{comment}{ * structure holding the priority information used to sort the objects.}}
\DoxyCodeLine{\Hypertarget{cam__queue_8h_source_l00047}00047 \textcolor{comment}{ * This structure is opaque to clients (outside of the XPT layer) to allow}}
\DoxyCodeLine{\Hypertarget{cam__queue_8h_source_l00048}00048 \textcolor{comment}{ * the implementation to change without affecting them.}}
\DoxyCodeLine{\Hypertarget{cam__queue_8h_source_l00049}00049 \textcolor{comment}{ */}}
\DoxyCodeLine{\Hypertarget{cam__queue_8h_source_l00050}\mbox{\hyperlink{structcamq}{00050}} \textcolor{keyword}{struct }\mbox{\hyperlink{structcamq}{camq}} \{}
\DoxyCodeLine{\Hypertarget{cam__queue_8h_source_l00051}\mbox{\hyperlink{structcamq_a09848452a34e48995b3d485ad1776d43}{00051}}         \mbox{\hyperlink{structcam__pinfo}{cam\_pinfo}} **\mbox{\hyperlink{structcamq_a09848452a34e48995b3d485ad1776d43}{queue\_array}};}
\DoxyCodeLine{\Hypertarget{cam__queue_8h_source_l00052}\mbox{\hyperlink{structcamq_a0f52bb514dd299f383aeb4cb7a7f6de3}{00052}}         \textcolor{keywordtype}{int}        \mbox{\hyperlink{structcamq_a0f52bb514dd299f383aeb4cb7a7f6de3}{array\_size}};}
\DoxyCodeLine{\Hypertarget{cam__queue_8h_source_l00053}\mbox{\hyperlink{structcamq_aa6838891d6293a8697c3e15381835335}{00053}}         \textcolor{keywordtype}{int}        \mbox{\hyperlink{structcamq_aa6838891d6293a8697c3e15381835335}{entries}};}
\DoxyCodeLine{\Hypertarget{cam__queue_8h_source_l00054}\mbox{\hyperlink{structcamq_af9b6ac7f8a88cf49b2eee4fb889001fd}{00054}}         u\_int32\_t  \mbox{\hyperlink{structcamq_af9b6ac7f8a88cf49b2eee4fb889001fd}{generation}};}
\DoxyCodeLine{\Hypertarget{cam__queue_8h_source_l00055}\mbox{\hyperlink{structcamq_acecce2d369e01e74f603936f820ce549}{00055}}         u\_int32\_t  \mbox{\hyperlink{structcamq_acecce2d369e01e74f603936f820ce549}{qfrozen\_cnt}};}
\DoxyCodeLine{\Hypertarget{cam__queue_8h_source_l00056}00056 \};}
\DoxyCodeLine{\Hypertarget{cam__queue_8h_source_l00057}00057 }
\DoxyCodeLine{\Hypertarget{cam__queue_8h_source_l00058}\mbox{\hyperlink{cam__queue_8h_a2c1b7587c89969d66bccfd5502f6c7c0}{00058}} \mbox{\hyperlink{cam__queue_8h_a2c1b7587c89969d66bccfd5502f6c7c0}{TAILQ\_HEAD}}(ccb\_hdr\_tailq, \mbox{\hyperlink{structccb__hdr}{ccb\_hdr}});}
\DoxyCodeLine{\Hypertarget{cam__queue_8h_source_l00059}\mbox{\hyperlink{cam__queue_8h_ad2c903b0c9101edfb41bab23a66f13b2}{00059}} \mbox{\hyperlink{cam__queue_8h_ad2c903b0c9101edfb41bab23a66f13b2}{LIST\_HEAD}}(ccb\_hdr\_list, \mbox{\hyperlink{structccb__hdr}{ccb\_hdr}});}
\DoxyCodeLine{\Hypertarget{cam__queue_8h_source_l00060}\mbox{\hyperlink{cam__queue_8h_adce8343f0dc360908574d91ac70f4a7f}{00060}} \mbox{\hyperlink{cam__queue_8h_adce8343f0dc360908574d91ac70f4a7f}{SLIST\_HEAD}}(ccb\_hdr\_slist, \mbox{\hyperlink{structccb__hdr}{ccb\_hdr}});}
\DoxyCodeLine{\Hypertarget{cam__queue_8h_source_l00061}00061 }
\DoxyCodeLine{\Hypertarget{cam__queue_8h_source_l00062}\mbox{\hyperlink{structcam__ccbq}{00062}} \textcolor{keyword}{struct }\mbox{\hyperlink{structcam__ccbq}{cam\_ccbq}} \{}
\DoxyCodeLine{\Hypertarget{cam__queue_8h_source_l00063}\mbox{\hyperlink{structcam__ccbq_af128199bb2be2854178209fbcfe4014e}{00063}}         \textcolor{keyword}{struct  }\mbox{\hyperlink{structcamq}{camq}} \mbox{\hyperlink{structcam__ccbq_af128199bb2be2854178209fbcfe4014e}{queue}};}
\DoxyCodeLine{\Hypertarget{cam__queue_8h_source_l00064}\mbox{\hyperlink{structcam__ccbq_a743d929181695ef9f7458d740c719240}{00064}}         \textcolor{keyword}{struct }ccb\_hdr\_tailq    \mbox{\hyperlink{structcam__ccbq_a743d929181695ef9f7458d740c719240}{queue\_extra\_head}};}
\DoxyCodeLine{\Hypertarget{cam__queue_8h_source_l00065}\mbox{\hyperlink{structcam__ccbq_a1b9f76bf95b466214209f486f8259dcb}{00065}}         \textcolor{keywordtype}{int}     \mbox{\hyperlink{structcam__ccbq_a1b9f76bf95b466214209f486f8259dcb}{queue\_extra\_entries}};}
\DoxyCodeLine{\Hypertarget{cam__queue_8h_source_l00066}\mbox{\hyperlink{structcam__ccbq_a4f1703a5d89b449ce27b84ea4ef57dfd}{00066}}         \textcolor{keywordtype}{int}     \mbox{\hyperlink{structcam__ccbq_a4f1703a5d89b449ce27b84ea4ef57dfd}{total\_openings}};}
\DoxyCodeLine{\Hypertarget{cam__queue_8h_source_l00067}\mbox{\hyperlink{structcam__ccbq_a9e96a72cdbc06338b67045a1c2ee3877}{00067}}         \textcolor{keywordtype}{int}     \mbox{\hyperlink{structcam__ccbq_a9e96a72cdbc06338b67045a1c2ee3877}{allocated}};}
\DoxyCodeLine{\Hypertarget{cam__queue_8h_source_l00068}\mbox{\hyperlink{structcam__ccbq_aef5404cb1fa8ad1c4ec40ad883c2b47c}{00068}}         \textcolor{keywordtype}{int}     \mbox{\hyperlink{structcam__ccbq_aef5404cb1fa8ad1c4ec40ad883c2b47c}{dev\_openings}};}
\DoxyCodeLine{\Hypertarget{cam__queue_8h_source_l00069}\mbox{\hyperlink{structcam__ccbq_a6a866cbf6518531b9b48c3521ca28d54}{00069}}         \textcolor{keywordtype}{int}     \mbox{\hyperlink{structcam__ccbq_a6a866cbf6518531b9b48c3521ca28d54}{dev\_active}};}
\DoxyCodeLine{\Hypertarget{cam__queue_8h_source_l00070}00070 \};}
\DoxyCodeLine{\Hypertarget{cam__queue_8h_source_l00071}00071 }
\DoxyCodeLine{\Hypertarget{cam__queue_8h_source_l00072}00072 \textcolor{keyword}{struct }\mbox{\hyperlink{structcam__ed}{cam\_ed}};}
\DoxyCodeLine{\Hypertarget{cam__queue_8h_source_l00073}00073 }
\DoxyCodeLine{\Hypertarget{cam__queue_8h_source_l00074}\mbox{\hyperlink{structcam__devq}{00074}} \textcolor{keyword}{struct }\mbox{\hyperlink{structcam__devq}{cam\_devq}} \{}
\DoxyCodeLine{\Hypertarget{cam__queue_8h_source_l00075}\mbox{\hyperlink{structcam__devq_ab217a0eaf915be52c98e4c8b24d8af04}{00075}}         \textcolor{keyword}{struct }mtx       \mbox{\hyperlink{structcam__devq_ab217a0eaf915be52c98e4c8b24d8af04}{send\_mtx}};}
\DoxyCodeLine{\Hypertarget{cam__queue_8h_source_l00076}\mbox{\hyperlink{structcam__devq_a7f843e3c67a07551caa448b9280163ea}{00076}}         \textcolor{keyword}{struct }\mbox{\hyperlink{structcamq}{camq}}  \mbox{\hyperlink{structcam__devq_a7f843e3c67a07551caa448b9280163ea}{send\_queue}};}
\DoxyCodeLine{\Hypertarget{cam__queue_8h_source_l00077}\mbox{\hyperlink{structcam__devq_ae19320f9ccbf7d70b80e7bb05c0c5434}{00077}}         \textcolor{keywordtype}{int}              \mbox{\hyperlink{structcam__devq_ae19320f9ccbf7d70b80e7bb05c0c5434}{send\_openings}};}
\DoxyCodeLine{\Hypertarget{cam__queue_8h_source_l00078}\mbox{\hyperlink{structcam__devq_a55994dd1e1bc3d195ac101d00c73821a}{00078}}         \textcolor{keywordtype}{int}              \mbox{\hyperlink{structcam__devq_a55994dd1e1bc3d195ac101d00c73821a}{send\_active}};}
\DoxyCodeLine{\Hypertarget{cam__queue_8h_source_l00079}00079 \};}
\DoxyCodeLine{\Hypertarget{cam__queue_8h_source_l00080}00080 }
\DoxyCodeLine{\Hypertarget{cam__queue_8h_source_l00081}00081 \textcolor{keyword}{struct }\mbox{\hyperlink{structcam__devq}{cam\_devq}} *\mbox{\hyperlink{cam__queue_8h_a1f8380a422948aad35ea6f4e62db024d}{cam\_devq\_alloc}}(\textcolor{keywordtype}{int} devices, \textcolor{keywordtype}{int} openings);}
\DoxyCodeLine{\Hypertarget{cam__queue_8h_source_l00082}00082 }
\DoxyCodeLine{\Hypertarget{cam__queue_8h_source_l00083}00083 \textcolor{keywordtype}{int}              \mbox{\hyperlink{cam__queue_8h_ad42b751273bb467f4dc2d1728e8676da}{cam\_devq\_init}}(\textcolor{keyword}{struct} \mbox{\hyperlink{structcam__devq}{cam\_devq}} *devq, \textcolor{keywordtype}{int} devices,}
\DoxyCodeLine{\Hypertarget{cam__queue_8h_source_l00084}00084                                \textcolor{keywordtype}{int} openings);}
\DoxyCodeLine{\Hypertarget{cam__queue_8h_source_l00085}00085 }
\DoxyCodeLine{\Hypertarget{cam__queue_8h_source_l00086}00086 \textcolor{keywordtype}{void}             \mbox{\hyperlink{cam__queue_8h_a68c69e569df0e305350f945b23d6be62}{cam\_devq\_free}}(\textcolor{keyword}{struct} \mbox{\hyperlink{structcam__devq}{cam\_devq}} *devq);}
\DoxyCodeLine{\Hypertarget{cam__queue_8h_source_l00087}00087 }
\DoxyCodeLine{\Hypertarget{cam__queue_8h_source_l00088}00088 u\_int32\_t        \mbox{\hyperlink{cam__queue_8h_ae3eb5833dfabe893a0817387358df9dd}{cam\_devq\_resize}}(\textcolor{keyword}{struct} \mbox{\hyperlink{structcam__devq}{cam\_devq}} *\mbox{\hyperlink{structcamq}{camq}}, \textcolor{keywordtype}{int} openings);}
\DoxyCodeLine{\Hypertarget{cam__queue_8h_source_l00089}00089 }
\DoxyCodeLine{\Hypertarget{cam__queue_8h_source_l00090}00090 \textcolor{comment}{/*}}
\DoxyCodeLine{\Hypertarget{cam__queue_8h_source_l00091}00091 \textcolor{comment}{ * Allocate a cam\_ccb\_queue structure and initialize it.}}
\DoxyCodeLine{\Hypertarget{cam__queue_8h_source_l00092}00092 \textcolor{comment}{ */}}
\DoxyCodeLine{\Hypertarget{cam__queue_8h_source_l00093}00093 \textcolor{keyword}{struct }\mbox{\hyperlink{structcam__ccbq}{cam\_ccbq}} *\mbox{\hyperlink{cam__queue_8h_abb3be5821df7a83dd70b97300da9af24}{cam\_ccbq\_alloc}}(\textcolor{keywordtype}{int} openings);}
\DoxyCodeLine{\Hypertarget{cam__queue_8h_source_l00094}00094 }
\DoxyCodeLine{\Hypertarget{cam__queue_8h_source_l00095}00095 u\_int32\_t       \mbox{\hyperlink{cam__queue_8h_acb10128288f5dd64035dd506eaf4e6ed}{cam\_ccbq\_resize}}(\textcolor{keyword}{struct} \mbox{\hyperlink{structcam__ccbq}{cam\_ccbq}} *ccbq, \textcolor{keywordtype}{int} devices);}
\DoxyCodeLine{\Hypertarget{cam__queue_8h_source_l00096}00096 }
\DoxyCodeLine{\Hypertarget{cam__queue_8h_source_l00097}00097 \textcolor{keywordtype}{int}             \mbox{\hyperlink{cam__queue_8h_af080e7b003aa14fe7afb73390f8616ad}{cam\_ccbq\_init}}(\textcolor{keyword}{struct} \mbox{\hyperlink{structcam__ccbq}{cam\_ccbq}} *ccbq, \textcolor{keywordtype}{int} openings);}
\DoxyCodeLine{\Hypertarget{cam__queue_8h_source_l00098}00098 }
\DoxyCodeLine{\Hypertarget{cam__queue_8h_source_l00099}00099 \textcolor{keywordtype}{void}            \mbox{\hyperlink{cam__queue_8h_a061d789d2c50829590b7fcd6de28fe0a}{cam\_ccbq\_free}}(\textcolor{keyword}{struct} \mbox{\hyperlink{structcam__ccbq}{cam\_ccbq}} *ccbq);}
\DoxyCodeLine{\Hypertarget{cam__queue_8h_source_l00100}00100 }
\DoxyCodeLine{\Hypertarget{cam__queue_8h_source_l00101}00101 \textcolor{keywordtype}{void}            \mbox{\hyperlink{cam__queue_8h_a30c0078f2814cdd41c6cd9dcee022119}{cam\_ccbq\_fini}}(\textcolor{keyword}{struct} \mbox{\hyperlink{structcam__ccbq}{cam\_ccbq}} *ccbq);}
\DoxyCodeLine{\Hypertarget{cam__queue_8h_source_l00102}00102 }
\DoxyCodeLine{\Hypertarget{cam__queue_8h_source_l00103}00103 \textcolor{comment}{/*}}
\DoxyCodeLine{\Hypertarget{cam__queue_8h_source_l00104}00104 \textcolor{comment}{ * Resize a cam queue}}
\DoxyCodeLine{\Hypertarget{cam__queue_8h_source_l00105}00105 \textcolor{comment}{ */}}
\DoxyCodeLine{\Hypertarget{cam__queue_8h_source_l00106}00106 u\_int32\_t       \mbox{\hyperlink{cam__queue_8h_ab787582d57cd74697512851155f9e6be}{camq\_resize}}(\textcolor{keyword}{struct} \mbox{\hyperlink{structcamq}{camq}} *\mbox{\hyperlink{structcam__ccbq_af128199bb2be2854178209fbcfe4014e}{queue}}, \textcolor{keywordtype}{int} new\_size);}
\DoxyCodeLine{\Hypertarget{cam__queue_8h_source_l00107}00107 }
\DoxyCodeLine{\Hypertarget{cam__queue_8h_source_l00108}00108 \textcolor{comment}{/* }}
\DoxyCodeLine{\Hypertarget{cam__queue_8h_source_l00109}00109 \textcolor{comment}{ * Initialize a camq structure.  Return 0 on success, 1 on failure.}}
\DoxyCodeLine{\Hypertarget{cam__queue_8h_source_l00110}00110 \textcolor{comment}{ */}}
\DoxyCodeLine{\Hypertarget{cam__queue_8h_source_l00111}00111 \textcolor{keywordtype}{int}             \mbox{\hyperlink{cam__queue_8h_a6556967440b36636025f054fe858dde3}{camq\_init}}(\textcolor{keyword}{struct} \mbox{\hyperlink{structcamq}{camq}} *\mbox{\hyperlink{structcamq}{camq}}, \textcolor{keywordtype}{int} size);}
\DoxyCodeLine{\Hypertarget{cam__queue_8h_source_l00112}00112 }
\DoxyCodeLine{\Hypertarget{cam__queue_8h_source_l00113}00113 \textcolor{comment}{/*}}
\DoxyCodeLine{\Hypertarget{cam__queue_8h_source_l00114}00114 \textcolor{comment}{ * Finialize any internal storage or state of a cam\_queue.}}
\DoxyCodeLine{\Hypertarget{cam__queue_8h_source_l00115}00115 \textcolor{comment}{ */}}
\DoxyCodeLine{\Hypertarget{cam__queue_8h_source_l00116}00116 \textcolor{keywordtype}{void}            \mbox{\hyperlink{cam__queue_8h_a0745e84207d09f016a5b565d10cfee0a}{camq\_fini}}(\textcolor{keyword}{struct} \mbox{\hyperlink{structcamq}{camq}} *\mbox{\hyperlink{structcam__ccbq_af128199bb2be2854178209fbcfe4014e}{queue}});}
\DoxyCodeLine{\Hypertarget{cam__queue_8h_source_l00117}00117 }
\DoxyCodeLine{\Hypertarget{cam__queue_8h_source_l00118}00118 \textcolor{comment}{/*}}
\DoxyCodeLine{\Hypertarget{cam__queue_8h_source_l00119}00119 \textcolor{comment}{ * cam\_queue\_insert: Given a CAM queue with at least one open spot,}}
\DoxyCodeLine{\Hypertarget{cam__queue_8h_source_l00120}00120 \textcolor{comment}{ * insert the new entry maintaining order.}}
\DoxyCodeLine{\Hypertarget{cam__queue_8h_source_l00121}00121 \textcolor{comment}{ */}}
\DoxyCodeLine{\Hypertarget{cam__queue_8h_source_l00122}00122 \textcolor{keywordtype}{void}            \mbox{\hyperlink{cam__queue_8h_a8ca07f8eba8e6dfcb814bb756a58942b}{camq\_insert}}(\textcolor{keyword}{struct} \mbox{\hyperlink{structcamq}{camq}} *\mbox{\hyperlink{structcam__ccbq_af128199bb2be2854178209fbcfe4014e}{queue}}, \mbox{\hyperlink{structcam__pinfo}{cam\_pinfo}} *new\_entry);}
\DoxyCodeLine{\Hypertarget{cam__queue_8h_source_l00123}00123 }
\DoxyCodeLine{\Hypertarget{cam__queue_8h_source_l00124}00124 \textcolor{comment}{/*}}
\DoxyCodeLine{\Hypertarget{cam__queue_8h_source_l00125}00125 \textcolor{comment}{ * camq\_remove: Remove and arbitrary entry from the queue maintaining}}
\DoxyCodeLine{\Hypertarget{cam__queue_8h_source_l00126}00126 \textcolor{comment}{ * queue order.}}
\DoxyCodeLine{\Hypertarget{cam__queue_8h_source_l00127}00127 \textcolor{comment}{ */}}
\DoxyCodeLine{\Hypertarget{cam__queue_8h_source_l00128}00128 \mbox{\hyperlink{structcam__pinfo}{cam\_pinfo}}      *\mbox{\hyperlink{cam__queue_8h_aceb69b00a057e05d894e44710436d9ba}{camq\_remove}}(\textcolor{keyword}{struct} \mbox{\hyperlink{structcamq}{camq}} *\mbox{\hyperlink{structcam__ccbq_af128199bb2be2854178209fbcfe4014e}{queue}}, \textcolor{keywordtype}{int} index);}
\DoxyCodeLine{\Hypertarget{cam__queue_8h_source_l00129}\mbox{\hyperlink{cam__queue_8h_a5cd5d725581af342b2f29d7d3905dc35}{00129}} \textcolor{preprocessor}{\#define CAMQ\_HEAD 1     }\textcolor{comment}{/* Head of queue index */}\textcolor{preprocessor}{}}
\DoxyCodeLine{\Hypertarget{cam__queue_8h_source_l00130}00130 }
\DoxyCodeLine{\Hypertarget{cam__queue_8h_source_l00131}00131 \textcolor{comment}{/* Index the first element in the heap */}}
\DoxyCodeLine{\Hypertarget{cam__queue_8h_source_l00132}\mbox{\hyperlink{cam__queue_8h_a59ae14ab5dd1e273e7a07ce7324958fa}{00132}} \textcolor{preprocessor}{\#define CAMQ\_GET\_HEAD(camq) ((camq)-\/>queue\_array[CAMQ\_HEAD])}}
\DoxyCodeLine{\Hypertarget{cam__queue_8h_source_l00133}00133 }
\DoxyCodeLine{\Hypertarget{cam__queue_8h_source_l00134}00134 \textcolor{comment}{/* Get the first element priority. */}}
\DoxyCodeLine{\Hypertarget{cam__queue_8h_source_l00135}\mbox{\hyperlink{cam__queue_8h_a02e1ec00a166a694b769ccea8fea5b81}{00135}} \textcolor{preprocessor}{\#define CAMQ\_GET\_PRIO(camq) (((camq)-\/>entries > 0) ?                    \(\backslash\)}}
\DoxyCodeLine{\Hypertarget{cam__queue_8h_source_l00136}00136 \textcolor{preprocessor}{                            ((camq)-\/>queue\_array[CAMQ\_HEAD]-\/>priority) : 0)}}
\DoxyCodeLine{\Hypertarget{cam__queue_8h_source_l00137}00137 }
\DoxyCodeLine{\Hypertarget{cam__queue_8h_source_l00138}00138 \textcolor{comment}{/*}}
\DoxyCodeLine{\Hypertarget{cam__queue_8h_source_l00139}00139 \textcolor{comment}{ * camq\_change\_priority: Raise or lower the priority of an entry}}
\DoxyCodeLine{\Hypertarget{cam__queue_8h_source_l00140}00140 \textcolor{comment}{ * maintaining queue order.}}
\DoxyCodeLine{\Hypertarget{cam__queue_8h_source_l00141}00141 \textcolor{comment}{ */}}
\DoxyCodeLine{\Hypertarget{cam__queue_8h_source_l00142}00142 \textcolor{keywordtype}{void}            \mbox{\hyperlink{cam__queue_8h_a6b98d9c94a02db39efb2460dad15af8f}{camq\_change\_priority}}(\textcolor{keyword}{struct} \mbox{\hyperlink{structcamq}{camq}} *\mbox{\hyperlink{structcam__ccbq_af128199bb2be2854178209fbcfe4014e}{queue}}, \textcolor{keywordtype}{int} index,}
\DoxyCodeLine{\Hypertarget{cam__queue_8h_source_l00143}00143                                      u\_int32\_t new\_priority);}
\DoxyCodeLine{\Hypertarget{cam__queue_8h_source_l00144}00144 }
\DoxyCodeLine{\Hypertarget{cam__queue_8h_source_l00145}00145 \textcolor{keyword}{static} \_\_inline \textcolor{keywordtype}{int}}
\DoxyCodeLine{\Hypertarget{cam__queue_8h_source_l00146}00146 \mbox{\hyperlink{cam__queue_8h_a0b82b99d54c4d5fb1a789d94335a65bf}{cam\_ccbq\_pending\_ccb\_count}}(\textcolor{keyword}{struct} \mbox{\hyperlink{structcam__ccbq}{cam\_ccbq}} *ccbq);}
\DoxyCodeLine{\Hypertarget{cam__queue_8h_source_l00147}00147 }
\DoxyCodeLine{\Hypertarget{cam__queue_8h_source_l00148}00148 \textcolor{keyword}{static} \_\_inline \textcolor{keywordtype}{void}}
\DoxyCodeLine{\Hypertarget{cam__queue_8h_source_l00149}00149 \mbox{\hyperlink{cam__queue_8h_ae816fd17d8099e7a084f95a762fad0a6}{cam\_ccbq\_take\_opening}}(\textcolor{keyword}{struct} \mbox{\hyperlink{structcam__ccbq}{cam\_ccbq}} *ccbq);}
\DoxyCodeLine{\Hypertarget{cam__queue_8h_source_l00150}00150 }
\DoxyCodeLine{\Hypertarget{cam__queue_8h_source_l00151}00151 \textcolor{keyword}{static} \_\_inline \textcolor{keywordtype}{void}}
\DoxyCodeLine{\Hypertarget{cam__queue_8h_source_l00152}00152 \mbox{\hyperlink{cam__queue_8h_ac9402e54e81d675ae8624ad22f454d7f}{cam\_ccbq\_insert\_ccb}}(\textcolor{keyword}{struct} \mbox{\hyperlink{structcam__ccbq}{cam\_ccbq}} *ccbq, \textcolor{keyword}{union} \mbox{\hyperlink{unionccb}{ccb}} *new\_ccb);}
\DoxyCodeLine{\Hypertarget{cam__queue_8h_source_l00153}00153 }
\DoxyCodeLine{\Hypertarget{cam__queue_8h_source_l00154}00154 \textcolor{keyword}{static} \_\_inline \textcolor{keywordtype}{void}}
\DoxyCodeLine{\Hypertarget{cam__queue_8h_source_l00155}00155 \mbox{\hyperlink{cam__queue_8h_ac81587eab84a0dbc03fed74ee9ab9598}{cam\_ccbq\_remove\_ccb}}(\textcolor{keyword}{struct} \mbox{\hyperlink{structcam__ccbq}{cam\_ccbq}} *ccbq, \textcolor{keyword}{union} \mbox{\hyperlink{unionccb}{ccb}} *\mbox{\hyperlink{unionccb}{ccb}});}
\DoxyCodeLine{\Hypertarget{cam__queue_8h_source_l00156}00156 }
\DoxyCodeLine{\Hypertarget{cam__queue_8h_source_l00157}00157 \textcolor{keyword}{static} \_\_inline \textcolor{keyword}{union }\mbox{\hyperlink{unionccb}{ccb}} *}
\DoxyCodeLine{\Hypertarget{cam__queue_8h_source_l00158}00158 \mbox{\hyperlink{cam__queue_8h_a88b04101c1b336d3159fe5f9dd2d9167}{cam\_ccbq\_peek\_ccb}}(\textcolor{keyword}{struct} \mbox{\hyperlink{structcam__ccbq}{cam\_ccbq}} *ccbq, \textcolor{keywordtype}{int} index);}
\DoxyCodeLine{\Hypertarget{cam__queue_8h_source_l00159}00159 }
\DoxyCodeLine{\Hypertarget{cam__queue_8h_source_l00160}00160 \textcolor{keyword}{static} \_\_inline \textcolor{keywordtype}{void}}
\DoxyCodeLine{\Hypertarget{cam__queue_8h_source_l00161}00161 \mbox{\hyperlink{cam__queue_8h_a8bad2c4c44090a886d9cc6f4a1ca99fc}{cam\_ccbq\_send\_ccb}}(\textcolor{keyword}{struct} \mbox{\hyperlink{structcam__ccbq}{cam\_ccbq}} *queue, \textcolor{keyword}{union} \mbox{\hyperlink{unionccb}{ccb}} *send\_ccb);}
\DoxyCodeLine{\Hypertarget{cam__queue_8h_source_l00162}00162 }
\DoxyCodeLine{\Hypertarget{cam__queue_8h_source_l00163}00163 \textcolor{keyword}{static} \_\_inline \textcolor{keywordtype}{void}}
\DoxyCodeLine{\Hypertarget{cam__queue_8h_source_l00164}00164 \mbox{\hyperlink{cam__queue_8h_ade394640c8b7360942ce215d7950a22d}{cam\_ccbq\_ccb\_done}}(\textcolor{keyword}{struct} \mbox{\hyperlink{structcam__ccbq}{cam\_ccbq}} *ccbq, \textcolor{keyword}{union} \mbox{\hyperlink{unionccb}{ccb}} *done\_ccb);}
\DoxyCodeLine{\Hypertarget{cam__queue_8h_source_l00165}00165 }
\DoxyCodeLine{\Hypertarget{cam__queue_8h_source_l00166}00166 \textcolor{keyword}{static} \_\_inline \textcolor{keywordtype}{void}}
\DoxyCodeLine{\Hypertarget{cam__queue_8h_source_l00167}00167 \mbox{\hyperlink{cam__queue_8h_aa5ba24545e74d7d96695981141068ef2}{cam\_ccbq\_release\_opening}}(\textcolor{keyword}{struct} \mbox{\hyperlink{structcam__ccbq}{cam\_ccbq}} *ccbq);}
\DoxyCodeLine{\Hypertarget{cam__queue_8h_source_l00168}00168 }
\DoxyCodeLine{\Hypertarget{cam__queue_8h_source_l00169}00169 \textcolor{keyword}{static} \_\_inline \textcolor{keywordtype}{int}}
\DoxyCodeLine{\Hypertarget{cam__queue_8h_source_l00170}\mbox{\hyperlink{cam__queue_8h_a0b82b99d54c4d5fb1a789d94335a65bf}{00170}} \mbox{\hyperlink{cam__queue_8h_a0b82b99d54c4d5fb1a789d94335a65bf}{cam\_ccbq\_pending\_ccb\_count}}(\textcolor{keyword}{struct} \mbox{\hyperlink{structcam__ccbq}{cam\_ccbq}} *ccbq)}
\DoxyCodeLine{\Hypertarget{cam__queue_8h_source_l00171}00171 \{}
\DoxyCodeLine{\Hypertarget{cam__queue_8h_source_l00172}00172         \textcolor{keywordflow}{return} (ccbq-\/>\mbox{\hyperlink{structcam__ccbq_af128199bb2be2854178209fbcfe4014e}{queue}}.\mbox{\hyperlink{structcamq_aa6838891d6293a8697c3e15381835335}{entries}} + ccbq-\/>\mbox{\hyperlink{structcam__ccbq_a1b9f76bf95b466214209f486f8259dcb}{queue\_extra\_entries}});}
\DoxyCodeLine{\Hypertarget{cam__queue_8h_source_l00173}00173 \}}
\DoxyCodeLine{\Hypertarget{cam__queue_8h_source_l00174}00174 }
\DoxyCodeLine{\Hypertarget{cam__queue_8h_source_l00175}00175 \textcolor{keyword}{static} \_\_inline \textcolor{keywordtype}{void}}
\DoxyCodeLine{\Hypertarget{cam__queue_8h_source_l00176}\mbox{\hyperlink{cam__queue_8h_ae816fd17d8099e7a084f95a762fad0a6}{00176}} \mbox{\hyperlink{cam__queue_8h_ae816fd17d8099e7a084f95a762fad0a6}{cam\_ccbq\_take\_opening}}(\textcolor{keyword}{struct} \mbox{\hyperlink{structcam__ccbq}{cam\_ccbq}} *ccbq)}
\DoxyCodeLine{\Hypertarget{cam__queue_8h_source_l00177}00177 \{}
\DoxyCodeLine{\Hypertarget{cam__queue_8h_source_l00178}00178 }
\DoxyCodeLine{\Hypertarget{cam__queue_8h_source_l00179}00179         ccbq-\/>\mbox{\hyperlink{structcam__ccbq_a9e96a72cdbc06338b67045a1c2ee3877}{allocated}}++;}
\DoxyCodeLine{\Hypertarget{cam__queue_8h_source_l00180}00180 \}}
\DoxyCodeLine{\Hypertarget{cam__queue_8h_source_l00181}00181 }
\DoxyCodeLine{\Hypertarget{cam__queue_8h_source_l00182}00182 \textcolor{keyword}{static} \_\_inline \textcolor{keywordtype}{void}}
\DoxyCodeLine{\Hypertarget{cam__queue_8h_source_l00183}\mbox{\hyperlink{cam__queue_8h_ac9402e54e81d675ae8624ad22f454d7f}{00183}} \mbox{\hyperlink{cam__queue_8h_ac9402e54e81d675ae8624ad22f454d7f}{cam\_ccbq\_insert\_ccb}}(\textcolor{keyword}{struct} \mbox{\hyperlink{structcam__ccbq}{cam\_ccbq}} *ccbq, \textcolor{keyword}{union} \mbox{\hyperlink{unionccb}{ccb}} *new\_ccb)}
\DoxyCodeLine{\Hypertarget{cam__queue_8h_source_l00184}00184 \{}
\DoxyCodeLine{\Hypertarget{cam__queue_8h_source_l00185}00185         \textcolor{keyword}{struct }\mbox{\hyperlink{structccb__hdr}{ccb\_hdr}} *old\_ccb;}
\DoxyCodeLine{\Hypertarget{cam__queue_8h_source_l00186}00186         \textcolor{keyword}{struct }\mbox{\hyperlink{structcamq}{camq}} *queue = \&ccbq-\/>\mbox{\hyperlink{structcam__ccbq_af128199bb2be2854178209fbcfe4014e}{queue}};}
\DoxyCodeLine{\Hypertarget{cam__queue_8h_source_l00187}00187 }
\DoxyCodeLine{\Hypertarget{cam__queue_8h_source_l00188}00188         KASSERT((new\_ccb-\/>\mbox{\hyperlink{unionccb_ab0f218bc2944e08931eb0d935ce4085f}{ccb\_h}}.\mbox{\hyperlink{structccb__hdr_a7439d6fedcb6191113a285c51038cd71}{func\_code}} \& \mbox{\hyperlink{cam__ccb_8h_aa49540dd5ca09d2e63a5251de499055ca381e033b34c98c2fc6be5c52e3b1dcce}{XPT\_FC\_QUEUED}}) != 0 \&\&}
\DoxyCodeLine{\Hypertarget{cam__queue_8h_source_l00189}00189             (new\_ccb-\/>\mbox{\hyperlink{unionccb_ab0f218bc2944e08931eb0d935ce4085f}{ccb\_h}}.\mbox{\hyperlink{structccb__hdr_a7439d6fedcb6191113a285c51038cd71}{func\_code}} \& \mbox{\hyperlink{cam__ccb_8h_aa49540dd5ca09d2e63a5251de499055cabaa3982afe2804b2936ae961ecd7aa5d}{XPT\_FC\_USER\_CCB}}) == 0,}
\DoxyCodeLine{\Hypertarget{cam__queue_8h_source_l00190}00190             (\textcolor{stringliteral}{"{}\%s: Cannot queue ccb \%p func\_code \%\#x"{}}, \_\_func\_\_, new\_ccb,}
\DoxyCodeLine{\Hypertarget{cam__queue_8h_source_l00191}00191              new\_ccb-\/>\mbox{\hyperlink{unionccb_ab0f218bc2944e08931eb0d935ce4085f}{ccb\_h}}.\mbox{\hyperlink{structccb__hdr_a7439d6fedcb6191113a285c51038cd71}{func\_code}}));}
\DoxyCodeLine{\Hypertarget{cam__queue_8h_source_l00192}00192 }
\DoxyCodeLine{\Hypertarget{cam__queue_8h_source_l00193}00193         \textcolor{comment}{/*}}
\DoxyCodeLine{\Hypertarget{cam__queue_8h_source_l00194}00194 \textcolor{comment}{         * If queue is already full, try to resize.}}
\DoxyCodeLine{\Hypertarget{cam__queue_8h_source_l00195}00195 \textcolor{comment}{         * If resize fail, push CCB with lowest priority out to the TAILQ.}}
\DoxyCodeLine{\Hypertarget{cam__queue_8h_source_l00196}00196 \textcolor{comment}{         */}}
\DoxyCodeLine{\Hypertarget{cam__queue_8h_source_l00197}00197         \textcolor{keywordflow}{if} (queue-\/>\mbox{\hyperlink{structcamq_aa6838891d6293a8697c3e15381835335}{entries}} == queue-\/>\mbox{\hyperlink{structcamq_a0f52bb514dd299f383aeb4cb7a7f6de3}{array\_size}} \&\&}
\DoxyCodeLine{\Hypertarget{cam__queue_8h_source_l00198}00198             \mbox{\hyperlink{cam__queue_8h_ab787582d57cd74697512851155f9e6be}{camq\_resize}}(\&ccbq-\/>\mbox{\hyperlink{structcam__ccbq_af128199bb2be2854178209fbcfe4014e}{queue}}, queue-\/>\mbox{\hyperlink{structcamq_a0f52bb514dd299f383aeb4cb7a7f6de3}{array\_size}} * 2) != \mbox{\hyperlink{cam_8h_a9ff49352334e6ad8ce937cf2fdf4cfb3a3487a040bd091973beb62275a7309324}{CAM\_REQ\_CMP}}) \{}
\DoxyCodeLine{\Hypertarget{cam__queue_8h_source_l00199}00199                 old\_ccb = (\textcolor{keyword}{struct }\mbox{\hyperlink{structccb__hdr}{ccb\_hdr}} *)\mbox{\hyperlink{cam__queue_8h_aceb69b00a057e05d894e44710436d9ba}{camq\_remove}}(queue, queue-\/>\mbox{\hyperlink{structcamq_aa6838891d6293a8697c3e15381835335}{entries}});}
\DoxyCodeLine{\Hypertarget{cam__queue_8h_source_l00200}00200                 TAILQ\_INSERT\_HEAD(\&ccbq-\/>\mbox{\hyperlink{structcam__ccbq_a743d929181695ef9f7458d740c719240}{queue\_extra\_head}}, old\_ccb,}
\DoxyCodeLine{\Hypertarget{cam__queue_8h_source_l00201}00201                     \mbox{\hyperlink{structccb__hdr_a09eb5ef956bf3ff5e6c8f1be72c376ee}{xpt\_links}}.tqe);}
\DoxyCodeLine{\Hypertarget{cam__queue_8h_source_l00202}00202                 old\_ccb-\/>\mbox{\hyperlink{structccb__hdr_a5f28f6d8f0a215f677b69fb9c04caf8c}{pinfo}}.\mbox{\hyperlink{structcam__pinfo_a47744d2d5380c9fc3f1b25aedd56c3c5}{index}} = \mbox{\hyperlink{cam_8h_a3d8cb1be334bcf52fbaedc1a1782c349}{CAM\_EXTRAQ\_INDEX}};}
\DoxyCodeLine{\Hypertarget{cam__queue_8h_source_l00203}00203                 ccbq-\/>\mbox{\hyperlink{structcam__ccbq_a1b9f76bf95b466214209f486f8259dcb}{queue\_extra\_entries}}++;}
\DoxyCodeLine{\Hypertarget{cam__queue_8h_source_l00204}00204         \}}
\DoxyCodeLine{\Hypertarget{cam__queue_8h_source_l00205}00205 }
\DoxyCodeLine{\Hypertarget{cam__queue_8h_source_l00206}00206         \mbox{\hyperlink{cam__queue_8h_a8ca07f8eba8e6dfcb814bb756a58942b}{camq\_insert}}(queue, \&new\_ccb-\/>\mbox{\hyperlink{unionccb_ab0f218bc2944e08931eb0d935ce4085f}{ccb\_h}}.\mbox{\hyperlink{structccb__hdr_a5f28f6d8f0a215f677b69fb9c04caf8c}{pinfo}});}
\DoxyCodeLine{\Hypertarget{cam__queue_8h_source_l00207}00207 \}}
\DoxyCodeLine{\Hypertarget{cam__queue_8h_source_l00208}00208 }
\DoxyCodeLine{\Hypertarget{cam__queue_8h_source_l00209}00209 \textcolor{keyword}{static} \_\_inline \textcolor{keywordtype}{void}}
\DoxyCodeLine{\Hypertarget{cam__queue_8h_source_l00210}\mbox{\hyperlink{cam__queue_8h_ac81587eab84a0dbc03fed74ee9ab9598}{00210}} \mbox{\hyperlink{cam__queue_8h_ac81587eab84a0dbc03fed74ee9ab9598}{cam\_ccbq\_remove\_ccb}}(\textcolor{keyword}{struct} \mbox{\hyperlink{structcam__ccbq}{cam\_ccbq}} *ccbq, \textcolor{keyword}{union} \mbox{\hyperlink{unionccb}{ccb}} *\mbox{\hyperlink{unionccb}{ccb}})}
\DoxyCodeLine{\Hypertarget{cam__queue_8h_source_l00211}00211 \{}
\DoxyCodeLine{\Hypertarget{cam__queue_8h_source_l00212}00212         \textcolor{keyword}{struct }\mbox{\hyperlink{structccb__hdr}{ccb\_hdr}} *cccb, *bccb;}
\DoxyCodeLine{\Hypertarget{cam__queue_8h_source_l00213}00213         \textcolor{keyword}{struct }\mbox{\hyperlink{structcamq}{camq}} *queue = \&ccbq-\/>\mbox{\hyperlink{structcam__ccbq_af128199bb2be2854178209fbcfe4014e}{queue}};}
\DoxyCodeLine{\Hypertarget{cam__queue_8h_source_l00214}00214         \mbox{\hyperlink{structcam__pinfo}{cam\_pinfo}} *removed\_entry \_\_unused;}
\DoxyCodeLine{\Hypertarget{cam__queue_8h_source_l00215}00215 }
\DoxyCodeLine{\Hypertarget{cam__queue_8h_source_l00216}00216         \textcolor{comment}{/* If the CCB is on the TAILQ, remove it from there. */}}
\DoxyCodeLine{\Hypertarget{cam__queue_8h_source_l00217}00217         \textcolor{keywordflow}{if} (\mbox{\hyperlink{unionccb}{ccb}}-\/>\mbox{\hyperlink{unionccb_ab0f218bc2944e08931eb0d935ce4085f}{ccb\_h}}.\mbox{\hyperlink{structccb__hdr_a5f28f6d8f0a215f677b69fb9c04caf8c}{pinfo}}.\mbox{\hyperlink{structcam__pinfo_a47744d2d5380c9fc3f1b25aedd56c3c5}{index}} == \mbox{\hyperlink{cam_8h_a3d8cb1be334bcf52fbaedc1a1782c349}{CAM\_EXTRAQ\_INDEX}}) \{}
\DoxyCodeLine{\Hypertarget{cam__queue_8h_source_l00218}00218                 TAILQ\_REMOVE(\&ccbq-\/>\mbox{\hyperlink{structcam__ccbq_a743d929181695ef9f7458d740c719240}{queue\_extra\_head}}, \&\mbox{\hyperlink{unionccb}{ccb}}-\/>\mbox{\hyperlink{unionccb_ab0f218bc2944e08931eb0d935ce4085f}{ccb\_h}},}
\DoxyCodeLine{\Hypertarget{cam__queue_8h_source_l00219}00219                     xpt\_links.tqe);}
\DoxyCodeLine{\Hypertarget{cam__queue_8h_source_l00220}00220                 \mbox{\hyperlink{unionccb}{ccb}}-\/>\mbox{\hyperlink{unionccb_ab0f218bc2944e08931eb0d935ce4085f}{ccb\_h}}.\mbox{\hyperlink{structccb__hdr_a5f28f6d8f0a215f677b69fb9c04caf8c}{pinfo}}.\mbox{\hyperlink{structcam__pinfo_a47744d2d5380c9fc3f1b25aedd56c3c5}{index}} = \mbox{\hyperlink{cam_8h_a7af58dadfb8e09c223ffed09239f787b}{CAM\_UNQUEUED\_INDEX}};}
\DoxyCodeLine{\Hypertarget{cam__queue_8h_source_l00221}00221                 ccbq-\/>\mbox{\hyperlink{structcam__ccbq_a1b9f76bf95b466214209f486f8259dcb}{queue\_extra\_entries}}-\/-\/;}
\DoxyCodeLine{\Hypertarget{cam__queue_8h_source_l00222}00222                 \textcolor{keywordflow}{return};}
\DoxyCodeLine{\Hypertarget{cam__queue_8h_source_l00223}00223         \}}
\DoxyCodeLine{\Hypertarget{cam__queue_8h_source_l00224}00224 }
\DoxyCodeLine{\Hypertarget{cam__queue_8h_source_l00225}00225         removed\_entry = \mbox{\hyperlink{cam__queue_8h_aceb69b00a057e05d894e44710436d9ba}{camq\_remove}}(queue, \mbox{\hyperlink{unionccb}{ccb}}-\/>\mbox{\hyperlink{unionccb_ab0f218bc2944e08931eb0d935ce4085f}{ccb\_h}}.\mbox{\hyperlink{structccb__hdr_a5f28f6d8f0a215f677b69fb9c04caf8c}{pinfo}}.\mbox{\hyperlink{structcam__pinfo_a47744d2d5380c9fc3f1b25aedd56c3c5}{index}});}
\DoxyCodeLine{\Hypertarget{cam__queue_8h_source_l00226}00226         KASSERT(removed\_entry == \&\mbox{\hyperlink{unionccb}{ccb}}-\/>\mbox{\hyperlink{unionccb_ab0f218bc2944e08931eb0d935ce4085f}{ccb\_h}}.\mbox{\hyperlink{structccb__hdr_a5f28f6d8f0a215f677b69fb9c04caf8c}{pinfo}},}
\DoxyCodeLine{\Hypertarget{cam__queue_8h_source_l00227}00227             (\textcolor{stringliteral}{"{}\%s: Removed wrong entry from queue (\%p != \%p)"{}}, \_\_func\_\_,}
\DoxyCodeLine{\Hypertarget{cam__queue_8h_source_l00228}00228              removed\_entry, \&\mbox{\hyperlink{unionccb}{ccb}}-\/>\mbox{\hyperlink{unionccb_ab0f218bc2944e08931eb0d935ce4085f}{ccb\_h}}.\mbox{\hyperlink{structccb__hdr_a5f28f6d8f0a215f677b69fb9c04caf8c}{pinfo}}));}
\DoxyCodeLine{\Hypertarget{cam__queue_8h_source_l00229}00229 }
\DoxyCodeLine{\Hypertarget{cam__queue_8h_source_l00230}00230         \textcolor{comment}{/*}}
\DoxyCodeLine{\Hypertarget{cam__queue_8h_source_l00231}00231 \textcolor{comment}{         * If there are some CCBs on TAILQ, find the best one and move it}}
\DoxyCodeLine{\Hypertarget{cam__queue_8h_source_l00232}00232 \textcolor{comment}{         * to the emptied space in the queue.}}
\DoxyCodeLine{\Hypertarget{cam__queue_8h_source_l00233}00233 \textcolor{comment}{         */}}
\DoxyCodeLine{\Hypertarget{cam__queue_8h_source_l00234}00234         bccb = TAILQ\_FIRST(\&ccbq-\/>\mbox{\hyperlink{structcam__ccbq_a743d929181695ef9f7458d740c719240}{queue\_extra\_head}});}
\DoxyCodeLine{\Hypertarget{cam__queue_8h_source_l00235}00235         \textcolor{keywordflow}{if} (bccb == NULL)}
\DoxyCodeLine{\Hypertarget{cam__queue_8h_source_l00236}00236                 \textcolor{keywordflow}{return};}
\DoxyCodeLine{\Hypertarget{cam__queue_8h_source_l00237}00237         TAILQ\_FOREACH(cccb, \&ccbq-\/>\mbox{\hyperlink{structcam__ccbq_a743d929181695ef9f7458d740c719240}{queue\_extra\_head}}, xpt\_links.tqe) \{}
\DoxyCodeLine{\Hypertarget{cam__queue_8h_source_l00238}00238                 \textcolor{keywordflow}{if} (bccb-\/>\mbox{\hyperlink{structccb__hdr_a5f28f6d8f0a215f677b69fb9c04caf8c}{pinfo}}.\mbox{\hyperlink{structcam__pinfo_a006313c394eb385f8f4aa130f6a9d213}{priority}} > cccb-\/>\mbox{\hyperlink{structccb__hdr_a5f28f6d8f0a215f677b69fb9c04caf8c}{pinfo}}.\mbox{\hyperlink{structcam__pinfo_a006313c394eb385f8f4aa130f6a9d213}{priority}} ||}
\DoxyCodeLine{\Hypertarget{cam__queue_8h_source_l00239}00239                     (bccb-\/>\mbox{\hyperlink{structccb__hdr_a5f28f6d8f0a215f677b69fb9c04caf8c}{pinfo}}.\mbox{\hyperlink{structcam__pinfo_a006313c394eb385f8f4aa130f6a9d213}{priority}} == cccb-\/>\mbox{\hyperlink{structccb__hdr_a5f28f6d8f0a215f677b69fb9c04caf8c}{pinfo}}.\mbox{\hyperlink{structcam__pinfo_a006313c394eb385f8f4aa130f6a9d213}{priority}} \&\&}
\DoxyCodeLine{\Hypertarget{cam__queue_8h_source_l00240}00240                      \mbox{\hyperlink{cam_8h_a29424f425e5a7c6f487d2aa062204f81}{GENERATIONCMP}}(bccb-\/>\mbox{\hyperlink{structccb__hdr_a5f28f6d8f0a215f677b69fb9c04caf8c}{pinfo}}.\mbox{\hyperlink{structcam__pinfo_a1e769219f43e7a79790aa0f1a7059c0f}{generation}}, >,}
\DoxyCodeLine{\Hypertarget{cam__queue_8h_source_l00241}00241                       cccb-\/>\mbox{\hyperlink{structccb__hdr_a5f28f6d8f0a215f677b69fb9c04caf8c}{pinfo}}.\mbox{\hyperlink{structcam__pinfo_a1e769219f43e7a79790aa0f1a7059c0f}{generation}})))}
\DoxyCodeLine{\Hypertarget{cam__queue_8h_source_l00242}00242                         bccb = cccb;}
\DoxyCodeLine{\Hypertarget{cam__queue_8h_source_l00243}00243         \}}
\DoxyCodeLine{\Hypertarget{cam__queue_8h_source_l00244}00244         TAILQ\_REMOVE(\&ccbq-\/>\mbox{\hyperlink{structcam__ccbq_a743d929181695ef9f7458d740c719240}{queue\_extra\_head}}, bccb, xpt\_links.tqe);}
\DoxyCodeLine{\Hypertarget{cam__queue_8h_source_l00245}00245         ccbq-\/>\mbox{\hyperlink{structcam__ccbq_a1b9f76bf95b466214209f486f8259dcb}{queue\_extra\_entries}}-\/-\/;}
\DoxyCodeLine{\Hypertarget{cam__queue_8h_source_l00246}00246         \mbox{\hyperlink{cam__queue_8h_a8ca07f8eba8e6dfcb814bb756a58942b}{camq\_insert}}(queue, \&bccb-\/>\mbox{\hyperlink{structccb__hdr_a5f28f6d8f0a215f677b69fb9c04caf8c}{pinfo}});}
\DoxyCodeLine{\Hypertarget{cam__queue_8h_source_l00247}00247 \}}
\DoxyCodeLine{\Hypertarget{cam__queue_8h_source_l00248}00248 }
\DoxyCodeLine{\Hypertarget{cam__queue_8h_source_l00249}00249 \textcolor{keyword}{static} \_\_inline \textcolor{keyword}{union }\mbox{\hyperlink{unionccb}{ccb}} *}
\DoxyCodeLine{\Hypertarget{cam__queue_8h_source_l00250}\mbox{\hyperlink{cam__queue_8h_a88b04101c1b336d3159fe5f9dd2d9167}{00250}} \mbox{\hyperlink{cam__queue_8h_a88b04101c1b336d3159fe5f9dd2d9167}{cam\_ccbq\_peek\_ccb}}(\textcolor{keyword}{struct} \mbox{\hyperlink{structcam__ccbq}{cam\_ccbq}} *ccbq, \textcolor{keywordtype}{int} index)}
\DoxyCodeLine{\Hypertarget{cam__queue_8h_source_l00251}00251 \{}
\DoxyCodeLine{\Hypertarget{cam__queue_8h_source_l00252}00252         \textcolor{keywordflow}{return}((\textcolor{keyword}{union} \mbox{\hyperlink{unionccb}{ccb}} *)ccbq-\/>\mbox{\hyperlink{structcam__ccbq_af128199bb2be2854178209fbcfe4014e}{queue}}.\mbox{\hyperlink{structcamq_a09848452a34e48995b3d485ad1776d43}{queue\_array}}[index]);}
\DoxyCodeLine{\Hypertarget{cam__queue_8h_source_l00253}00253 \}}
\DoxyCodeLine{\Hypertarget{cam__queue_8h_source_l00254}00254 }
\DoxyCodeLine{\Hypertarget{cam__queue_8h_source_l00255}00255 \textcolor{keyword}{static} \_\_inline \textcolor{keywordtype}{void}}
\DoxyCodeLine{\Hypertarget{cam__queue_8h_source_l00256}\mbox{\hyperlink{cam__queue_8h_a8bad2c4c44090a886d9cc6f4a1ca99fc}{00256}} \mbox{\hyperlink{cam__queue_8h_a8bad2c4c44090a886d9cc6f4a1ca99fc}{cam\_ccbq\_send\_ccb}}(\textcolor{keyword}{struct} \mbox{\hyperlink{structcam__ccbq}{cam\_ccbq}} *ccbq, \textcolor{keyword}{union} \mbox{\hyperlink{unionccb}{ccb}} *send\_ccb)}
\DoxyCodeLine{\Hypertarget{cam__queue_8h_source_l00257}00257 \{}
\DoxyCodeLine{\Hypertarget{cam__queue_8h_source_l00258}00258 }
\DoxyCodeLine{\Hypertarget{cam__queue_8h_source_l00259}00259         send\_ccb-\/>\mbox{\hyperlink{unionccb_ab0f218bc2944e08931eb0d935ce4085f}{ccb\_h}}.\mbox{\hyperlink{structccb__hdr_a5f28f6d8f0a215f677b69fb9c04caf8c}{pinfo}}.\mbox{\hyperlink{structcam__pinfo_a47744d2d5380c9fc3f1b25aedd56c3c5}{index}} = \mbox{\hyperlink{cam_8h_ae078a01f7b90158ef215b29ca1307071}{CAM\_ACTIVE\_INDEX}};}
\DoxyCodeLine{\Hypertarget{cam__queue_8h_source_l00260}00260         ccbq-\/>\mbox{\hyperlink{structcam__ccbq_a6a866cbf6518531b9b48c3521ca28d54}{dev\_active}}++;}
\DoxyCodeLine{\Hypertarget{cam__queue_8h_source_l00261}00261         ccbq-\/>\mbox{\hyperlink{structcam__ccbq_aef5404cb1fa8ad1c4ec40ad883c2b47c}{dev\_openings}}-\/-\/;}
\DoxyCodeLine{\Hypertarget{cam__queue_8h_source_l00262}00262 \}}
\DoxyCodeLine{\Hypertarget{cam__queue_8h_source_l00263}00263 }
\DoxyCodeLine{\Hypertarget{cam__queue_8h_source_l00264}00264 \textcolor{keyword}{static} \_\_inline \textcolor{keywordtype}{void}}
\DoxyCodeLine{\Hypertarget{cam__queue_8h_source_l00265}\mbox{\hyperlink{cam__queue_8h_ade394640c8b7360942ce215d7950a22d}{00265}} \mbox{\hyperlink{cam__queue_8h_ade394640c8b7360942ce215d7950a22d}{cam\_ccbq\_ccb\_done}}(\textcolor{keyword}{struct} \mbox{\hyperlink{structcam__ccbq}{cam\_ccbq}} *ccbq, \textcolor{keyword}{union} \mbox{\hyperlink{unionccb}{ccb}} *done\_ccb)}
\DoxyCodeLine{\Hypertarget{cam__queue_8h_source_l00266}00266 \{}
\DoxyCodeLine{\Hypertarget{cam__queue_8h_source_l00267}00267 }
\DoxyCodeLine{\Hypertarget{cam__queue_8h_source_l00268}00268         ccbq-\/>\mbox{\hyperlink{structcam__ccbq_a6a866cbf6518531b9b48c3521ca28d54}{dev\_active}}-\/-\/;}
\DoxyCodeLine{\Hypertarget{cam__queue_8h_source_l00269}00269         ccbq-\/>\mbox{\hyperlink{structcam__ccbq_aef5404cb1fa8ad1c4ec40ad883c2b47c}{dev\_openings}}++;}
\DoxyCodeLine{\Hypertarget{cam__queue_8h_source_l00270}00270 \}}
\DoxyCodeLine{\Hypertarget{cam__queue_8h_source_l00271}00271 }
\DoxyCodeLine{\Hypertarget{cam__queue_8h_source_l00272}00272 \textcolor{keyword}{static} \_\_inline \textcolor{keywordtype}{void}}
\DoxyCodeLine{\Hypertarget{cam__queue_8h_source_l00273}\mbox{\hyperlink{cam__queue_8h_aa5ba24545e74d7d96695981141068ef2}{00273}} \mbox{\hyperlink{cam__queue_8h_aa5ba24545e74d7d96695981141068ef2}{cam\_ccbq\_release\_opening}}(\textcolor{keyword}{struct} \mbox{\hyperlink{structcam__ccbq}{cam\_ccbq}} *ccbq)}
\DoxyCodeLine{\Hypertarget{cam__queue_8h_source_l00274}00274 \{}
\DoxyCodeLine{\Hypertarget{cam__queue_8h_source_l00275}00275 }
\DoxyCodeLine{\Hypertarget{cam__queue_8h_source_l00276}00276         ccbq-\/>\mbox{\hyperlink{structcam__ccbq_a9e96a72cdbc06338b67045a1c2ee3877}{allocated}}-\/-\/;}
\DoxyCodeLine{\Hypertarget{cam__queue_8h_source_l00277}00277 \}}
\DoxyCodeLine{\Hypertarget{cam__queue_8h_source_l00278}00278 }
\DoxyCodeLine{\Hypertarget{cam__queue_8h_source_l00279}00279 \textcolor{preprocessor}{\#endif }\textcolor{comment}{/* \_KERNEL */}\textcolor{preprocessor}{}}
\DoxyCodeLine{\Hypertarget{cam__queue_8h_source_l00280}00280 \textcolor{preprocessor}{\#endif  }\textcolor{comment}{/* \_CAM\_CAM\_QUEUE\_H */}\textcolor{preprocessor}{}}

\end{DoxyCode}
