openocd/src
David Brownell db116b1ea3 target: provide container_of()
Provide a cleaner way to handle single inheritance of targets
in C, using the same model Linux does:  structs containing other
structs, un-nested via calls to a "container_of()" macro that
are packaged in typesafe inline functions.

Targets already use this containment idiom, but make it much
more complicated because they un-nest using embedded "void *"
pointers ... in chains of up to five per target, which is all
pure needless complication.  (Example: arm92x core, arm9tdmi,
arm7_9, armv4_5 ... on top of the base "target" class.)

Applying this scheme consistently simplifies things, and gets
rid of many error-prone untyped pointers.  It won't change any
part of the type model though -- it just simplifies things.
(And facilitates more cleanup later on.)

Rule of thumb:  where there's an X->arch_info void* pointer,
access to that pointer can and should be removed.  It may be
convenient to set up pointers to some of the embedded structs;
and shrink their current "*_common" names (annoyingly long).

Signed-off-by: David Brownell <dbrownell@users.sourceforge.net>
2009-11-05 21:59:39 -08:00
..
flash Improve str9xpec command argument parsing. 2009-11-05 18:19:19 -08:00
helper Improve debug_level command argument parsing. 2009-11-05 18:03:18 -08:00
jtag Improve jtag command argument parsing. 2009-11-05 18:03:18 -08:00
pld Improve pld command argument parsing. 2009-11-05 18:03:19 -08:00
server Update all server port command to use new helper. 2009-11-05 18:03:19 -08:00
svf SVF: fix checking bit pattern against length 2009-10-29 15:39:03 -07:00
target target: provide container_of() 2009-11-05 21:59:39 -08:00
xsvf XSVF: bugfix handling state paths 2009-10-29 12:42:41 -07:00
ecosboard.c warnings: remove 2009-11-05 09:03:24 +01:00
main.c Dick Hollenbeck <dick@softplc.com> moved stuff into openocd.c - should never have been in main.c in the first place. DLL will now build. 2009-05-02 19:31:30 +00:00
Makefile.am MinGW: use WinSock2 2009-10-19 17:48:19 -07:00
openocd.c Change most in-tree references from SVN to GIT. 2009-10-08 00:13:50 +00:00