Changeset 8e0de06 in rtems-tools


Ignore:
Timestamp:
Jul 29, 2013, 4:55:38 AM (6 years ago)
Author:
Dhananjay Balan <mb.dhananjay@…>
Branches:
4.10, 4.11, e9f48e9face6c4dea62712d73b35412c0fe10332
Children:
59c4946
Parents:
c63080d
git-author:
Dhananjay Balan <mb.dhananjay@…> (07/29/13 04:55:38)
git-committer:
Chris Johns <chrisj@…> (08/24/14 23:52:40)
Message:

Add classic barrier.

  • Add support for classic barrier object.
  • Drop CORE_ from names in supercore
Location:
tools/gdb/python
Files:
3 edited

Legend:

Unmodified
Added
Removed
  • tools/gdb/python/classic.py

    rc63080d r8e0de06  
    4040                       'semaphore-pri',
    4141                       'semaphore-pri-ceiling'],
    42         'barrier' : ['scope',
    43                      'priority',
    44                      'barrier'],
     42        'barrier' : ['barrier'],
    4543        'message_queue' : ['priority',
    4644                           'scope'],
     
    150148
    151149class task:
    152     "Print a classic tasks."
     150    "Print a classic task"
    153151
    154152    def __init__(self, id):
     
    180178            self.object['message_queue']['Wait_queue'])
    181179
    182         self.core_control = supercore.CORE_message_queue(self.object['message_queue'])
     180        self.core_control = supercore.message_queue(self.object['message_queue'])
    183181
    184182    def show(self, from_tty):
     
    239237        print '   Memory:'
    240238        self.heap.show()
     239
     240class barrier:
     241    '''classic barrier abstraction'''
     242
     243    def __init__(self,id):
     244        self.id = id
     245        self.object = objects.information.object(self.id).dereference()
     246        self.object_control = objects.control(self.object['Object'])
     247        self.attr = attribute(self.object['attribute_set'],'barrier')
     248        self.core_b_control = supercore.barrier_control(self.object['Barrier'])
     249
     250    def show(self,from_tty):
     251        print '     Name:',self.object_control.name()
     252        print '     Attr:',self.attr.to_string()
     253
     254        if self.attr.test('barrier','barrier-auto-release'):
     255            max_count = self.core_b_control.max_count()
     256            print 'Aut Count:', max_count
     257
     258        print '  Waiting:',self.core_b_control.waiting_threads()
     259        helper.tasks_printer_routine(self.core_b_control.tasks())
     260
  • tools/gdb/python/rtems.py

    rc63080d r8e0de06  
    8181        'classic/timers' : lambda id: classic.timer(id),
    8282        'classic/partitions' : lambda id: classic.partition(id),
    83         'classic/regions' : lambda id: classic.region(id)
     83        'classic/regions' : lambda id: classic.region(id),
     84        'classic/barriers' : lambda id: classic.barrier(id)
    8485        }
    8586
  • tools/gdb/python/supercore.py

    rc63080d r8e0de06  
    66import helper
    77
    8 class CORE_message_queue:
     8class message_queue:
    99    '''Manage a Supercore message_queue'''
    1010
     
    1717    def show(self):
    1818        helper.tasks_printer_routine(self.wait_queue)
     19
     20class barrier_attributes:
     21    '''supercore bbarrier attribute'''
     22
     23    def __init__(self,attr):
     24        self.attr = attr
     25
     26    def max_count(self):
     27        c = self.attr['maximum_count']
     28        return c
     29
     30    def discipline(self):
     31        d = self.attr['discipline']
     32        return d
     33
     34class barrier_control:
     35    '''Manage a Supercore barrier'''
     36
     37    def __init__(self, barrier):
     38        self.barrier = barrier
     39        self.wait_queue = threads.queue(self.barrier['Wait_queue'])
     40        self.attr = barrier_attributes(self.barrier['Attributes'])
     41
     42    def waiting_threads(self):
     43        wt = self.barrier['number_of_waiting_threads']
     44        return wt
     45
     46    def max_count(self):
     47        return self.attr.max_count()
     48
     49    def discipline(self):
     50        return self.attr.discipline()
     51
     52    def tasks(self):
     53        return self.wait_queue
Note: See TracChangeset for help on using the changeset viewer.