Subversion Repositories HelenOS

Rev

Rev 4754 | Show entire file | Ignore whitespace | Details | Blame | Last modification | View Log | RSS feed

Rev 4754 Rev 4756
Line 103... Line 103...
103
 
103
 
104
/** Returns the packet of dimensions at least as given.
104
/** Returns the packet of dimensions at least as given.
105
 *  Tries to reuse free packets first.
105
 *  Tries to reuse free packets first.
106
 *  Creates a new packet aligned to the memory page size if none available.
106
 *  Creates a new packet aligned to the memory page size if none available.
107
 *  Locks the global data during its processing.
107
 *  Locks the global data during its processing.
108
 *  @param addr_len The source and destination addresses maximal length in bytes. Input parameter.
108
 *  @param[in] addr_len The source and destination addresses maximal length in bytes.
109
 *  @param max_prefix The maximal prefix length in bytes. Input parameter.
109
 *  @param[in] max_prefix The maximal prefix length in bytes.
110
 *  @param max_content The maximal content length in bytes. Input parameter.
110
 *  @param[in] max_content The maximal content length in bytes.
111
 *  @param max_suffix The maximal suffix length in bytes. Input parameter.
111
 *  @param[in] max_suffix The maximal suffix length in bytes.
112
 *  @returns The packet of dimensions at least as given.
112
 *  @returns The packet of dimensions at least as given.
113
 *  @returns NULL if there is not enough memory left.
113
 *  @returns NULL if there is not enough memory left.
114
 */
114
 */
115
packet_t    packet_get( size_t addr_len, size_t max_prefix, size_t max_content, size_t max_suffix );
115
packet_t    packet_get( size_t addr_len, size_t max_prefix, size_t max_content, size_t max_suffix );
116
 
116
 
117
/** Releases the packet queue.
117
/** Releases the packet queue.
118
 *  @param packet_id The first packet identifier. Input parameter.
118
 *  @param[in] packet_id The first packet identifier.
119
 *  @returns EOK on success.
119
 *  @returns EOK on success.
120
 *  @returns ENOENT if there is no such packet.
120
 *  @returns ENOENT if there is no such packet.
121
 */
121
 */
122
int packet_release_wrapper( packet_id_t packet_id );
122
int packet_release_wrapper( packet_id_t packet_id );
123
 
123
 
124
/** Releases the packet and returns it to the appropriate free packet queue.
124
/** Releases the packet and returns it to the appropriate free packet queue.
125
 *  Should be used only when the global data are locked.
125
 *  Should be used only when the global data are locked.
126
 *  @param packet The packet to be released. Input parameter.
126
 *  @param[in] packet The packet to be released.
127
 */
127
 */
128
void packet_release( packet_t packet );
128
void packet_release( packet_t packet );
129
 
129
 
130
/** Creates a new packet of dimensions at least as given.
130
/** Creates a new packet of dimensions at least as given.
131
 *  Should be used only when the global data are locked.
131
 *  Should be used only when the global data are locked.
132
 *  @param length The total length of the packet, including the header, the addresses and the data of the packet. Input parameter.
132
 *  @param[in] length The total length of the packet, including the header, the addresses and the data of the packet.
133
 *  @param addr_len The source and destination addresses maximal length in bytes. Input parameter.
133
 *  @param[in] addr_len The source and destination addresses maximal length in bytes.
134
 *  @param max_prefix The maximal prefix length in bytes. Input parameter.
134
 *  @param[in] max_prefix The maximal prefix length in bytes.
135
 *  @param max_content The maximal content length in bytes. Input parameter.
135
 *  @param[in] max_content The maximal content length in bytes.
136
 *  @param max_suffix The maximal suffix length in bytes. Input parameter.
136
 *  @param[in] max_suffix The maximal suffix length in bytes.
137
 *  @returns The packet of dimensions at least as given.
137
 *  @returns The packet of dimensions at least as given.
138
 *  @returns NULL if there is not enough memory left.
138
 *  @returns NULL if there is not enough memory left.
139
 */
139
 */
140
packet_t    packet_create( size_t length, size_t addr_len, size_t max_prefix, size_t max_content, size_t max_suffix );
140
packet_t    packet_create( size_t length, size_t addr_len, size_t max_prefix, size_t max_content, size_t max_suffix );
141
 
141
 
142
/** Clears and initializes the packet according to the given dimensions.
142
/** Clears and initializes the packet according to the given dimensions.
143
 *  @param packet The packet to be initialized. Input parameter.
143
 *  @param[in] packet The packet to be initialized.
144
 *  @param addr_len The source and destination addresses maximal length in bytes. Input parameter.
144
 *  @param[in] addr_len The source and destination addresses maximal length in bytes.
145
 *  @param max_prefix The maximal prefix length in bytes. Input parameter.
145
 *  @param[in] max_prefix The maximal prefix length in bytes.
146
 *  @param max_content The maximal content length in bytes. Input parameter.
146
 *  @param[in] max_content The maximal content length in bytes.
147
 *  @param max_suffix The maximal suffix length in bytes. Input parameter.
147
 *  @param[in] max_suffix The maximal suffix length in bytes.
148
 */
148
 */
149
void    packet_init( packet_t packet, size_t addr_len, size_t max_prefix, size_t max_content, size_t max_suffix );
149
void    packet_init( packet_t packet, size_t addr_len, size_t max_prefix, size_t max_content, size_t max_suffix );
150
 
150
 
151
/** Shares the packet memory block.
151
/** Shares the packet memory block.
152
 *  @param packet The packet to be shared.
152
 *  @param[in] packet The packet to be shared.
153
 *  @returns EOK on success.
153
 *  @returns EOK on success.
154
 *  @returns EINVAL if the packet is not valid.
154
 *  @returns EINVAL if the packet is not valid.
155
 *  @returns EINVAL if the calling module does not accept the memory.
155
 *  @returns EINVAL if the calling module does not accept the memory.
156
 *  @returns ENOMEM if the desired and actual sizes differ.
156
 *  @returns ENOMEM if the desired and actual sizes differ.
157
 *  @returns Other error codes as defined for the ipc_share_in_finalize() function.
157
 *  @returns Other error codes as defined for the ipc_share_in_finalize() function.