On Fri, Oct 23, 2009 at 10:29 AM, David Brownell <[email protected]> wrote: > On Thursday 22 October 2009, Øyvind Harboe wrote: >> I'm thinking about adding these two fn's to target->type. It would >> provide a polymorphic interface on top of which we can implement >> general mrc/mcr commands. >> >> Do we need anything but cp15? If not, then cpnum could be >> omitted. > > I'd include cpnum ... and wrap the params in a struct :)
Euhhh... I'm not super keen on that. We don't need to go much further down this line and defining structures just makes it bigger... >> /* Read coprocessor - arm specific. Default implementation returns >> error. */ >> int (*mrc)(struct target_s *target, int cpnum, uint32_t op1, uint32_t >> op2, uint32_t CRn, uint32_t CRm, uint32_t *value); >> >> /* Write coprocessor. Default implementation returns error. */ >> int (*mrc)(struct target_s *target, int cpnum, uint32_t op1, uint32_t >> op2, uint32_t CRn, uint32_t CRm, uint32_t value); > > These would be methods in the armv4_5 struct yes? The thing > that should be core-ARM-for-everything-except-Cortex-M? No. They go into the target->type. OpenOCD does not use C++ and the idea of multiple interfaces. Also the ARM11 is *very* different so stuffing it into the armv4_5 would be a pain. In lieu of C++ & interfaces, I think the least horrible choice is to put it into target->type and return error when it is not supported. >> Regarding command syntax, since we're omitting the register >> to/from argument we're not 100% compatible with the machine code >> syntax anyway. > > It should be a conceptual "Tcl register" ... :) > > >> For the mrc(read) operation, I was thinking about having the register >> read returned as a Tcl result, so one could do: >> >> set result [mrc x y ...] >> >> >> I want the commands to be tcl friendly, on top of which we can implement >> tcl wrappers for humans. > > Why need a wrapper? If you return the value, it'll be printed... I don't think a wrapper is needed really.. Perhaps someone wants to make a proc that is compatible with e.g. Lauterbach syntax? -- Øyvind Harboe http://www.zylin.com/zy1000.html ARM7 ARM9 ARM11 XScale Cortex JTAG debugger and flash programmer _______________________________________________ Openocd-development mailing list [email protected] https://lists.berlios.de/mailman/listinfo/openocd-development
