On Sunday 17 May 2009, Rick Altherr wrote: > Rather than combine them, I'd like to see jtag_queue_command() enforce > validation of the command to be enqueued. Then the patterns would be: > > cmd = cmd_queue_alloc(); > > cmd->type = JTAG_SCAN; > ....
Then how about passing JTAG_* to the allocator? Related approach: command-specific allocators, which take the parameters that will be fed to each command. > > jtag_queue_command(cmd); > > Otherwise, you place a command in the queue before it is filled out. Yeah, that bothered me a bit too, but it *is* the current idiom. Some jtag_queue_scan(...) calls -- allocate and set up each flavor of command, then queue it -- could address that issue *and* keep to the current idiom. > This works fine today where the JTAG queue is manually flushed, but if > we ever went to a opportunistic queue draining scheme (device driver > pulls next item off queue automatically when a command finishes), you > could get bogus commands being executed. _______________________________________________ Openocd-development mailing list Openocd-development@lists.berlios.de https://lists.berlios.de/mailman/listinfo/openocd-development