mirror of
https://git.rtems.org/rtems-tools/
synced 2025-10-17 06:37:43 +08:00
Update chains structures
- Fixes chains structure parsing - Fix Semaphore node parsing
This commit is contained in:

committed by
Chris Johns

parent
56a70aec55
commit
10bcd5d4dc
@@ -14,15 +14,17 @@ class node:
|
||||
self.node_val = node_val
|
||||
|
||||
def null(self):
|
||||
return self.node_val['next'] == 0
|
||||
if not self.node_val:
|
||||
return True
|
||||
return False
|
||||
|
||||
def next(self):
|
||||
if not self.null():
|
||||
self.node_val = self.node_val['next'].dereference()
|
||||
self.node_val = self.node_val['next']
|
||||
|
||||
def previous(self):
|
||||
if not self.null():
|
||||
self.node_val = self.node_val['previous'].dereference()
|
||||
self.node_val = self.node_val['previous']
|
||||
|
||||
def cast(self, typename):
|
||||
if not self.null():
|
||||
@@ -30,6 +32,7 @@ class node:
|
||||
return self.node_val.cast(nodetype)
|
||||
return None
|
||||
|
||||
|
||||
class control:
|
||||
"""Manage the Chain_Control."""
|
||||
|
||||
@@ -37,7 +40,8 @@ class control:
|
||||
self.ctrl = ctrl
|
||||
|
||||
def first(self):
|
||||
return node(self.ctrl['first'].dereference())
|
||||
t = node(self.ctrl['Head']['Node'])
|
||||
return t
|
||||
|
||||
def last(self):
|
||||
return node(self.ctrl['first'])
|
||||
|
@@ -62,6 +62,9 @@ class infotables:
|
||||
api = id.api()
|
||||
_class = id._class()
|
||||
index = id.index()
|
||||
return self.object_return(api, _class, index)
|
||||
|
||||
def object_return(self, api, _class, index):
|
||||
n = self.name(api, _class)
|
||||
self.load(n)
|
||||
max = self.maximum(api, _class)
|
||||
|
@@ -14,7 +14,6 @@ def task_chain(chain):
|
||||
tasks = []
|
||||
node = chain.first()
|
||||
while not node.null():
|
||||
print node.addr
|
||||
tasks.append(control(node.cast('Thread_Control')))
|
||||
node.next()
|
||||
return tasks
|
||||
@@ -188,7 +187,8 @@ class queue:
|
||||
else:
|
||||
t = []
|
||||
for ph in range(0, self.priority_headers):
|
||||
t.extend(task_chain(chains.control(self.que['Queues']['Fifo'])))
|
||||
t.extend(task_chain(chains.control( \
|
||||
self.que['Queues']['Priority'][ph])))
|
||||
return t
|
||||
|
||||
def to_string(self):
|
||||
|
Reference in New Issue
Block a user