summaryrefslogtreecommitdiffstats
path: root/libpdbg/chip.c
Commit message (Collapse)AuthorAgeFilesLines
* libpdbg/chip: add HEIR and HID register to ram_state_threadRashmica Gupta2018-10-151-0/+7
| | | | | Signed-off-by: Rashmica Gupta <rashmica.g@gmail.com> Reviewed-by: Alistair Popple <alistair@popple.id.au>
* libpdbg/chip: implement putnia with a sequence compatible with P9Nicholas Piggin2018-09-201-4/+15
| | | | | | | | | P9 MTNIA uses LR as the source register, so set LR as well as GPR0. This will work on P8 and P9. This is a bit ugly, but it will work until we have general getspr/putspr calls for target backends. Signed-off-by: Nicholas Piggin <npiggin@gmail.com> Tested-by: Rashmica Gupta <rashmica.g@gmail.com>
* libpdbg: Add in mtocrf and putcr functionRashmica Gupta2018-09-121-0/+26
| | | | | Signed-off-by: Rashmica Gupta <rashmica.g@gmail.com> Reviewed-by: Nicholas Piggin <npiggin@gmail.com>
* libpdbg: Make getcr actually get all of the Condition RegisterRashmica Gupta2018-09-121-10/+17
| | | | | Signed-off-by: Rashmica Gupta <rashmica.g@gmail.com> Reviewed-by: Nicholas Piggin <npiggin@gmail.com>
* libpdbg: Add in getxer and putxer functionsRashmica Gupta2018-09-121-9/+31
| | | | | Signed-off-by: Rashmica Gupta <rashmica.g@gmail.com> Reviewed-by: Nicholas Piggin <npiggin@gmail.com>
* libpdbg: Print the name of the instruction when erroringRashmica Gupta2018-09-121-8/+8
| | | | | Signed-off-by: Rashmica Gupta <rashmica.g@gmail.com> Reviewed-by: Nicholas Piggin <npiggin@gmail.com>
* libpdbg: Initialize to avoid build errors with -O3Amitay Isaacs2018-08-131-2/+2
| | | | Signed-off-by: Amitay Isaacs <amitay@ozlabs.org>
* libpdbg/chip.c: Fix logic error attempting to restore r0 and r1Alistair Popple2018-08-091-1/+1
| | | | | | | | | | When instruction ramming fails we attempt to restore r0 and r1. This is unlikely to work as instruction ramming isn't likely to magically start working if a previous attempt failed. Therefore it is only attempted once before bailing. However a logic bug in the code meant it would try indefinitely. Signed-off-by: Alistair Popple <alistair@popple.id.au>
* regs: print correct PTCR registerNicholas Piggin2018-08-021-1/+1
| | | | Signed-off-by: Nicholas Piggin <npiggin@gmail.com>
* libpdbg: Attempt to restore registers that we clobbered on failureRashmica Gupta2018-06-151-2/+6
| | | | Signed-off-by: Rashmica Gupta <rashmica.g@gmail.com>
* libpdbg: Don't dump XER with ram_getsprAlistair Popple2018-05-241-0/+3
| | | | | | | Dumping XER checkstops P8 hosts. There is a special ramming op-code for XER which needs to be used instead. Signed-off-by: Alistair Popple <alistair@popple.id.au>
* libpdbg: Abstract thread statusAlistair Popple2018-05-241-1/+1
| | | | | | | | | | | | | | | | There is currently no abstraction of thread status between library and application. It just passes the hardware specific values down. There is also no interface exported in the library headers to read status. This makes it difficult to implement more advanced functionality in the application as there is no way hardware agnostic way to determine if a thread is in powersave mode or not for example. Instead introduce a hardware agnostic thread state so that we can implement more advanced functionality such as automatically stopping threads if required. Signed-off-by: Alistair Popple <alistair@popple.id.au>
* libpdbg: Replace PR_PERL with PR_INFOAmitay Isaacs2018-05-181-0/+1
| | | | | | ... and avoid duplicate definitions Signed-off-by: Amitay Isaacs <amitay@ozlabs.org>
* pdbg: add 'regs' commandNicholas Piggin2018-05-181-2/+167
| | | | | | | | | | | This uses ramming to pull out most registers. There are more SPRs to left to add. Ramming remains set over all register extraction, by keeping ram_is_setup target attribut. This helps to speed things up and minimise disturbance to the host. Signed-off-by: Nicholas Piggin <npiggin@gmail.com>
* libpdbg/chip.c: ram_instructions add error handlingNicholas Piggin2018-05-081-1/+5
| | | | | | | Pass errors back to the caller, and clean up with ram_destroy on failure. Signed-off-by: Nicholas Piggin <npiggin@gmail.com>
* libpdbg: Add support for getring on POWER9Alistair Popple2018-04-271-0/+12
| | | | | | Add basic support for a getring operation on POWER9. Signed-off-by: Alistair Popple <alistair@popple.id.au>
* Refactor for an exportable APIAlistair Popple2017-12-081-11/+18
| | | | | | | | | | The existing API between libpdbg and pdbg was poorly defined. Other programs are beginning to utilise libpdbg so a more strictly defined API would be beneficial. This patch introduces a new header (libpdbg.h) which includes the definition of a public API for libpdbg and updates pdbg to only depend on this. Signed-off-by: Alistair Popple <alistair@popple.id.au>
* Rename struct target to struct pdbg_targetAlistair Popple2017-12-061-4/+4
| | | | | | | In preparation for a better defined libpdbg API rename "struct target" to something less generic so that we can export the name. Signed-off-by: Alistair Popple <alistair@popple.id.au>
* libpdbg: Fix incorrect restore of r1 in ram_instructions()Cyril Bur2017-11-241-1/+1
| | | | Signed-off-by: Cyril Bur <cyrilbur@gmail.com>
* libpdbg: Add sreset commandAlistair Popple2017-07-311-0/+9
| | | | Signed-off-by: Alistair Popple <alistair@popple.id.au>
* Makefile.am: Enable -Wall -Werror for libpdbgAlistair Popple2017-07-141-1/+1
| | | | | | | Several minor fixes were required to enable building on both x64 and ARM with -Wall -Werror, mostly related to unused variables and bad printf string formats. Signed-off-by: Alistair Popple <alistair@popple.id.au>
* libpdbg: Add support for P9 thread operationsAlistair Popple2017-06-281-302/+25
| | | | | | | This patch adds support for starting and stopping threads on POWER9 as well as instruction ramming which is required to read/write GPRs, etc. Signed-off-by: Alistair Popple <alistair@popple.id.au>
* Clean-up target configuration in preparation for adding P9 supportAlistair Popple2017-03-301-123/+119
| | | | | | | | | | The previous implementation of targeting was hardcoded, cumbersome and difficult to reconfigure for different chip types. This moves to a method of configuring targets using device-tree which is much easier to maintain and allows methods to be added to support operations like getmem on POWER9. Signed-off-by: Alistair Popple <alistair@popple.id.au>
* libpdbg/chip.c: Correct detection of chip typeAlistair Popple2016-12-081-1/+1
| | | | | | | The processor chip type was not being detected correctly resulting in attempts to probe unsupported system components. Signed-off-by: Alistair Popple <alistair@popple.id.au>
* Add detection of chip typesAlistair Popple2016-12-021-0/+4
| | | | | | | Support detecting different chip types so we enable chip type dependent behaviour. Signed-off-by: Alistair Popple <alistair@popple.id.au>
* Fix thread status checks during instruction rammingAlistair Popple2016-11-301-13/+3
| | | | | | | | | | | | Instructions can only be rammed into a thread is all threads on a chiplet are quiesced or sleeping. This was not properly enforced which leads to system checkstops when ramming threads if the chip isn't fully quiesced. This adds a check to ensure all threads are quiesced. It also changes the startchip/stopchip behaviour to stop all threads on the given chiplet regards of which threads are selected. Signed-off-by: Alistair Popple <alistair@popple.id.au>
* libpdbg/chip.c: Add command to read virtual addressesAlistair Popple2016-11-221-10/+45
| | | | | | | | | Adds a command to read a 64-bit word from a given virtual address. The address is read in the current thread context and may cause an exception. In the case of exception it will be raised on the host when thread execution is resumed. Signed-off-by: Alistair Popple <alistair@popple.id.au>
* Add support for i2c access to secondary processorsAlistair Popple2016-10-251-0/+510
This includes better support for selecting targets, probing thread status and a number of other minor bugfixes. Also adds an option to print version numbers. Signed-off-by: Alistair Popple <alistair@popple.id.au>
OpenPOWER on IntegriCloud