Hi All,
I'm adding support for IO ports watchpoints for quark_x10xx targets (the SOC 
that comes with the Intel Galileo board).

This is a special kind of watchpoint that triggers when an IO port is written 
to or read from.
A classic example is port 0x80, on PCs motherboards its value is often 
displayed on a seven segment display and gives information about what 
phase/state the BIOS is currently at (POST code).
It's common practice to set a watchpoint to move among phases when debugging 
the BIOS/EFI, so makes a lot of sense adding support for it in OpenOCD.

An IO watchpoint is basically your usual HW watchpoint with a couple of 
different bits but using the same set of registers, so its management fits 
perfectly with all the generic watchpoint functions.
In the current prototype I've added:
- a new WPT_IO to the watchpoint_rw enum in src/target/breakpoints.h 
- a new "i" case in the wp_command handler in src/target/target.c
(plus, of course a couple of other minor changes to deal with the extended 
number of cases in a few switch statements).

A telnet session using the new IO type of watchpoint looks like:
> wp 0x80 1 i   
'IO' watchpoint 4 set at 0x00000080 with length 1 (hwreg=0)
> wp
address: 0x00000080, len: 0x00000001, r/w/a/i: 3, value: 0x00000000, mask: 
0xffffffff


I'm writing this email because I want to be sure that this is an acceptable 
design before submitting a patch.
IO watchpoints are an Intel Architecture (x86) feature that doesn't have an 
equivalent on the other supported architectures, as far as I know, but the 
implementation is clean and straightforward when done at the highest OpenOCD 
level, again because in the end they are watchpoints, and I don't think it 
belongs to the specific x86 code.

I went for this approach being the same used for hw_ctx breakpoints, which did 
extend the generic breakpoint structure and the global bp command, even though 
they are not supported by all architectures.

Looking forward to your feedback.

Cheers, Ivan
Intel GmbH
Dornacher Strasse 1
85622 Feldkirchen/Muenchen, Deutschland
Sitz der Gesellschaft: Feldkirchen bei Muenchen
Geschaeftsfuehrer: Christian Lamprechter, Hannes Schwaderer, Douglas Lusk
Registergericht: Muenchen HRB 47456
Ust.-IdNr./VAT Registration No.: DE129385895
Citibank Frankfurt a.M. (BLZ 502 109 00) 600119052


------------------------------------------------------------------------------
Infragistics Professional
Build stunning WinForms apps today!
Reboot your WinForms applications with our WinForms controls. 
Build a bridge from your legacy apps to the future.
http://pubads.g.doubleclick.net/gampad/clk?id=153845071&iu=/4140/ostg.clktrk
_______________________________________________
OpenOCD-devel mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/openocd-devel

Reply via email to