| 236 | } |
| 237 | |
| 238 | static struct its_command *its_cmd_alloc(struct gicv3_its *its) |
| 239 | { |
| 240 | struct its_command *cmd = RT_NULL; |
| 241 | |
| 242 | for (rt_uint32_t count = 0; count <= 10000; ++count) |
| 243 | { |
| 244 | if ((its->cmd_idx + 1) % ITS_CMD_QUEUE_NR != its_readl(its, GITS_CREADR) / sizeof(*cmd)) |
| 245 | { |
| 246 | struct its_command *cmds = its->cmd_base; |
| 247 | |
| 248 | cmd = &cmds[its->cmd_idx++]; |
| 249 | its->cmd_idx %= ITS_CMD_QUEUE_NR; |
| 250 | |
| 251 | rt_memset(cmd, 0, sizeof(*cmd)); |
| 252 | |
| 253 | break; |
| 254 | } |
| 255 | |
| 256 | rt_hw_us_delay(10); |
| 257 | } |
| 258 | |
| 259 | return cmd; |
| 260 | } |
| 261 | |
| 262 | static rt_err_t its_cmd_submit_raw(struct gicv3_its *its, struct its_command *cmd) |
| 263 | { |
no test coverage detected