| 314 | } |
| 315 | |
| 316 | static rt_err_t its_cmd_submit_nomap(struct gicv3_its *its, struct its_command *cmd, |
| 317 | int cpu_id, rt_bool_t sync) |
| 318 | { |
| 319 | rt_err_t err; |
| 320 | struct its_command *hw_cmd; |
| 321 | |
| 322 | rt_hw_spin_lock(&its->cmd_lock.lock); |
| 323 | |
| 324 | if (!(hw_cmd = its_cmd_alloc(its))) |
| 325 | { |
| 326 | err = -RT_EBUSY; |
| 327 | goto _out_lock; |
| 328 | } |
| 329 | |
| 330 | rt_memcpy(hw_cmd, cmd, sizeof(*hw_cmd)); |
| 331 | |
| 332 | if ((err = its_cmd_submit_raw(its, hw_cmd))) |
| 333 | { |
| 334 | goto _out_lock; |
| 335 | } |
| 336 | |
| 337 | if (sync) |
| 338 | { |
| 339 | if (!(hw_cmd = its_cmd_alloc(its))) |
| 340 | { |
| 341 | err = -RT_EBUSY; |
| 342 | goto _out_lock; |
| 343 | } |
| 344 | |
| 345 | its_encode_cmd(hw_cmd, GITS_CMD_SYNC); |
| 346 | its_encode_target(hw_cmd, its->collections[cpu_id].target_address); |
| 347 | |
| 348 | err = its_cmd_submit_raw(its, hw_cmd); |
| 349 | } |
| 350 | |
| 351 | _out_lock: |
| 352 | rt_hw_spin_unlock(&its->cmd_lock.lock); |
| 353 | |
| 354 | return err; |
| 355 | } |
| 356 | |
| 357 | static rt_err_t its_cmd_submit(struct gicv3_its *its, struct its_command *cmd, |
| 358 | struct its_map *map, rt_bool_t sync) |
no test coverage detected