[ Next Article | Previous Article | Book Contents | Library Home | Legal | Search ]
Kernel Extensions and Device Support Programming Concepts

btac/BRAT Subcommands for the KDB Kernel Debugger and kdb Command


btac, cbtac, lbtac, lcbtac Subcommands

Note: This subcommand is only available within the kdb command; it is not included in the KDB Kernel Debugger.

On POWER PC architecture, a hardware register may be used (called HID2 on POWER 601) to enter KDB when a specified effective address is decoded. The HID2 register holds the effective address, and the HID1 register specifies full branch target address compare and trap to address vector 0x1300 (0x2000 on 601). See PowerPC Implementation Definition for the 601-604-620 Processor (book IV) to have more information. The btac subcommand may be used to stop when Branch Target Address Compare is true. The cbtac subcommand may be used to clear the last btac subcommand. This subcommand is global to all processors, each processor may have different address to compare with the local subcommands lbtac lcbtac.

It is possible to specify if the address is physical or virtual with -p or -v option. 604 and 620 processors take care of the translation mode, and it is necessary to specify which mode is used. By default KDB chooses the current state of the machine: if the subcommand is entered before VMM inititialisation, the address is physical (real address), else virtual (effective address).

Example

   KDB(7)> btac open set BRAT on open function
   KDB(7)> btac display current BRAT status
   CPU 0: .open+000000 eaddr=001B5354 vsid=00000000 hit=0
   CPU 1: .open+000000 eaddr=001B5354 vsid=00000000 hit=0
   CPU 2: .open+000000 eaddr=001B5354 vsid=00000000 hit=0
   CPU 3: .open+000000 eaddr=001B5354 vsid=00000000 hit=0
   CPU 4: .open+000000 eaddr=001B5354 vsid=00000000 hit=0
   CPU 5: .open+000000 eaddr=001B5354 vsid=00000000 hit=0
   CPU 6: .open+000000 eaddr=001B5354 vsid=00000000 hit=0
   CPU 7: .open+000000 eaddr=001B5354 vsid=00000000 hit=0
   KDB(7)> e exit the debugger
   ...
   Branch trap: 001B5354 <.open+000000>
   .sys_call+000000  bcctrl                        <.open>
   KDB(5)> btac display current BRAT status
   CPU 0: .open+000000 eaddr=001B5354 vsid=00000000 hit=0
   CPU 1: .open+000000 eaddr=001B5354 vsid=00000000 hit=0
   CPU 2: .open+000000 eaddr=001B5354 vsid=00000000 hit=0
   CPU 3: .open+000000 eaddr=001B5354 vsid=00000000 hit=0
   CPU 4: .open+000000 eaddr=001B5354 vsid=00000000 hit=0
   CPU 5: .open+000000 eaddr=001B5354 vsid=00000000 hit=1
   CPU 6: .open+000000 eaddr=001B5354 vsid=00000000 hit=0
   CPU 7: .open+000000 eaddr=001B5354 vsid=00000000 hit=0
   KDB(5)> lbtac close set local BRAT on close function
   KDB(5)> e exit the debugger
   ...
   Branch trap: 001B5354 <.open+000000>
   .sys_call+000000  bcctrl                        <.open>
   KDB(7)> e exit the debugger
   ...
   Branch trap: 00197D40 <.close+000000>
   .sys_call+000000  bcctrl                        <.close>
   KDB(5)> e exit the debugger
   ...
   Branch trap: 001B5354 <.open+000000>
   .sys_call+000000  bcctrl                        <.open>
   KDB(6)> btac display current BRAT status
   CPU 0: .open+000000 eaddr=001B5354 vsid=00000000 hit=0
   CPU 1: .open+000000 eaddr=001B5354 vsid=00000000 hit=0
   CPU 2: .open+000000 eaddr=001B5354 vsid=00000000 hit=0
   CPU 3: .open+000000 eaddr=001B5354 vsid=00000000 hit=0
   CPU 4: .open+000000 eaddr=001B5354 vsid=00000000 hit=0
   CPU 5: .close+000000 eaddr=00197D40 vsid=00000000 hit=1
   CPU 6: .open+000000 eaddr=001B5354 vsid=00000000 hit=1
   CPU 7: .open+000000 eaddr=001B5354 vsid=00000000 hit=1
   KDB(6)> cbtac reset all BRAT registers

[ Next Article | Previous Article | Book Contents | Library Home | Legal | Search ]