-<h2>semaphore_create</h2>\r<hr>\r<p>\r<strong>Function</strong> - Create a new semaphore.\r<h3>SYNOPSIS</h3>\r<pre>\r<strong>kern_return_t semaphore_create</strong>\r <strong>(task_t</strong> <var>task</var>,\r <strong>semaphore_t</strong> <var>*semaphore</var>,\r <strong>int</strong> <var>policy</var>,\r <strong>int</strong> <var>value</var><strong>);</strong>\r</pre>\r<h3>PARAMETERS</h3>\r<dl>\r<dt> <var>task</var>\r<dd>\r[in task port] The task receiving the send right of the newly created semaphore.\r<p>\r<dt> <var>semaphore</var>\r<dd>\r[out send right] The port naming the created semaphore.\r<p>\r<dt> <var>policy</var>\r<dd>\r[in scalar] The blocked thread wakeup policy for the newly created semaphore. Valid policies are:\r<dl>\r<p>\r <dt> SYNC_POLICY_FIFO\r<dd>\ra first-in-first-out policy for scheduling thread wakeup.\r <p>\r <dt> SYNC_POLICY_FIXED_PRIORITY\r<dd>\ra fixed priority policy for scheduling thread wakeup.\r </dl>\r <p>\r<dt> <var>value</var>\r<dd>\r[in scalar] The initial value of the semaphore count.\r</dl>\r<h3>DESCRIPTION</h3>\r<p>\rThe <strong>semaphore_create</strong> function creates a new semaphore, associates the\rcreated semaphore with the specified task, and returns a send right\rnaming the new semaphore. In order to support a robust\rproducer/consumer communication service, Interrupt Service Routines\r(ISR) must be able to signal semaphores. The semaphore synchronizer\rservice is designed to allow user-level device drivers to perform\rsignal operations, eliminating the need for event counters. Device\rdrivers which utilize semaphores are responsible for creating (via\r<strong>semaphore_create</strong>) and exporting (via <strong>device_get_status</strong>)\rsemaphores for\ruser level access. Device driver semaphore creation is done at device\rinitialization time. Device drivers may support multiple semaphores.\r<h3>RETURN VALUES</h3>\r<dl>\r <p>\r<dt> <strong>KERN_INVALID_ARGUMENT</strong>\r<dd>\rThe task argument or the policy argument was invalid,\r or the initial value of the semaphore was invalid.\r <p>\r<dt> <strong>KERN_RESOURCE_SHORTAGE</strong>\r<dd>\rThe kernel could not allocate the semaphore.\r <p>\r<dt> <strong>KERN_SUCCESS</strong>\r<dd>\rThe semaphore was successfully created.\r</dl>\r<h3>RELATED INFORMATION</h3>\r<p>\rFunctions:\r<a href="semaphore_destroy.html"><strong>semaphore_destroy</strong></a>,\r<a href="semaphore_signal.html"><strong>semaphore_signal</strong></a>,\r<a href="semaphore_signal_all.html"><strong>semaphore_signal_all</strong></a>,\r<a href="semaphore_wait.html"><strong>semaphore_wait</strong></a>,\r<a href="device_get_status.html"><strong>device_get_status</strong></a>.\r
\ No newline at end of file
+<h2>semaphore_create</h2>
+<hr>
+<p>
+<strong>Function</strong> - Create a new semaphore.
+<h3>SYNOPSIS</h3>
+<pre>
+<strong>kern_return_t semaphore_create</strong>
+ <strong>(task_t</strong> <var>task</var>,
+ <strong>semaphore_t</strong> <var>*semaphore</var>,
+ <strong>int</strong> <var>policy</var>,
+ <strong>int</strong> <var>value</var><strong>);</strong>
+</pre>
+<h3>PARAMETERS</h3>
+<dl>
+<dt> <var>task</var>
+<dd>
+[in task port] The task receiving the send right of the newly created semaphore.
+<p>
+<dt> <var>semaphore</var>
+<dd>
+[out send right] The port naming the created semaphore.
+<p>
+<dt> <var>policy</var>
+<dd>
+[in scalar] The blocked thread wakeup policy for the newly created semaphore. Valid policies are:
+<dl>
+<p>
+ <dt> SYNC_POLICY_FIFO
+<dd>
+a first-in-first-out policy for scheduling thread wakeup.
+ <p>
+ <dt> SYNC_POLICY_FIXED_PRIORITY
+<dd>
+a fixed priority policy for scheduling thread wakeup.
+ </dl>
+ <p>
+<dt> <var>value</var>
+<dd>
+[in scalar] The initial value of the semaphore count.
+</dl>
+<h3>DESCRIPTION</h3>
+<p>
+The <strong>semaphore_create</strong> function creates a new semaphore, associates the
+created semaphore with the specified task, and returns a send right
+naming the new semaphore. In order to support a robust
+producer/consumer communication service, Interrupt Service Routines
+(ISR) must be able to signal semaphores. The semaphore synchronizer
+service is designed to allow user-level device drivers to perform
+signal operations, eliminating the need for event counters. Device
+drivers which utilize semaphores are responsible for creating (via
+<strong>semaphore_create</strong>) and exporting (via <strong>device_get_status</strong>)
+semaphores for
+user level access. Device driver semaphore creation is done at device
+initialization time. Device drivers may support multiple semaphores.
+<h3>RETURN VALUES</h3>
+<dl>
+ <p>
+<dt> <strong>KERN_INVALID_ARGUMENT</strong>
+<dd>
+The task argument or the policy argument was invalid,
+ or the initial value of the semaphore was invalid.
+ <p>
+<dt> <strong>KERN_RESOURCE_SHORTAGE</strong>
+<dd>
+The kernel could not allocate the semaphore.
+ <p>
+<dt> <strong>KERN_SUCCESS</strong>
+<dd>
+The semaphore was successfully created.
+</dl>
+<h3>RELATED INFORMATION</h3>
+<p>
+Functions:
+<a href="semaphore_destroy.html"><strong>semaphore_destroy</strong></a>,
+<a href="semaphore_signal.html"><strong>semaphore_signal</strong></a>,
+<a href="semaphore_signal_all.html"><strong>semaphore_signal_all</strong></a>,
+<a href="semaphore_wait.html"><strong>semaphore_wait</strong></a>,
+<a href="device_get_status.html"><strong>device_get_status</strong></a>.