| 69 | ****************************************************************************/ |
| 70 | |
| 71 | int unload_module(FAR struct binary_s *binp) |
| 72 | { |
| 73 | int ret; |
| 74 | |
| 75 | if (binp) |
| 76 | { |
| 77 | /* Perform any format-specific unload operations */ |
| 78 | |
| 79 | if (binp->unload) |
| 80 | { |
| 81 | ret = binp->unload(binp); |
| 82 | if (ret < 0) |
| 83 | { |
| 84 | berr("binp->unload() failed: %d\n", ret); |
| 85 | return ret; |
| 86 | } |
| 87 | } |
| 88 | |
| 89 | /* Unmap mapped address spaces */ |
| 90 | |
| 91 | if (binp->mapped) |
| 92 | { |
| 93 | binfo("Unmapping address space: %p\n", binp->mapped); |
| 94 | |
| 95 | file_munmap(binp->mapped, binp->mapsize); |
| 96 | } |
| 97 | |
| 98 | /* Notice that the address environment is not destroyed. This should |
| 99 | * happen automatically when the task exits. |
| 100 | */ |
| 101 | } |
| 102 | |
| 103 | return OK; |
| 104 | } |
| 105 | |
| 106 | #endif /* CONFIG_BINFMT_DISABLE */ |
no test coverage detected