xref: /xnu-10063.121.3/osfmk/man/device_read_overwrite.html (revision 2c2f96dc2b9a4408a43d3150ae9c105355ca3daa)
1*2c2f96dcSApple OSS Distributions<h2>device_read_overwrite</h2>
2*2c2f96dcSApple OSS Distributions<hr>
3*2c2f96dcSApple OSS Distributions<p><strong>System Trap</strong> -- Read a sequence of bytes from a specific device into my address space.
4*2c2f96dcSApple OSS Distributions<h3>SYNOPSIS</h3>
5*2c2f96dcSApple OSS Distributions<pre>
6*2c2f96dcSApple OSS Distributions
7*2c2f96dcSApple OSS Distributions<strong>kern_return_t   device_read_overwrite</strong>
8*2c2f96dcSApple OSS Distributions                <strong>(mach_port_t</strong>                               <var>device</var>,
9*2c2f96dcSApple OSS Distributions                 <strong>dev_mode_t</strong>                                <var>mode</var>,
10*2c2f96dcSApple OSS Distributions                 <strong>recnum_t</strong>                                <var>recnum</var>,
11*2c2f96dcSApple OSS Distributions                 <strong>io_buf_len_t</strong>                      <var>bytes_wanted</var>,
12*2c2f96dcSApple OSS Distributions                 <strong>io_buf_pointer_t</strong>                          <var>data</var>,
13*2c2f96dcSApple OSS Distributions                 <strong>mach_msg_type_number_t</strong>              <var>data_count</var><strong>);</strong>
14*2c2f96dcSApple OSS Distributions
15*2c2f96dcSApple OSS Distributions
16*2c2f96dcSApple OSS Distributions
17*2c2f96dcSApple OSS Distributions<strong>kern_return_t   device_read_overwrite_request</strong>
18*2c2f96dcSApple OSS Distributions                <strong>(mach_port_t</strong>                             <var>device</var>,
19*2c2f96dcSApple OSS Distributions                 <strong>mach_port_t</strong>                         <var>reply_port</var>,
20*2c2f96dcSApple OSS Distributions                 <strong>dev_mode_t</strong>                                <var>mode</var>,
21*2c2f96dcSApple OSS Distributions                 <strong>recnum_t</strong>                                <var>recnum</var>,
22*2c2f96dcSApple OSS Distributions                 <strong>io_buf_len_t</strong>                      <var>bytes_wanted</var>,
23*2c2f96dcSApple OSS Distributions                 <strong>io_buf_pointer_t</strong>                          <var>data</var><strong>);</strong>
24*2c2f96dcSApple OSS Distributions
25*2c2f96dcSApple OSS Distributions
26*2c2f96dcSApple OSS Distributions
27*2c2f96dcSApple OSS Distributions<strong>kern_return_t   ds_device_read_reply_overwrite</strong>
28*2c2f96dcSApple OSS Distributions                <strong>(mach_port_t</strong>                        <var>reply_port</var>,
29*2c2f96dcSApple OSS Distributions                 <strong>kern_return_t</strong>                      <var>return_code</var>,
30*2c2f96dcSApple OSS Distributions                 <strong>io_buf_len_t</strong>                        <var>data_count</var><strong>);</strong>
31*2c2f96dcSApple OSS Distributions</pre>
32*2c2f96dcSApple OSS Distributions<h3>PARAMETERS</h3>
33*2c2f96dcSApple OSS Distributions<dl>
34*2c2f96dcSApple OSS Distributions<p>
35*2c2f96dcSApple OSS Distributions<dt> <var>device</var>
36*2c2f96dcSApple OSS Distributions<dd>
37*2c2f96dcSApple OSS Distributions[in device send right]
38*2c2f96dcSApple OSS DistributionsA device port to the device to be read.
39*2c2f96dcSApple OSS Distributions<p>
40*2c2f96dcSApple OSS Distributions<dt> <var>reply_port</var>
41*2c2f96dcSApple OSS Distributions<dd>
42*2c2f96dcSApple OSS Distributions[in reply receive (to be converted to send-once) right]
43*2c2f96dcSApple OSS DistributionsThe port to
44*2c2f96dcSApple OSS Distributionswhich the reply message is to be sent.
45*2c2f96dcSApple OSS Distributions<p>
46*2c2f96dcSApple OSS Distributions<dt> <var>mode</var>
47*2c2f96dcSApple OSS Distributions<dd>
48*2c2f96dcSApple OSS Distributions[in scalar]
49*2c2f96dcSApple OSS DistributionsI/O mode value.  Meaningful options are:
50*2c2f96dcSApple OSS Distributions<dl>
51*2c2f96dcSApple OSS Distributions<p>
52*2c2f96dcSApple OSS Distributions<dt> <strong>D_NOWAIT</strong>
53*2c2f96dcSApple OSS Distributions<dd>
54*2c2f96dcSApple OSS DistributionsDo not wait if data is unavailable.
55*2c2f96dcSApple OSS Distributions</dl>
56*2c2f96dcSApple OSS Distributions<p>
57*2c2f96dcSApple OSS Distributions<dt> <var>recnum</var>
58*2c2f96dcSApple OSS Distributions<dd>
59*2c2f96dcSApple OSS Distributions[in scalar]
60*2c2f96dcSApple OSS DistributionsRecord number to be read.
61*2c2f96dcSApple OSS Distributions<p>
62*2c2f96dcSApple OSS Distributions<dt> <var>bytes_wanted</var>
63*2c2f96dcSApple OSS Distributions<dd>
64*2c2f96dcSApple OSS Distributions[in scalar]
65*2c2f96dcSApple OSS DistributionsSize of data transfer.
66*2c2f96dcSApple OSS Distributions<p>
67*2c2f96dcSApple OSS Distributions<dt> <var>return_code</var>
68*2c2f96dcSApple OSS Distributions<dd>
69*2c2f96dcSApple OSS Distributions[in scalar]
70*2c2f96dcSApple OSS DistributionsThe return status code from the read.
71*2c2f96dcSApple OSS Distributions<p>
72*2c2f96dcSApple OSS Distributions<dt> <var>data</var>
73*2c2f96dcSApple OSS Distributions<dd>
74*2c2f96dcSApple OSS Distributions[pointer to in array of bytes]
75*2c2f96dcSApple OSS DistributionsData buffer to be overwritten.
76*2c2f96dcSApple OSS Distributions<p>
77*2c2f96dcSApple OSS Distributions<dt> <var>data_count</var>
78*2c2f96dcSApple OSS Distributions<dd>
79*2c2f96dcSApple OSS Distributions[out scalar, in for asynchronous form]
80*2c2f96dcSApple OSS DistributionsNumber of returned data bytes.
81*2c2f96dcSApple OSS Distributions</dl>
82*2c2f96dcSApple OSS Distributions<h3>DESCRIPTION</h3>
83*2c2f96dcSApple OSS Distributions<p>
84*2c2f96dcSApple OSS DistributionsThe <strong>device_read_overwrite</strong> system trap reads a sequence
85*2c2f96dcSApple OSS Distributionsof bytes from a
86*2c2f96dcSApple OSS Distributionsdevice object directly into the caller's address space.  The
87*2c2f96dcSApple OSS Distributionsmeaning of <var>recnum</var> as
88*2c2f96dcSApple OSS Distributionswell as the specific operation performed is device dependent.
89*2c2f96dcSApple OSS Distributions<h3>NOTES</h3>
90*2c2f96dcSApple OSS Distributions<p>
91*2c2f96dcSApple OSS DistributionsThe <strong>device_read_overwrite_request</strong> and <strong>device_read_reply_overwrite</strong>
92*2c2f96dcSApple OSS Distributionscalls may be removed from the interface in favor of new asynchronous support.
93*2c2f96dcSApple OSS Distributions<h3>RETURN VALUES</h3>
94*2c2f96dcSApple OSS Distributions<p>
95*2c2f96dcSApple OSS DistributionsOnly generic errors apply.
96*2c2f96dcSApple OSS Distributions<h3>RELATED INFORMATION</h3>
97*2c2f96dcSApple OSS Distributions<p>
98*2c2f96dcSApple OSS DistributionsFunctions:
99*2c2f96dcSApple OSS Distributions<a href="device_read.html"><strong>device_read</strong></a>,
100*2c2f96dcSApple OSS Distributions<a href="device_read_inband.html"><strong>device_read_inband</strong></a>,
101*2c2f96dcSApple OSS Distributions<a href="device_reply_server.html"><strong>device_reply_server</strong></a>.
102