mirror of
https://git.rtems.org/rtems-tools/
synced 2025-10-17 06:03:44 +08:00
Add cpu registers to task output.
This commit is contained in:

committed by
Chris Johns

parent
5a4834c641
commit
bd0b98d55e
@@ -16,6 +16,7 @@ import threads
|
|||||||
import watchdog
|
import watchdog
|
||||||
import heaps
|
import heaps
|
||||||
import supercore
|
import supercore
|
||||||
|
import sparc
|
||||||
|
|
||||||
class attribute:
|
class attribute:
|
||||||
"""The Classic API attribute."""
|
"""The Classic API attribute."""
|
||||||
@@ -155,6 +156,8 @@ class task:
|
|||||||
self.task = \
|
self.task = \
|
||||||
threads.control(self.object)
|
threads.control(self.object)
|
||||||
self.wait_info = self.task.wait_info()
|
self.wait_info = self.task.wait_info()
|
||||||
|
# ToDo: Insert platform dep. code here.
|
||||||
|
self.regs = sparc.register(self.object['Registers'])
|
||||||
|
|
||||||
def show(self, from_tty):
|
def show(self, from_tty):
|
||||||
print ' Name:', self.task.name()
|
print ' Name:', self.task.name()
|
||||||
@@ -163,6 +166,8 @@ class task:
|
|||||||
print ' Real:', self.task.real_priority()
|
print ' Real:', self.task.real_priority()
|
||||||
print ' Preempt:', self.task.preemptible()
|
print ' Preempt:', self.task.preemptible()
|
||||||
print ' T Budget:', self.task.cpu_time_budget()
|
print ' T Budget:', self.task.cpu_time_budget()
|
||||||
|
print ' Regsters:'
|
||||||
|
self.regs.show()
|
||||||
|
|
||||||
|
|
||||||
class message_queue:
|
class message_queue:
|
||||||
|
@@ -4,7 +4,12 @@
|
|||||||
|
|
||||||
from helper import test_bit
|
from helper import test_bit
|
||||||
|
|
||||||
class psr:
|
|
||||||
|
|
||||||
|
class register:
|
||||||
|
'''SPARC Registers'''
|
||||||
|
|
||||||
|
class psr:
|
||||||
'''status register'''
|
'''status register'''
|
||||||
|
|
||||||
sv_table = {
|
sv_table = {
|
||||||
@@ -68,9 +73,6 @@ class psr:
|
|||||||
|
|
||||||
return val
|
return val
|
||||||
|
|
||||||
class register:
|
|
||||||
'''SPARC Registers'''
|
|
||||||
|
|
||||||
def __init__(self,reg):
|
def __init__(self,reg):
|
||||||
self.reg = reg
|
self.reg = reg
|
||||||
|
|
||||||
@@ -108,8 +110,33 @@ class register:
|
|||||||
val.append(self.reg['o'+str(i)])
|
val.append(self.reg['o'+str(i)])
|
||||||
return val
|
return val
|
||||||
|
|
||||||
|
def status(self):
|
||||||
|
return self.psr(self.reg['psr'])
|
||||||
|
|
||||||
|
def show(self):
|
||||||
|
print ' Global Regs:',
|
||||||
|
print ' [',
|
||||||
|
for i in self.global_regs():
|
||||||
|
print str(i)+',',
|
||||||
|
print '\b\b ]'
|
||||||
|
|
||||||
|
print ' Local Regs:',
|
||||||
|
print ' [',
|
||||||
|
for i in self.local_regs():
|
||||||
|
print str(i)+',',
|
||||||
|
print '\b\b ]'
|
||||||
|
|
||||||
|
print ' In Regs:',
|
||||||
|
print ' [',
|
||||||
|
for i in self.in_regs():
|
||||||
|
print str(i)+',',
|
||||||
|
print '\b\b ]'
|
||||||
|
|
||||||
|
print ' Out Regs:',
|
||||||
|
print ' [',
|
||||||
|
for i in self.out_regs():
|
||||||
|
print str(i)+',',
|
||||||
|
print '\b\b ]'
|
||||||
|
|
||||||
|
sr = self.status()
|
||||||
|
print sr.to_string()
|
Reference in New Issue
Block a user