Changeset 3090715 in mainline for uspace/lib/net/generic/packet_remote.c
- Timestamp:
- 2010-11-07T21:16:56Z (14 years ago)
- Branches:
- lfn, master, serial, ticket/834-toolchain-update, topic/msim-upgrade, topic/simplify-dev-export
- Children:
- 1d0d06a
- Parents:
- 9ce7eb5 (diff), 9ee9d5d (diff)
Note: this is a merge changeset, the changes displayed below correspond to the merge itself.
Use the(diff)
links above to see all the changes relative to each parent. - File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
uspace/lib/net/generic/packet_remote.c
r9ce7eb5 r3090715 38 38 #include <async.h> 39 39 #include <errno.h> 40 #include <err.h>41 40 #include <ipc/ipc.h> 42 41 #include <ipc/packet.h> … … 67 66 packet_return(int phone, packet_ref packet, packet_id_t packet_id, size_t size) 68 67 { 69 ERROR_DECLARE;70 71 68 ipc_call_t answer; 72 aid_t message = async_send_1(phone, NET_PACKET_GET, packet_id, &answer); 69 aid_t message; 70 int rc; 71 72 message = async_send_1(phone, NET_PACKET_GET, packet_id, &answer); 73 73 74 74 *packet = (packet_t) as_get_mappable_page(size); 75 if (ERROR_OCCURRED(async_share_in_start_0_0(phone, *packet, size)) ||76 ERROR_OCCURRED(pm_add(*packet))) {75 rc = async_share_in_start_0_0(phone, *packet, size); 76 if (rc != EOK) { 77 77 munmap(*packet, size); 78 78 async_wait_for(message, NULL); 79 return ERROR_CODE; 79 return rc; 80 } 81 rc = pm_add(*packet); 82 if (rc != EOK) { 83 munmap(*packet, size); 84 async_wait_for(message, NULL); 85 return rc; 80 86 } 81 87 … … 103 109 int packet_translate_remote(int phone, packet_ref packet, packet_id_t packet_id) 104 110 { 105 ERROR_DECLARE;111 int rc; 106 112 107 113 if (!packet) … … 112 118 ipcarg_t size; 113 119 114 ERROR_PROPAGATE(async_req_1_1(phone, NET_PACKET_GET_SIZE, 115 packet_id, &size)); 116 ERROR_PROPAGATE(packet_return(phone, packet, packet_id, size)); 120 rc = async_req_1_1(phone, NET_PACKET_GET_SIZE, packet_id, 121 &size); 122 if (rc != EOK) 123 return rc; 124 rc = packet_return(phone, packet, packet_id, size); 125 if (rc != EOK) 126 return rc; 117 127 } 118 128 if ((*packet)->next) { … … 141 151 size_t max_prefix, size_t max_suffix) 142 152 { 143 ERROR_DECLARE;144 145 153 ipcarg_t packet_id; 146 154 ipcarg_t size; 147 148 if (ERROR_OCCURRED(async_req_4_2(phone, NET_PACKET_CREATE_4, 149 max_content, addr_len, max_prefix, max_suffix, &packet_id, &size))) 155 int rc; 156 157 rc = async_req_4_2(phone, NET_PACKET_CREATE_4, max_content, addr_len, 158 max_prefix, max_suffix, &packet_id, &size); 159 if (rc != EOK) 150 160 return NULL; 151 161 … … 153 163 packet_t packet = pm_find(packet_id); 154 164 if (!packet) { 155 if (ERROR_OCCURRED(packet_return(phone, &packet, packet_id,156 size)))165 rc = packet_return(phone, &packet, packet_id, size); 166 if (rc != EOK) 157 167 return NULL; 158 168 } … … 172 182 packet_t packet_get_1_remote(int phone, size_t content) 173 183 { 174 ERROR_DECLARE;175 176 184 ipcarg_t packet_id; 177 185 ipcarg_t size; 178 179 if (ERROR_OCCURRED(async_req_1_2(phone, NET_PACKET_CREATE_1, content, 180 &packet_id, &size))) 186 int rc; 187 188 rc = async_req_1_2(phone, NET_PACKET_CREATE_1, content, &packet_id, 189 &size); 190 if (rc != EOK) 181 191 return NULL; 182 192 183 193 packet_t packet = pm_find(packet_id); 184 194 if (!packet) { 185 if (ERROR_OCCURRED(packet_return(phone, &packet, packet_id,186 size)))195 rc = packet_return(phone, &packet, packet_id, size); 196 if (rc != EOK) 187 197 return NULL; 188 198 }
Note:
See TracChangeset
for help on using the changeset viewer.