00001 #ifndef __MK__DSPMach_H___
00002 #define __MK__DSPMach_H___
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013 #ifndef GNUSTEP
00014
00015 #import <mach/mach.h>
00016
00017
00018 #if !defined(macosx)
00019 #define macosx (defined(__ppc__) && !defined(ppc))
00020 #define macosx_server (defined(__ppc__) && defined(ppc))
00021 #endif
00022
00023 #if macosx
00024 typedef natural_t msg_type_t;
00025 typedef long msg_type_long_t;
00026 #endif
00027
00028 #if !m68k && (defined(NeXT) || (defined(__APPLE__) && defined(__MACH__)) || defined(WIN32))
00029 #import "dspdriverAccess.h"
00030
00031 extern mach_msg_header_t *_DSP_data_request_msg (
00032 mach_msg_header_t *msg,
00033 mach_port_t stream_port,
00034 mach_port_t reply_port,
00035 int data_tag,
00036 int chan,
00037 int msgID);
00038
00039 extern mach_msg_header_t *_DSP_simple_request_msg (
00040 mach_port_t cmd_port,
00041 mach_port_t reply_port,
00042 int messageType);
00043
00044 extern void _DSP_free_simple_request_msg(mach_msg_header_t **msg);
00045
00046 #endif
00047
00048 #import "_DSPMachAccessMacros.h"
00049
00050
00051
00052 #import "_MachMessages.h"
00053
00054
00055
00056
00057
00058 mach_msg_header_t *_DSP_stream_msg (
00059 mach_msg_header_t *msg,
00060 mach_port_t stream_port,
00061 mach_port_t reply_port,
00062 int data_tag);
00063 mach_msg_header_t *_DSP_stream_play_data (
00064 mach_msg_header_t *msg,
00065 pointer_t data,
00066 boolean_t started_msg,
00067 boolean_t completed_msg,
00068 boolean_t aborted_msg,
00069 boolean_t paused_msg,
00070 boolean_t resumed_msg,
00071 boolean_t underflow_msg,
00072 boolean_t preempt,
00073 boolean_t deallocate,
00074 mach_port_t reg_port,
00075 int nbytes);
00076 mach_msg_header_t *_DSP_stream_record_data (
00077 mach_msg_header_t *msg,
00078 boolean_t started_msg,
00079 boolean_t completed_msg,
00080 boolean_t aborted_msg,
00081 boolean_t paused_msg,
00082 boolean_t resumed_msg,
00083 boolean_t overflow_msg,
00084 int nbytes,
00085 mach_port_t reg_port,
00086 char *filename);
00087 mach_msg_header_t *_DSP_stream_control (
00088 mach_msg_header_t *msg,
00089 int control);
00090 kern_return_t _DSP_stream_nsamples (
00091 mach_port_t stream_port,
00092 int *nsamples);
00093 kern_return_t _DSP_get_stream (
00094 mach_port_t device_port,
00095 mach_port_t owner_port,
00096 mach_port_t *stream_port,
00097 u_int stream);
00098 kern_return_t _DSP_set_dsp_owner_port (
00099 mach_port_t device_port,
00100 mach_port_t owner_port,
00101 mach_port_t *neg_port);
00102 kern_return_t _DSP_set_sndin_owner_port (
00103 mach_port_t device_port,
00104 mach_port_t owner_port,
00105 mach_port_t *neg_port);
00106 kern_return_t _DSP_set_sndout_owner_port (
00107 mach_port_t device_port,
00108 mach_port_t owner_port,
00109 mach_port_t *neg_port);
00110 kern_return_t _DSP_get_dsp_cmd_port (
00111 mach_port_t device_port,
00112 mach_port_t owner_port,
00113 mach_port_t *cmd_port);
00114 kern_return_t _DSP_dsp_proto (
00115 mach_port_t device_port,
00116 mach_port_t owner_port,
00117 int proto);
00118 kern_return_t _DSP_dspcmd_event (
00119 mach_port_t cmd_port,
00120 u_int mask,
00121 u_int flags,
00122 mach_msg_header_t *msg);
00123 kern_return_t _DSP_dspcmd_chandata (
00124 mach_port_t cmd_port,
00125 int addr,
00126 int size,
00127 int skip,
00128 int space,
00129 int mode,
00130 int chan);
00131 kern_return_t _DSP_dspcmd_dmaout (
00132 mach_port_t cmd_port,
00133 int addr,
00134 int size,
00135 int skip,
00136 int space,
00137 int mode,
00138 pointer_t data);
00139 kern_return_t _DSP_dspcmd_dmain (
00140 mach_port_t cmd_port,
00141 int addr,
00142 int size,
00143 int skip,
00144 int space,
00145 int mode,
00146 pointer_t *data);
00147 kern_return_t _DSP_dspcmd_abortdma (
00148 mach_port_t cmd_port,
00149 int *dma_state,
00150 vm_address_t *start,
00151 vm_address_t *stop,
00152 vm_address_t *next);
00153 kern_return_t _DSP_dspcmd_req_msg (
00154 mach_port_t cmd_port,
00155 mach_port_t reply_port);
00156 kern_return_t _DSP_dspcmd_req_err (
00157 mach_port_t cmd_port,
00158 mach_port_t reply_port);
00159 void _DSP_dspcmd_msg_data (
00160 snd_dsp_msg_t *msg,
00161 int **buf_addr,
00162 int *buf_size);
00163
00164 mach_msg_header_t *_DSP_dspcmd_msg (
00165 mach_port_t cmd_port,
00166 mach_port_t reply_port,
00167 int priority,
00168 int atomic);
00169
00170 void _DSP_free_dspcmd_msg(mach_msg_header_t **msg);
00171
00172 mach_msg_header_t *_DSP_dspcmd_msg_reset (
00173 mach_msg_header_t *msg,
00174 mach_port_t cmd_port,
00175 mach_port_t reply_port,
00176 int priority,
00177 int atomic);
00178
00179 mach_msg_header_t *_DSP_dsprcv_msg (
00180 mach_port_t cmd_port,
00181 mach_port_t reply_port);
00182
00183 mach_msg_header_t *_DSP_dsprcv_msg_reset (
00184 mach_msg_header_t *msg,
00185 mach_port_t cmd_port,
00186 mach_port_t reply_port);
00187
00188 mach_msg_header_t *_DSP_dspreply_msg (
00189 mach_port_t reply_port);
00190
00191 mach_msg_header_t *_DSP_dspreply_msg_reset (
00192 mach_msg_header_t *msg,
00193 mach_port_t reply_port);
00194
00195 mach_msg_header_t *_DSP_dsp_condition (
00196 mach_msg_header_t *msg,
00197 u_int mask,
00198 u_int flags);
00199 mach_msg_header_t *_DSP_dsp_data (
00200 mach_msg_header_t *msg,
00201 pointer_t data,
00202 int eltsize,
00203 int nelts);
00204 mach_msg_header_t *_DSP_dsp_host_command (
00205 mach_msg_header_t *msg,
00206 u_int host_command);
00207 mach_msg_header_t *_DSP_dsp_host_flag (
00208 mach_msg_header_t *msg,
00209 u_int mask,
00210 u_int flags);
00211 mach_msg_header_t *_DSP_dsp_ret_msg (
00212 mach_msg_header_t *msg,
00213 mach_msg_header_t *ret_msg);
00214 mach_msg_header_t *_DSP_dspreset (
00215 mach_msg_header_t *msg);
00216 mach_msg_header_t *_DSP_dspregs (
00217 mach_msg_header_t *msg);
00218 mach_msg_header_t *_DSP_stream_options (
00219 mach_msg_header_t *msg,
00220 int high_water,
00221 int low_water,
00222 int dma_size);
00223 mach_msg_header_t *_DSP_dsp_protocol (
00224 mach_msg_header_t *msg,
00225 mach_port_t device_port,
00226 mach_port_t owner_port,
00227 int protocol);
00228 mach_msg_header_t *_DSP_dsp_read_data(
00229 mach_msg_header_t *msg,
00230 int eltsize,
00231 int nelts);
00232
00233 #endif
00234 #endif