! \brief Disable/Enables parallel branch usage (read and write) */
| 143 | /*! \brief Disable/Enables parallel branch usage (read and write) |
| 144 | */ |
| 145 | void set_dset_state(unsigned char enable) |
| 146 | { |
| 147 | struct dset_ctx *dsct = get_dset_ctx(); |
| 148 | static unsigned int bk_nr_branches; |
| 149 | |
| 150 | if (!dsct) |
| 151 | return; |
| 152 | |
| 153 | if (enable) { |
| 154 | /* enable dset usage */ |
| 155 | if (dsct->enabled) return; /* already enabled */ |
| 156 | /* enable read */ |
| 157 | dsct->nr_branches = bk_nr_branches; |
| 158 | bk_nr_branches = 0; |
| 159 | /* enable write */ |
| 160 | dsct->enabled = 1; |
| 161 | } else { |
| 162 | /* disable dset usage */ |
| 163 | if (!dsct->enabled) return; /* already disabled */ |
| 164 | /* disable read */ |
| 165 | bk_nr_branches = dsct->nr_branches; |
| 166 | dsct->nr_branches = 0; |
| 167 | /* disabel write */ |
| 168 | dsct->enabled = 0; |
| 169 | } |
| 170 | } |
| 171 | |
| 172 | |
| 173 | /*! \brief Find the next brand from the destination set |