Changeset 9de9b7d2 in rtems for cpukit/libblock


Ignore:
Timestamp:
Aug 14, 2013, 9:06:02 AM (6 years ago)
Author:
Sebastian Huber <sebastian.huber@…>
Branches:
4.11, master
Children:
540e8603
Parents:
4180a9b
git-author:
Sebastian Huber <sebastian.huber@…> (08/14/13 09:06:02)
git-committer:
Sebastian Huber <sebastian.huber@…> (08/14/13 09:10:45)
Message:

libblock: Add SMP support

File:
1 edited

Legend:

Unmodified
Added
Removed
  • cpukit/libblock/src/diskdevs.c

    r4180a9b r9de9b7d2  
    5858static volatile bool diskdevs_protected;
    5959
     60static rtems_interrupt_lock diskdevs_lock;
     61
    6062static rtems_status_code
    6163disk_lock(void)
     
    436438  rtems_interrupt_level level;
    437439
    438   rtems_interrupt_disable(level);
     440  rtems_interrupt_lock_acquire(&diskdevs_lock, level);
    439441  if (!diskdevs_protected) {
    440442    /* Frequent and quickest case */
    441443    dd = get_disk_entry(dev, false);
    442     rtems_interrupt_enable(level);
     444    rtems_interrupt_lock_release(&diskdevs_lock, level);
    443445  } else {
    444     rtems_interrupt_enable(level);
     446    rtems_interrupt_lock_release(&diskdevs_lock, level);
    445447
    446448    sc = disk_lock();
     
    462464  bool deleted = false;
    463465
    464   rtems_interrupt_disable(level);
     466  rtems_interrupt_lock_acquire(&diskdevs_lock, level);
    465467  uses = --dd->uses;
    466468  deleted = dd->deleted;
    467   rtems_interrupt_enable(level);
     469  rtems_interrupt_lock_release(&diskdevs_lock, level);
    468470
    469471  if (uses == 0 && deleted) {
Note: See TracChangeset for help on using the changeset viewer.