| 178 | } |
| 179 | |
| 180 | static int |
| 181 | contigmem_unload(void) |
| 182 | { |
| 183 | int i; |
| 184 | |
| 185 | if (contigmem_refcnt > 0) |
| 186 | return EBUSY; |
| 187 | |
| 188 | if (contigmem_cdev != NULL) |
| 189 | destroy_dev(contigmem_cdev); |
| 190 | |
| 191 | if (contigmem_eh_tag != NULL) |
| 192 | EVENTHANDLER_DEREGISTER(process_exit, contigmem_eh_tag); |
| 193 | |
| 194 | for (i = 0; i < RTE_CONTIGMEM_MAX_NUM_BUFS; i++) { |
| 195 | if (contigmem_buffers[i].addr != NULL) |
| 196 | contigfree(contigmem_buffers[i].addr, |
| 197 | contigmem_buffer_size, M_CONTIGMEM); |
| 198 | if (mtx_initialized(&contigmem_buffers[i].mtx)) |
| 199 | mtx_destroy(&contigmem_buffers[i].mtx); |
| 200 | } |
| 201 | |
| 202 | return 0; |
| 203 | } |
| 204 | |
| 205 | static int |
| 206 | contigmem_physaddr(SYSCTL_HANDLER_ARGS) |
no test coverage detected